// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: rcall_lidel_variant(kv_ul_ov_t*, overlap_region_alloc*, haplotype_evdience_alloc*, asg64_v*, asg64_v*, unsigned long)
uint64_t rcall_lidel_variant(kv_ul_ov_t *cz, overlap_region_alloc *ol, haplotype_evdience_alloc *hp, asg64_v *idx, asg64_v *idz, uint64_t rid)
{
    // fprintf(stderr, "-0-[M::%s] %.*s\tis_match::%u\n", __func__, (int)Get_NAME_LENGTH(R_INF, ol->list[48].y_id), Get_NAME(R_INF, ol->list[48].y_id), ol->list[48].is_match); 

    uint64_t i, k, zi, zk, nec[2], p, pmm, pmn, bn0 = 0, *ia, in, sv_n = cz->n, svi_n = 0, ovn = 0, m, rm_n; /**overlap_region *z;**/ ul_ov_t ez, *cp;
    hp->length = hp->snp_stat.n = idx->n = idz->n = 0; 
    ///for debug indel
    // fprintf(stderr, "+[M::%s] sv_n::%lu\n", __func__, sv_n);
    for (k = 1, i = 0; k <= sv_n; k++) {
        // fprintf(stderr, "+[M::%s] i::%ld, k::%ld\n", __func__, i, k);
        if (k == sv_n || (cz->a[k].ts) != (cz->a[i].ts)) {
            ///calculate pos
            for (zi = i, nec[0] = nec[1] = 0, idx->n = bn0, pmm = ((uint64_t)-1), pmn = 0; zi < k; zi++) {
                // z = &(ol->list[cz->a[zi].tn]); 
                nec[cz->a[zi].el]++;
                p = cz->a[zi].qs; p <<= 32; p |= ((uint64_t)cz->a[zi].qe);
                kv_push(uint64_t, *idx, p);
                if(pmm == ((uint64_t)-1)) pmm = p;
                if(pmm == p) pmn++;
                // fprintf(stderr, "[M::%s] cid::%u\trid::%u\t%.*s\tq::[%u,%u)\terr::%u\n", __func__, cz->a[zi].ts, z->y_id, (int)Get_NAME_LENGTH(R_INF, z->y_id), Get_NAME(R_INF, z->y_id), cz->a[zi].qs, cz->a[zi].qe, cz->a[zi].qn);
            }
            if(nec[0] < nec[1]) {
                ///calculate pos
                if((pmn <= 0) || (pmn < (idx->n - bn0 - pmn))) {
                    ia = idx->a + bn0; in = idx->n - bn0;
                    if(k - i > 1) radix_sort_bc64(ia, ia + in);
                    for (zk = 1, zi = 0, pmm = ((uint64_t)-1), pmn = 0; zk <= in; zk++) {
                        if((zk == in) || (ia[zi] != ia[zk])) {
                            if((zk - zi) > pmn) {
                                pmn = zk - zi; pmm = ia[zi];
                            }
                            zi = zk;
                        }
                    }
                }

                ez.qs = pmm>>32; ez.qe = (uint32_t)pmm; ez.ts = i; ez.te = k; ez.qn = 0; ez.tn = cz->a[i].ts;
                ///calculate error
                for (zi = i, idx->n = bn0, pmm = ((uint64_t)-1), pmn = 0; zi < k; zi++) {
                    if((cz->a[zi].qs != ez.qs) || (cz->a[zi].qe != ez.qe)) continue;
                    kv_push(uint64_t, *idx, cz->a[zi].qn);
                    if(pmm == ((uint64_t)-1)) pmm = cz->a[zi].qn;
                    if(pmm == cz->a[zi].qn) pmn++;
                }
                if((pmn <= 0) || (pmn < (idx->n - bn0 - pmn))) {
                    ia = idx->a + bn0; in = idx->n - bn0;
                    if(k - i > 1) radix_sort_bc64(ia, ia + in);
                    for (zk = 1, zi = 0, pmm = ((uint64_t)-1), pmn = 0; zk <= in; zk++) {
                        if((zk == in) || (ia[zi] != ia[zk])) {
                            if((zk - zi) > pmn) {
                                pmn = zk - zi; pmm = ia[zi];
                            }
                            zi = zk;
                        }
                    }
                }
                ez.qn = pmm; kv_push(ul_ov_t, *cz, ez);
                
                // fprintf(stderr, "-[M::%s] nec[0]::%ld, nec[1]::%ld, pa::[%u, %u), err::%u\n\n", __func__, nec[0], nec[1], ez.qs, ez.qe, ez.qn);
            }
            
            i = k;
        }
    }
    // fprintf(stderr, "-1-[M::%s] %.*s\tis_match::%u\n", __func__, (int)Get_NAME_LENGTH(R_INF, ol->list[48].y_id), Get_NAME(R_INF, ol->list[48].y_id), ol->list[48].is_match); 

    svi_n = cz->n - sv_n; idx->n = 0;
    gen_ov_lidel_variant(cz, ol, idx, 0); 
    ovn = cz->n - sv_n - svi_n;
    // fprintf(stderr, "-2-[M::%s] %.*s\tis_match::%u\n", __func__, (int)Get_NAME_LENGTH(R_INF, ol->list[48].y_id), Get_NAME(R_INF, ol->list[48].y_id), ol->list[48].is_match); 
    // fprintf(stderr, "+[M::%s] sv_n::%lu, svi_n::%lu, ovn::%lu\n", __func__, sv_n, svi_n, ovn);

    ul_ov_t *sv = cz->a, *svi = cz->a + sv_n, *ov = cz->a + sv_n + svi_n; int64_t s, e, os, oe, q[2];
    radix_sort_ul_ov_srt_qs1(svi, svi + svi_n); 
    for (k = i = 0; k < svi_n; k++) {
        // fprintf(stderr, "\n-3-[M::%s] %.*s\tis_match::%u\n", __func__, (int)Get_NAME_LENGTH(R_INF, ol->list[48].y_id), Get_NAME(R_INF, ol->list[48].y_id), ol->list[48].is_match); 
        ///label matched overlaps
        s = svi[k].qs; e = svi[k].qe;
        for (p = svi[k].ts; p < svi[k].te; p++) {
            // z = &(ol->list[sv[p].tn]);
            // fprintf(stderr, "+++[M::%s] cid::%lu\tccid::%lu\trid::%u\t%.*s\tq::[%ld,%ld)\terr::%u\n", __func__, k, p - svi[k].ts, z->y_id, (int)Get_NAME_LENGTH(R_INF, z->y_id), Get_NAME(R_INF, z->y_id), s, e, sv[p].qn);
            assert(sv[p].ts == svi[k].tn);
            // if(!(ol->list[sv[p].tn].is_match == 1)) {
            //     fprintf(stderr, "+[M::%s] rid::%lu\toid::%u\tis_match::%u\n", __func__, rid, sv[p].tn, ol->list[sv[p].tn].is_match); 
            //     fprintf(stderr, "[M::%s] cid::%lu\tccid::%lu\trid::%u\t%.*s\tq::[%ld,%ld)\terr::%u\n", __func__, k, p - svi[k].ts, z->y_id, (int)Get_NAME_LENGTH(R_INF, z->y_id), Get_NAME(R_INF, z->y_id), s, e, sv[p].qn);
            // }
            assert(ol->list[sv[p].tn].is_match == 1);
            ol->list[sv[p].tn].is_match = 2;
        }

        ///filter out passed overlaps
        for (m = rm_n = ovn; m < idx->n; m++) {
            cp = &(ov[idx->a[m]]);
            q[0] = ol->list[ovlp_id(*cp)].w_list.a[ovlp_cur_wid(*cp)].x_start+ovlp_bd(*cp);
            q[1] = ol->list[ovlp_id(*cp)].w_list.a[ovlp_cur_wid(*cp)].x_end+1-ovlp_bd(*cp);
            if(q[1] <= s) continue;
            idx->a[rm_n++] = idx->a[m];
        }
        idx->n = rm_n;

        ///push new overlaps
        for (; i < ovn; ++i) {
            cp = &(ov[(uint32_t)idx->a[i]]);
            q[0] = ol->list[ovlp_id(*cp)].w_list.a[ovlp_cur_wid(*cp)].x_start+ovlp_bd(*cp);
            q[1] = ol->list[ovlp_id(*cp)].w_list.a[ovlp_cur_wid(*cp)].x_end+1-ovlp_bd(*cp);
            if(q[0] >= e) break;
            os = MAX(q[0], s); oe = MIN(q[1], e);
            if(oe > os) {
                kv_push(uint64_t, *idx, ((uint32_t)idx->a[i]));
            }
        }

        push_idel_info(hp, s, e, svi[k].qn, ov, ovn, sv + svi[k].ts, svi[k].te - svi[k].ts, ol->list, idx->a + ovn, idx->n - ovn, rid, asm_opt.het_cov, asm_opt.hom_cov, asm_opt.polyploidy, 0.333333, 5);

        ///relabel matched overlaps
        for (p = svi[k].ts; p < svi[k].te; p++) {
            assert(ol->list[sv[p].tn].is_match == 2);
            ol->list[sv[p].tn].is_match = 1;
        }
        // fprintf(stderr, "-4-[M::%s] %.*s\tis_match::%u\n", __func__, (int)Get_NAME_LENGTH(R_INF, ol->list[48].y_id), Get_NAME(R_INF, ol->list[48].y_id), ol->list[48].is_match); 
    }

    return hp->length;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rcx, %r9
movq %rsi, %r14
movq 0x8(%rdi), %r13
xorl %ebx, %ebx
movq %rbx, (%r8)
movq %rbx, 0x220(%rdx)
movq %rdx, 0xa8(%rsp)
movl $0x0, 0x10(%rdx)
testq %r13, %r13
movq %rcx, 0x58(%rsp)
movq %rsi, 0x90(%rsp)
je 0x72305
movl $0x1, %r11d
xorl %esi, %esi
movq %rdi, 0x60(%rsp)
movq %r13, 0x88(%rsp)
cmpq %r13, %r11
je 0x71efa
movq (%rdi), %rax
leaq (%r11,%r11,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %r11, %rcx
movl 0x10(%rax,%rcx), %ecx
leaq (%rsi,%rsi,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rsi, %rdx
cmpl 0x10(%rax,%rdx), %ecx
jne 0x71efa
movq %rsi, %rax
jmp 0x722f2
xorps %xmm0, %xmm0
movaps %xmm0, 0xb0(%rsp)
movq $0x0, (%r9)
movq %r11, %rcx
movq %r11, %rax
subq %rsi, %rcx
jbe 0x722f2
movq %rcx, 0x78(%rsp)
movq 0x10(%r9), %rax
leaq (%rsi,%rsi,8), %rcx
leaq (%rcx,%rcx,2), %rdx
leaq (%rdx,%rsi), %rcx
movq %rcx, 0xa0(%rsp)
movq %rdx, 0x70(%rsp)
leaq 0x4(%rsi,%rdx), %r12
movq $-0x1, %rbp
movq %rsi, 0x80(%rsp)
movq %rsi, %r13
xorl %ebx, %ebx
movq %r11, 0x68(%rsp)
movq (%rdi), %rcx
movl 0x14(%rcx,%r12), %edx
shrl $0x1b, %edx
andl $0x8, %edx
incq 0xb0(%rsp,%rdx)
movl (%rcx,%r12), %r14d
movl 0x4(%rcx,%r12), %r15d
movq (%r9), %rcx
cmpq 0x8(%r9), %rcx
jne 0x71fb9
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r9)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x68(%rsp), %r11
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %r9
movq %rax, 0x10(%r9)
movq (%r9), %rcx
shlq $0x20, %r14
orq %r14, %r15
leaq 0x1(%rcx), %rdx
movq %rdx, (%r9)
cmpq $-0x1, %rbp
cmoveq %r15, %rbp
movq %r15, (%rax,%rcx,8)
xorl %ecx, %ecx
cmpq %r15, %rbp
sete %cl
addq %rcx, %rbx
incq %r13
addq $0x1c, %r12
cmpq %r13, %r11
jne 0x71f5b
movq 0xb0(%rsp), %rcx
movq %r11, %rax
cmpq 0xb8(%rsp), %rcx
movq 0x90(%rsp), %r14
movq 0x88(%rsp), %r13
movq 0x80(%rsp), %r15
movq 0x78(%rsp), %rdx
jae 0x722f2
testq %rbx, %rbx
sete %al
movq (%r9), %r12
movq %r12, %rcx
subq %rbx, %rcx
cmpq %rcx, %rbx
setb %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x720d0
movq 0x10(%r9), %rbx
cmpq $0x2, %rdx
jb 0x72069
leaq (%rbx,%r12,8), %rsi
movq %rbx, %rdi
callq 0x45373
movq 0x68(%rsp), %r11
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %r9
testq %r12, %r12
je 0x720c9
leaq 0x1(%r12), %rax
cmpq $0x3, %rax
movl $0x2, %ecx
cmovbq %rcx, %rax
movq $-0x1, %rbp
movl $0x1, %ecx
xorl %esi, %esi
xorl %edx, %edx
cmpq %rcx, %r12
je 0x720a4
movq (%rbx,%rsi,8), %r8
cmpq (%rbx,%rcx,8), %r8
jne 0x720a4
movq %rsi, %r10
jmp 0x720bc
movq %rcx, %r8
subq %rsi, %r8
movq %rcx, %r10
cmpq %rdx, %r8
jbe 0x720bc
movq (%rbx,%rsi,8), %rbp
movq %r8, %rdx
movq %rcx, %r10
incq %rcx
movq %r10, %rsi
cmpq %rcx, %rax
jne 0x72090
jmp 0x720d0
movq $-0x1, %rbp
movq %rbp, %r12
shrq $0x20, %r12
movq 0x70(%rsp), %rax
addq %r15, %rax
movq %r11, %rdx
movq (%rdi), %rcx
movl 0x10(%rcx,%rax), %eax
movl %eax, 0x70(%rsp)
movq $0x0, (%r9)
subq %r15, %rdx
movq %rdx, 0x98(%rsp)
jbe 0x721d1
movq $-0x1, %r13
movq %r15, %rbx
xorl %r10d, %r10d
movq 0xa0(%rsp), %r15
movq %r12, 0x78(%rsp)
cmpl %r12d, 0x4(%rcx,%r15)
jne 0x721a0
cmpl %ebp, 0x8(%rcx,%r15)
jne 0x721a0
movq (%r9), %rdx
movq 0x10(%r9), %rax
cmpq 0x8(%r9), %rdx
jne 0x7217e
leaq (%rdx,%rdx), %rsi
testq %rdx, %rdx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r9)
shlq $0x3, %rsi
movq %rax, %rdi
movq %r10, %r12
callq 0x2370
movq %r12, %r10
movq 0x78(%rsp), %r12
movq 0x68(%rsp), %r11
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %r9
movq %rax, 0x10(%r9)
movq (%rdi), %rcx
movq (%r9), %rdx
movl (%rcx,%r15), %esi
leaq 0x1(%rdx), %r8
movq %r8, (%r9)
movq %rsi, (%rax,%rdx,8)
cmpq $-0x1, %r13
cmoveq %rsi, %r13
xorl %eax, %eax
cmpq %rsi, %r13
sete %al
addq %rax, %r10
incq %rbx
addq $0x1c, %r15
cmpq %rbx, %r11
jne 0x7211f
movq (%r9), %r15
testq %r10, %r10
sete %al
movq %r15, %rcx
subq %r10, %rcx
cmpq %rcx, %r10
setb %cl
orb %al, %cl
cmpb $0x1, %cl
je 0x721d4
jmp 0x72264
xorl %r15d, %r15d
movq 0x10(%r9), %rbx
cmpq $0x2, 0x98(%rsp)
jb 0x721fe
leaq (%rbx,%r15,8), %rsi
movq %rbx, %rdi
callq 0x45373
movq 0x68(%rsp), %r11
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %r9
testq %r15, %r15
je 0x7225d
leaq 0x1(%r15), %rax
cmpq $0x3, %rax
movl $0x2, %ecx
cmovbq %rcx, %rax
movq $-0x1, %r13
movl $0x1, %ecx
xorl %esi, %esi
xorl %edx, %edx
cmpq %rcx, %r15
je 0x72238
movq (%rbx,%rsi,8), %r8
cmpq (%rbx,%rcx,8), %r8
jne 0x72238
movq %rsi, %r10
jmp 0x72250
movq %rcx, %r8
subq %rsi, %r8
movq %rcx, %r10
cmpq %rdx, %r8
jbe 0x72250
movq (%rbx,%rsi,8), %r13
movq %r8, %rdx
movq %rcx, %r10
incq %rcx
movq %r10, %rsi
cmpq %rcx, %rax
jne 0x72224
jmp 0x72264
movq $-0x1, %r13
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
cmpq 0x10(%rdi), %rcx
jne 0x722ae
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rdx
movq %rdx, 0x10(%rdi)
leaq (%rdx,%rdx,8), %rcx
leaq (%rcx,%rcx,2), %rsi
addq %rdx, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x68(%rsp), %r11
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %r9
movq %rax, (%rdi)
movq 0x8(%rdi), %rcx
movq 0x80(%rsp), %rsi
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%rdi)
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movl %r13d, (%rax,%rdx)
movl %r12d, 0x4(%rax,%rdx)
movl %ebp, 0x8(%rax,%rdx)
movl 0x70(%rsp), %ecx
movl %ecx, 0xc(%rax,%rdx)
movl %esi, 0x10(%rax,%rdx)
movl %r11d, 0x14(%rax,%rdx)
movq %r11, %rax
movq 0x88(%rsp), %r13
incq %r11
movq %rax, %rsi
cmpq %r13, %r11
jbe 0x71eca
movq 0x8(%rdi), %rbx
movq $0x0, (%r9)
movq %r14, %rsi
movq %r9, %rdx
xorl %ecx, %ecx
movq %rdi, %r15
callq 0x71b9a
movq (%r15), %rcx
movq 0x8(%r15), %r12
leaq (,%r13,8), %rax
addq %r13, %rax
leaq (%rax,%rax,2), %rdi
addq %rcx, %rdi
addq %r13, %rdi
leaq (%rbx,%rbx,8), %rax
movq %r13, %r15
leaq (%rax,%rax,2), %r13
addq %rbx, %r13
movq %rcx, 0x70(%rsp)
addq %rcx, %r13
movq %rdi, 0xa0(%rsp)
movq %r13, %rsi
callq 0x46b25
movq %rbx, %rax
subq %r15, %rax
movq %rax, 0x98(%rsp)
je 0x726b7
subq %rbx, %r12
movq 0x70(%rsp), %rax
leaq 0x10(%rax), %rcx
movq %rcx, 0xd0(%rsp)
addq $0xc, %rax
movq %rax, 0xc8(%rsp)
xorl %r15d, %r15d
xorl %esi, %esi
movq %r12, 0x68(%rsp)
leaq (%rsi,%rsi,8), %rax
leaq (%rax,%rax,2), %rax
addq %rsi, %rax
movq 0xa0(%rsp), %rcx
leaq (%rcx,%rax), %rdx
movl 0x4(%rcx,%rax), %ebp
movl 0x8(%rcx,%rax), %ebx
movl 0x10(%rcx,%rax), %r11d
movl 0x14(%rcx,%rax), %r10d
cmpl %r10d, %r11d
jae 0x72425
movl 0xc(%rdx), %eax
movq %r10, %rcx
subq %r11, %rcx
leaq (%r11,%r11,8), %rdi
leaq (%rdi,%rdi,2), %rdi
movq %rdx, %r9
movq 0xd0(%rsp), %rdx
addq %rdx, %rdi
addq %r11, %rdi
movq %r9, %rdx
cmpl %eax, (%rdi)
jne 0x72712
movq (%r14), %r8
movl -0x4(%rdi), %r9d
imulq $0xa8, %r9, %r9
cmpb $0x1, 0x2c(%r8,%r9)
jne 0x726d4
addq %r9, %r8
addq $0x2c, %r8
movb $0x2, (%r8)
addq $0x1c, %rdi
decq %rcx
jne 0x723ef
movq %r11, 0x88(%rsp)
movq %r10, 0x78(%rsp)
movq %rdx, 0x60(%rsp)
movq %rsi, 0x80(%rsp)
movq 0x58(%rsp), %rax
movq (%rax), %rcx
movq 0x10(%rax), %rax
movq %r12, %rdi
cmpq %rcx, %r12
jae 0x724c3
movq 0x90(%rsp), %rdx
movq (%rdx), %r8
movq %r12, %r9
movq %r12, %rdi
movq (%rax,%r9,8), %r10
leaq (%r10,%r10,8), %r11
leaq (%r11,%r11,2), %r11
addq %r10, %r11
movl (%r13,%r11), %r14d
movl 0xc(%r13,%r11), %edx
imulq $0xa8, %rdx, %rdx
movq 0x58(%r8,%rdx), %rdx
movl 0x18(%r13,%r11), %r11d
movl $0x3fffffff, %esi       # imm = 0x3FFFFFFF
andl %esi, %r11d
shlq $0x5, %r14
movl 0x4(%rdx,%r14), %edx
subl %r11d, %edx
incl %edx
movslq %edx, %rdx
cmpq %rbp, %rdx
jle 0x724bb
movq %r10, (%rax,%rdi,8)
incq %rdi
movq 0x58(%rsp), %rcx
movq (%rcx), %rcx
incq %r9
cmpq %rcx, %r9
jb 0x72464
movq 0x58(%rsp), %r8
movq %rdi, (%r8)
cmpq %r12, %r15
jae 0x725a3
movq 0x90(%rsp), %r14
movl (%rax,%r15,8), %ecx
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdi
addq %rcx, %rdi
movq (%r14), %rcx
movl (%r13,%rdi), %edx
movl 0xc(%r13,%rdi), %esi
imulq $0xa8, %rsi, %rsi
movq 0x58(%rcx,%rsi), %rsi
shlq $0x5, %rdx
movslq (%rsi,%rdx), %rcx
movl 0x18(%r13,%rdi), %edi
andl $0x3fffffff, %edi       # imm = 0x3FFFFFFF
addq %rdi, %rcx
cmpq %rbx, %rcx
jge 0x7258f
addq %rdx, %rsi
movl 0x4(%rsi), %edx
subl %edi, %edx
incl %edx
movslq %edx, %rdx
cmpq %rbp, %rcx
cmovleq %rbp, %rcx
cmpq %rbx, %rdx
cmovgeq %rbx, %rdx
cmpq %rcx, %rdx
jle 0x72583
movq (%r8), %rcx
cmpq 0x8(%r8), %rcx
jne 0x72574
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r8)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x58(%rsp), %r8
movq %rax, 0x10(%r8)
movq (%r8), %rcx
movl (%rax,%r15,8), %edx
leaq 0x1(%rcx), %rsi
movq %rsi, (%r8)
movq %rdx, (%rax,%rcx,8)
incq %r15
cmpq %r12, %r15
jb 0x724dc
movq 0x60(%rsp), %r12
movl 0x10(%r12), %esi
movl 0x14(%r12), %r11d
movq (%r8), %rdi
jmp 0x725bd
movq 0x90(%rsp), %r14
movq 0x60(%rsp), %r12
movq 0x78(%rsp), %r11
movq 0x88(%rsp), %rsi
movl (%r12), %ecx
movl %esi, %edx
leaq (%rdx,%rdx,8), %r8
leaq (%r8,%r8,2), %r8
addq 0x70(%rsp), %rdx
addq %r8, %rdx
subl %esi, %r11d
movq (%r14), %rsi
movq 0x68(%rsp), %r8
leaq (%rax,%r8,8), %rax
subq %r8, %rdi
leaq 0x22316c(%rip), %r10    # 0x295758
movslq 0xd4(%r10), %r8
movslq 0xd0(%r10), %r9
movslq 0x1bc(%r10), %r10
movq %r10, 0x40(%rsp)
movq %r9, 0x38(%rsp)
movq %r8, 0x30(%rsp)
movq %rdi, 0x20(%rsp)
movq %rax, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %r11, 0x8(%rsp)
movq %rdx, (%rsp)
movq $0x5, 0x48(%rsp)
movq 0xa8(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %r13, %r8
movsd 0x1bf00e(%rip), %xmm0   # 0x231658
callq 0x717e3
movl 0x10(%r12), %eax
movl 0x14(%r12), %ecx
cmpl %ecx, %eax
jae 0x72699
movq (%r14), %rdx
subq %rax, %rcx
leaq (%rax,%rax,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq 0xc8(%rsp), %rax
addq %rsi, %rax
movl (%rax), %esi
imulq $0xa8, %rsi, %rsi
cmpb $0x2, 0x2c(%rdx,%rsi)
jne 0x726f3
addq %rdx, %rsi
addq $0x2c, %rsi
movb $0x1, (%rsi)
addq $0x1c, %rax
decq %rcx
jne 0x72676
movq 0x80(%rsp), %rsi
incq %rsi
cmpq 0x98(%rsp), %rsi
movq 0x68(%rsp), %r12
jne 0x7239c
movq 0xa8(%rsp), %rax
movl 0x10(%rax), %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1c1db4(%rip), %rdi    # 0x23448f
leaq 0x1bf071(%rip), %rsi    # 0x231753
leaq 0x1c1d27(%rip), %rcx    # 0x234410
movl $0x4e94, %edx           # imm = 0x4E94
callq 0x2110
leaq 0x1c1db6(%rip), %rdi    # 0x2344b0
leaq 0x1bf052(%rip), %rsi    # 0x231753
leaq 0x1c1d08(%rip), %rcx    # 0x234410
movl $0x4eb2, %edx           # imm = 0x4EB2
callq 0x2110
leaq 0x1c1ce1(%rip), %rdi    # 0x2343fa
leaq 0x1bf033(%rip), %rsi    # 0x231753
leaq 0x1c1ce9(%rip), %rcx    # 0x234410
movl $0x4e8f, %edx           # imm = 0x4E8F
callq 0x2110