void av_dynarray_add(void *tab_ptr, int *nb_ptr, void *elem)

{

    /* see similar ffmpeg.c:grow_array() */

    int nb, nb_alloc;

    intptr_t *tab;



    nb = *nb_ptr;

    tab = *(intptr_t**)tab_ptr;

    if ((nb & (nb - 1)) == 0) {

        if (nb == 0)

            nb_alloc = 1;

        else

            nb_alloc = nb * 2;

        tab = av_realloc(tab, nb_alloc * sizeof(intptr_t));

        *(intptr_t**)tab_ptr = tab;

    }

    tab[nb++] = (intptr_t)elem;

    *nb_ptr = nb;

}

void av_dynarray_add(void *tab_ptr, int *nb_ptr, void *elem)

{

    

    int nb, nb_alloc;

    intptr_t *tab;



    nb = *nb_ptr;

    tab = *(intptr_t**)tab_ptr;

    if ((nb & (nb - 1)) == 0) {

        if (nb == 0)

            nb_alloc = 1;

        else

            nb_alloc = nb * 2;

        tab = av_realloc(tab, nb_alloc * sizeof(intptr_t));

        *(intptr_t**)tab_ptr = tab;

    }

    tab[nb++] = (intptr_t)elem;

    *nb_ptr = nb;

}

        if (nb == 0)
void FUNC_0(void *VAR_0, int *VAR_1, void *VAR_2)

{

    

    int VAR_3, VAR_4;

    intptr_t *tab;



    VAR_3 = *VAR_1;

    tab = *(intptr_t**)VAR_0;

    if ((VAR_3 & (VAR_3 - 1)) == 0) {

        if (VAR_3 == 0)

            VAR_4 = 1;

        else

            VAR_4 = VAR_3 * 2;

        tab = av_realloc(tab, VAR_4 * sizeof(intptr_t));

        *(intptr_t**)VAR_0 = tab;

    }

    tab[VAR_3++] = (intptr_t)VAR_2;

    *VAR_1 = VAR_3;

}

void FUNC_0(void *VAR_0, int *VAR_1, void *VAR_2)
{ int VAR_3, VAR_4; intptr_t *tab; VAR_3 = *VAR_1; tab = *(intptr_t**)VAR_0; if ((VAR_3 & (VAR_3 - 1)) == 0) { if (VAR_3 == 0)
VAR_4 = 1; else
VAR_4 = VAR_3 * 2; tab = av_realloc(tab, VAR_4 * sizeof(intptr_t)); *(intptr_t**)VAR_0 = tab; } tab[VAR_3++] = (intptr_t)VAR_2; *VAR_1 = VAR_3; }