static int decode_mb(MadContext *s, AVFrame *frame, int inter)

{

    int mv_map = 0;

    int mv_x, mv_y;

    int j;



    if (inter) {

        int v = decode210(&s->gb);

        if (v < 2) {

            mv_map = v ? get_bits(&s->gb, 6) : 63;

            mv_x = decode_motion(&s->gb);

            mv_y = decode_motion(&s->gb);

        }

    }



    for (j=0; j<6; j++) {

        if (mv_map & (1<<j)) {  // mv_x and mv_y are guarded by mv_map

            int add = 2*decode_motion(&s->gb);

            if (s->last_frame->data[0])

                comp_block(s, frame, s->mb_x, s->mb_y, j, mv_x, mv_y, add);

        } else {

            s->dsp.clear_block(s->block);

            if(decode_block_intra(s, s->block) < 0)

                return -1;

            idct_put(s, frame, s->block, s->mb_x, s->mb_y, j);

        }

    }

    return 0;

}

static int decode_mb(MadContext *s, AVFrame *frame, int inter)

{

    int mv_map = 0;

    int mv_x, mv_y;

    int j;



    if (inter) {

        int v = decode210(&s->gb);

        if (v < 2) {

            mv_map = v ? get_bits(&s->gb, 6) : 63;

            mv_x = decode_motion(&s->gb);

            mv_y = decode_motion(&s->gb);

        }

    }



    for (j=0; j<6; j++) {

        if (mv_map & (1<<j)) {  

            int add = 2*decode_motion(&s->gb);

            if (s->last_frame->data[0])

                comp_block(s, frame, s->mb_x, s->mb_y, j, mv_x, mv_y, add);

        } else {

            s->dsp.clear_block(s->block);

            if(decode_block_intra(s, s->block) < 0)

                return -1;

            idct_put(s, frame, s->block, s->mb_x, s->mb_y, j);

        }

    }

    return 0;

}

    int mv_x, mv_y;
static int FUNC_0(MadContext *VAR_0, AVFrame *VAR_1, int VAR_2)

{

    int VAR_3 = 0;

    int VAR_4, VAR_5;

    int VAR_6;



    if (VAR_2) {

        int VAR_7 = decode210(&VAR_0->gb);

        if (VAR_7 < 2) {

            VAR_3 = VAR_7 ? get_bits(&VAR_0->gb, 6) : 63;

            VAR_4 = decode_motion(&VAR_0->gb);

            VAR_5 = decode_motion(&VAR_0->gb);

        }

    }



    for (VAR_6=0; VAR_6<6; VAR_6++) {

        if (VAR_3 & (1<<VAR_6)) {  

            int VAR_8 = 2*decode_motion(&VAR_0->gb);

            if (VAR_0->last_frame->data[0])

                comp_block(VAR_0, VAR_1, VAR_0->mb_x, VAR_0->mb_y, VAR_6, VAR_4, VAR_5, VAR_8);

        } else {

            VAR_0->dsp.clear_block(VAR_0->block);

            if(decode_block_intra(VAR_0, VAR_0->block) < 0)

                return -1;

            idct_put(VAR_0, VAR_1, VAR_0->block, VAR_0->mb_x, VAR_0->mb_y, VAR_6);

        }

    }

    return 0;

}

static int FUNC_0(MadContext *VAR_0, AVFrame *VAR_1, int VAR_2)
{ int VAR_3 = 0; int VAR_4, VAR_5; int VAR_6; if (VAR_2) { int VAR_7 = decode210(&VAR_0->gb); if (VAR_7 < 2) { VAR_3 = VAR_7 ? get_bits(&VAR_0->gb, 6) : 63; VAR_4 = decode_motion(&VAR_0->gb); VAR_5 = decode_motion(&VAR_0->gb); } } for (VAR_6=0; VAR_6<6; VAR_6++) { if (VAR_3 & (1<<VAR_6)) { int VAR_8 = 2*decode_motion(&VAR_0->gb); if (VAR_0->last_frame->data[0])
comp_block(VAR_0, VAR_1, VAR_0->mb_x, VAR_0->mb_y, VAR_6, VAR_4, VAR_5, VAR_8); } else { VAR_0->dsp.clear_block(VAR_0->block); if(decode_block_intra(VAR_0, VAR_0->block) < 0)
return -1; idct_put(VAR_0, VAR_1, VAR_0->block, VAR_0->mb_x, VAR_0->mb_y, VAR_6); } } return 0; }