int ff_mlz_decompression(MLZ* mlz, GetBitContext* gb, int size, unsigned char *buff) {

    MLZDict *dict = mlz->dict;

    unsigned long output_chars;

    int string_code, last_string_code, char_code;



    string_code = 0;

    char_code   = -1;

    last_string_code = -1;

    output_chars = 0;



    while (output_chars < size) {

        string_code = input_code(gb, mlz->dic_code_bit);

        switch (string_code) {

            case FLUSH_CODE:

            case MAX_CODE:

                ff_mlz_flush_dict(mlz);

                char_code = -1;

                last_string_code = -1;

                break;

            case FREEZE_CODE:

                mlz->freeze_flag = 1;

                break;

            default:

                if (string_code > mlz->current_dic_index_max) {

                    av_log(mlz->context, AV_LOG_ERROR, "String code %d exceeds maximum value of %d.\n", string_code, mlz->current_dic_index_max);



                if (string_code == (int) mlz->bump_code) {

                    ++mlz->dic_code_bit;

                    mlz->current_dic_index_max *= 2;

                    mlz->bump_code = mlz->current_dic_index_max - 1;

                } else {

                    if (string_code >= mlz->next_code) {

                        int ret = decode_string(mlz, &buff[output_chars], last_string_code, &char_code, size - output_chars);

                        if (ret < 0 || ret > size - output_chars) {

                            av_log(mlz->context, AV_LOG_ERROR, "output chars overflow\n");



                        output_chars += ret;

                        ret = decode_string(mlz, &buff[output_chars], char_code, &char_code, size - output_chars);

                        if (ret < 0 || ret > size - output_chars) {

                            av_log(mlz->context, AV_LOG_ERROR, "output chars overflow\n");



                        output_chars += ret;

                        set_new_entry_dict(dict, mlz->next_code, last_string_code, char_code);





                        mlz->next_code++;

                    } else {

                        int ret = decode_string(mlz, &buff[output_chars], string_code, &char_code, size - output_chars);

                        if (ret < 0 || ret > size - output_chars) {

                            av_log(mlz->context, AV_LOG_ERROR, "output chars overflow\n");



                        output_chars += ret;

                        if (output_chars <= size && !mlz->freeze_flag) {

                            if (last_string_code != -1) {

                                set_new_entry_dict(dict, mlz->next_code, last_string_code, char_code);





                                mlz->next_code++;


                        } else {

                            break;



                    last_string_code = string_code;


                break;




int ff_mlz_decompression(MLZ* mlz, GetBitContext* gb, int size, unsigned char *buff) {

    MLZDict *dict = mlz->dict;

    unsigned long output_chars;

    int string_code, last_string_code, char_code;



    string_code = 0;

    char_code   = -1;

    last_string_code = -1;

    output_chars = 0;



    while (output_chars < size) {

        string_code = input_code(gb, mlz->dic_code_bit);

        switch (string_code) {

            case FLUSH_CODE:

            case MAX_CODE:

                ff_mlz_flush_dict(mlz);

                char_code = -1;

                last_string_code = -1;

                break;

            case FREEZE_CODE:

                mlz->freeze_flag = 1;

                break;

            default:

                if (string_code > mlz->current_dic_index_max) {

                    av_log(mlz->context, AV_LOG_ERROR, "String code %d exceeds maximum value of %d.\n", string_code, mlz->current_dic_index_max);



                if (string_code == (int) mlz->bump_code) {

                    ++mlz->dic_code_bit;

                    mlz->current_dic_index_max *= 2;

                    mlz->bump_code = mlz->current_dic_index_max - 1;

                } else {

                    if (string_code >= mlz->next_code) {

                        int ret = decode_string(mlz, &buff[output_chars], last_string_code, &char_code, size - output_chars);

                        if (ret < 0 || ret > size - output_chars) {

                            av_log(mlz->context, AV_LOG_ERROR, "output chars overflow\n");



                        output_chars += ret;

                        ret = decode_string(mlz, &buff[output_chars], char_code, &char_code, size - output_chars);

                        if (ret < 0 || ret > size - output_chars) {

                            av_log(mlz->context, AV_LOG_ERROR, "output chars overflow\n");



                        output_chars += ret;

                        set_new_entry_dict(dict, mlz->next_code, last_string_code, char_code);





                        mlz->next_code++;

                    } else {

                        int ret = decode_string(mlz, &buff[output_chars], string_code, &char_code, size - output_chars);

                        if (ret < 0 || ret > size - output_chars) {

                            av_log(mlz->context, AV_LOG_ERROR, "output chars overflow\n");



                        output_chars += ret;

                        if (output_chars <= size && !mlz->freeze_flag) {

                            if (last_string_code != -1) {

                                set_new_entry_dict(dict, mlz->next_code, last_string_code, char_code);





                                mlz->next_code++;


                        } else {

                            break;



                    last_string_code = string_code;


                break;




int FUNC_0(MLZ* VAR_0, GetBitContext* VAR_1, int VAR_2, unsigned char *VAR_3) {

    MLZDict *dict = VAR_0->dict;

    unsigned long VAR_4;

    int VAR_5, VAR_6, VAR_7;



    VAR_5 = 0;

    VAR_7   = -1;

    VAR_6 = -1;

    VAR_4 = 0;



    while (VAR_4 < VAR_2) {

        VAR_5 = input_code(VAR_1, VAR_0->dic_code_bit);

        switch (VAR_5) {

            case FLUSH_CODE:

            case MAX_CODE:

                ff_mlz_flush_dict(VAR_0);

                VAR_7 = -1;

                VAR_6 = -1;

                break;

            case FREEZE_CODE:

                VAR_0->freeze_flag = 1;

                break;

            default:

                if (VAR_5 > VAR_0->current_dic_index_max) {

                    av_log(VAR_0->context, AV_LOG_ERROR, "String code %d exceeds maximum value of %d.\n", VAR_5, VAR_0->current_dic_index_max);



                if (VAR_5 == (int) VAR_0->bump_code) {

                    ++VAR_0->dic_code_bit;

                    VAR_0->current_dic_index_max *= 2;

                    VAR_0->bump_code = VAR_0->current_dic_index_max - 1;

                } else {

                    if (VAR_5 >= VAR_0->next_code) {

                        int VAR_9 = decode_string(VAR_0, &VAR_3[VAR_4], VAR_6, &VAR_7, VAR_2 - VAR_4);

                        if (VAR_9 < 0 || VAR_9 > VAR_2 - VAR_4) {

                            av_log(VAR_0->context, AV_LOG_ERROR, "output chars overflow\n");



                        VAR_4 += VAR_9;

                        VAR_9 = decode_string(VAR_0, &VAR_3[VAR_4], VAR_7, &VAR_7, VAR_2 - VAR_4);

                        if (VAR_9 < 0 || VAR_9 > VAR_2 - VAR_4) {

                            av_log(VAR_0->context, AV_LOG_ERROR, "output chars overflow\n");



                        VAR_4 += VAR_9;

                        set_new_entry_dict(dict, VAR_0->next_code, VAR_6, VAR_7);





                        VAR_0->next_code++;

                    } else {

                        int VAR_9 = decode_string(VAR_0, &VAR_3[VAR_4], VAR_5, &VAR_7, VAR_2 - VAR_4);

                        if (VAR_9 < 0 || VAR_9 > VAR_2 - VAR_4) {

                            av_log(VAR_0->context, AV_LOG_ERROR, "output chars overflow\n");



                        VAR_4 += VAR_9;

                        if (VAR_4 <= VAR_2 && !VAR_0->freeze_flag) {

                            if (VAR_6 != -1) {

                                set_new_entry_dict(dict, VAR_0->next_code, VAR_6, VAR_7);





                                VAR_0->next_code++;


                        } else {

                            break;



                    VAR_6 = VAR_5;


                break;




int FUNC_0(MLZ* VAR_0, GetBitContext* VAR_1, int VAR_2, unsigned char *VAR_3) { MLZDict *dict = VAR_0->dict; unsigned long VAR_4; int VAR_5, VAR_6, VAR_7; VAR_5 = 0; VAR_7   = -1; VAR_6 = -1; VAR_4 = 0; while (VAR_4 < VAR_2) { VAR_5 = input_code(VAR_1, VAR_0->dic_code_bit); switch (VAR_5) { case FLUSH_CODE:
case MAX_CODE:
ff_mlz_flush_dict(VAR_0); VAR_7 = -1; VAR_6 = -1; break; case FREEZE_CODE:
VAR_0->freeze_flag = 1; break; default:
if (VAR_5 > VAR_0->current_dic_index_max) { av_log(VAR_0->context, AV_LOG_ERROR, "String code %d exceeds maximum value of %d.\n", VAR_5, VAR_0->current_dic_index_max); if (VAR_5 == (int) VAR_0->bump_code) { ++VAR_0->dic_code_bit; VAR_0->current_dic_index_max *= 2; VAR_0->bump_code = VAR_0->current_dic_index_max - 1; } else { if (VAR_5 >= VAR_0->next_code) { int VAR_9 = decode_string(VAR_0, &VAR_3[VAR_4], VAR_6, &VAR_7, VAR_2 - VAR_4); if (VAR_9 < 0 || VAR_9 > VAR_2 - VAR_4) { av_log(VAR_0->context, AV_LOG_ERROR, "output chars overflow\n"); VAR_4 += VAR_9; VAR_9 = decode_string(VAR_0, &VAR_3[VAR_4], VAR_7, &VAR_7, VAR_2 - VAR_4); if (VAR_9 < 0 || VAR_9 > VAR_2 - VAR_4) { av_log(VAR_0->context, AV_LOG_ERROR, "output chars overflow\n"); VAR_4 += VAR_9; set_new_entry_dict(dict, VAR_0->next_code, VAR_6, VAR_7); VAR_0->next_code++; } else { int VAR_9 = decode_string(VAR_0, &VAR_3[VAR_4], VAR_5, &VAR_7, VAR_2 - VAR_4); if (VAR_9 < 0 || VAR_9 > VAR_2 - VAR_4) { av_log(VAR_0->context, AV_LOG_ERROR, "output chars overflow\n"); VAR_4 += VAR_9; if (VAR_4 <= VAR_2 && !VAR_0->freeze_flag) { if (VAR_6 != -1) { set_new_entry_dict(dict, VAR_0->next_code, VAR_6, VAR_7); VAR_0->next_code++; } else { break; VAR_6 = VAR_5; break;