// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/macroblock.c
// Function: x264_macroblock_write_cavlc(x264_t*, bs_s*, x264_macroblock_t*)
void x264_macroblock_write_cavlc(x264_t *h, bs_t *s, x264_macroblock_t *mb) {LOG_CALL;
    int i_mb_i_offset;
    int i;

    switch (h->sh.i_type)
    {
        case SLICE_TYPE_I:
            i_mb_i_offset = 0;
            break;
        case SLICE_TYPE_P:
            i_mb_i_offset = 5;
            break;
        case SLICE_TYPE_B:
            i_mb_i_offset = 23;
            break;
        default:
            fprintf(stderr, "internal error or slice unsupported\n");
            return;
    }

    /* Write:
      - type
      - prediction
      - mv */
    if (mb->i_type == I_PCM)
    {
        /* Untested */
        bs_write_ue(s, i_mb_i_offset + 25,"i_mb_i_offset");

        bs_align_0(s);
        /* Luma */
        for (i = 0; i < 16 * 16; i++)
        {
            bs_write(s, 8, h->picture->plane[0][mb->i_mb_y * 16 * h->picture->i_stride[0] + mb->i_mb_x * 16 + i], "h->picture->plane[0][");
        }
        /* Cb */
        for (i = 0; i < 8 * 8; i++)
        {
            bs_write(s, 8, h->picture->plane[1][mb->i_mb_y * 8 * h->picture->i_stride[1] + mb->i_mb_x * 8 + i], "h->picture->plane[1][");
        }
        /* Cr */
        for (i = 0; i < 8 * 8; i++)
        {
            bs_write(s, 8, h->picture->plane[2][mb->i_mb_y * 8 * h->picture->i_stride[2] + mb->i_mb_x * 8 + i], "h->picture->plane[2][");
        }

        for (i = 0; i < 16 + 8; i++)
        {
            /* special case */
            mb->block[i].i_non_zero_count = 16;
        }
        return;
    } else if (mb->i_type == I_4x4)
    {
        bs_write_ue(s, i_mb_i_offset + 0,"i_mb_i_offset");

        /* Prediction: Luma */
        for (i = 0; i < 16; i++)
        {
            int i_predicted_mode = x264_mb_predict_intra4x4_mode(h, mb, i);
            int i_mode = mb->block[i].i_intra4x4_pred_mode;

            if (i_predicted_mode == i_mode)
            {
                bs_write1(s, 1,"b_prev_intra4x4_pred_mode"); /* b_prev_intra4x4_pred_mode */
            } else
            {
                bs_write1(s, 0,"b_prev_intra4x4_pred_mode"); /* b_prev_intra4x4_pred_mode */
                if (i_mode < i_predicted_mode)
                {
                    bs_write(s, 3, i_mode, "i_mode");
                } else
                {
                    bs_write(s, 3, i_mode - 1, "i_mode");
                }
            }
        }
        /* Prediction: chroma */
        bs_write_ue(s, mb->i_chroma_pred_mode,"i_chroma_pred_mode");
    } else if (mb->i_type == I_16x16)
    {
        bs_write_ue(s, i_mb_i_offset + 1 + mb->i_intra16x16_pred_mode +
                mb->i_cbp_chroma * 4 +
                (mb->i_cbp_luma == 0 ? 0 : 12),"i_mb_i_offset");
        /* Prediction: chroma */
        bs_write_ue(s, mb->i_chroma_pred_mode,"i_chroma_pred_mode");
    } else if (mb->i_type == P_L0)
    {
        int mvp[2];

        if (mb->i_partition == D_16x16)
        {
            bs_write_ue(s, 0,"i_partition==D_16x16");

            if (h->sh.i_num_ref_idx_l0_active > 1)
            {
                 bs_write_te(s, h->sh.i_num_ref_idx_l0_active - 1, mb->partition[0][0].i_ref[0],"i_num_ref_idx_l0_active");
            }
            x264_mb_predict_mv(mb, 0, 0, 0, mvp);
            bs_write_se(s, mb->partition[0][0].mv[0][0] - mvp[0],"mb->partition[0][0].mv[0][0] - mvp[0]");
            bs_write_se(s, mb->partition[0][0].mv[0][1] - mvp[1],"mb->partition[0][0].mv[0][1] - mvp[1]");
        } else if (mb->i_partition == D_16x8)
        {
            bs_write_ue(s, 1,"mb->i_partition == D_16x8");
            if (h->sh.i_num_ref_idx_l0_active > 1)
            {
                bs_write_te(s, h->sh.i_num_ref_idx_l0_active - 1, mb->partition[0][0].i_ref[0],"i_num_ref_idx_l0_active");
                bs_write_te(s, h->sh.i_num_ref_idx_l0_active - 1, mb->partition[0][2].i_ref[0],"i_num_ref_idx_l0_active");
            }

            x264_mb_predict_mv(mb, 0, 0, 0, mvp);
            bs_write_se(s, mb->partition[0][0].mv[0][0] - mvp[0],"mb->partition[0][0].mv[0][0] - mvp[0]");
            bs_write_se(s, mb->partition[0][0].mv[0][1] - mvp[1],"mb->partition[0][0].mv[0][1] - mvp[1]");

            x264_mb_predict_mv(mb, 0, 1, 0, mvp);
            bs_write_se(s, mb->partition[0][2].mv[0][0] - mvp[0],"mb->partition[0][2].mv[0][0] - mvp[0]");
            bs_write_se(s, mb->partition[0][2].mv[0][1] - mvp[1],"mb->partition[0][2].mv[0][1] - mvp[1]");
        } else if (mb->i_partition == D_8x16)
        {
            bs_write_ue(s, 2,"mb->i_partition == D_8x16");
            if (h->sh.i_num_ref_idx_l0_active > 1)
            {
                bs_write_te(s, h->sh.i_num_ref_idx_l0_active - 1, mb->partition[0][0].i_ref[0],"i_num_ref_idx_l0_active");
                bs_write_te(s, h->sh.i_num_ref_idx_l0_active - 1, mb->partition[2][0].i_ref[0],"i_num_ref_idx_l0_active");
            }

            x264_mb_predict_mv(mb, 0, 0, 0, mvp);
            bs_write_se(s, mb->partition[0][0].mv[0][0] - mvp[0],"mb->partition[0][0].mv[0][0] - mvp[0]");
            bs_write_se(s, mb->partition[0][0].mv[0][1] - mvp[1],"mb->partition[0][0].mv[0][1] - mvp[1]");

            x264_mb_predict_mv(mb, 0, 1, 0, mvp);
            bs_write_se(s, mb->partition[2][0].mv[0][0] - mvp[0],"mb->partition[2][0].mv[0][0] - mvp[0]");
            bs_write_se(s, mb->partition[2][0].mv[0][1] - mvp[1]," mb->partition[2][0].mv[0][1] - mvp[1]");
        }
    } else if (mb->i_type == P_8x8)
    {
        int b_sub_ref0;

        if (mb->partition[0][0].i_ref[0] == 0 &&
                mb->partition[0][2].i_ref[0] == 0 &&
                mb->partition[2][0].i_ref[0] == 0 &&
                mb->partition[2][2].i_ref[0] == 0)
        {
            bs_write_ue(s, 4, "partition");
            b_sub_ref0 = 0;
        } else
        {
            bs_write_ue(s, 3, "partition");
            b_sub_ref0 = 1;
        }
        /* sub mb type */
        for (i = 0; i < 4; i++)
        {
            switch (mb->i_sub_partition[i])
            {
                case D_L0_8x8:
                    bs_write_ue(s, 0,"D_L0_8x8");
                    break;
                case D_L0_8x4:
                    bs_write_ue(s, 1,"D_L0_8x4");
                    break;
                case D_L0_4x8:
                    bs_write_ue(s, 2,"D_L0_4x8");
                    break;
                case D_L0_4x4:
                    bs_write_ue(s, 3,"D_L0_4x4");
                    break;
            }
        }
        /* ref0 */
        if (h->sh.i_num_ref_idx_l0_active > 1 && b_sub_ref0)
        {
            bs_write_te(s, h->sh.i_num_ref_idx_l0_active - 1, mb->partition[0][0].i_ref[0],"i_num_ref_idx_l0_active");
            bs_write_te(s, h->sh.i_num_ref_idx_l0_active - 1, mb->partition[2][0].i_ref[0],"i_num_ref_idx_l0_active");
            bs_write_te(s, h->sh.i_num_ref_idx_l0_active - 1, mb->partition[0][2].i_ref[0],"i_num_ref_idx_l0_active");
            bs_write_te(s, h->sh.i_num_ref_idx_l0_active - 1, mb->partition[2][2].i_ref[0],"i_num_ref_idx_l0_active");
        }
        for (i = 0; i < 4; i++)
        {
            int i_part;
            for (i_part = 0; i_part < x264_mb_partition_count_table[mb->i_sub_partition[i]]; i_part++)
            {
                int mvx, mvy;
                int mvp[2];

                x264_mb_partition_get(mb, 0, i, i_part, NULL, &mvx, &mvy);
                x264_mb_predict_mv(mb, 0, i, i_part, mvp);

                bs_write_se(s, mvx - mvp[0],"mvy - mvp[0]");
                bs_write_se(s, mvy - mvp[1],"mvy - mvp[1]");
            }
        }
    } else if (mb->i_type == B_8x8)
    {
        fprintf(stderr, "invalid/unhandled mb_type (B_8x8)\n");
        return;
    } else if (mb->i_type != B_DIRECT)
    {
        /* All B mode */
        /* Motion Vector */
        int i_part = x264_mb_partition_count_table[mb->i_partition];
        int i_ref;
        int mvx, mvy;
        int mvp[2];

        int b_list0[2];
        int b_list1[2];

        /* init ref list utilisations */
        for (i = 0; i < 2; i++)
        {
            b_list0[i] = x264_mb_type_list0_table[mb->i_type][i];
            b_list1[i] = x264_mb_type_list1_table[mb->i_type][i];
        }


        if (mb->i_partition == D_16x16)
        {
            if (b_list0[0] && b_list1[0])
            {
                bs_write_ue(s, 3,"D_16x16 b_list0[0] && b_list1[0])");
            } else if (b_list1[0])
            {
                bs_write_ue(s, 2,"D_16x16 b_list1[0])");
            } else
            {
                bs_write_ue(s, 1,"D_16x16 not b_list0[0] && not b_list1[0])");
            }
        } else
        {
            if (mb->i_type == B_BI_BI)
            {
                bs_write_ue(s, 20 + (mb->i_partition == D_16x8 ? 0 : 1),"B_BI_BI");
            } else if (b_list0[0] && b_list1[0])
            {
                /* B_BI_LX* */
                bs_write_ue(s, 16 + (b_list0[1] ? 0 : 2) + (mb->i_partition == D_16x8 ? 0 : 1),"B_BI_LX");
            } else if (b_list0[1] && b_list1[1])
            {
                /* B_LX_BI */
                bs_write_ue(s, 12 + (b_list0[1] ? 0 : 2) + (mb->i_partition == D_16x8 ? 0 : 1),"B_LX_BI");
            } else if (b_list1[1])
            {
                /* B_LX_L1 */
                bs_write_ue(s, 6 + (b_list0[0] ? 2 : 0) + (mb->i_partition == D_16x8 ? 0 : 1),"B_LX_L1");
            } else if (b_list0[1])
            {
                /* B_LX_L0 */
                bs_write_ue(s, 4 + (b_list0[0] ? 0 : 6) + (mb->i_partition == D_16x8 ? 0 : 1),"B_LX_L0");
            }
        }

        if (h->sh.i_num_ref_idx_l0_active > 1)
        {
            for (i = 0; i < i_part; i++)
            {
                if (b_list0[i])
                {
                    x264_mb_partition_get(mb, 0, i, 0, &i_ref, NULL, NULL);
                    bs_write_te(s, h->sh.i_num_ref_idx_l0_active - 1, i_ref,"i_num_ref_idx_l0_active");
                }
            }
        }
        if (h->sh.i_num_ref_idx_l1_active > 1)
        {
            for (i = 0; i < i_part; i++)
            {
                if (b_list1[i])
                {
                    x264_mb_partition_get(mb, 1, i, 0, &i_ref, NULL, NULL);
                    bs_write_te(s, h->sh.i_num_ref_idx_l1_active - 1, i_ref,"i_num_ref_idx_l1_active");
                }
            }
        }

        for (i = 0; i < i_part; i++)
        {
            if (b_list0[i])
            {
                x264_mb_partition_get(mb, 0, i, 0, NULL, &mvx, &mvy);
                x264_mb_predict_mv(mb, 0, i, 0, mvp);

                bs_write_se(s, mvx - mvp[0],"mvy - mvp[0]");
                bs_write_se(s, mvy - mvp[1],"mvy - mvp[1]");
            }
        }
        for (i = 0; i < i_part; i++)
        {
            if (b_list1[i])
            {
                x264_mb_partition_get(mb, 1, i, 0, NULL, &mvx, &mvy);
                x264_mb_predict_mv(mb, 1, i, 0, mvp);

                bs_write_se(s, mvx - mvp[0],"mvy - mvp[0]");
                bs_write_se(s, mvy - mvp[1],"mvy - mvp[1]");
            }
        }
    } else if (mb->i_type == B_DIRECT)
    {
        bs_write_ue(s, 0,"B_DIRECT");
    } else
    {
        fprintf(stderr, "invalid/unhandled mb_type\n");
        return;
    }

    /* Coded block patern */
    if (mb->i_type == I_4x4)
    {
        bs_write_ue(s, intra4x4_cbp_to_golomb[(mb->i_cbp_chroma << 4) | mb->i_cbp_luma],"intra4x4_cbp_to_golomb");
    } else if (mb->i_type != I_16x16)
    {
        bs_write_ue(s, inter_cbp_to_golomb[(mb->i_cbp_chroma << 4) | mb->i_cbp_luma],"inter_cbp_to_golomb");
    }

    /* write residual */
    if (mb->i_type == I_16x16)
    {
        if (mb->i_mb_x > 0 || mb->i_mb_y > 0)
            bs_write_se(s, mb->i_qp - (mb - 1)->i_qp, "i_qp" );
        else
            bs_write_se(s, mb->i_qp - h->pps->i_pic_init_qp - h->sh.i_qp_delta,"i_qp");

        /* DC Luma */
        block_residual_write_cavlc(h, s, mb, BLOCK_INDEX_LUMA_DC, mb->luma16x16_dc, 16);

        if (mb->i_cbp_luma != 0)
        {
            /* AC Luma */
            for (i = 0; i < 16; i++)
            {
                block_residual_write_cavlc(h, s, mb, i, mb->block[i].residual_ac, 15);
            }
        }
    } else if (mb->i_cbp_luma != 0 || mb->i_cbp_chroma != 0)
    {
        bs_write_se(s, mb->i_qp - h->pps->i_pic_init_qp - h->sh.i_qp_delta, "i_qp");

        for (i = 0; i < 16; i++)
        {
            if (mb->i_cbp_luma & (1 << (i / 4)))
            {
                block_residual_write_cavlc(h, s, mb, i, mb->block[i].luma4x4, 16);
            }
        }
    }
    if (mb->i_cbp_chroma != 0)
    {
        /* Chroma DC residual present */
        block_residual_write_cavlc(h, s, mb, BLOCK_INDEX_CHROMA_DC, mb->chroma_dc[0], 4);
        block_residual_write_cavlc(h, s, mb, BLOCK_INDEX_CHROMA_DC, mb->chroma_dc[1], 4);
        if (mb->i_cbp_chroma & 0x02) /* Chroma AC residual present */
        {
            for (i = 0; i < 8; i++)
            {
                block_residual_write_cavlc(h, s, mb, 16 + i, mb->block[16 + i].residual_ac, 15);
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r13
leaq 0x9ce6(%rip), %rdi      # 0x1b1b4
leaq 0x10493(%rip), %rsi     # 0x21968
leaq 0x104e2(%rip), %rdx     # 0x219be
xorl %eax, %eax
callq 0x39ba
movl 0x10db00(%r13), %eax
cmpq $0x3, %rax
jae 0x11cad
movl 0x18(%rbx), %ecx
cmpq $0x10, %rcx
movq %rbx, %r11
movq %rbx, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq %r13, -0x48(%rbp)
ja 0x11bf5
leaq 0x10ac9(%rip), %rdx     # 0x21fe0
movl (%rdx,%rax,4), %esi
leaq 0xe2ff(%rip), %rax      # 0x1f820
movslq (%rax,%rcx,4), %rdx
addq %rax, %rdx
jmpq *%rdx
leaq 0x104a9(%rip), %rdx     # 0x219da
movq %r12, %rdi
callq 0x12165
movq -0x30(%rbp), %rsi
leaq 0x324(%rsi), %r14
xorl %r12d, %r12d
movq -0x38(%rbp), %rbx
cmpq $0x10, %r12
je 0x116de
movq %r13, %rdi
movl %r12d, %edx
callq 0x5490
movl (%r14), %r13d
cmpl %r13d, %eax
jne 0x11576
movq -0x38(%rbp), %rdi
pushq $0x1
popq %rsi
callq 0x122a0
jmp 0x115a0
movl %eax, %r15d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x122a0
cmpl %r15d, %r13d
jl 0x1158b
decl %r13d
movq %rbx, %rdi
pushq $0x3
popq %rsi
movl %r13d, %edx
leaq 0xccbc(%rip), %rcx      # 0x1e257
callq 0x1221b
incq %r12
addq $0x84, %r14
movq -0x30(%rbp), %rsi
movq -0x48(%rbp), %r13
jmp 0x1154b
addl $0x19, %esi
leaq 0x1041c(%rip), %rdx     # 0x219da
movq %r12, %rdi
callq 0x12165
movq %r12, %rdi
callq 0x121d7
xorl %r15d, %r15d
leaq 0x10410(%rip), %rbx     # 0x219e8
pushq $0x8
popq %r14
cmpl $0x100, %r15d           # imm = 0x100
movq -0x30(%rbp), %rdx
je 0x1161c
movq 0x10ee48(%r13), %rax
movq 0x20(%rax), %rcx
movl 0xc(%rax), %eax
imull 0x4(%rdx), %eax
addl (%rdx), %eax
shll $0x4, %eax
addl %r15d, %eax
cltq
movzbl (%rcx,%rax), %edx
movq %r12, %rdi
movl %r14d, %esi
movq %rbx, %rcx
callq 0x1221b
incl %r15d
jmp 0x115dc
xorl %r15d, %r15d
leaq 0x103d8(%rip), %rbx     # 0x219fe
pushq $0x8
popq %r14
cmpl $0x40, %r15d
je 0x11666
movq 0x10ee48(%r13), %rax
movl 0x10(%rax), %ecx
imull 0x4(%rdx), %ecx
addl (%rdx), %ecx
movq 0x28(%rax), %rax
leal (%r15,%rcx,8), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
movq %r12, %rdi
movl %r14d, %esi
movq %rbx, %rcx
callq 0x1221b
movq -0x30(%rbp), %rdx
incl %r15d
jmp 0x1162a
xorl %r15d, %r15d
leaq 0x103a4(%rip), %rbx     # 0x21a14
pushq $0x8
popq %r14
cmpl $0x40, %r15d
je 0x116b0
movq 0x10ee48(%r13), %rax
movl 0x14(%rax), %ecx
imull 0x4(%rdx), %ecx
addl (%rdx), %ecx
movq 0x30(%rax), %rax
leal (%r15,%rcx,8), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
movq %r12, %rdi
movl %r14d, %esi
movq %rbx, %rcx
callq 0x1221b
movq -0x30(%rbp), %rdx
incl %r15d
jmp 0x11674
movl $0x328, %eax            # imm = 0x328
cmpq $0xf88, %rax            # imm = 0xF88
je 0x11928
movl $0x10, (%rdx,%rax)
addq $0x84, %rax
jmp 0x116b5
leaq 0x10584(%rip), %rdx     # 0x21c5b
movq %r12, %rdi
xorl %esi, %esi
jmp 0x11739
movl 0x2c0(%rsi), %esi
leaq 0xcb73(%rip), %rdx      # 0x1e25e
movq -0x38(%rbp), %rdi
jmp 0x11739
addl 0x2bc(%r11), %esi
movl 0x2b4(%r11), %eax
movl 0x2b8(%r11), %ecx
leal (%rsi,%rax,4), %eax
testl %ecx, %ecx
pushq $0xc
popq %rdx
cmovel %ecx, %edx
leal (%rdx,%rax), %esi
incl %esi
leaq 0x102bd(%rip), %rdx     # 0x219da
movq %r12, %rdi
callq 0x12165
movq -0x30(%rbp), %rax
movl 0x2c0(%rax), %esi
leaq 0xcb28(%rip), %rdx      # 0x1e25e
movq %r12, %rdi
callq 0x12165
movq -0x30(%rbp), %r11
movl 0x18(%r11), %eax
testl %eax, %eax
je 0x11763
cmpl $0x1, %eax
movq -0x38(%rbp), %r12
je 0x117a4
leaq 0x10521(%rip), %rdx     # 0x21c7b
leaq 0xe40f(%rip), %rax      # 0x1fb70
jmp 0x11775
leaq 0x104fa(%rip), %rdx     # 0x21c64
leaq 0x1083f(%rip), %rax     # 0x21fb0
movq -0x38(%rbp), %r12
movl 0x2b4(%r11), %ecx
shll $0x4, %ecx
orl 0x2b8(%r11), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %esi
movq %r12, %rdi
callq 0x12165
movq -0x30(%rbp), %r11
cmpl $0x1, 0x18(%r11)
jne 0x11840
cmpl $0x0, (%r11)
jg 0x117b5
cmpl $0x0, 0x4(%r11)
jle 0x11c6a
movl 0x2b0(%r11), %esi
subl -0xcd8(%r11), %esi
movq %r11, %rbx
leaq 0xcaec(%rip), %rdx      # 0x1e2b9
movq %r12, %rdi
callq 0x12382
leaq 0x2c4(%rbx), %r8
pushq $-0x2
popq %rcx
pushq $0x10
popq %r9
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x123b6
cmpl $0x0, 0x2b8(%rbx)
movq %rbx, %r11
je 0x118d1
leaq 0x32c(%r11), %rbx
xorl %r14d, %r14d
pushq $0xf
popq %r15
cmpq $0x10, %r14
je 0x118d1
movq %r13, %rdi
movq %r12, %rsi
movq %r11, %rdx
movl %r14d, %ecx
movq %rbx, %r8
movl %r15d, %r9d
callq 0x123b6
movq -0x30(%rbp), %r11
incq %r14
addq $0x84, %rbx
jmp 0x1180f
cmpl $0x0, 0x2b8(%r11)
jne 0x11854
cmpl $0x0, 0x2b4(%r11)
je 0x118d1
movl 0x2b0(%r11), %esi
movq 0x10dae0(%r13), %rax
movl 0x1034(%rax), %eax
addl 0x10db44(%r13), %eax
subl %eax, %esi
leaq 0xca41(%rip), %rdx      # 0x1e2b9
movq %r12, %rdi
callq 0x12382
movq -0x30(%rbp), %r11
leaq 0x368(%r11), %rbx
xorl %r14d, %r14d
pushq $0x10
popq %r15
cmpq $0x10, %r14
je 0x118d1
movl 0x2b8(%r11), %eax
movl %r14d, %ecx
shrl $0x2, %ecx
btl %ecx, %eax
jae 0x118c5
movq %r13, %rdi
movq %r12, %rsi
movq %r11, %rdx
movl %r14d, %ecx
movq %rbx, %r8
movl %r15d, %r9d
callq 0x123b6
movq -0x30(%rbp), %r11
incq %r14
addq $0x84, %rbx
jmp 0x11892
cmpl $0x0, 0x2b4(%r11)
je 0x11928
leaq 0x304(%r11), %r8
pushq $-0x1
popq %rbx
pushq $0x4
popq %r14
movq %r13, %rdi
movq %r12, %rsi
movq %r11, %rdx
movl %ebx, %ecx
movl %r14d, %r9d
callq 0x123b6
movq -0x30(%rbp), %rax
leaq 0x314(%rax), %r8
movq %r13, %rdi
movq %r12, %rsi
movq -0x30(%rbp), %rdx
movl %ebx, %ecx
movl %r14d, %r9d
callq 0x123b6
movq -0x30(%rbp), %rdx
testb $0x2, 0x2b4(%rdx)
jne 0x11937
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xb6c, %r14d           # imm = 0xB6C
xorl %r15d, %r15d
pushq $0xf
popq %rbx
cmpq $0xf8c, %r14            # imm = 0xF8C
je 0x11928
movl %r15d, %ecx
orl $0x10, %ecx
leaq (%rdx,%r14), %r8
movq %r13, %rdi
movq %r12, %rsi
movl %ebx, %r9d
callq 0x123b6
movq -0x30(%rbp), %rdx
incq %r15
addq $0x84, %r14
jmp 0x11943
movl 0x1c(%r11), %eax
cmpl $0xe, %eax
je 0x11dad
cmpl $0xf, %eax
je 0x11cd7
cmpl $0x10, %eax
jne 0x11742
leaq 0x100aa(%rip), %rdx     # 0x21a44
movq %r12, %rdi
xorl %esi, %esi
callq 0x12165
movl 0x10db38(%r13), %esi
cmpl $0x2, %esi
jl 0x119c8
decl %esi
movq -0x30(%rbp), %rax
movl 0x30(%rax), %edx
leaq 0xc006(%rip), %rcx      # 0x1d9c6
movq %r12, %rdi
callq 0x1231d
leaq -0x40(%rbp), %rbx
movq -0x30(%rbp), %r14
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x5acc
movl 0x38(%r14), %esi
subl (%rbx), %esi
leaq 0x1006b(%rip), %rdx     # 0x21a59
movq %r12, %rdi
callq 0x12382
leaq 0x3c(%r14), %rax
leaq 0x1007e(%rip), %rdx     # 0x21a7f
jmp 0x11e7e
cmpl $0x0, 0x30(%r11)
jne 0x11a2f
cmpl $0x0, 0x80(%r11)
jne 0x11a2f
cmpl $0x0, 0x170(%r11)
jne 0x11a2f
cmpl $0x0, 0x1c0(%r11)
je 0x12156
movb $0x1, %al
movl %eax, -0x64(%rbp)
pushq $0x3
popq %rsi
leaq 0x104b5(%rip), %rdx     # 0x21ef3
movq %r12, %rdi
callq 0x12165
pushq $0x8
popq %r15
leaq 0xde13(%rip), %r12      # 0x1f864
leaq 0x1012c(%rip), %r13     # 0x21b84
pushq $0x2
popq %rbx
leaq 0x10110(%rip), %r14     # 0x21b72
movq -0x30(%rbp), %r11
cmpq $0xc, %r15
je 0x11ac1
movl (%r11,%r15,4), %eax
cmpq $0x3, %rax
ja 0x11abc
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movq -0x38(%rbp), %rdi
pushq $0x3
popq %rsi
leaq 0x10100(%rip), %rdx     # 0x21b8d
jmp 0x11ab3
movq -0x38(%rbp), %rdi
movl %ebx, %esi
movq %r13, %rdx
jmp 0x11ab3
movq -0x38(%rbp), %rdi
xorl %esi, %esi
movq %r14, %rdx
jmp 0x11ab3
movq -0x38(%rbp), %rdi
pushq $0x1
popq %rsi
leaq 0x100c8(%rip), %rdx     # 0x21b7b
callq 0x12165
movq -0x30(%rbp), %r11
incq %r15
jmp 0x11a66
movq -0x48(%rbp), %r13
movl 0x10db38(%r13), %esi
cmpl $0x2, %esi
setl %al
movl -0x64(%rbp), %ecx
xorb $0x1, %cl
orb %al, %cl
jne 0x11b56
decl %esi
movl 0x30(%r11), %edx
leaq 0xbedd(%rip), %rbx      # 0x1d9c6
movq -0x38(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rcx
callq 0x1231d
movl 0x10db38(%r13), %esi
decl %esi
movq -0x30(%rbp), %rax
movl 0x170(%rax), %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x1231d
movl 0x10db38(%r13), %esi
decl %esi
movq -0x30(%rbp), %rax
movl 0x80(%rax), %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x1231d
movl 0x10db38(%r13), %esi
decl %esi
movq -0x30(%rbp), %rax
movl 0x1c0(%rax), %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x1231d
movq -0x30(%rbp), %r11
xorl %r12d, %r12d
leaq 0x10036(%rip), %r14     # 0x21b96
leaq 0x1003c(%rip), %rbx     # 0x21ba3
movq -0x38(%rbp), %r15
cmpq $0x4, %r12
je 0x11742
xorl %r13d, %r13d
movslq 0x20(%r11,%r12,4), %rax
leaq 0xde7c(%rip), %rcx      # 0x1fa00
cmpl (%rcx,%rax,4), %r13d
jge 0x11be9
leaq -0x50(%rbp), %rax
movq %rax, (%rsp)
movq %r11, %rdi
xorl %esi, %esi
movl %r12d, %edx
movl %r13d, %ecx
xorl %r8d, %r8d
leaq -0x58(%rbp), %r9
callq 0x5a03
movq -0x30(%rbp), %rdi
xorl %esi, %esi
movl %r12d, %edx
movl %r13d, %ecx
leaq -0x40(%rbp), %r8
callq 0x5acc
movl -0x58(%rbp), %esi
subl -0x40(%rbp), %esi
movq %r15, %rdi
movq %r14, %rdx
callq 0x12382
movl -0x50(%rbp), %esi
subl -0x3c(%rbp), %esi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x12382
movq -0x30(%rbp), %r11
incl %r13d
jmp 0x11b78
incq %r12
movq -0x48(%rbp), %r13
jmp 0x11b6b
movslq %ecx, %rdx
movslq 0x1c(%r11), %rax
leaq 0xddfd(%rip), %rsi      # 0x1fa00
movl (%rsi,%rax,4), %r12d
shlq $0x3, %rdx
xorl %esi, %esi
leaq 0xde3c(%rip), %rdi      # 0x1fa50
leaq 0xdec5(%rip), %r8       # 0x1fae0
cmpq $0x8, %rsi
je 0x11c3d
leaq (%rdx,%rsi), %r9
movl (%rdi,%r9), %r10d
movl %r10d, -0x58(%rbp,%rsi)
movl (%r8,%r9), %r9d
movl %r9d, -0x50(%rbp,%rsi)
addq $0x4, %rsi
jmp 0x11c1b
cmpl $0x10, %eax
jne 0x11c8c
cmpl $0x0, -0x58(%rbp)
setne %cl
movl -0x50(%rbp), %eax
testl %eax, %eax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x11e90
leaq 0xff70(%rip), %rdx      # 0x21bd3
pushq $0x3
jmp 0x11f07
movl 0x2b0(%r11), %esi
movq 0x10dae0(%r13), %rax
movl 0x1034(%rax), %eax
addl 0x10db44(%r13), %eax
subl %eax, %esi
jmp 0x117c3
cmpl $0xf, %ecx
jne 0x11e9f
xorl %esi, %esi
cmpl $0xe, %eax
sete %sil
xorl $0x15, %esi
leaq 0xff8b(%rip), %rdx      # 0x21c33
jmp 0x11f08
movq 0x1631c(%rip), %rax     # 0x27fd0
movq (%rax), %rcx
leaq 0xc52c(%rip), %rdi      # 0x1e1ea
pushq $0x24
popq %rsi
pushq $0x1
popq %rdx
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21e0
leaq 0xfe2d(%rip), %rdx      # 0x21b0b
pushq $0x2
popq %rsi
movq %r12, %rdi
callq 0x12165
movl 0x10db38(%r13), %esi
cmpl $0x2, %esi
jl 0x11d2c
decl %esi
movq -0x30(%rbp), %r14
movl 0x30(%r14), %edx
leaq 0xbcc0(%rip), %rbx      # 0x1d9c6
movq %r12, %rdi
movq %rbx, %rcx
callq 0x1231d
movl 0x10db38(%r13), %esi
decl %esi
movl 0x170(%r14), %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x1231d
leaq -0x40(%rbp), %rbx
movq -0x30(%rbp), %r14
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x5acc
movl 0x38(%r14), %esi
subl (%rbx), %esi
leaq 0xfd07(%rip), %rdx      # 0x21a59
movq %r12, %rdi
callq 0x12382
movl 0x3c(%r14), %esi
subl 0x4(%rbx), %esi
leaq 0xfd17(%rip), %rdx      # 0x21a7f
movq %r12, %rdi
callq 0x12382
pushq $0x1
popq %rdx
movq %r14, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x5acc
movl 0x178(%r14), %esi
subl (%rbx), %esi
leaq 0xfd93(%rip), %rdx      # 0x21b25
movq %r12, %rdi
callq 0x12382
leaq 0x17c(%r14), %rax
leaq 0xfda3(%rip), %rdx      # 0x21b4b
jmp 0x11e7e
leaq 0xfcf1(%rip), %rdx      # 0x21aa5
pushq $0x1
popq %rsi
movq %r12, %rdi
callq 0x12165
movl 0x10db38(%r13), %esi
cmpl $0x2, %esi
jl 0x11e02
decl %esi
movq -0x30(%rbp), %r14
movl 0x30(%r14), %edx
leaq 0xbbea(%rip), %rbx      # 0x1d9c6
movq %r12, %rdi
movq %rbx, %rcx
callq 0x1231d
movl 0x10db38(%r13), %esi
decl %esi
movl 0x80(%r14), %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x1231d
leaq -0x40(%rbp), %rbx
movq -0x30(%rbp), %r14
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x5acc
movl 0x38(%r14), %esi
subl (%rbx), %esi
leaq 0xfc31(%rip), %rdx      # 0x21a59
movq %r12, %rdi
callq 0x12382
movl 0x3c(%r14), %esi
subl 0x4(%rbx), %esi
leaq 0xfc41(%rip), %rdx      # 0x21a7f
movq %r12, %rdi
callq 0x12382
pushq $0x1
popq %rdx
movq %r14, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x5acc
movl 0x88(%r14), %esi
subl (%rbx), %esi
leaq 0xfc57(%rip), %rdx      # 0x21abf
movq %r12, %rdi
callq 0x12382
leaq 0x8c(%r14), %rax
leaq 0xfc67(%rip), %rdx      # 0x21ae5
movl (%rax), %esi
subl -0x3c(%rbp), %esi
movq %r12, %rdi
callq 0x12382
jmp 0x1173e
testl %eax, %eax
je 0x11efe
leaq 0xfd5a(%rip), %rdx      # 0x21bf5
pushq $0x2
jmp 0x11f07
movl -0x58(%rbp), %ecx
movl -0x54(%rbp), %edx
testl %ecx, %ecx
je 0x11ecd
cmpl $0x0, -0x50(%rbp)
je 0x11ecd
xorl %ecx, %ecx
testl %edx, %edx
sete %cl
xorl %edx, %edx
cmpl $0xe, %eax
setne %dl
leal (%rdx,%rcx,2), %esi
addl $0x10, %esi
leaq 0xfd70(%rip), %rdx      # 0x21c3b
jmp 0x11f08
testl %edx, %edx
setne %dil
movl -0x4c(%rbp), %esi
testl %esi, %esi
setne %r8b
andb %dil, %r8b
cmpb $0x1, %r8b
jne 0x120ef
xorl %esi, %esi
cmpl $0xe, %eax
sete %sil
xorl $0xd, %esi
leaq 0xfd47(%rip), %rdx      # 0x21c43
jmp 0x11f08
leaq 0xfd04(%rip), %rdx      # 0x21c09
pushq $0x1
popq %rsi
movq -0x38(%rbp), %rdi
callq 0x12165
movq -0x30(%rbp), %r11
cmpl $0x2, 0x10db38(%r13)
jl 0x11f82
xorl %ebx, %ebx
testl %r12d, %r12d
movl $0x0, %r13d
cmovgl %r12d, %r13d
leaq -0x60(%rbp), %r14
leaq 0xba8d(%rip), %r15      # 0x1d9c6
cmpq %rbx, %r13
je 0x11f82
cmpl $0x0, -0x58(%rbp,%rbx,4)
je 0x11f7d
andq $0x0, (%rsp)
movq %r11, %rdi
xorl %esi, %esi
movl %ebx, %edx
xorl %ecx, %ecx
movq %r14, %r8
xorl %r9d, %r9d
callq 0x5a03
movq -0x48(%rbp), %rax
movl 0x10db38(%rax), %esi
decl %esi
movl -0x60(%rbp), %edx
movq -0x38(%rbp), %rdi
movq %r15, %rcx
callq 0x1231d
movq -0x30(%rbp), %r11
incq %rbx
jmp 0x11f39
xorl %r15d, %r15d
testl %r12d, %r12d
cmovgl %r12d, %r15d
movq -0x48(%rbp), %rax
cmpl $0x2, 0x10db3c(%rax)
jl 0x11ff4
xorl %ebx, %ebx
pushq $0x1
popq %r14
leaq -0x60(%rbp), %r13
leaq 0xba34(%rip), %r12      # 0x1d9de
cmpq %rbx, %r15
je 0x11ff4
cmpl $0x0, -0x50(%rbp,%rbx,4)
je 0x11fef
andq $0x0, (%rsp)
movq %r11, %rdi
movl %r14d, %esi
movl %ebx, %edx
xorl %ecx, %ecx
movq %r13, %r8
xorl %r9d, %r9d
callq 0x5a03
movq -0x48(%rbp), %rax
movl 0x10db3c(%rax), %esi
decl %esi
movl -0x60(%rbp), %edx
movq -0x38(%rbp), %rdi
movq %r12, %rcx
callq 0x1231d
movq -0x30(%rbp), %r11
incq %rbx
jmp 0x11faa
xorl %ebx, %ebx
leaq -0x68(%rbp), %r12
leaq 0xfba2(%rip), %r13      # 0x21ba3
movq -0x38(%rbp), %r14
cmpq %rbx, %r15
je 0x1206c
cmpl $0x0, -0x58(%rbp,%rbx,4)
je 0x12067
movq %r12, (%rsp)
movq %r11, %rdi
xorl %esi, %esi
movl %ebx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
leaq -0x5c(%rbp), %r9
callq 0x5a03
movq -0x30(%rbp), %rdi
xorl %esi, %esi
movl %ebx, %edx
xorl %ecx, %ecx
leaq -0x40(%rbp), %r8
callq 0x5acc
movl -0x5c(%rbp), %esi
subl -0x40(%rbp), %esi
movq %r14, %rdi
leaq 0xfb49(%rip), %rdx      # 0x21b96
callq 0x12382
movl -0x68(%rbp), %esi
subl -0x3c(%rbp), %esi
movq %r14, %rdi
movq %r13, %rdx
callq 0x12382
movq -0x30(%rbp), %r11
incq %rbx
jmp 0x12005
xorl %ebx, %ebx
pushq $0x1
popq %r14
movq -0x48(%rbp), %r13
cmpq %rbx, %r15
je 0x11742
cmpl $0x0, -0x50(%rbp,%rbx,4)
je 0x120ea
movq %r12, (%rsp)
movq %r11, %rdi
movl %r14d, %esi
movl %ebx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
leaq -0x5c(%rbp), %r9
callq 0x5a03
movq -0x30(%rbp), %rdi
movl %r14d, %esi
movl %ebx, %edx
xorl %ecx, %ecx
leaq -0x40(%rbp), %r8
callq 0x5acc
movl -0x5c(%rbp), %esi
subl -0x40(%rbp), %esi
movq -0x38(%rbp), %r13
movq %r13, %rdi
leaq 0xface(%rip), %rdx      # 0x21b96
callq 0x12382
movl -0x68(%rbp), %esi
subl -0x3c(%rbp), %esi
movq %r13, %rdi
movq -0x48(%rbp), %r13
leaq 0xfac2(%rip), %rdx      # 0x21ba3
callq 0x12382
movq -0x30(%rbp), %r11
incq %rbx
jmp 0x12076
testl %esi, %esi
je 0x1212c
xorl %edx, %edx
testl %ecx, %ecx
setne %dl
xorl %ecx, %ecx
cmpl $0xe, %eax
setne %cl
leal (%rcx,%rdx,2), %esi
addl $0x6, %esi
leaq 0xfb3c(%rip), %rdx      # 0x21c4b
jmp 0x11f08
movq 0x15eb5(%rip), %rax     # 0x27fd0
movq (%rax), %rcx
leaq 0xfa8b(%rip), %rdi      # 0x21bb0
pushq $0x22
jmp 0x11cc0
testl %edx, %edx
je 0x11f15
testl %ecx, %ecx
pushq $0x4
popq %rcx
pushq $0xa
popq %rdx
cmovnel %ecx, %edx
xorl %esi, %esi
cmpl $0xe, %eax
setne %sil
orl %edx, %esi
leaq 0xfb02(%rip), %rdx      # 0x21c53
jmp 0x11f08
pushq $0x4
popq %rsi
movl $0x0, -0x64(%rbp)
jmp 0x11a37