// File: /workspace/github_c_makefile_star2_O1/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 0xb57c(%rip), %r12      # 0x251b4
leaq 0x11dd9(%rip), %r13     # 0x2ba18
leaq 0x1210c(%rip), %rdx     # 0x2bd52
movq %r12, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x4c22
leaq 0x122a9(%rip), %rdx     # 0x2bf03
movq %r12, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x4c22
movl 0x10db00(%rbx), %eax
testl %eax, %eax
movq %rbx, -0x30(%rbp)
je 0x19cc3
cmpl $0x2, %eax
jne 0x19f2d
movq 0x10(%r14), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
xorl %esi, %esi
testq %rcx, %rcx
je 0x19c98
cmpl $0x0, 0x18(%rcx)
setne %sil
testq %rax, %rax
je 0x19ca4
cmpl $0x1, 0x18(%rax)
sbbl $-0x1, %esi
movl 0x18(%r14), %eax
leaq 0x10db60(%rbx), %r12
addl $0x3, %esi
cmpl $0x2, %eax
je 0x19cf5
testl %eax, %eax
jne 0x19cfd
movq %r12, %rdi
jmp 0x19f64
movl 0x18(%r14), %eax
cmpq $0x4, %rax
ja 0x19e28
leaq 0xfc4c(%rip), %rcx      # 0x29924
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x10db60(%rbx), %r12
movq %r12, %rdi
movl $0xe, %esi
jmp 0x19f52
movq %r12, %rdi
jmp 0x19dda
movq %r12, %rdi
movl $0x1, %edx
callq 0x40ca
movq %r12, %rdi
xorl %esi, %esi
callq 0x44c5
xorl %edx, %edx
cmpl $0x0, 0x2b8(%r14)
setne %dl
movq %r12, %rdi
movl $0x6, %esi
callq 0x40ca
cmpl $0x0, 0x2b4(%r14)
je 0x19eeb
movq %r12, %rdi
movl $0x7, %esi
movl $0x1, %edx
callq 0x40ca
xorl %edx, %edx
cmpl $0x1, 0x2b4(%r14)
setne %dl
movq %r12, %rdi
movl $0x8, %esi
jmp 0x19ef5
movl 0x1c(%r14), %eax
cmpl $0xe, %eax
je 0x19f68
cmpl $0xf, %eax
je 0x19f34
cmpl $0x10, %eax
jne 0x19fa2
leaq 0x10db60(%rbx), %r12
movq %r12, %rdi
movl $0xe, %esi
xorl %edx, %edx
callq 0x40ca
movq %r12, %rdi
movl $0xf, %esi
xorl %edx, %edx
callq 0x40ca
movq %r12, %rdi
movl $0x10, %esi
jmp 0x19f64
leaq 0x10db60(%rbx), %r12
movq %r12, %rdi
movl $0xe, %esi
movl $0x1, %edx
callq 0x40ca
movq %r12, %rdi
movl $0x11, %esi
movl $0x1, %edx
callq 0x40ca
movq %r12, %rdi
movl $0x1, %esi
callq 0x44c5
jmp 0x19fa2
leaq 0x10db60(%rbx), %r12
movq %r12, %rdi
movl $0xe, %esi
xorl %edx, %edx
callq 0x40ca
movq %r12, %rdi
movl $0xf, %esi
xorl %edx, %edx
callq 0x40ca
movq %r12, %rdi
movl $0x10, %esi
jmp 0x19f98
leaq 0x10db60(%rbx), %r12
movq %r12, %rdi
movl $0xe, %esi
movl $0x1, %edx
callq 0x40ca
movq %r12, %rdi
movl $0x11, %esi
movl $0x1, %edx
callq 0x40ca
xorl %r13d, %r13d
movq %r12, %rdi
xorl %esi, %esi
callq 0x44c5
xorl %edx, %edx
cmpl $0x0, 0x2b8(%r14)
setne %dl
movq %r12, %rdi
movl $0x12, %esi
callq 0x40ca
cmpl $0x0, 0x2b4(%r14)
je 0x19ea5
movq %r12, %rdi
movl $0x13, %esi
movl $0x1, %edx
callq 0x40ca
xorl %r13d, %r13d
cmpl $0x1, 0x2b4(%r14)
setne %r13b
movq %r12, %rdi
movl $0x13, %esi
movl %r13d, %edx
callq 0x40ca
movl 0x2bc(%r14), %eax
addl $-0x2, %eax
xorl %edx, %edx
cmpl $-0x3, %eax
setb %dl
movq %r12, %rdi
movl $0x14, %esi
callq 0x40ca
movl 0x2bc(%r14), %edx
andl $0x1, %edx
movq %r12, %rdi
movl $0x14, %esi
jmp 0x19f9d
movq %r12, %rdi
movl $0x7, %esi
xorl %edx, %edx
callq 0x40ca
movl 0x2bc(%r14), %eax
addl $-0x2, %eax
xorl %edx, %edx
cmpl $-0x3, %eax
setb %dl
movq %r12, %rdi
movl $0x9, %esi
callq 0x40ca
movl 0x2bc(%r14), %edx
andl $0x1, %edx
movq %r12, %rdi
movl $0xa, %esi
jmp 0x19f9d
callq 0x2fda
jmp 0x19fa2
leaq 0x10db60(%rbx), %r12
movq %r12, %rdi
movl $0xe, %esi
xorl %edx, %edx
callq 0x40ca
movq %r12, %rdi
movl $0xf, %esi
movl $0x1, %edx
callq 0x40ca
movq %r12, %rdi
movl $0x11, %esi
xorl %edx, %edx
jmp 0x19f9d
leaq 0x10db60(%rbx), %r12
movq %r12, %rdi
movl $0xe, %esi
xorl %edx, %edx
callq 0x40ca
movq %r12, %rdi
movl $0xf, %esi
movl $0x1, %edx
callq 0x40ca
movq %r12, %rdi
movl $0x11, %esi
movl $0x1, %edx
callq 0x40ca
movl 0x18(%r14), %eax
cmpq $0x6, %rax
ja 0x1a559
leaq 0xf981(%rip), %rcx      # 0x29938
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 0x6753
movl %eax, %r15d
movl (%rbx), %r12d
leaq 0xb1c0(%rip), %rdi      # 0x251b4
leaq 0x11a1d(%rip), %rsi     # 0x2ba18
leaq 0x11f4d(%rip), %rdx     # 0x2bf4f
xorl %eax, %eax
callq 0x4c22
cmpl %r12d, %r15d
jne 0x1a01e
movq -0x38(%rbp), %rdi
movl $0x44, %esi
movl $0x1, %edx
jmp 0x1a078
movq -0x38(%rbp), %rdi
movl $0x44, %esi
xorl %edx, %edx
callq 0x40ca
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 0x40ca
movl %r12d, %edx
shrl %edx
andl $0x1, %edx
movq %r15, %rdi
movl $0x45, %esi
callq 0x40ca
shrl $0x2, %r12d
andl $0x1, %r12d
movq %r15, %rdi
movl $0x45, %esi
movl %r12d, %edx
callq 0x40ca
incq %r13
addq $0x84, %rbx
cmpq $0x10, %r13
jne 0x19fd8
leaq 0xb11c(%rip), %rdi      # 0x251b4
leaq 0x11979(%rip), %rsi     # 0x2ba18
leaq 0x11eca(%rip), %rdx     # 0x2bf70
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x4c22
movq 0x10(%r14), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
testq %rcx, %rcx
je 0x1a4d0
cmpl $0x1, 0x18(%rcx)
movq -0x30(%rbp), %rdx
ja 0x1a4d4
xorl %r15d, %r15d
cmpl $0x0, 0x2c0(%rcx)
setne %r15b
jmp 0x1a4d4
movq -0x30(%rbp), %rax
leaq 0x10db60(%rax), %r15
movl $0x8, %r13d
leaq 0xf857(%rip), %rbx      # 0x29954
movl (%r14,%r13,4), %r12d
leaq 0xb0ac(%rip), %rdi      # 0x251b4
leaq 0x11909(%rip), %rsi     # 0x2ba18
leaq 0x11e7b(%rip), %rdx     # 0x2bf91
xorl %eax, %eax
callq 0x4c22
cmpq $0x3, %r12
ja 0x1a1b3
movslq (%rbx,%r12,4), %rax
addq %rbx, %rax
jmpq *%rax
movq %r15, %rdi
movl $0x15, %esi
xorl %edx, %edx
callq 0x40ca
movq %r15, %rdi
movl $0x16, %esi
movl $0x1, %edx
callq 0x40ca
movq %r15, %rdi
movl $0x17, %esi
jmp 0x1a1ac
movq %r15, %rdi
movl $0x15, %esi
xorl %edx, %edx
callq 0x40ca
movq %r15, %rdi
movl $0x16, %esi
movl $0x1, %edx
callq 0x40ca
movq %r15, %rdi
movl $0x17, %esi
jmp 0x1a18e
movq %r15, %rdi
movl $0x15, %esi
movl $0x1, %edx
jmp 0x1a1ae
movq %r15, %rdi
movl $0x15, %esi
xorl %edx, %edx
callq 0x40ca
movq %r15, %rdi
movl $0x16, %esi
xorl %edx, %edx
callq 0x40ca
incq %r13
cmpq $0xc, %r13
jne 0x1a0fd
movq -0x30(%rbp), %rbx
cmpl $0x2, 0x10db38(%rbx)
jl 0x1a1e7
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x1aaa7
incl %r15d
cmpl $0x4, %r15d
jne 0x1a1d0
xorl %r15d, %r15d
leaq 0xf8bf(%rip), %rbx      # 0x29ab0
movq -0x30(%rbp), %r13
xorl %r12d, %r12d
movq %r13, %rdi
movq %r14, %rsi
movl %r15d, %edx
movl %r12d, %ecx
callq 0x1ac2e
incl %r12d
movslq 0x20(%r14,%r15,4), %rax
cmpl (%rbx,%rax,4), %r12d
jl 0x1a1f8
incq %r15
cmpq $0x4, %r15
jne 0x1a1f5
jmp 0x1a5db
leaq 0xaf88(%rip), %rdi      # 0x251b4
leaq 0xeea9(%rip), %rsi      # 0x290dc
leaq 0xaf81(%rip), %rdx      # 0x251bb
xorl %eax, %eax
callq 0x4c22
movl 0x18(%r15), %eax
cmpl $0x8, %eax
je 0x1a286
testl %eax, %eax
jle 0x1a286
incl %eax
movq 0x8(%r15), %rdx
cmpq 0x10(%r15), %rdx
jae 0x1a286
movb 0x18(%r15), %cl
decb %cl
movl $0x1, %esi
shll %cl, %esi
notb %sil
andb %sil, (%rdx)
decl 0x18(%r15)
jne 0x1a27f
incq 0x8(%r15)
movl $0x8, 0x18(%r15)
decl %eax
cmpl $0x1, %eax
jg 0x1a250
leaq 0x11ae1(%rip), %r13     # 0x2bd6e
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 0xf1dc(%rip), %rdi      # 0x29498
movl $0x8, %esi
movl %r12d, %edx
movq %r13, %rcx
xorl %eax, %eax
callq 0x4c22
movl $0x9, %eax
movq 0x8(%r15), %rdx
cmpq 0x10(%r15), %rdx
jae 0x1a32a
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 0x1a323
incq 0x8(%r15)
movl $0x8, 0x18(%r15)
decl %eax
cmpl $0x1, %eax
ja 0x1a2d3
incl %ebx
cmpl $0x100, %ebx            # imm = 0x100
jne 0x1a28f
leaq 0x11a44(%rip), %r13     # 0x2bd83
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 0xf12b(%rip), %rdi      # 0x29498
movl $0x8, %esi
movl %r12d, %edx
movq %r13, %rcx
xorl %eax, %eax
callq 0x4c22
movl $0x9, %eax
movq 0x8(%r15), %rdx
cmpq 0x10(%r15), %rdx
jae 0x1a3db
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 0x1a3d4
incq 0x8(%r15)
movl $0x8, 0x18(%r15)
decl %eax
cmpl $0x1, %eax
ja 0x1a384
incl %ebx
cmpl $0x40, %ebx
jne 0x1a341
leaq 0x119ab(%rip), %r13     # 0x2bd98
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 0xf07d(%rip), %rdi      # 0x29498
movl $0x8, %esi
movl %r12d, %edx
movq %r13, %rcx
xorl %eax, %eax
callq 0x4c22
movl $0x9, %eax
movq 0x8(%r15), %rdx
cmpq 0x10(%r15), %rdx
jae 0x1a489
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 0x1a482
incq 0x8(%r15)
movl $0x8, 0x18(%r15)
decl %eax
cmpl $0x1, %eax
ja 0x1a432
incl %ebx
cmpl $0x40, %ebx
jne 0x1a3ef
movl $0x328, %eax            # imm = 0x328
movl $0x10, (%r14,%rax)
addq $0x84, %rax
cmpq $0xf88, %rax            # imm = 0xF88
jne 0x1a499
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 0x40a5
movq -0x30(%rbp), %rdx
testq %rax, %rax
je 0x1a4ea
cmpl $0x1, 0x18(%rax)
ja 0x1a4ea
cmpl $0x1, 0x2c0(%rax)
sbbl $-0x1, %r15d
leaq 0x10db60(%rdx), %r12
addl $0x40, %r15d
cmpl $0x0, 0x2c0(%r14)
je 0x1a547
movq %r12, %rdi
movl %r15d, %esi
movl $0x1, %edx
callq 0x40ca
xorl %edx, %edx
cmpl $0x1, 0x2c0(%r14)
setne %dl
movq %r12, %rdi
movl $0x43, %esi
callq 0x40ca
cmpl $0x2, 0x2c0(%r14)
jl 0x1a5db
setne %al
movzbl %al, %edx
movq %r12, %rdi
movl $0x43, %esi
jmp 0x1a54f
movq %r12, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x40ca
jmp 0x1a5db
cmpl $0x10, %eax
je 0x1aa9d
movslq 0x1c(%r14), %rax
leaq 0xf543(%rip), %rcx      # 0x29ab0
movl (%rcx,%rax,4), %ebx
movq -0x30(%rbp), %r13
cmpl $0x2, 0x10db38(%r13)
jl 0x1a5ab
cmpl $0x2, %ebx
movl $0x1, %r12d
cmovgel %ebx, %r12d
xorl %r15d, %r15d
cmpl $0x3, 0x18(%r14)
jne 0x1a5a3
movq %r13, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x1aaa7
incl %r15d
cmpl %r15d, %r12d
jne 0x1a58e
cmpl $0x2, %ebx
movl $0x1, %r12d
cmovgel %ebx, %r12d
xorl %r15d, %r15d
cmpl $0x3, 0x18(%r14)
jne 0x1a5d3
movq -0x30(%rbp), %rdi
movq %r14, %rsi
movl %r15d, %edx
xorl %ecx, %ecx
callq 0x1ac2e
incl %r15d
cmpl %r15d, %r12d
jne 0x1a5bb
cmpl $0x1, 0x18(%r14)
je 0x1a805
leaq 0xabc7(%rip), %rdi      # 0x251b4
leaq 0x11424(%rip), %rsi     # 0x2ba18
leaq 0x119e7(%rip), %rdx     # 0x2bfe2
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x4c22
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 0xd6c7(%rip), %rax      # 0x27cf0
movzbl (%r15,%rax), %eax
leaq 0xd6ab(%rip), %rcx      # 0x27ce0
movzbl (%r15,%rcx), %ecx
movl $0x0, %esi
testq %rdi, %rdi
je 0x1a68c
movl 0x18(%rdi), %r8d
cmpl $0x2, %r8d
je 0x1a68c
cmpl $0x5, %r8d
je 0x1a687
cmpl $0x11, %r8d
je 0x1a687
leal -0x1(%rax), %esi
andb $0x3, %sil
movzbl %sil, %esi
leaq 0xac94(%rip), %r8       # 0x25300
leaq (%r8,%rsi,4), %rsi
movzbl (%rcx,%rsi), %esi
shrl $0x2, %esi
movl 0x2b8(%rdi), %edi
btl %esi, %edi
movl $0x0, %esi
jb 0x1a68c
movl $0x1, %esi
movq (%rdx,%r13,4), %rdx
testq %rdx, %rdx
je 0x1a6cf
movl 0x18(%rdx), %edi
cmpl $0x2, %edi
je 0x1a6cf
cmpl $0x5, %edi
je 0x1a6cc
cmpl $0x11, %edi
je 0x1a6cc
decb %cl
andb $0x3, %cl
movzbl %cl, %ecx
leaq 0xac4a(%rip), %rdi      # 0x25300
leaq (%rdi,%rax,4), %rax
movzbl (%rcx,%rax), %eax
shrl $0x2, %eax
movl 0x2b8(%rdx), %ecx
btl %eax, %ecx
jb 0x1a6cf
orl $0x2, %esi
addl $0x49, %esi
movl 0x2b8(%r14), %eax
xorl %edx, %edx
btl %r12d, %eax
setb %dl
movq %rbx, %rdi
callq 0x40ca
leaq 0x4(%r15), %rax
incl %r12d
addq $0x20, %r13
cmpq $0xc, %r15
movq %rax, %r15
jb 0x1a619
leaq 0xaaab(%rip), %rdi      # 0x251b4
leaq 0x11308(%rip), %rsi     # 0x2ba18
leaq 0x118e2(%rip), %rdx     # 0x2bff9
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x4c22
movq 0x10(%r14), %rax
movq (%rax), %r15
movq 0x8(%rax), %r13
testq %r15, %r15
je 0x1a754
movl 0x18(%r15), %eax
cmpl $0x2, %eax
je 0x1a74e
cmpl $0x5, %eax
je 0x1a754
cmpl $0x11, %eax
je 0x1a754
cmpl $0x0, 0x2b4(%r15)
je 0x1a754
movl $0x1, %r12d
testq %r13, %r13
je 0x1a77a
movl 0x18(%r13), %eax
cmpl $0x2, %eax
je 0x1a776
cmpl $0x5, %eax
je 0x1a77a
cmpl $0x11, %eax
je 0x1a77a
cmpl $0x0, 0x2b4(%r13)
je 0x1a77a
orl $0x2, %r12d
addl $0x4d, %r12d
xorl %edx, %edx
cmpl $0x0, 0x2b4(%r14)
setg %dl
movq %rbx, %rdi
movl %r12d, %esi
callq 0x40ca
movl 0x2b4(%r14), %eax
testl %eax, %eax
jle 0x1a805
movl $0x4, %esi
testq %r15, %r15
je 0x1a7cd
movl 0x18(%r15), %ecx
cmpl $0x2, %ecx
je 0x1a7c8
cmpl $0x5, %ecx
je 0x1a7cd
cmpl $0x11, %ecx
je 0x1a7cd
cmpl $0x2, 0x2b4(%r15)
jne 0x1a7cd
movl $0x5, %esi
testq %r13, %r13
je 0x1a7f2
movl 0x18(%r13), %ecx
cmpl $0x2, %ecx
je 0x1a7ef
cmpl $0x5, %ecx
je 0x1a7f2
cmpl $0x11, %ecx
je 0x1a7f2
cmpl $0x2, 0x2b4(%r13)
jne 0x1a7f2
orl $0x2, %esi
addl $0x4d, %esi
xorl %edx, %edx
cmpl $0x1, %eax
setne %dl
movq %rbx, %rdi
callq 0x40ca
cmpl $0x0, 0x2b8(%r14)
movq -0x30(%rbp), %r13
jg 0x1a828
cmpl $0x0, 0x2b4(%r14)
jg 0x1a828
cmpl $0x1, 0x18(%r14)
jne 0x1aa79
leaq 0xa985(%rip), %rdi      # 0x251b4
leaq 0x111e2(%rip), %rsi     # 0x2ba18
leaq 0x117d5(%rip), %rdx     # 0x2c012
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4c22
movq 0x10dae0(%r13), %rcx
movl 0x10db44(%r13), %eax
addl 0x1034(%rcx), %eax
cmpl $0x0, (%r14)
jg 0x1a86b
cmpl $0x0, 0x4(%r14)
jle 0x1aa88
leaq -0xf88(%r14), %rcx
cmpl $0x0, -0xf88(%r14)
jg 0x1a88a
cmpl $0x0, -0xf84(%r14)
jle 0x1aa8f
movl -0xcd8(%r14), %ebx
subl -0x1c60(%r14), %ebx
xorl %r15d, %r15d
testq %rcx, %rcx
je 0x1a8d3
movl 0x18(%rcx), %edx
cmpl $0x5, %edx
je 0x1a8d3
cmpl $0x11, %edx
je 0x1a8d3
cmpl $0x2, %edx
je 0x1a8d3
testl %ebx, %ebx
je 0x1a8d3
cmpl $0x1, %edx
je 0x1a8cd
cmpl $0x0, 0x2b8(%rcx)
jne 0x1a8cd
cmpl $0x0, 0x2b4(%rcx)
je 0x1a8d3
movl $0x1, %r15d
movl 0x2b0(%r14), %edx
testq %rcx, %rcx
je 0x1a8e5
movl 0x2b0(%rcx), %eax
subl %eax, %edx
leal (%rdx,%rdx), %eax
negl %eax
testl %edx, %edx
leal -0x1(%rdx,%rdx), %ebx
cmovlel %eax, %ebx
testl %ebx, %ebx
jle 0x1a928
leaq 0x10db60(%r13), %r12
incl %ebx
leal 0x3c(%r15), %esi
movq %r12, %rdi
movl $0x1, %edx
callq 0x40ca
cmpl $0x2, %r15d
movl $0x3, %r15d
sbbl $0x0, %r15d
decl %ebx
cmpl $0x1, %ebx
jg 0x1a902
leaq 0x10db60(%r13), %rdi
addl $0x3c, %r15d
movl %r15d, %esi
xorl %edx, %edx
callq 0x40ca
cmpl $0x1, 0x18(%r14)
jne 0x1a9a6
leaq 0x2c4(%r14), %r8
movq %r13, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x10, %r9d
callq 0x1ae25
cmpl $0x0, 0x2b8(%r14)
je 0x1a9ee
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 0x1ae25
incq %r12
addq $0x84, %r15
cmpq $0x10, %r12
jne 0x1a978
jmp 0x1a9ee
leaq 0x368(%r14), %r15
xorl %r12d, %r12d
movl 0x2b8(%r14), %eax
movl %r12d, %ecx
shrl $0x2, %ecx
btl %ecx, %eax
jae 0x1a9de
movq %r13, %rdi
movq %r14, %rsi
movl $0x2, %edx
movl %r12d, %ecx
movq %r15, %r8
movl $0x10, %r9d
callq 0x1ae25
incq %r12
addq $0x84, %r15
cmpq $0x10, %r12
jne 0x1a9b0
testb $0x3, 0x2b4(%r14)
je 0x1aa39
leaq 0x304(%r14), %r8
movq %r13, %rdi
movq %r14, %rsi
movl $0x3, %edx
xorl %ecx, %ecx
movl $0x4, %r9d
callq 0x1ae25
leaq 0x314(%r14), %r8
movq %r13, %rdi
movq %r14, %rsi
movl $0x3, %edx
movl $0x1, %ecx
movl $0x4, %r9d
callq 0x1ae25
testb $0x2, 0x2b4(%r14)
je 0x1aa79
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 0x1ae25
incq %r12
addq $0x84, %r15
cmpq $0x8, %r12
jne 0x1aa4d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ecx, %ecx
jmp 0x1a898
movl -0xcd8(%r14), %ebx
subl %eax, %ebx
jmp 0x1a898
callq 0x3009
jmp 0x1a5db