// File: /workspace/github_c_makefile_star2_O3/akumrao[P]videoAnalyzer/encoder/macroblock.c
// Function: x264_macroblock_encode(x264_t*, x264_macroblock_t*)
void x264_macroblock_encode(x264_t *h, x264_macroblock_t *mb) {LOG_CALL;
    x264_mb_context_t *ctx = mb->context;
    int i;

    int i_qscale;

    /* quantification scale */
    i_qscale = mb->i_qp;

    if (mb->i_type == I_16x16)
    {
        /* do the right prediction */
        h->predict_16x16[mb->i_intra16x16_pred_mode](ctx->p_fdec[0], ctx->i_fdec[0]);

        /* encode the 16x16 macroblock */
        x264_mb_encode_i16x16(h, mb, i_qscale);

        /* fix the pred mode value */
        mb->i_intra16x16_pred_mode = x264_mb_pred_mode16x16_fix[mb->i_intra16x16_pred_mode];
    } else if (mb->i_type == I_4x4)
    {
        for (i = 0; i < 16; i++)
        {
            uint8_t *p_dst_by;

            /* Do the right prediction */
            p_dst_by = ctx->p_fdec[0] + 4 * block_idx_x[i] + 4 * block_idx_y[i] * ctx->i_fdec[0];
            h->predict_4x4[mb->block[i].i_intra4x4_pred_mode](p_dst_by, ctx->i_fdec[0]);

            /* encode one 4x4 block */
            x264_mb_encode_i4x4(h, mb, i, i_qscale);

            /* fix the pred mode value */
            mb->block[i].i_intra4x4_pred_mode = x264_mb_pred_mode4x4_fix[mb->block[i].i_intra4x4_pred_mode];
        }
    } else /* Inter MB */
    {
        int16_t dct4x4[16][4][4];

        int i8x8, i4x4, idx;
        int i_decimate_mb = 0;

        /* Motion compensation */
        x264_mb_mc(h, mb);

        for (i8x8 = 0; i8x8 < 4; i8x8++)
        {
            int16_t luma[4][4];
            int i_decimate_8x8;

            /* encode one 4x4 block */
            i_decimate_8x8 = 0;
            for (i4x4 = 0; i4x4 < 4; i4x4++)
            {
                uint8_t *p_src, *p_dst;

                idx = i8x8 * 4 + i4x4;

                p_src = ctx->p_img[0] + 4 * block_idx_x[idx] + 4 * block_idx_y[idx] * ctx->i_img[0];
                p_dst = ctx->p_fdec[0] + 4 * block_idx_x[idx] + 4 * block_idx_y[idx] * ctx->i_fdec[0];

                /* we calculate diff */
                h->pixf.sub4x4(luma, p_src, ctx->i_img[0], p_dst, ctx->i_fdec[0]);

                /* calculate dct coeffs */
                h->dctf.dct4x4(dct4x4[idx], luma);
                quant_4x4(dct4x4[idx], i_qscale, 0);

                scan_zigzag_4x4full(mb->block[idx].luma4x4, dct4x4[idx]);
                i_decimate_8x8 += x264_mb_decimate_score(mb->block[idx].luma4x4, 16);
            }

            /* decimate this 8x8 block */
            i_decimate_mb += i_decimate_8x8;
            if (i_decimate_8x8 < 4)
            {
                for (i4x4 = 0; i4x4 < 4; i4x4++)
                {
                    int x, y;
                    idx = i8x8 * 4 + i4x4;
                    for (i = 0; i < 16; i++)
                    {
                        mb->block[idx].luma4x4[i] = 0;
                    }
                    for (x = 0; x < 4; x++)
                    {
                        for (y = 0; y < 4; y++)
                        {
                            dct4x4[idx][x][y] = 0;
                        }
                    }
                }
            }
        }

        if (i_decimate_mb < 6)
        {
            for (i8x8 = 0; i8x8 < 4; i8x8++)
            {
                for (i4x4 = 0; i4x4 < 4; i4x4++)
                {
                    for (i = 0; i < 16; i++)
                    {
                        mb->block[i8x8 * 4 + i4x4].luma4x4[i] = 0;
                    }
                }
            }
        } else
        {
            for (i8x8 = 0; i8x8 < 4; i8x8++)
            {
                int16_t luma[4][4];
                /* TODO we could avoid it if we had decimate this 8x8 block */
                /* output samples to fdec */
                for (i4x4 = 0; i4x4 < 4; i4x4++)
                {
                    uint8_t *p_dst;

                    idx = i8x8 * 4 + i4x4;

                    x264_mb_dequant_4x4(dct4x4[idx], i_qscale);
                    h->dctf.idct4x4(luma, dct4x4[idx]);

                    /* put pixel to fdec */
                    p_dst = ctx->p_fdec[0] + 4 * block_idx_x[idx] + 4 * block_idx_y[idx] * ctx->i_fdec[0];
                    h->pixf.add4x4(p_dst, ctx->i_fdec[0], luma);
                }
            }
        }
    }

    /* encode chroma */
    i_qscale = i_chroma_qp_table[x264_clip3(i_qscale + h->pps->i_chroma_qp_index_offset, 0, 51)];
    if (IS_INTRA(mb->i_type))
    {
        /* do the right prediction */
        h->predict_8x8[mb->i_chroma_pred_mode](ctx->p_fdec[1], ctx->i_fdec[1]);
        h->predict_8x8[mb->i_chroma_pred_mode](ctx->p_fdec[2], ctx->i_fdec[2]);
    }

    /* encode the 8x8 blocks */
    x264_mb_encode_8x8(h, mb, !IS_INTRA(mb->i_type), i_qscale);

    /* fix the pred mode value */
    if (IS_INTRA(mb->i_type))
    {
        mb->i_chroma_pred_mode = x264_mb_pred_mode8x8_fix[mb->i_chroma_pred_mode];
    }

    /* Calculate the Luma/Chroma patern and non_zero_count */
    if (mb->i_type == I_16x16)
    {
        mb->i_cbp_luma = 0x00;
        for (i = 0; i < 16; i++)
        {
            mb->block[i].i_non_zero_count = array_non_zero_count(mb->block[i].residual_ac, 15);
            if (mb->block[i].i_non_zero_count > 0)
            {
                mb->i_cbp_luma = 0x0f;
            }
        }
    } else
    {
        mb->i_cbp_luma = 0x00;
        for (i = 0; i < 16; i++)
        {
            mb->block[i].i_non_zero_count = array_non_zero_count(mb->block[i].luma4x4, 16);
            if (mb->block[i].i_non_zero_count > 0)
            {
                mb->i_cbp_luma |= 1 << (i / 4);
            }
        }
    }

    /* Calculate the chroma patern */
    mb->i_cbp_chroma = 0x00;
    for (i = 0; i < 8; i++)
    {
        mb->block[16 + i].i_non_zero_count = array_non_zero_count(mb->block[16 + i].residual_ac, 15);
        if (mb->block[16 + i].i_non_zero_count > 0)
        {
            mb->i_cbp_chroma = 0x02; /* dc+ac (we can't do only ac) */
        }
    }
    if (mb->i_cbp_chroma == 0x00 &&
            (array_non_zero_count(mb->chroma_dc[0], 4) > 0 || array_non_zero_count(mb->chroma_dc[1], 4)) > 0)
    {
        mb->i_cbp_chroma = 0x01; /* dc only */
    }

    /* Check for P_SKIP
     * XXX: in the me perhaps we should take x264_mb_predict_mv_pskip into account
     *      (if multiple mv give same result)*/
    if (mb->i_type == P_L0 && mb->i_partition == D_16x16 &&
            mb->i_cbp_luma == 0x00 && mb->i_cbp_chroma == 0x00)
    {

        int i_ref;
        int mvx, mvy;
        x264_mb_partition_get(mb, 0, 0, 0, &i_ref, &mvx, &mvy);

        if (i_ref == 0)
        {
            int mvp[2];

            x264_mb_predict_mv_pskip(mb, mvp);
            if (mvp[0] == mvx && mvp[1] == mvy)
            {
                mb->i_type = P_SKIP;
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4d8, %rsp            # imm = 0x4D8
movq %rsi, %r14
movq %rdi, %r12
leaq 0x100e6(%rip), %rdi     # 0x271b4
leaq 0x1668f(%rip), %rsi     # 0x2d764
leaq 0x166c7(%rip), %rdx     # 0x2d7a3
xorl %eax, %eax
callq 0x4a56
movq 0x10(%r14), %r13
movl 0x2b0(%r14), %eax
movl %eax, -0x2c(%rbp)
movl 0x18(%r14), %eax
cmpl $0x1, %eax
movq %r14, -0x38(%rbp)
movq %r12, -0x58(%rbp)
movq %r13, -0x70(%rbp)
je 0x1718f
testl %eax, %eax
jne 0x174a0
leaq 0x324(%r14), %rbx
xorl %r15d, %r15d
movl -0x2c(%rbp), %r14d
leaq 0x12f19(%rip), %rax     # 0x2a040
movzbl (%r15,%rax), %eax
shlq $0x2, %rax
addq 0x40(%r13), %rax
leaq 0x12ef5(%rip), %rcx     # 0x2a030
movzbl (%r15,%rcx), %edi
shll $0x2, %edi
movslq 0x58(%r13), %rsi
imulq %rsi, %rdi
addq %rax, %rdi
movslq (%rbx), %rax
callq *0x10f248(%r12,%rax,8)
movq %r12, %rdi
movq -0x38(%rbp), %rsi
movl %r15d, %edx
movl %r14d, %ecx
callq 0x16e6c
movslq (%rbx), %rax
leaq 0x1461b(%rip), %rcx     # 0x2b790
movl (%rcx,%rax,4), %eax
movl %eax, (%rbx)
incq %r15
addq $0x84, %rbx
cmpq $0x10, %r15
jne 0x17120
jmp 0x17869
movslq 0x2bc(%r14), %rax
movq 0x40(%r13), %rdi
movl 0x58(%r13), %esi
callq *0x10f1d8(%r12,%rax,8)
leaq 0x10007(%rip), %rdi     # 0x271b4
leaq 0x165b0(%rip), %rsi     # 0x2d764
leaq 0x1694b(%rip), %rdx     # 0x2db06
xorl %eax, %eax
callq 0x4a56
movq 0x10(%r14), %rax
movq 0x18(%rax), %rsi
movl 0x30(%rax), %edx
movq 0x40(%rax), %rcx
movl 0x58(%rax), %r8d
leaq -0x2d0(%rbp), %rdi
movq %rcx, -0x60(%rbp)
movl %r8d, -0x40(%rbp)
callq *0x10f360(%r12)
leaq 0x32c(%r14), %rbx
leaq 0x149d6(%rip), %r14     # 0x2bbd0
leaq 0x14a0f(%rip), %r12     # 0x2bc10
xorl %r13d, %r13d
leaq 0x1(%r13), %rax
movq %rax, -0x48(%rbp)
shlq $0x5, %rax
leaq (%rax,%rbp), %r15
addq $-0x4f0, %r15           # imm = 0xFB10
movq %r13, %rax
shlq $0x5, %rax
leaq (%rax,%rbp), %rsi
addq $-0x2d0, %rsi           # imm = 0xFD30
movq %r15, %rdi
movq -0x58(%rbp), %rax
callq *0x10f398(%rax)
movzwl (%r15), %eax
leaq 0x12deb(%rip), %rcx     # 0x2a030
movzbl (%r13,%rcx), %ecx
leaq 0x12dee(%rip), %rdx     # 0x2a040
movzbl (%r13,%rdx), %edx
leaq -0x4f0(%rbp,%rcx,8), %rcx
movw %ax, (%rcx,%rdx,2)
movq %r15, %rdi
movl -0x2c(%rbp), %esi
movl $0x1, %edx
callq 0x16fde
leaq 0xff39(%rip), %rdi      # 0x271b4
leaq 0x164e2(%rip), %rsi     # 0x2d764
leaq 0x13051(%rip), %rdx     # 0x2a2da
xorl %eax, %eax
callq 0x4a56
xorl %eax, %eax
movslq 0x4(%r14,%rax,4), %rcx
movslq 0x4(%r12,%rax,4), %rdx
leaq (%r15,%rcx,8), %rcx
movswl (%rcx,%rdx,2), %ecx
movl %ecx, (%rbx,%rax,4)
incq %rax
cmpq $0xf, %rax
jne 0x17292
addq $0x84, %rbx
movq -0x48(%rbp), %r13
cmpq $0x10, %r13
jne 0x17204
leaq -0x4f0(%rbp), %r15
movq %r15, %rdi
movq %r15, %rsi
movq -0x58(%rbp), %r13
callq *0x10f3a0(%r13)
leaq 0xfed0(%rip), %rdi      # 0x271b4
leaq 0x16479(%rip), %rsi     # 0x2d764
leaq 0x105c2(%rip), %rdx     # 0x278b4
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4a56
movl -0x2c(%rbp), %r8d
movslq %r8d, %rax
imulq $0x2aaaaaab, %rax, %rsi # imm = 0x2AAAAAAB
movq %rsi, %rdi
shrq $0x3f, %rdi
shrq $0x20, %rsi
leal (%rsi,%rdi), %edx
leal 0xf(%rdx), %ecx
movl $0x2, %eax
shll %cl, %eax
cltq
imulq $0x55555556, %rax, %rax # imm = 0x55555556
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x20, %rax
addl %ecx, %eax
addl %edx, %edx
leal (%rdx,%rdx,2), %ecx
movl %r8d, %edx
subl %ecx, %edx
movslq %edx, %rcx
shlq $0x6, %rcx
leaq 0x14701(%rip), %rdx     # 0x2ba50
movl (%rcx,%rdx), %edx
leal (%rsi,%rdi), %ecx
addl $0x10, %ecx
xorl %esi, %esi
movswl (%r15,%rsi,2), %r8d
movl %edx, %edi
imull %r8d, %edi
testl %r8d, %r8d
jle 0x17370
addl %eax, %edi
sarl %cl, %edi
jmp 0x1737f
movl %eax, %r8d
subl %edi, %r8d
sarl %cl, %r8d
negl %r8d
movl %r8d, %edi
movw %di, (%r15,%rsi,2)
incq %rsi
cmpq $0x4, %rsi
jne 0x1735a
incq %rbx
addq $0x8, %r15
cmpq $0x4, %rbx
jne 0x17358
leaq 0xfe13(%rip), %rdi      # 0x271b4
leaq 0x163bc(%rip), %rsi     # 0x2d764
leaq 0x12f15(%rip), %rdx     # 0x2a2c4
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4a56
movq -0x38(%rbp), %rdx
movslq (%rbx,%r14), %rax
movslq (%rbx,%r12), %rcx
leaq -0x4f0(,%rax,8), %rax
addq %rbp, %rax
movswl (%rax,%rcx,2), %eax
movl %eax, 0x2c4(%rdx,%rbx)
addq $0x4, %rbx
cmpq $0x40, %rbx
jne 0x173bc
leaq -0x4f0(%rbp), %r15
movq %r15, %rdi
movq %r15, %rsi
callq *0x10f3b0(%r13)
movq %r15, %rdi
movl -0x2c(%rbp), %esi
callq 0x677b
leaq -0x4d0(%rbp), %r15
xorl %ebx, %ebx
movq %r13, %r12
leaq -0x2d0(%rbp), %r13
leaq 0x1(%rbx), %r14
movq %r15, %rdi
movl -0x2c(%rbp), %esi
callq 0x6874
leaq 0x12c04(%rip), %rax     # 0x2a030
movzbl (%rbx,%rax), %eax
leaq 0x12c09(%rip), %rcx     # 0x2a040
movzbl (%rbx,%rcx), %ecx
leaq -0x4f0(%rbp,%rax,8), %rax
movzwl (%rax,%rcx,2), %eax
movw %ax, (%r15)
movq %r13, %rdi
movq %r15, %rsi
callq *0x10f3a8(%r12)
addq $0x20, %r13
addq $0x20, %r15
movq %r14, %rbx
cmpq $0x10, %r14
jne 0x17416
leaq -0x2d0(%rbp), %rdx
movq -0x60(%rbp), %rdi
movl -0x40(%rbp), %esi
callq *0x10f378(%r12)
movq -0x38(%rbp), %rdx
movslq 0x2bc(%rdx), %rax
leaq 0x142de(%rip), %rcx     # 0x2b770
movl (%rcx,%rax,4), %eax
movl %eax, 0x2bc(%rdx)
jmp 0x17865
movq %r12, %rdi
movq %r14, %rsi
callq 0x71f5
leaq 0x324(%r14), %rax
movq %rax, -0x68(%rbp)
leaq 0x368(%r14), %rbx
leaq 0x12b7c(%rip), %rcx     # 0x2a040
leaq 0x12b65(%rip), %rdx     # 0x2a030
leaq 0x146fe(%rip), %r14     # 0x2bbd0
leaq 0x14737(%rip), %r15     # 0x2bc10
movq %rbx, -0x78(%rbp)
xorl %esi, %esi
xorl %eax, %eax
movl %eax, -0xa0(%rbp)
movq %rsi, %rax
shlq $0x7, %rax
addq %rbp, %rax
addq $-0x4f0, %rax           # imm = 0xFB10
movq %rax, -0x88(%rbp)
imulq $0x210, %rsi, %rax      # imm = 0x210
movq %rax, -0x90(%rbp)
movq %rsi, -0x98(%rbp)
leaq (,%rsi,4), %rax
movq %rax, -0xa8(%rbp)
movq %rbx, -0x80(%rbp)
xorl %esi, %esi
xorl %edi, %edi
movl %edi, -0x48(%rbp)
movq -0xa8(%rbp), %rax
movq %rsi, -0x60(%rbp)
addq %rax, %rsi
movzbl (%rcx,%rsi), %eax
shll $0x2, %eax
movq 0x18(%r13), %rcx
addq %rax, %rcx
movzbl (%rdx,%rsi), %edi
movq %rsi, %r12
movq %rsi, -0x40(%rbp)
shll $0x2, %edi
movslq 0x30(%r13), %rdx
movq %rdx, %rsi
imulq %rdi, %rsi
addq %rcx, %rsi
addq 0x40(%r13), %rax
movl 0x58(%r13), %r8d
imull %r8d, %edi
movslq %edi, %rcx
addq %rax, %rcx
leaq -0x2d0(%rbp), %rdi
movq -0x58(%rbp), %r13
callq *0x10f350(%r13)
movq %r12, %rax
shlq $0x5, %rax
leaq (%rax,%rbp), %r12
addq $-0x4f0, %r12           # imm = 0xFB10
movq %r12, %rdi
leaq -0x2d0(%rbp), %rsi
callq *0x10f398(%r13)
movq %r12, %rdi
movl -0x2c(%rbp), %esi
xorl %edx, %edx
callq 0x16fde
movq -0x40(%rbp), %rcx
movq %rcx, %rax
shlq $0x7, %rax
leaq (%rax,%rcx,4), %rax
movq -0x68(%rbp), %rcx
leaq (%rcx,%rax), %r13
addq $0x44, %r13
leaq 0xfbd9(%rip), %rdi      # 0x271b4
leaq 0x16182(%rip), %rsi     # 0x2d764
leaq 0x12cdb(%rip), %rdx     # 0x2a2c4
xorl %eax, %eax
callq 0x4a56
xorl %eax, %eax
movslq (%rax,%r14), %rcx
movslq (%rax,%r15), %rdx
leaq (%r12,%rcx,8), %rcx
movswl (%rcx,%rdx,2), %ecx
movl %ecx, (%rbx,%rax)
addq $0x4, %rax
cmpq $0x40, %rax
jne 0x175f2
movq %r13, %rdi
movl $0x10, %esi
callq 0x18069
movl -0x48(%rbp), %edi
addl %eax, %edi
movq -0x60(%rbp), %rsi
incq %rsi
addq $0x84, %rbx
cmpq $0x4, %rsi
movq -0x70(%rbp), %r13
leaq 0x12a02(%rip), %rcx     # 0x2a040
leaq 0x129eb(%rip), %rdx     # 0x2a030
jne 0x1752a
cmpl $0x3, %edi
jg 0x176fb
xorps %xmm0, %xmm0
movq -0x88(%rbp), %rax
movaps %xmm0, 0x70(%rax)
movaps %xmm0, 0x60(%rax)
movaps %xmm0, 0x50(%rax)
movaps %xmm0, 0x40(%rax)
movaps %xmm0, 0x30(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
movq -0x78(%rbp), %rax
movq -0x90(%rbp), %rsi
movups %xmm0, 0x30(%rax,%rsi)
movups %xmm0, 0x20(%rax,%rsi)
movups %xmm0, 0x10(%rax,%rsi)
movups %xmm0, (%rax,%rsi)
movups %xmm0, 0x84(%rax,%rsi)
movups %xmm0, 0x94(%rax,%rsi)
movups %xmm0, 0xa4(%rax,%rsi)
movups %xmm0, 0xb4(%rax,%rsi)
movups %xmm0, 0x108(%rax,%rsi)
movups %xmm0, 0x118(%rax,%rsi)
movups %xmm0, 0x128(%rax,%rsi)
movups %xmm0, 0x138(%rax,%rsi)
movups %xmm0, 0x18c(%rax,%rsi)
movups %xmm0, 0x19c(%rax,%rsi)
movups %xmm0, 0x1ac(%rax,%rsi)
movups %xmm0, 0x1bc(%rax,%rsi)
movl -0xa0(%rbp), %eax
addl %edi, %eax
movq -0x98(%rbp), %rsi
incq %rsi
movq -0x80(%rbp), %rbx
addq $0x210, %rbx            # imm = 0x210
cmpq $0x4, %rsi
jne 0x174e1
cmpl $0x6, %eax
jge 0x177b4
movl $0x4f4, %eax            # imm = 0x4F4
xorps %xmm0, %xmm0
movq -0x38(%rbp), %rcx
movups %xmm0, -0x15c(%rcx,%rax)
movups %xmm0, -0x16c(%rcx,%rax)
movups %xmm0, -0x17c(%rcx,%rax)
movups %xmm0, -0x18c(%rcx,%rax)
movups %xmm0, -0x108(%rcx,%rax)
movups %xmm0, -0xf8(%rcx,%rax)
movups %xmm0, -0xe8(%rcx,%rax)
movups %xmm0, -0xd8(%rcx,%rax)
movups %xmm0, -0x84(%rcx,%rax)
movups %xmm0, -0x74(%rcx,%rax)
movups %xmm0, -0x64(%rcx,%rax)
movups %xmm0, -0x54(%rcx,%rax)
movups %xmm0, (%rcx,%rax)
movups %xmm0, 0x10(%rcx,%rax)
movups %xmm0, 0x20(%rcx,%rax)
movups %xmm0, 0x30(%rcx,%rax)
addq $0x210, %rax            # imm = 0x210
cmpq $0xd34, %rax            # imm = 0xD34
jne 0x17737
jmp 0x17861
leaq -0x4f0(%rbp), %r15
xorl %eax, %eax
xorl %ecx, %ecx
movq -0x58(%rbp), %r13
movq -0x70(%rbp), %r12
movq %rax, -0x48(%rbp)
movq %rcx, -0x40(%rbp)
movq %r15, -0x60(%rbp)
xorl %ebx, %ebx
leaq -0x2d0(%rbp), %r14
movq %r15, %rdi
movl -0x2c(%rbp), %esi
callq 0x6874
movq %r14, %rdi
movq %r15, %rsi
callq *0x10f3a8(%r13)
movq -0x48(%rbp), %rax
addq %rbx, %rax
leaq 0x1283e(%rip), %rcx     # 0x2a040
movzbl (%rcx,%rax), %ecx
shlq $0x2, %rcx
addq 0x40(%r12), %rcx
leaq 0x1281a(%rip), %rdx     # 0x2a030
movzbl (%rdx,%rax), %edi
shll $0x2, %edi
movslq 0x58(%r12), %rsi
imulq %rsi, %rdi
addq %rcx, %rdi
movq %r14, %rdx
callq *0x10f368(%r13)
incq %rbx
addq $0x20, %r15
cmpq $0x4, %rbx
jne 0x177dc
movq -0x40(%rbp), %rcx
incq %rcx
movq -0x48(%rbp), %rax
addq $0x4, %rax
movq -0x60(%rbp), %r15
subq $-0x80, %r15
cmpq $0x4, %rcx
jne 0x177c7
movq -0x58(%rbp), %r12
movl -0x2c(%rbp), %r14d
movq 0x10dae0(%r12), %rax
addl 0x103c(%rax), %r14d
cmpl $0x33, %r14d
movl $0x33, %eax
cmovbl %r14d, %eax
xorl %ecx, %ecx
testl %r14d, %r14d
cmovsl %ecx, %eax
leaq 0x13f2c(%rip), %rcx     # 0x2b7c0
movl (%rcx,%rax,4), %r15d
movb $0x1, %al
movl %eax, -0x80(%rbp)
movq -0x38(%rbp), %r14
cmpl $0x1, 0x18(%r14)
movb $0x1, %bl
movq %r12, %r13
ja 0x178e5
movslq 0x2c0(%r14), %rax
movq -0x70(%rbp), %rbx
movq 0x48(%rbx), %rdi
movl 0x5c(%rbx), %esi
callq *0x10f210(%r13,%rax,8)
movslq 0x2c0(%r14), %rax
movq 0x50(%rbx), %rdi
movl 0x60(%rbx), %esi
callq *0x10f210(%r13,%rax,8)
cmpl $0x2, 0x18(%r14)
setae %bl
leaq 0xf8c8(%rip), %rdi      # 0x271b4
leaq 0x15e71(%rip), %rsi     # 0x2d764
leaq 0x16239(%rip), %rdx     # 0x2db33
xorl %eax, %eax
callq 0x4a56
movq 0x10(%r14), %rax
movq %rax, -0xc8(%rbp)
movl %ebx, %eax
xorb $0x1, %al
movb %al, -0x2d(%rbp)
movzbl %al, %eax
movl %eax, -0x70(%rbp)
leaq 0x324(%r14), %rax
movq %rax, -0x40(%rbp)
movl %r15d, -0x48(%rbp)
movslq %r15d, %rsi
imulq $0x2aaaaaab, %rsi, %rax # imm = 0x2AAAAAAB
movq %rax, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rax
leal (%rax,%rdx), %edi
leal 0xf(%rdi), %ecx
movl $0x2, %r8d
shll %cl, %r8d
movl %r8d, -0xb0(%rbp)
movzbl %bl, %ecx
leal (%rcx,%rcx,2), %ecx
addl $0x3, %ecx
movl %ecx, -0xac(%rbp)
addl %edi, %edi
leal (%rdi,%rdi,2), %ecx
subl %ecx, %esi
movslq %esi, %rcx
shlq $0x6, %rcx
leaq 0x140d9(%rip), %rsi     # 0x2ba50
addq %rcx, %rsi
movq %rsi, -0xc0(%rbp)
leal (%rax,%rdx), %r12d
addl $0x10, %r12d
leaq 0x304(%r14), %rax
movq %rax, -0x78(%rbp)
leaq 0xb6c(%r14), %rax
movq %rax, -0x68(%rbp)
leaq -0x4f0(%rbp), %rbx
leaq 0x14263(%rip), %r15     # 0x2bc10
xorl %r14d, %r14d
movl $0x0, -0x2c(%rbp)
movq -0xc8(%rbp), %rax
movq 0x20(%rax,%r14,8), %rsi
movq 0x48(%rax,%r14,8), %rcx
movl 0x34(%rax,%r14,4), %edx
movl 0x5c(%rax,%r14,4), %r8d
movq %rbx, %rdi
movq %rcx, -0xa0(%rbp)
movl %r8d, -0x98(%rbp)
callq *0x10f358(%r13)
leaq 0x10(,%r14,4), %rax
movq %rax, -0xa8(%rbp)
movq %r14, -0x90(%rbp)
imulq $0x210, %r14, %rcx      # imm = 0x210
movq -0x68(%rbp), %rax
movq %rcx, -0x88(%rbp)
leaq (%rax,%rcx), %rbx
xorl %r14d, %r14d
movq %r14, %rax
shlq $0x5, %rax
leaq (%rax,%rbp), %r13
addq $-0x2d0, %r13           # imm = 0xFD30
leaq (%rax,%rbp), %rsi
addq $-0x4f0, %rsi           # imm = 0xFB10
movq %r13, %rdi
movq -0x58(%rbp), %rax
callq *0x10f398(%rax)
movzwl (%r13), %eax
leaq 0x125e1(%rip), %rcx     # 0x2a030
movzbl (%r14,%rcx), %ecx
leaq 0x125e5(%rip), %rdx     # 0x2a040
movzbl (%r14,%rdx), %edx
leaq -0x50(%rbp,%rcx,4), %rcx
movw %ax, (%rcx,%rdx,2)
movq %r13, %rdi
movl -0x48(%rbp), %esi
movl -0x70(%rbp), %edx
callq 0x16fde
movq -0xa8(%rbp), %rax
addq %r14, %rax
movq %rax, %rcx
shlq $0x7, %rcx
leaq (%rcx,%rax,4), %rax
movq -0x40(%rbp), %rcx
addq %rcx, %rax
addq $0x8, %rax
movq %rax, -0x60(%rbp)
leaq 0xf712(%rip), %rdi      # 0x271b4
leaq 0x15cbb(%rip), %rsi     # 0x2d764
leaq 0x1282a(%rip), %rdx     # 0x2a2da
xorl %eax, %eax
callq 0x4a56
xorl %eax, %eax
leaq 0x14110(%rip), %rsi     # 0x2bbd0
movslq 0x4(%rsi,%rax,4), %rcx
movslq 0x4(%r15,%rax,4), %rdx
leaq (,%rcx,8), %rcx
addq %r13, %rcx
movswl (%rcx,%rdx,2), %ecx
movl %ecx, (%rbx,%rax,4)
incq %rax
cmpq $0xf, %rax
jne 0x17ac0
movq -0x60(%rbp), %rdi
movl $0xf, %esi
callq 0x18069
addl %eax, -0x2c(%rbp)
incq %r14
addq $0x84, %rbx
cmpq $0x4, %r14
jne 0x17a19
leaq -0x50(%rbp), %rdi
movq %rdi, %rsi
movq -0x58(%rbp), %rbx
callq *0x10f3b8(%rbx)
leaq 0xf692(%rip), %rdi      # 0x271b4
leaq 0x15c3b(%rip), %rsi     # 0x2d764
leaq 0xfd6d(%rip), %rdx      # 0x2789d
xorl %eax, %eax
callq 0x4a56
movl -0xb0(%rbp), %eax
cltd
idivl -0xac(%rbp)
movq -0xc0(%rbp), %rcx
movl (%rcx), %edx
movb $0x1, %sil
xorl %ecx, %ecx
movq -0x90(%rbp), %r14
leaq -0x50(,%rcx,4), %rdi
addq %rbp, %rdi
movb $0x1, %r8b
xorl %r9d, %r9d
movswl (%rdi,%r9,2), %ecx
movl %edx, %r10d
imull %ecx, %r10d
testl %ecx, %ecx
jle 0x17b85
addl %eax, %r10d
movl %r12d, %ecx
sarl %cl, %r10d
jmp 0x17b97
movl %eax, %r11d
subl %r10d, %r11d
movl %r12d, %ecx
sarl %cl, %r11d
negl %r11d
movl %r11d, %r10d
leaq (%rdi,%r9,2), %rcx
movw %r10w, (%rcx)
movl $0x1, %r9d
testb $0x1, %r8b
movl $0x0, %r8d
jne 0x17b6a
movl $0x1, %ecx
testb $0x1, %sil
movl $0x0, %esi
jne 0x17b59
shlq $0x4, %r14
leaq 0xf5e8(%rip), %rdi      # 0x271b4
leaq 0x15b91(%rip), %rsi     # 0x2d764
leaq 0x1278e(%rip), %rdx     # 0x2a368
xorl %eax, %eax
callq 0x4a56
movswl -0x50(%rbp), %eax
movq -0x78(%rbp), %rcx
movl %eax, (%rcx,%r14)
movswl -0x4e(%rbp), %eax
movl %eax, 0x4(%rcx,%r14)
movswl -0x4c(%rbp), %eax
movl %eax, 0x8(%rcx,%r14)
movswl -0x4a(%rbp), %eax
movl %eax, 0xc(%rcx,%r14)
cmpl $0x7, -0x2c(%rbp)
setge %al
orb -0x2d(%rbp), %al
jne 0x17cd1
xorps %xmm0, %xmm0
movaps %xmm0, -0x260(%rbp)
movaps %xmm0, -0x270(%rbp)
movaps %xmm0, -0x280(%rbp)
movaps %xmm0, -0x290(%rbp)
movaps %xmm0, -0x2a0(%rbp)
movaps %xmm0, -0x2b0(%rbp)
movaps %xmm0, -0x2c0(%rbp)
movaps %xmm0, -0x2d0(%rbp)
movq -0x68(%rbp), %rax
movq -0x88(%rbp), %rcx
movups %xmm0, 0x2c(%rax,%rcx)
movups %xmm0, 0x20(%rax,%rcx)
movups %xmm0, 0x10(%rax,%rcx)
movups %xmm0, (%rax,%rcx)
movups %xmm0, 0x84(%rax,%rcx)
movups %xmm0, 0x94(%rax,%rcx)
movups %xmm0, 0xa4(%rax,%rcx)
movups %xmm0, 0xb0(%rax,%rcx)
movups %xmm0, 0x108(%rax,%rcx)
movups %xmm0, 0x118(%rax,%rcx)
movups %xmm0, 0x128(%rax,%rcx)
movups %xmm0, 0x134(%rax,%rcx)
movups %xmm0, 0x18c(%rax,%rcx)
movups %xmm0, 0x19c(%rax,%rcx)
movups %xmm0, 0x1ac(%rax,%rcx)
movups %xmm0, 0x1b8(%rax,%rcx)
leaq -0x50(%rbp), %r14
movq %r14, %rdi
movq %r14, %rsi
callq *0x10f3c0(%rbx)
movq %r14, %rdi
movl -0x48(%rbp), %esi
callq 0x668c
leaq -0x2d0(%rbp), %r13
leaq -0x4f0(%rbp), %rbx
xorl %r14d, %r14d
movq %r13, %rdi
movl -0x48(%rbp), %esi
callq 0x6874
leaq 0x12321(%rip), %rax     # 0x2a030
movzbl (%r14,%rax), %eax
leaq 0x12325(%rip), %rcx     # 0x2a040
movzbl (%r14,%rcx), %ecx
leaq -0x50(%rbp,%rax,4), %rax
movzwl (%rax,%rcx,2), %eax
movw %ax, (%r13)
movq %rbx, %rdi
movq %r13, %rsi
movq -0x58(%rbp), %rax
callq *0x10f3a8(%rax)
incq %r14
addq $0x20, %rbx
addq $0x20, %r13
cmpq $0x4, %r14
jne 0x17cfd
movq -0xa0(%rbp), %rdi
movl -0x98(%rbp), %esi
leaq -0x4f0(%rbp), %rbx
movq %rbx, %rdx
movq -0x58(%rbp), %r13
callq *0x10f370(%r13)
movl $0x1, %r14d
testb $0x1, -0x80(%rbp)
movl $0x0, -0x80(%rbp)
jne 0x179b7
movq -0x38(%rbp), %rdx
movl 0x18(%rdx), %eax
cmpl $0x1, %eax
ja 0x17e39
movslq 0x2c0(%rdx), %rax
leaq 0x13aea(%rip), %rcx     # 0x2b890
movl (%rcx,%rax,4), %eax
movl %eax, 0x2c0(%rdx)
jne 0x17e39
movl $0x0, 0x2b8(%rdx)
leaq 0x32c(%rdx), %r12
leaq 0x15997(%rip), %r14     # 0x2d764
leaq 0x15d72(%rip), %r15     # 0x2db46
xorl %r13d, %r13d
movq %r13, %rax
shlq $0x7, %rax
leaq (%rax,%r13,4), %rbx
addq -0x40(%rbp), %rbx
leaq 0xf3c7(%rip), %rdi      # 0x271b4
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x4a56
xorl %ecx, %ecx
xorl %eax, %eax
cmpl $0x1, (%r12,%rcx,4)
sbbl $-0x1, %eax
incq %rcx
cmpq $0xf, %rcx
jne 0x17dfe
movl %eax, 0x4(%rbx)
testl %eax, %eax
je 0x17e24
movq -0x38(%rbp), %rax
movl $0xf, 0x2b8(%rax)
incq %r13
addq $0x84, %r12
cmpq $0x10, %r13
jne 0x17dd7
jmp 0x17ec1
movl $0x0, 0x2b8(%rdx)
leaq 0x368(%rdx), %r12
leaq 0x15913(%rip), %r14     # 0x2d764
leaq 0x15cee(%rip), %r15     # 0x2db46
xorl %r13d, %r13d
movq %r13, %rax
shlq $0x7, %rax
leaq (%rax,%r13,4), %rbx
addq -0x40(%rbp), %rbx
leaq 0xf343(%rip), %rdi      # 0x271b4
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x4a56
xorl %ecx, %ecx
xorl %eax, %eax
cmpl $0x1, (%r12,%rcx,4)
sbbl $-0x1, %eax
incq %rcx
cmpq $0x10, %rcx
jne 0x17e82
movl %eax, 0x4(%rbx)
testl %eax, %eax
je 0x17eb1
movl %r13d, %ecx
shrl $0x2, %ecx
movl $0x1, %eax
shll %cl, %eax
movq -0x38(%rbp), %rcx
orl %eax, 0x2b8(%rcx)
incq %r13
addq $0x84, %r12
cmpq $0x10, %r13
jne 0x17e5b
movq -0x38(%rbp), %rax
movl $0x0, 0x2b4(%rax)
leaq 0xf2de(%rip), %rbx      # 0x271b4
leaq 0x15887(%rip), %r14     # 0x2d764
leaq 0x15c62(%rip), %r15     # 0x2db46
xorl %r12d, %r12d
movq %r12, %rax
orq $0x10, %rax
shlq $0x7, %rax
leaq (%rax,%r12,4), %r13
addq $0x40, %r13
addq -0x40(%rbp), %r13
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x4a56
xorl %ecx, %ecx
xorl %eax, %eax
movq -0x68(%rbp), %rdx
cmpl $0x1, (%rdx,%rcx,4)
sbbl $-0x1, %eax
incq %rcx
cmpq $0xf, %rcx
jne 0x17f16
movl %eax, 0x4(%r13)
testl %eax, %eax
je 0x17f3c
movq -0x38(%rbp), %rax
movl $0x2, 0x2b4(%rax)
incq %r12
addq $0x84, %rdx
movq %rdx, -0x68(%rbp)
cmpq $0x8, %r12
jne 0x17ee7
movq -0x38(%rbp), %r14
cmpl $0x0, 0x2b4(%r14)
jne 0x17fda
leaq 0xf24f(%rip), %rdi      # 0x271b4
leaq 0x157f8(%rip), %rsi     # 0x2d764
leaq 0x15bd3(%rip), %rdx     # 0x2db46
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4a56
xorl %eax, %eax
movq -0x78(%rbp), %rcx
cmpl $0x1, (%rcx,%rbx,4)
sbbl $-0x1, %eax
incq %rbx
cmpq $0x4, %rbx
jne 0x17f82
testl %eax, %eax
jne 0x17fcf
leaq 0xf217(%rip), %rdi      # 0x271b4
leaq 0x157c0(%rip), %rsi     # 0x2d764
leaq 0x15b9b(%rip), %rdx     # 0x2db46
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4a56
xorl %eax, %eax
cmpl $0x1, 0x314(%r14,%rbx,4)
sbbl $-0x1, %eax
incq %rbx
cmpq $0x4, %rbx
jne 0x17fb6
testl %eax, %eax
je 0x17fda
movl $0x1, 0x2b4(%r14)
cmpl $0x3, 0x18(%r14)
jne 0x18057
cmpl $0x10, 0x1c(%r14)
jne 0x18057
cmpl $0x0, 0x2b8(%r14)
jne 0x18057
cmpl $0x0, 0x2b4(%r14)
jne 0x18057
leaq -0xb4(%rbp), %rax
movq %rax, (%rsp)
leaq -0x2d0(%rbp), %rbx
leaq -0x50(%rbp), %r9
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x6ad0
cmpl $0x0, (%rbx)
jne 0x18057
leaq -0x4f0(%rbp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7120
movl (%rbx), %eax
cmpl -0x50(%rbp), %eax
jne 0x18057
movl -0x4ec(%rbp), %eax
cmpl -0xb4(%rbp), %eax
jne 0x18057
movl $0x5, 0x18(%r14)
addq $0x4d8, %rsp            # imm = 0x4D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq