static int remove_mapping(BDRVVVFATState* s, int mapping_index)

{

    mapping_t* mapping = array_get(&(s->mapping), mapping_index);

    mapping_t* first_mapping = array_get(&(s->mapping), 0);



    /* free mapping */

    if (mapping->first_mapping_index < 0)

	free(mapping->path);



    /* remove from s->mapping */

    array_remove(&(s->mapping), mapping_index);



    /* adjust all references to mappings */

    adjust_mapping_indices(s, mapping_index, -1);



    if (s->current_mapping && first_mapping != (mapping_t*)s->mapping.pointer)

	s->current_mapping = array_get(&(s->mapping),

		s->current_mapping - first_mapping);



    return 0;

}

static int remove_mapping(BDRVVVFATState* s, int mapping_index)

{

    mapping_t* mapping = array_get(&(s->mapping), mapping_index);

    mapping_t* first_mapping = array_get(&(s->mapping), 0);



    

    if (mapping->first_mapping_index < 0)

	free(mapping->path);



    

    array_remove(&(s->mapping), mapping_index);



    

    adjust_mapping_indices(s, mapping_index, -1);



    if (s->current_mapping && first_mapping != (mapping_t*)s->mapping.pointer)

	s->current_mapping = array_get(&(s->mapping),

		s->current_mapping - first_mapping);



    return 0;

}

    if (mapping->first_mapping_index < 0) 	free(mapping->path);
static int FUNC_0(BDRVVVFATState* VAR_0, int VAR_1)

{

    mapping_t* mapping = array_get(&(VAR_0->mapping), VAR_1);

    mapping_t* first_mapping = array_get(&(VAR_0->mapping), 0);



    

    if (mapping->first_mapping_index < 0)

	free(mapping->path);



    

    array_remove(&(VAR_0->mapping), VAR_1);



    

    adjust_mapping_indices(VAR_0, VAR_1, -1);



    if (VAR_0->current_mapping && first_mapping != (mapping_t*)VAR_0->mapping.pointer)

	VAR_0->current_mapping = array_get(&(VAR_0->mapping),

		VAR_0->current_mapping - first_mapping);



    return 0;

}

static int FUNC_0(BDRVVVFATState* VAR_0, int VAR_1)
{ mapping_t* mapping = array_get(&(VAR_0->mapping), VAR_1); mapping_t* first_mapping = array_get(&(VAR_0->mapping), 0); if (mapping->first_mapping_index < 0)
free(mapping->path); array_remove(&(VAR_0->mapping), VAR_1); adjust_mapping_indices(VAR_0, VAR_1, -1); if (VAR_0->current_mapping && first_mapping != (mapping_t*)VAR_0->mapping.pointer)
VAR_0->current_mapping = array_get(&(VAR_0->mapping),
VAR_0->current_mapping - first_mapping); return 0; }