// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]oatk/syncasm.c
// Function: make_ma_block
static void make_ma_block(scg_t *g, sr_t *sr, scg_ra_t *ra, uint32_t n, ma_t *ma)
{
    uint32_t i, j, n_scm, n_frg;
    uint64_t uid, *scm, *u_scm, *lcs_b, s_beg, u_n, s_n;
    double score, intpart;
    int max_d, n_b;
    ra_frg_t *frg;

    // collect syncmers on read
    n_scm = sr->n;
    scm = sr->k_mer;

    score = modf(ra[0].s, &intpart);
    if (score < FLT_EPSILON) score = 1.0;
    max_d = n_scm - lround(ra[0].s - score);
    
    // find LCS blocks for each alignment record
    lcs_block_t lcs_blocks[n];
    for (i = 0; i < n; ++i) {
        n_frg = ra[i].n;
        kv_init(lcs_blocks[i]);

        for (j = 0; j < n_frg; ++j) {
            frg = &ra[i].a[j];
            uid = frg->uid >> 1;
            u_n = frg->u_end - frg->u_beg + 1;
            s_n = frg->s_end - frg->s_beg + 1;
            if (frg->uid & 1) {
                // mapped to reverse strand
                MYMALLOC(u_scm, u_n);
                memcpy(u_scm, &g->utg_asmg->vtx[uid].a[frg->u_beg], sizeof(uint64_t) * u_n);
                array_reverse(u_scm, u_n);
            } else {
                u_scm = &g->utg_asmg->vtx[uid].a[frg->u_beg];
            }
            // find LCS
            lcs_b = find_lcs(&scm[frg->s_beg], s_n, u_scm, u_n, frg->s_beg, max_d, &n_b);
            // add LCS blocks
            kv_pushn(uint64_t, lcs_blocks[i], lcs_b, n_b);
            free(lcs_b);
            if (frg->uid & 1) free(u_scm);
        }
        // merge blocks
        // lcs_block_merge(&lcs_blocks[i]);
    }

    // make multiple alignment
    uint64_t uids[n], frgs[n], lcsb[n], begs[n], lens[n];
    int m_ext, ext;
    kvec_t(uint32_t) n_match;
    kvec_t(uint64_t) u_match;
    kv_init(n_match);
    kv_init(u_match);
    MYBZERO(lcsb, n);
    MYBZERO(frgs, n);

    for (i = 0; i < n; ++i) {
        if (lcs_blocks[i].n == 0)
            goto ma_done;
        shift_lcs_block(i);
    }

    while (1) {
        // find left alignment position
        s_beg = 0;
        for (i = 0; i < n; ++i)
            s_beg = MAX(s_beg, begs[i]);
        // find max extension
        m_ext = INT32_MAX;
        for (i = 0; i < n; ++i) {
            ext = (int) lens[i] - s_beg + begs[i];
            m_ext = MIN(m_ext, ext);
        }
        if (m_ext > 0) {
            // add ma block
            kv_push(uint32_t, n_match, m_ext);
            for (i = 0; i < n; ++i)
                kv_push(uint64_t, u_match, uids[i]);
            // shift LCS blocks
            for (i = 0; i < n; ++i) {
                ext = (int) lens[i] - s_beg + begs[i];
                if (ext == m_ext) {
                    // shift the block
                    ++lcsb[i];
                    if (lcsb[i] == lcs_blocks[i].n)
                        goto ma_done;
                    shift_lcs_block(i);
                } else {
                    begs[i] = s_beg + m_ext;
                    lens[i] = ext - m_ext;
                }
            }
        } else {
            // shift the block with smallest begs
            for (i = 0, j = 1; j < n; ++j)
                if (begs[j] < begs[i])
                    i = j;
            ++lcsb[i];
            if (lcsb[i] == lcs_blocks[i].n)
                goto ma_done;
            shift_lcs_block(i);
        }
    }

ma_done:
    for (i = 0; i < n; ++i)
        kv_destroy(lcs_blocks[i]);

    ma->a = n;
    ma->b = n_match.n;
    ma->n = n_match.a;
    ma->u = u_match.a;

#ifdef DEBUG_LCS_MALIGN
    fprintf(stderr, "[DEBUG_LCS_MALIGN::%s] MA BLOCKs of read %lu - %s\n", __func__, sr->sid, sr->sname);
    for (i = 0; i < ma->a; ++i) {
        fprintf(stderr, "[DEBUG_LCS_MALIGN::%s] MA_RECORD %u -", __func__, i);
        for (j = 0; j < ma->b; ++j)
            fprintf(stderr, " BLOCK %u: %lu %u;", j, ma->u[j * (ma->a) + i], ma->n[j]);
        fputc('\n', stderr);
    }
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %r8, -0xb8(%rbp)
movl %ecx, %ebx
movq %rdi, -0x98(%rbp)
movq 0x50(%rsi), %r15
movq %rdx, -0x88(%rbp)
movsd 0x18(%rdx), %xmm0
movsd %xmm0, -0x48(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x21a0
movapd %xmm0, %xmm1
cmpltsd 0x111ad(%rip), %xmm1    # 0x19808
movsd 0x1116d(%rip), %xmm2    # 0x197d0
andpd %xmm1, %xmm2
andnpd %xmm0, %xmm1
orpd %xmm1, %xmm2
movsd -0x48(%rbp), %xmm0
subsd %xmm2, %xmm0
callq 0x2110
movq %rsp, -0xb0(%rbp)
movl %ebx, -0x7c(%rbp)
movl %ebx, %eax
movq %rsp, %r14
movq %rax, -0x60(%rbp)
imulq $0x18, %rax, %rax
movq %rax, -0xc0(%rbp)
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
movq %r15, -0xd8(%rbp)
leaq -0x8(%r15), %rax
movq %rax, -0xd0(%rbp)
xorl %edx, %edx
movq %r14, -0xa0(%rbp)
cmpq -0x60(%rbp), %rdx
je 0x8ce4
movq %rdx, %rax
shlq $0x5, %rax
movq -0x88(%rbp), %rcx
leaq (%rcx,%rax), %rsi
movq %rsi, -0xe8(%rbp)
movl 0x8(%rcx,%rax), %eax
movq %rax, -0xf0(%rbp)
movq %rdx, -0xc8(%rbp)
imulq $0x18, %rdx, %rax
andq $0x0, 0x10(%r14,%rax)
leaq (%r14,%rax), %r15
xorpd %xmm0, %xmm0
movupd %xmm0, (%r14,%rax)
xorl %r13d, %r13d
xorl %r12d, %r12d
movq %r15, -0xe0(%rbp)
cmpq -0xf0(%rbp), %r12
je 0x8cd5
movq %r13, -0xa8(%rbp)
movq -0xe8(%rbp), %rax
movq 0x10(%rax), %r14
movq %r12, -0x78(%rbp)
shlq $0x5, %r12
movq (%r14,%r12), %rax
movq 0x8(%r14,%r12), %r9
movq %rax, %r15
shrq %r15
movq 0x10(%r14,%r12), %r13
movq %r13, -0x38(%rbp)
subq %r9, %r13
leaq 0x1(%r13), %rdi
movl 0x1c(%r14,%r12), %ecx
movq %rcx, -0x68(%rbp)
movl 0x18(%r14,%r12), %ecx
movq %rcx, -0x48(%rbp)
testb $0x1, %al
movq %r9, -0x30(%rbp)
jne 0x87a0
movq -0x98(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
imulq $0x28, %r15, %rcx
leaq (,%r9,8), %r11
addq 0x8(%rax,%rcx), %r11
jmp 0x881c
leaq (,%rdi,8), %rbx
movq %rdi, -0x40(%rbp)
movq %rbx, %rdi
callq 0x2310
movq %rax, %rdi
movq -0x98(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
imulq $0x28, %r15, %rcx
movq -0x30(%rbp), %rdx
leaq (,%rdx,8), %rsi
addq 0x8(%rax,%rcx), %rsi
movq %rdi, %r15
movq %rbx, %rdx
callq 0x22b0
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x8815
xorl %eax, %eax
movq %r15, %r11
movq -0x30(%rbp), %r9
cmpq %r13, %rax
jae 0x881c
movq (%r11,%rax,8), %rcx
movq (%r11,%r13,8), %rdx
movq %rdx, (%r11,%rax,8)
movq %rcx, (%r11,%r13,8)
incq %rax
decq %r13
jmp 0x87f8
movq %r15, %r11
movq -0x30(%rbp), %r9
addq %r12, %r14
movq -0x48(%rbp), %rcx
movslq %ecx, %r12
movq -0x68(%rbp), %rax
movl %eax, %edx
subl %r12d, %edx
incl %edx
movq -0xd8(%rbp), %rax
leaq (%rax,%rcx,8), %rbx
cmpl %edi, %edx
movl %edi, %esi
cmovll %edx, %esi
testl %esi, %esi
movl $0x0, %eax
cmovlel %eax, %esi
xorl %eax, %eax
cmpq %rax, %rsi
je 0x8869
movq (%r11,%rax,8), %rcx
xorq (%rbx,%rax,8), %rcx
cmpq $0x1, %rcx
ja 0x8867
incq %rax
jmp 0x884f
movl %eax, %esi
movl %edx, -0x8c(%rbp)
movslq %edx, %rax
movq %rsi, -0x40(%rbp)
movslq %esi, %rcx
movslq %edi, %rdx
leaq -0x8(%r11,%rdx,8), %rsi
movq -0x48(%rbp), %rdi
leaq (,%rdi,8), %rdi
leaq (%rdi,%rax,8), %rdi
addq -0xd0(%rbp), %rdi
movq -0x38(%rbp), %r8
subl %ecx, %r8d
subl %r9d, %r8d
addl $0x2, %r8d
xorl %r9d, %r9d
movq %r9, %r15
movl %r8d, %r13d
leaq (%rax,%r9), %r8
cmpq %rcx, %r8
jle 0x88d7
leaq (%rdx,%r15), %r8
cmpq %rcx, %r8
jle 0x88d7
movq (%rsi,%r15,8), %r10
xorq (%rdi,%r15,8), %r10
leaq -0x1(%r15), %r9
leal -0x1(%r13), %r8d
cmpq $0x2, %r10
jb 0x88a9
movq -0x40(%rbp), %r8
testl %r8d, %r8d
movq %r14, -0x118(%rbp)
je 0x891a
pushq $0x10
popq %rdi
movq %r11, %r14
callq 0x2310
movq -0x40(%rbp), %r8
movq %r14, %r11
shlq $0x20, %r12
movl %r8d, %esi
orq %rsi, %r12
movq %rax, -0x50(%rbp)
movq %r12, (%rax)
pushq $0x2
popq %rcx
movq %rcx, -0x58(%rbp)
pushq $0x1
popq %rax
movq %rax, -0x70(%rbp)
jmp 0x8934
xorl %esi, %esi
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x70(%rbp)
movq -0x68(%rbp), %rdx
movl %edx, %ecx
movq -0x48(%rbp), %r9
subl %r9d, %ecx
leaq (%rcx,%r15), %rax
incq %rax
movq %rax, -0x110(%rbp)
movq %r15, %rdi
leaq (%rbx,%rsi,8), %r15
movq %r11, -0x100(%rbp)
leaq (%r11,%rsi,8), %rbx
movl %edx, %eax
subl %r8d, %eax
movl %eax, %ecx
subl %r9d, %ecx
leaq (%rcx,%rdi), %r12
incq %r12
movq -0x38(%rbp), %rcx
subl %r8d, %ecx
subl -0x30(%rbp), %ecx
leaq (%rcx,%rdi), %rdx
incq %rdx
movq %rdx, -0x38(%rbp)
subl %r9d, %eax
leal (%rax,%rdi), %r14d
addl $0x2, %r14d
movq %rdi, -0xf8(%rbp)
addq %rdi, %rcx
addq $0x2, %rcx
movq %rcx, -0x108(%rbp)
movl %r14d, %eax
imull %ecx, %eax
movslq %eax, %rdi
pushq $0x4
popq %rsi
callq 0x2250
movq %rax, -0x30(%rbp)
movslq %r14d, %rdi
shlq $0x3, %rdi
callq 0x2310
movq %rax, %r14
movq -0x30(%rbp), %r8
movq %r8, (%rax)
movslq -0x108(%rbp), %rax
movslq -0x38(%rbp), %rcx
movslq %r12d, %rdx
movslq %r13d, %rsi
leaq (%r8,%rsi,4), %rdi
shlq $0x2, %rsi
pushq $0x1
popq %r9
cmpq %rdx, %r9
jg 0x8a45
leaq (%r8,%rax,4), %r8
movq %r8, (%r14,%r9,8)
pushq $0x1
popq %r10
cmpq %rcx, %r10
jg 0x8a3d
movq -0x8(%rbx,%r10,8), %r13
xorq -0x8(%r15,%r9,8), %r13
movq -0x8(%r14,%r9,8), %r11
cmpq $0x1, %r13
ja 0x8a24
movl -0x4(%r11,%r10,4), %r11d
incl %r11d
jmp 0x8a34
movl (%r11,%r10,4), %r13d
movl -0x4(%rdi,%r10,4), %r11d
cmpl %r11d, %r13d
cmovgl %r13d, %r11d
movl %r11d, (%rdi,%r10,4)
incq %r10
jmp 0x8a00
incq %r9
addq %rsi, %rdi
jmp 0x89ef
movq -0x40(%rbp), %r8
addl -0x48(%rbp), %r8d
movq -0x70(%rbp), %r13
movq -0x38(%rbp), %rsi
testl %r12d, %r12d
je 0x8b05
testl %esi, %esi
je 0x8b05
movslq %r12d, %rax
movslq %esi, %rcx
movq -0x8(%rbx,%rcx,8), %rdx
xorq -0x8(%r15,%rax,8), %rdx
cmpq $0x1, %rdx
jbe 0x8a97
movq (%r14,%rax,8), %rdx
movl -0x4(%rdx,%rcx,4), %edx
movq -0x8(%r14,%rax,8), %rax
cmpl (%rax,%rcx,4), %edx
jg 0x8a93
decl %r12d
jmp 0x8a55
decl %esi
jmp 0x8a55
movq -0x58(%rbp), %rax
cmpq %rax, %r13
movq -0x50(%rbp), %rdi
jne 0x8ade
movq %r13, -0x48(%rbp)
leaq (%rax,%rax), %r13
testq %rax, %rax
pushq $0x2
popq %rax
cmoveq %rax, %r13
movq %rsi, -0x38(%rbp)
leaq (,%r13,8), %rsi
movq %r8, -0x40(%rbp)
callq 0x2350
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %r8
movq %rax, %rdi
movq %r13, -0x58(%rbp)
movq -0x48(%rbp), %r13
leal (%r8,%r12), %eax
decl %eax
movl %r12d, %ecx
decl %ecx
shlq $0x20, %rax
incq %rax
movq %rdi, -0x50(%rbp)
movq %rax, (%rdi,%r13,8)
incq %r13
decl %esi
movl %ecx, %r12d
jmp 0x8a55
movq -0x30(%rbp), %rdi
callq 0x2060
movq %r14, %rdi
callq 0x2060
movq -0x70(%rbp), %r8
cmpq %r8, %r13
pushq $0x1
popq %rbx
movq -0xe0(%rbp), %r15
movq -0x78(%rbp), %r12
movq -0x50(%rbp), %r9
movl -0x8c(%rbp), %edi
jne 0x8bd0
cmpl -0x110(%rbp), %edi
jle 0x8b88
movq -0x58(%rbp), %rax
cmpq %rax, %r13
jne 0x8b68
movq %rax, %rsi
shlq $0x4, %rsi
testq %rax, %rax
pushq $0x10
popq %rax
cmoveq %rax, %rsi
movq %r9, %rdi
callq 0x2350
movq %rax, %r9
movq -0x68(%rbp), %rax
movq -0xf8(%rbp), %rcx
addl %ecx, %eax
incl %eax
shlq $0x20, %rax
negq %rcx
orq %rax, %rcx
movq %rcx, (%r9,%r13,8)
incq %r13
cmpq $0x2, %r13
jb 0x8c03
movq %rbx, %rcx
xorl %eax, %eax
cmpq %rcx, %r13
je 0x8bfd
movq (%r9,%rax,8), %rdx
movq %rdx, %rsi
shrq $0x20, %rsi
movl %edx, %edi
addq %rsi, %rdi
movq (%r9,%rcx,8), %rsi
movq %rsi, %r8
shrq $0x20, %r8
cmpq %r8, %rdi
jne 0x8bc3
movl %esi, %esi
addq %rdx, %rsi
movq %rsi, (%r9,%rax,8)
jmp 0x8bcb
movq %rsi, 0x8(%r9,%rax,8)
incq %rax
incq %rcx
jmp 0x8b93
leaq (%r9,%r8,8), %rax
notq %r8
addq %r13, %r8
xorl %ecx, %ecx
cmpq %r8, %rcx
jae 0x8b3b
movq (%rax,%rcx,8), %rdx
movq (%rax,%r8,8), %rsi
movq %rsi, (%rax,%rcx,8)
movq %rdx, (%rax,%r8,8)
incq %rcx
decq %r8
jmp 0x8bdc
incq %rax
movq %rax, %r13
movq (%r15), %r14
movslq %r13d, %rbx
addq %r14, %rbx
cmpq 0x8(%r15), %rbx
jbe 0x8c7f
leaq -0x1(%rbx), %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0x8(%r15)
leaq 0x8(,%rcx,8), %rsi
movq -0xa8(%rbp), %rdi
movq %r15, %r12
movq %r13, %r15
movq %r9, %r13
callq 0x2350
movq %r13, %r9
movq %r15, %r13
movq %r12, %r15
movq -0x78(%rbp), %r12
movq %rax, 0x10(%r15)
jmp 0x8c86
movq -0xa8(%rbp), %rax
shlq $0x20, %r13
movq %r13, %rdx
movq %rax, %r13
leaq (%rax,%r14,8), %rdi
sarq $0x1d, %rdx
movq %r9, %rsi
movq %r9, %r14
callq 0x22b0
movq %rbx, (%r15)
movq %r14, %rdi
callq 0x2060
movq -0x118(%rbp), %rax
testb $0x1, (%rax)
je 0x8cc6
movq -0x100(%rbp), %rdi
callq 0x2060
incq %r12
movq -0xa0(%rbp), %r14
jmp 0x871e
movq -0xc8(%rbp), %rdx
incq %rdx
jmp 0x86c4
movq %rsp, %rdx
movq -0x60(%rbp), %rcx
leaq 0xf(,%rcx,8), %rax
andq $-0x10, %rax
subq %rax, %rdx
movq %rdx, -0x68(%rbp)
movq %rdx, %rsp
movq %rsp, %r15
subq %rax, %r15
movq %r15, %rsp
movq %rsp, %rdi
subq %rax, %rdi
movq %rdi, %rsp
movq %rsp, %rbx
subq %rax, %rbx
movq %rbx, %rsp
movq %rsp, %r13
subq %rax, %r13
movq %r13, %rsp
leaq (,%rcx,8), %r12
movq $0x0, -0x30(%rbp)
movq %rdi, -0x48(%rbp)
xorl %esi, %esi
movq %r12, %rdx
callq 0x21e0
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x21e0
movq %r15, %r10
movq -0x68(%rbp), %r9
xorl %eax, %eax
cmpl -0x7c(%rbp), %eax
je 0x8dd9
movl %eax, %ecx
imulq $0x18, %rcx, %rdx
cmpq $0x0, (%r14,%rdx)
je 0x9093
addq %r14, %rdx
movq 0x10(%rdx), %rdx
movq -0x48(%rbp), %rsi
movq (%rsi,%rcx,8), %rsi
movq (%rdx,%rsi,8), %rdx
movl %edx, %esi
shrq $0x20, %rdx
movq %rdx, (%rbx,%rcx,8)
movq %rsi, (%r13,%rcx,8)
movq %rcx, %rsi
shlq $0x5, %rsi
movq -0x88(%rbp), %rdi
movq 0x10(%rdi,%rsi), %rdi
movq (%r10,%rcx,8), %r8
leaq -0x1(%r8), %rsi
shlq $0x5, %r8
addq %r8, %rdi
addq $0x1c, %rdi
movq %rdi, %r8
incq %rsi
addq $0x20, %rdi
cmpl %edx, (%r8)
jb 0x8db7
movq %rsi, (%r10,%rcx,8)
movq -0x3c(%rdi), %rdx
shrq %rdx
movq %rdx, (%r9,%rcx,8)
incl %eax
jmp 0x8d59
movq $0x0, -0x30(%rbp)
pushq $0x1
popq %r11
movq $0x0, -0x78(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x50(%rbp)
xorl %r8d, %r8d
movq $0x0, -0x40(%rbp)
xorl %eax, %eax
xorl %r15d, %r15d
cmpq %rax, -0x60(%rbp)
je 0x8e23
movq (%rbx,%rax,8), %rcx
cmpq %rcx, %r15
cmovbeq %rcx, %r15
incq %rax
jmp 0x8e0d
movl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %eax, %eax
cmpq %rax, -0x60(%rbp)
je 0x8e48
movl (%r13,%rax,8), %ecx
subl %r15d, %ecx
addl (%rbx,%rax,8), %ecx
cmpl %ecx, %r12d
cmovgel %ecx, %r12d
incq %rax
jmp 0x8e2b
testl %r12d, %r12d
jg 0x8ef4
xorl %edx, %edx
movq %r11, %rcx
movl %edx, %eax
cmpq -0x60(%rbp), %rcx
jae 0x8e73
movq (%rbx,%rcx,8), %rdi
movl %ecx, %esi
cmpq (%rbx,%rax,8), %rdi
jb 0x8e6c
movl %edx, %esi
incq %rcx
movl %esi, %edx
jmp 0x8e56
movq -0x48(%rbp), %rdx
movq (%rdx,%rax,8), %rcx
leaq 0x1(%rcx), %rsi
movq %rsi, (%rdx,%rax,8)
imulq $0x18, %rax, %rdx
cmpq (%r14,%rdx), %rsi
je 0x908d
addq %r14, %rdx
movq 0x10(%rdx), %rdx
movq 0x8(%rdx,%rcx,8), %rcx
movl %ecx, %edx
shrq $0x20, %rcx
movq %rcx, (%rbx,%rax,8)
movq %rdx, (%r13,%rax,8)
movq %rax, %rdx
shlq $0x5, %rdx
movq -0x88(%rbp), %rsi
movq 0x10(%rsi,%rdx), %rsi
movq (%r10,%rax,8), %rdi
leaq -0x1(%rdi), %rdx
shlq $0x5, %rdi
addq %rdi, %rsi
addq $0x1c, %rsi
movq %rsi, %rdi
incq %rdx
addq $0x20, %rsi
cmpl %ecx, (%rdi)
jb 0x8ed2
movq %rdx, (%r10,%rax,8)
movq -0x3c(%rsi), %rcx
shrq %rcx
movq %rcx, (%r9,%rax,8)
jmp 0x8e08
movq -0x78(%rbp), %rax
cmpq %rax, -0x58(%rbp)
movq %r10, -0x70(%rbp)
jne 0x8f3b
leaq (%rax,%rax), %r14
testq %rax, %rax
pushq $0x2
popq %rax
cmoveq %rax, %r14
leaq (,%r14,4), %rsi
movq -0x30(%rbp), %rdi
movq %r8, -0x38(%rbp)
callq 0x2350
movq -0x38(%rbp), %r8
pushq $0x1
popq %r11
movq -0x70(%rbp), %r10
movq -0x68(%rbp), %r9
movq %r14, -0x78(%rbp)
jmp 0x8f3f
movq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x58(%rbp), %rcx
movl %r12d, (%rax,%rcx,4)
movq %r9, %rdx
movq -0x60(%rbp), %r14
movq -0x50(%rbp), %rdi
movq -0x40(%rbp), %rcx
subq $0x1, %r14
jb 0x8fb7
cmpq %r8, %rcx
jne 0x8fa7
leaq (%r8,%r8), %rsi
testq %r8, %r8
pushq $0x2
popq %rax
cmoveq %rax, %rsi
movq %rsi, -0x50(%rbp)
leaq (,%rsi,8), %rsi
movq %rcx, -0x40(%rbp)
movq %rdx, -0x38(%rbp)
callq 0x2350
movq -0x38(%rbp), %rdx
movq -0x40(%rbp), %rcx
pushq $0x1
popq %r11
movq -0x70(%rbp), %r10
movq -0x68(%rbp), %r9
movq %rax, %rdi
movq -0x50(%rbp), %r8
movq (%rdx), %rax
movq %rax, (%rdi,%rcx,8)
incq %rcx
addq $0x8, %rdx
jmp 0x8f5a
movq %rcx, -0x40(%rbp)
movq %rdi, -0x50(%rbp)
incq -0x58(%rbp)
movl %r12d, %eax
addq %r15, %rax
movq %rax, -0x38(%rbp)
xorl %ecx, %ecx
movq -0xa0(%rbp), %r14
cmpq -0x60(%rbp), %rcx
je 0x8e08
movl (%r13,%rcx,8), %edx
subl %r15d, %edx
addl (%rbx,%rcx,8), %edx
subl %r12d, %edx
jne 0x9075
movq -0x48(%rbp), %rsi
movq (%rsi,%rcx,8), %rdx
leaq 0x1(%rdx), %rdi
movq %rdi, (%rsi,%rcx,8)
imulq $0x18, %rcx, %rsi
cmpq (%r14,%rsi), %rdi
je 0x908d
movq %r8, %rax
addq %r14, %rsi
movq 0x10(%rsi), %rsi
movq 0x8(%rsi,%rdx,8), %rdx
movl %edx, %esi
shrq $0x20, %rdx
movq %rdx, (%rbx,%rcx,8)
movq %rsi, (%r13,%rcx,8)
movq %rcx, %rsi
shlq $0x5, %rsi
movq -0x88(%rbp), %rdi
movq 0x10(%rdi,%rsi), %rdi
movq (%r10,%rcx,8), %r8
leaq -0x1(%r8), %rsi
shlq $0x5, %r8
addq %r8, %rdi
addq $0x1c, %rdi
movq %rdi, %r8
incq %rsi
addq $0x20, %rdi
cmpl %edx, (%r8)
jb 0x9052
movq %rsi, (%r10,%rcx,8)
movq -0x3c(%rdi), %rdx
shrq %rdx
movq %rdx, (%r9,%rcx,8)
movq %rax, %r8
jmp 0x9085
movq -0x38(%rbp), %rax
movq %rax, (%rbx,%rcx,8)
movslq %edx, %rdx
movq %rdx, (%r13,%rcx,8)
incq %rcx
jmp 0x8fd6
movq -0x58(%rbp), %r12
jmp 0x909e
xorl %r12d, %r12d
movq $0x0, -0x50(%rbp)
xorl %ebx, %ebx
movq -0x30(%rbp), %r15
cmpq %rbx, -0xc0(%rbp)
je 0x90bd
movq 0x10(%r14,%rbx), %rdi
callq 0x2060
addq $0x18, %rbx
jmp 0x90a4
movq -0xb8(%rbp), %rax
movl -0x7c(%rbp), %ecx
movl %ecx, (%rax)
movl %r12d, 0x4(%rax)
movq %r15, 0x8(%rax)
movq -0x50(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0xb0(%rbp), %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq