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

    /* Write the MB type */
#if 0
    fprintf(stderr, "[%d,%d] type=%d cbp=%d predc=%d\n",
            mb->i_mb_x, mb->i_mb_y,
            1 + mb->i_intra16x16_pred_mode + mb->i_cbp_chroma * 4 + (mb->i_cbp_luma == 0 ? 0 : 12),
            (mb->i_cbp_chroma << 4) | mb->i_cbp_luma,
            mb->i_chroma_pred_mode);
#endif
    x264_cabac_mb_type(h, mb);

    /* PCM special block type UNTESTED */
    if (mb->i_type == I_PCM)
    {
        bs_align_0(s); /* not sure */
        /* 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;
        }

        x264_cabac_encode_init(&h->cabac, s);
        return;
    }

    if (IS_INTRA(mb->i_type))
    {
        /* Prediction */
        if (mb->i_type == I_4x4)
        {
            for (i = 0; i < 16; i++)
            {
                x264_cabac_mb_intra4x4_pred_mode(h, mb,
                        x264_mb_predict_intra4x4_mode(h, mb, i),
                        mb->block[i].i_intra4x4_pred_mode);
            }
        }
        x264_cabac_mb_intra8x8_pred_mode(h, mb);
    } else if (mb->i_type == P_8x8)
    {
        /* sub mb type */
        for (i = 0; i < 4; i++)
        {
            x264_cabac_mb_sub_partition(h, mb->i_sub_partition[i]);
        }
        /* ref 0 */
        if (h->sh.i_num_ref_idx_l0_active > 1)
        {
            for (i = 0; i < 4; i++)
            {
                x264_cabac_mb_ref(h, mb, 0, i);
            }
        }

        for (i = 0; i < 4; i++)
        {
            int i_sub;
            for (i_sub = 0; i_sub < x264_mb_partition_count_table[mb->i_sub_partition[i]]; i_sub++)
            {
                x264_cabac_mb_mv(h, mb, 0, i, i_sub);
            }
        }
    } else if (mb->i_type == B_8x8)
    {
        /* TODO */
        fprintf(stderr, "Arggg B_8x8\n");
    } else if (mb->i_type != B_DIRECT)
    {
        /* FIXME -> invalid for B frame */

        /* Motion Vector */
        int i_part = x264_mb_partition_count_table[mb->i_partition];

        if (h->sh.i_num_ref_idx_l0_active > 1)
        {
            for (i = 0; i < i_part; i++)
            {
                if (mb->i_type == P_L0)
                {
                    x264_cabac_mb_ref(h, mb, 0, i);
                }
            }
        }

        for (i = 0; i < i_part; i++)
        {
            if (mb->i_type == P_L0)
            {
                x264_cabac_mb_mv(h, mb, 0, i, 0);
            }
        }
    }

    if (mb->i_type != I_16x16)
    {
        x264_cabac_mb_cbp_luma(h, mb);
        x264_cabac_mb_cbp_chroma(h, mb);
    }

    if (mb->i_cbp_luma > 0 || mb->i_cbp_chroma > 0 || mb->i_type == I_16x16)
    {
        x264_cabac_mb_qp_delta(h, mb);

        /* write residual */
        if (mb->i_type == I_16x16)
        {
            /* DC Luma */
            block_residual_write_cabac(h, mb, 0, 0, mb->luma16x16_dc, 16);

            if (mb->i_cbp_luma != 0)
            {
                /* AC Luma */
                for (i = 0; i < 16; i++)
                {
                    block_residual_write_cabac(h, mb, 1, i, mb->block[i].residual_ac, 15);
                }
            }
        } else
        {
            for (i = 0; i < 16; i++)
            {
                if (mb->i_cbp_luma & (1 << (i / 4)))
                {
                    block_residual_write_cabac(h, mb, 2, i, mb->block[i].luma4x4, 16);
                }
            }
        }

        if (mb->i_cbp_chroma & 0x03) /* Chroma DC residual present */
        {
            block_residual_write_cabac(h, mb, 3, 0, mb->chroma_dc[0], 4);
            block_residual_write_cabac(h, mb, 3, 1, mb->chroma_dc[1], 4);
        }
        if (mb->i_cbp_chroma & 0x02) /* Chroma AC residual present */
        {
            for (i = 0; i < 8; i++)
            {
                block_residual_write_cabac(h, mb, 4, 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 $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xc86b(%rip), %r12      # 0x271b4
leaq 0x12e14(%rip), %r13     # 0x2d764
leaq 0x13147(%rip), %rdx     # 0x2da9e
movq %r12, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x4a56
leaq 0x132e4(%rip), %rdx     # 0x2dc4f
movq %r12, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x4a56
movl 0x10db00(%rbx), %eax
testl %eax, %eax
movq %rbx, -0x30(%rbp)
je 0x1a9d4
cmpl $0x2, %eax
jne 0x1ac3e
movq 0x10(%r14), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
xorl %esi, %esi
testq %rcx, %rcx
je 0x1a9a9
cmpl $0x0, 0x18(%rcx)
setne %sil
testq %rax, %rax
je 0x1a9b5
cmpl $0x1, 0x18(%rax)
sbbl $-0x1, %esi
movl 0x18(%r14), %eax
leaq 0x10db60(%rbx), %r12
addl $0x3, %esi
cmpl $0x2, %eax
je 0x1aa06
testl %eax, %eax
jne 0x1aa0e
movq %r12, %rdi
jmp 0x1ac75
movl 0x18(%r14), %eax
cmpq $0x4, %rax
ja 0x1ab39
leaq 0x10d3b(%rip), %rcx     # 0x2b724
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x10db60(%rbx), %r12
movq %r12, %rdi
movl $0xe, %esi
jmp 0x1ac63
movq %r12, %rdi
jmp 0x1aaeb
movq %r12, %rdi
movl $0x1, %edx
callq 0x3efb
movq %r12, %rdi
xorl %esi, %esi
callq 0x42f8
xorl %edx, %edx
cmpl $0x0, 0x2b8(%r14)
setne %dl
movq %r12, %rdi
movl $0x6, %esi
callq 0x3efb
cmpl $0x0, 0x2b4(%r14)
je 0x1abfc
movq %r12, %rdi
movl $0x7, %esi
movl $0x1, %edx
callq 0x3efb
xorl %edx, %edx
cmpl $0x1, 0x2b4(%r14)
setne %dl
movq %r12, %rdi
movl $0x8, %esi
jmp 0x1ac06
movl 0x1c(%r14), %eax
cmpl $0xe, %eax
je 0x1ac79
cmpl $0xf, %eax
je 0x1ac45
cmpl $0x10, %eax
jne 0x1acb3
leaq 0x10db60(%rbx), %r12
movq %r12, %rdi
movl $0xe, %esi
xorl %edx, %edx
callq 0x3efb
movq %r12, %rdi
movl $0xf, %esi
xorl %edx, %edx
callq 0x3efb
movq %r12, %rdi
movl $0x10, %esi
jmp 0x1ac75
leaq 0x10db60(%rbx), %r12
movq %r12, %rdi
movl $0xe, %esi
movl $0x1, %edx
callq 0x3efb
movq %r12, %rdi
movl $0x11, %esi
movl $0x1, %edx
callq 0x3efb
movq %r12, %rdi
movl $0x1, %esi
callq 0x42f8
jmp 0x1acb3
leaq 0x10db60(%rbx), %r12
movq %r12, %rdi
movl $0xe, %esi
xorl %edx, %edx
callq 0x3efb
movq %r12, %rdi
movl $0xf, %esi
xorl %edx, %edx
callq 0x3efb
movq %r12, %rdi
movl $0x10, %esi
jmp 0x1aca9
leaq 0x10db60(%rbx), %r12
movq %r12, %rdi
movl $0xe, %esi
movl $0x1, %edx
callq 0x3efb
movq %r12, %rdi
movl $0x11, %esi
movl $0x1, %edx
callq 0x3efb
xorl %r13d, %r13d
movq %r12, %rdi
xorl %esi, %esi
callq 0x42f8
xorl %edx, %edx
cmpl $0x0, 0x2b8(%r14)
setne %dl
movq %r12, %rdi
movl $0x12, %esi
callq 0x3efb
cmpl $0x0, 0x2b4(%r14)
je 0x1abb6
movq %r12, %rdi
movl $0x13, %esi
movl $0x1, %edx
callq 0x3efb
xorl %r13d, %r13d
cmpl $0x1, 0x2b4(%r14)
setne %r13b
movq %r12, %rdi
movl $0x13, %esi
movl %r13d, %edx
callq 0x3efb
movl 0x2bc(%r14), %eax
addl $-0x2, %eax
xorl %edx, %edx
cmpl $-0x3, %eax
setb %dl
movq %r12, %rdi
movl $0x14, %esi
callq 0x3efb
movl 0x2bc(%r14), %edx
andl $0x1, %edx
movq %r12, %rdi
movl $0x14, %esi
jmp 0x1acae
movq %r12, %rdi
movl $0x7, %esi
xorl %edx, %edx
callq 0x3efb
movl 0x2bc(%r14), %eax
addl $-0x2, %eax
xorl %edx, %edx
cmpl $-0x3, %eax
setb %dl
movq %r12, %rdi
movl $0x9, %esi
callq 0x3efb
movl 0x2bc(%r14), %edx
andl $0x1, %edx
movq %r12, %rdi
movl $0xa, %esi
jmp 0x1acae
callq 0x2ebd
jmp 0x1acb3
leaq 0x10db60(%rbx), %r12
movq %r12, %rdi
movl $0xe, %esi
xorl %edx, %edx
callq 0x3efb
movq %r12, %rdi
movl $0xf, %esi
movl $0x1, %edx
callq 0x3efb
movq %r12, %rdi
movl $0x11, %esi
xorl %edx, %edx
jmp 0x1acae
leaq 0x10db60(%rbx), %r12
movq %r12, %rdi
movl $0xe, %esi
xorl %edx, %edx
callq 0x3efb
movq %r12, %rdi
movl $0xf, %esi
movl $0x1, %edx
callq 0x3efb
movq %r12, %rdi
movl $0x11, %esi
movl $0x1, %edx
callq 0x3efb
movl 0x18(%r14), %eax
cmpq $0x6, %rax
ja 0x1b26f
leaq 0x10a70(%rip), %rcx     # 0x2b738
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x324(%r14), %rbx
movq -0x30(%rbp), %rax
addq $0x10db60, %rax         # imm = 0x10DB60
movq %rax, -0x38(%rbp)
xorl %r13d, %r13d
movq -0x30(%rbp), %rdi
movq %r14, %rsi
movl %r13d, %edx
callq 0x6577
movl %eax, %r15d
movl (%rbx), %r12d
leaq 0xc4af(%rip), %rdi      # 0x271b4
leaq 0x12a58(%rip), %rsi     # 0x2d764
leaq 0x12f88(%rip), %rdx     # 0x2dc9b
xorl %eax, %eax
callq 0x4a56
cmpl %r12d, %r15d
jne 0x1ad2f
movq -0x38(%rbp), %rdi
movl $0x44, %esi
movl $0x1, %edx
jmp 0x1ad89
movq -0x38(%rbp), %rdi
movl $0x44, %esi
xorl %edx, %edx
callq 0x3efb
xorl %eax, %eax
cmpl %r15d, %r12d
setg %al
subl %eax, %r12d
movl %r12d, %edx
andl $0x1, %edx
movq -0x38(%rbp), %r15
movq %r15, %rdi
movl $0x45, %esi
callq 0x3efb
movl %r12d, %edx
shrl %edx
andl $0x1, %edx
movq %r15, %rdi
movl $0x45, %esi
callq 0x3efb
shrl $0x2, %r12d
andl $0x1, %r12d
movq %r15, %rdi
movl $0x45, %esi
movl %r12d, %edx
callq 0x3efb
incq %r13
addq $0x84, %rbx
cmpq $0x10, %r13
jne 0x1ace9
leaq 0xc40b(%rip), %rdi      # 0x271b4
leaq 0x129b4(%rip), %rsi     # 0x2d764
leaq 0x12f05(%rip), %rdx     # 0x2dcbc
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x4a56
movq 0x10(%r14), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
testq %rcx, %rcx
je 0x1b1e6
cmpl $0x1, 0x18(%rcx)
movq -0x30(%rbp), %rdx
ja 0x1b1ea
xorl %r15d, %r15d
cmpl $0x0, 0x2c0(%rcx)
setne %r15b
jmp 0x1b1ea
movq -0x30(%rbp), %rax
leaq 0x10db60(%rax), %r15
movl $0x8, %r13d
leaq 0x10946(%rip), %rbx     # 0x2b754
movl (%r14,%r13,4), %r12d
leaq 0xc39b(%rip), %rdi      # 0x271b4
leaq 0x12944(%rip), %rsi     # 0x2d764
leaq 0x12eb6(%rip), %rdx     # 0x2dcdd
xorl %eax, %eax
callq 0x4a56
cmpq $0x3, %r12
ja 0x1aec4
movslq (%rbx,%r12,4), %rax
addq %rbx, %rax
jmpq *%rax
movq %r15, %rdi
movl $0x15, %esi
xorl %edx, %edx
callq 0x3efb
movq %r15, %rdi
movl $0x16, %esi
movl $0x1, %edx
callq 0x3efb
movq %r15, %rdi
movl $0x17, %esi
jmp 0x1aebd
movq %r15, %rdi
movl $0x15, %esi
xorl %edx, %edx
callq 0x3efb
movq %r15, %rdi
movl $0x16, %esi
movl $0x1, %edx
callq 0x3efb
movq %r15, %rdi
movl $0x17, %esi
jmp 0x1ae9f
movq %r15, %rdi
movl $0x15, %esi
movl $0x1, %edx
jmp 0x1aebf
movq %r15, %rdi
movl $0x15, %esi
xorl %edx, %edx
callq 0x3efb
movq %r15, %rdi
movl $0x16, %esi
xorl %edx, %edx
callq 0x3efb
incq %r13
cmpq $0xc, %r13
jne 0x1ae0e
movq -0x30(%rbp), %r13
cmpl $0x2, 0x10db38(%r13)
jl 0x1aef9
xorl %r15d, %r15d
movq %r13, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x1b7a6
incl %r15d
cmpl $0x4, %r15d
jne 0x1aee2
xorl %r15d, %r15d
leaq 0x109ad(%rip), %rbx     # 0x2b8b0
xorl %r12d, %r12d
movq %r13, %rdi
movq %r14, %rsi
movl %r15d, %edx
movl %r12d, %ecx
callq 0x1b94f
incl %r12d
movslq 0x20(%r14,%r15,4), %rax
cmpl (%rbx,%rax,4), %r12d
jl 0x1af06
incq %r15
cmpq $0x4, %r15
jne 0x1af03
jmp 0x1b2f0
leaq 0xc27a(%rip), %rdi      # 0x271b4
leaq 0xff9b(%rip), %rsi      # 0x2aedc
leaq 0xc273(%rip), %rdx      # 0x271bb
xorl %eax, %eax
callq 0x4a56
movl 0x18(%r15), %ecx
cmpl $0x8, %ecx
je 0x1af9c
testl %ecx, %ecx
jle 0x1af9c
leal 0x1(%rcx), %eax
movq 0x8(%r15), %rdx
cmpq 0x10(%r15), %rdx
jae 0x1af9c
decb %cl
movl $0x1, %esi
shll %cl, %esi
notb %sil
andb %sil, (%rdx)
movl 0x18(%r15), %ecx
decl %ecx
movl %ecx, 0x18(%r15)
jne 0x1af95
incq 0x8(%r15)
movl $0x8, 0x18(%r15)
movl $0x8, %ecx
decl %eax
cmpl $0x1, %eax
ja 0x1af5f
leaq 0x12b17(%rip), %r13     # 0x2daba
xorl %ebx, %ebx
movq -0x30(%rbp), %rax
movq 0x10ee48(%rax), %rax
movq 0x20(%rax), %rcx
movl 0xc(%rax), %eax
imull 0x4(%r14), %eax
addl (%r14), %eax
shll $0x4, %eax
addl %ebx, %eax
cltq
movzbl (%rcx,%rax), %r12d
leaq 0x102c6(%rip), %rdi     # 0x2b298
movl $0x8, %esi
movl %r12d, %edx
movq %r13, %rcx
xorl %eax, %eax
callq 0x4a56
movl $0x9, %eax
movq 0x8(%r15), %rdx
cmpq 0x10(%r15), %rdx
jae 0x1b040
movb 0x18(%r15), %cl
decb %cl
movl $0x1, %esi
shll %cl, %esi
leal -0x2(%rax), %ecx
movzbl %cl, %ecx
movb (%rdx), %dil
movl %esi, %r8d
notb %r8b
andb %dil, %r8b
orb %sil, %dil
btl %ecx, %r12d
movzbl %dil, %ecx
movzbl %r8b, %esi
cmovbl %ecx, %esi
movb %sil, (%rdx)
decl 0x18(%r15)
jne 0x1b039
incq 0x8(%r15)
movl $0x8, 0x18(%r15)
decl %eax
cmpl $0x1, %eax
ja 0x1afe9
incl %ebx
cmpl $0x100, %ebx            # imm = 0x100
jne 0x1afa5
leaq 0x12a7a(%rip), %r13     # 0x2dacf
xorl %ebx, %ebx
movq -0x30(%rbp), %rax
movq 0x10ee48(%rax), %rax
movl 0x10(%rax), %ecx
imull 0x4(%r14), %ecx
addl (%r14), %ecx
movq 0x28(%rax), %rax
leal (%rbx,%rcx,8), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %r12d
leaq 0x10215(%rip), %rdi     # 0x2b298
movl $0x8, %esi
movl %r12d, %edx
movq %r13, %rcx
xorl %eax, %eax
callq 0x4a56
movl $0x9, %eax
movq 0x8(%r15), %rdx
cmpq 0x10(%r15), %rdx
jae 0x1b0f1
movb 0x18(%r15), %cl
decb %cl
movl $0x1, %esi
shll %cl, %esi
leal -0x2(%rax), %ecx
movzbl %cl, %ecx
movb (%rdx), %dil
movl %esi, %r8d
notb %r8b
andb %dil, %r8b
orb %sil, %dil
btl %ecx, %r12d
movzbl %dil, %ecx
movzbl %r8b, %esi
cmovbl %ecx, %esi
movb %sil, (%rdx)
decl 0x18(%r15)
jne 0x1b0ea
incq 0x8(%r15)
movl $0x8, 0x18(%r15)
decl %eax
cmpl $0x1, %eax
ja 0x1b09a
incl %ebx
cmpl $0x40, %ebx
jne 0x1b057
leaq 0x129e1(%rip), %r13     # 0x2dae4
xorl %ebx, %ebx
movq -0x30(%rbp), %rax
movq 0x10ee48(%rax), %rax
movl 0x14(%rax), %ecx
imull 0x4(%r14), %ecx
addl (%r14), %ecx
movq 0x30(%rax), %rax
leal (%rbx,%rcx,8), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %r12d
leaq 0x10167(%rip), %rdi     # 0x2b298
movl $0x8, %esi
movl %r12d, %edx
movq %r13, %rcx
xorl %eax, %eax
callq 0x4a56
movl $0x9, %eax
movq 0x8(%r15), %rdx
cmpq 0x10(%r15), %rdx
jae 0x1b19f
movb 0x18(%r15), %cl
decb %cl
movl $0x1, %esi
shll %cl, %esi
leal -0x2(%rax), %ecx
movzbl %cl, %ecx
movb (%rdx), %dil
movl %esi, %r8d
notb %r8b
andb %dil, %r8b
orb %sil, %dil
btl %ecx, %r12d
movzbl %dil, %ecx
movzbl %r8b, %esi
cmovbl %ecx, %esi
movb %sil, (%rdx)
decl 0x18(%r15)
jne 0x1b198
incq 0x8(%r15)
movl $0x8, 0x18(%r15)
decl %eax
cmpl $0x1, %eax
ja 0x1b148
incl %ebx
cmpl $0x40, %ebx
jne 0x1b105
movl $0x328, %eax            # imm = 0x328
movl $0x10, (%r14,%rax)
addq $0x84, %rax
cmpq $0xf88, %rax            # imm = 0xF88
jne 0x1b1af
movq -0x30(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movq %r15, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3ed6
movq -0x30(%rbp), %rdx
testq %rax, %rax
je 0x1b200
cmpl $0x1, 0x18(%rax)
ja 0x1b200
cmpl $0x1, 0x2c0(%rax)
sbbl $-0x1, %r15d
leaq 0x10db60(%rdx), %r12
addl $0x40, %r15d
cmpl $0x0, 0x2c0(%r14)
je 0x1b25d
movq %r12, %rdi
movl %r15d, %esi
movl $0x1, %edx
callq 0x3efb
xorl %edx, %edx
cmpl $0x1, 0x2c0(%r14)
setne %dl
movq %r12, %rdi
movl $0x43, %esi
callq 0x3efb
cmpl $0x2, 0x2c0(%r14)
jl 0x1b2f0
setne %al
movzbl %al, %edx
movq %r12, %rdi
movl $0x43, %esi
jmp 0x1b265
movq %r12, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x3efb
jmp 0x1b2f0
cmpl $0x10, %eax
je 0x1b79c
movslq 0x1c(%r14), %rax
leaq 0x1062d(%rip), %rcx     # 0x2b8b0
movl (%rcx,%rax,4), %ebx
movq -0x30(%rbp), %r13
cmpl $0x2, 0x10db38(%r13)
jl 0x1b2c1
cmpl $0x2, %ebx
movl $0x1, %r12d
cmovgel %ebx, %r12d
xorl %r15d, %r15d
cmpl $0x3, 0x18(%r14)
jne 0x1b2b9
movq %r13, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x1b7a6
incl %r15d
cmpl %r15d, %r12d
jne 0x1b2a4
cmpl $0x2, %ebx
movl $0x1, %r12d
cmovgel %ebx, %r12d
xorl %r15d, %r15d
cmpl $0x3, 0x18(%r14)
jne 0x1b2e8
movq %r13, %rdi
movq %r14, %rsi
movl %r15d, %edx
xorl %ecx, %ecx
callq 0x1b94f
incl %r15d
cmpl %r15d, %r12d
jne 0x1b2d1
cmpl $0x1, 0x18(%r14)
je 0x1b51a
leaq 0xbeb2(%rip), %rdi      # 0x271b4
leaq 0x1245b(%rip), %rsi     # 0x2d764
leaq 0x12a1e(%rip), %rdx     # 0x2dd2e
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x4a56
movq -0x30(%rbp), %rax
leaq 0x10db60(%rax), %rbx
movl $0x13c, %r13d           # imm = 0x13C
xorl %r15d, %r15d
movq 0x10(%r14), %rdx
movq -0x8(%rdx,%r13,4), %rdi
leaq 0xed02(%rip), %rax      # 0x2a040
movzbl (%r15,%rax), %eax
leaq 0xece6(%rip), %rcx      # 0x2a030
movzbl (%r15,%rcx), %ecx
movl $0x0, %esi
testq %rdi, %rdi
je 0x1b3a1
movl 0x18(%rdi), %r8d
cmpl $0x2, %r8d
je 0x1b3a1
cmpl $0x5, %r8d
je 0x1b39c
cmpl $0x11, %r8d
je 0x1b39c
leal -0x1(%rax), %esi
andb $0x3, %sil
movzbl %sil, %esi
leaq 0xbf7f(%rip), %r8       # 0x27300
leaq (%r8,%rsi,4), %rsi
movzbl (%rcx,%rsi), %esi
shrl $0x2, %esi
movl 0x2b8(%rdi), %edi
btl %esi, %edi
movl $0x0, %esi
jb 0x1b3a1
movl $0x1, %esi
movq (%rdx,%r13,4), %rdx
testq %rdx, %rdx
je 0x1b3e4
movl 0x18(%rdx), %edi
cmpl $0x2, %edi
je 0x1b3e4
cmpl $0x5, %edi
je 0x1b3e1
cmpl $0x11, %edi
je 0x1b3e1
decb %cl
andb $0x3, %cl
movzbl %cl, %ecx
leaq 0xbf35(%rip), %rdi      # 0x27300
leaq (%rdi,%rax,4), %rax
movzbl (%rcx,%rax), %eax
shrl $0x2, %eax
movl 0x2b8(%rdx), %ecx
btl %eax, %ecx
jb 0x1b3e4
orl $0x2, %esi
addl $0x49, %esi
movl 0x2b8(%r14), %eax
xorl %edx, %edx
btl %r12d, %eax
setb %dl
movq %rbx, %rdi
callq 0x3efb
leaq 0x4(%r15), %rax
incl %r12d
addq $0x20, %r13
cmpq $0xc, %r15
movq %rax, %r15
jb 0x1b32e
leaq 0xbd96(%rip), %rdi      # 0x271b4
leaq 0x1233f(%rip), %rsi     # 0x2d764
leaq 0x12919(%rip), %rdx     # 0x2dd45
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x4a56
movq 0x10(%r14), %rax
movq (%rax), %r15
movq 0x8(%rax), %r13
testq %r15, %r15
je 0x1b469
movl 0x18(%r15), %eax
cmpl $0x2, %eax
je 0x1b463
cmpl $0x5, %eax
je 0x1b469
cmpl $0x11, %eax
je 0x1b469
cmpl $0x0, 0x2b4(%r15)
je 0x1b469
movl $0x1, %r12d
testq %r13, %r13
je 0x1b48f
movl 0x18(%r13), %eax
cmpl $0x2, %eax
je 0x1b48b
cmpl $0x5, %eax
je 0x1b48f
cmpl $0x11, %eax
je 0x1b48f
cmpl $0x0, 0x2b4(%r13)
je 0x1b48f
orl $0x2, %r12d
addl $0x4d, %r12d
xorl %edx, %edx
cmpl $0x0, 0x2b4(%r14)
setg %dl
movq %rbx, %rdi
movl %r12d, %esi
callq 0x3efb
movl 0x2b4(%r14), %eax
testl %eax, %eax
jle 0x1b51a
movl $0x4, %esi
testq %r15, %r15
je 0x1b4e2
movl 0x18(%r15), %ecx
cmpl $0x2, %ecx
je 0x1b4dd
cmpl $0x5, %ecx
je 0x1b4e2
cmpl $0x11, %ecx
je 0x1b4e2
cmpl $0x2, 0x2b4(%r15)
jne 0x1b4e2
movl $0x5, %esi
testq %r13, %r13
je 0x1b507
movl 0x18(%r13), %ecx
cmpl $0x2, %ecx
je 0x1b504
cmpl $0x5, %ecx
je 0x1b507
cmpl $0x11, %ecx
je 0x1b507
cmpl $0x2, 0x2b4(%r13)
jne 0x1b507
orl $0x2, %esi
addl $0x4d, %esi
xorl %edx, %edx
cmpl $0x1, %eax
setne %dl
movq %rbx, %rdi
callq 0x3efb
cmpl $0x0, 0x2b8(%r14)
movq -0x30(%rbp), %r13
jg 0x1b53d
cmpl $0x0, 0x2b4(%r14)
jg 0x1b53d
cmpl $0x1, 0x18(%r14)
jne 0x1b77b
leaq 0xbc70(%rip), %rdi      # 0x271b4
leaq 0x12219(%rip), %rsi     # 0x2d764
leaq 0x1280c(%rip), %rdx     # 0x2dd5e
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x4a56
movq 0x10dae0(%r13), %rcx
movl 0x10db44(%r13), %eax
addl 0x1034(%rcx), %eax
cmpl $0x0, (%r14)
jg 0x1b57d
cmpl $0x0, 0x4(%r14)
jle 0x1b5de
cmpl $0x0, -0xf88(%r14)
jg 0x1b595
cmpl $0x0, -0xf84(%r14)
jle 0x1b78a
movl -0xcd8(%r14), %eax
movl %eax, %ecx
subl -0x1c60(%r14), %ecx
movl -0xf70(%r14), %edx
cmpl $0x5, %edx
je 0x1b5de
cmpl $0x11, %edx
je 0x1b5de
cmpl $0x2, %edx
je 0x1b5de
testl %ecx, %ecx
je 0x1b5de
cmpl $0x1, %edx
je 0x1b5d8
cmpl $0x0, -0xcd0(%r14)
jne 0x1b5d8
cmpl $0x0, -0xcd4(%r14)
je 0x1b5de
movl $0x1, %r15d
movl 0x2b0(%r14), %ecx
subl %eax, %ecx
leal (%rcx,%rcx), %eax
negl %eax
testl %ecx, %ecx
leal -0x1(%rcx,%rcx), %ebx
cmovlel %eax, %ebx
testl %ebx, %ebx
jle 0x1b628
leaq 0x10db60(%r13), %r12
incl %ebx
leal 0x3c(%r15), %esi
movq %r12, %rdi
movl $0x1, %edx
callq 0x3efb
cmpl $0x2, %r15d
movl $0x3, %r15d
sbbl $0x0, %r15d
decl %ebx
cmpl $0x1, %ebx
ja 0x1b602
leaq 0x10db60(%r13), %rdi
addl $0x3c, %r15d
movl %r15d, %esi
xorl %edx, %edx
callq 0x3efb
cmpl $0x1, 0x18(%r14)
jne 0x1b6a6
leaq 0x2c4(%r14), %r8
movq %r13, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x10, %r9d
callq 0x1bb54
cmpl $0x0, 0x2b8(%r14)
je 0x1b6ee
leaq 0x32c(%r14), %r15
xorl %r12d, %r12d
movq %r13, %rdi
movq %r14, %rsi
movl $0x1, %edx
movl %r12d, %ecx
movq %r15, %r8
movl $0xf, %r9d
callq 0x1bb54
incq %r12
addq $0x84, %r15
cmpq $0x10, %r12
jne 0x1b678
jmp 0x1b6ee
leaq 0x368(%r14), %r15
xorl %r12d, %r12d
movl 0x2b8(%r14), %eax
movl %r12d, %ecx
shrl $0x2, %ecx
btl %ecx, %eax
jae 0x1b6de
movq %r13, %rdi
movq %r14, %rsi
movl $0x2, %edx
movl %r12d, %ecx
movq %r15, %r8
movl $0x10, %r9d
callq 0x1bb54
incq %r12
addq $0x84, %r15
cmpq $0x10, %r12
jne 0x1b6b0
movl 0x2b4(%r14), %eax
testb $0x3, %al
je 0x1b741
leaq 0x304(%r14), %r8
movq %r13, %rdi
movq %r14, %rsi
movl $0x3, %edx
xorl %ecx, %ecx
movl $0x4, %r9d
callq 0x1bb54
leaq 0x314(%r14), %r8
movq %r13, %rdi
movq %r14, %rsi
movl $0x3, %edx
movl $0x1, %ecx
movl $0x4, %r9d
callq 0x1bb54
movl 0x2b4(%r14), %eax
testb $0x2, %al
je 0x1b77b
leaq 0xb6c(%r14), %r15
xorl %r12d, %r12d
movq %r13, %rdi
movq %r14, %rsi
movl $0x4, %edx
movl %r12d, %ecx
movq %r15, %r8
movl $0xf, %r9d
callq 0x1bb54
incq %r12
addq $0x84, %r15
cmpq $0x8, %r12
jne 0x1b74f
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl -0xcd8(%r14), %edx
movl %edx, %ecx
subl %eax, %ecx
movl %edx, %eax
jmp 0x1b5a5
callq 0x2eec
jmp 0x1b2f0