// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: gen_fg(ma_ug_t*, asg_t*, ma_hit_t_alloc*, ma_sub_t*, int, int, int)
ma_ug_t* gen_fg(ma_ug_t *ug, asg_t *rg, ma_hit_t_alloc* src, ma_sub_t *cov, int32_t max_hang, int32_t min_ovlp, int32_t gap_fuzz)
{
    uint32_t *idx; MALLOC(idx, rg->n_seq); 
    memset(idx, -1, sizeof((*idx))*rg->n_seq);
    ma_ug_t *fg = copy_untig_graph(ug); asg_cleanup(fg->g);///some edges might be deleted
    kvec_t(uint64_t) srt; kv_init(srt);    
    uint64_t i, k, l, m, rv, rw, uv, uw, zn, z, nist = 0; ma_utg_t *u;
    for (k = 0; k < fg->u.n; k++) {
        u = &(ug->u.a[k]); fg->g->seq[k].c = PRIMARY_LABLE;
        if((u->circ) || (u->n == 0)) continue;
        m = k<<1; m |= (((uint64_t)Uc_beg((*u)))<<32); kv_push(uint64_t, srt, m);///((uint32_t)(((*u)).a[0]>>32));
        m = (k<<1)+1; m |= (((uint64_t)Uc_end((*u)))<<32); kv_push(uint64_t, srt, m);
    }
    

    radix_sort_arch64(srt.a, srt.a+srt.n);
    for (k = 1, l = 0; k <= srt.n; k++) {
        if(k == srt.n || (srt.a[k]>>33) != (srt.a[l]>>33)) {
            idx[srt.a[l]>>33] = l;
            l = k;
        }
    }

    ma_hit_t_alloc* x; asg_arc_t *za; 
    ma_hit_t *h; ma_sub_t *sq, *st;
    int32_t r; asg_arc_t t0, t1, *p;
    for (k = 0; k < fg->u.n; k++) {
        u = &(ug->u.a[k]);
        if((u->circ) || (u->n == 0)) continue;

        uv = k<<1; rv = Uc_end((*u))^1;
        x = &(src[rv>>1]); 
        za = asg_arc_a(ug->g, uv); 
        zn = asg_arc_n(ug->g, uv); 
        for (i = 0; i < x->length; i++) {
            h = &(x->buffer[i]);
            // if(!(h->el)) continue;
            sq = &(cov[Get_qn(*h)]); st = &(cov[Get_tn(*h)]);
            if(st->del || rg->seq[Get_tn(*h)].del) continue;
            r = ma_hit2arc(h, sq->e - sq->s, st->e - st->s, max_hang, 
                                asm_opt.max_hang_rate, min_ovlp, &t0);
        
            ///if it is a contained read, skip
            if(r < 0) continue;
            if((t0.ul>>32) != rv) continue;
            rw = t0.v;
            if(idx[rw>>1] == ((uint32_t)-1)) continue;
            if(!(get_edge_from_source(src, cov, NULL, max_hang, min_ovlp, t0.ul>>32, t0.v, &t0))) continue;

            m = idx[rw>>1]; assert((srt.a[m]>>33) == (rw>>1));
            for (; m < srt.n && (srt.a[m]>>33) == (rw>>1); m++) {
                if(rw == (srt.a[m]>>32)) {
                    uw = (uint32_t)srt.a[m];
                    if(uv == uw) continue;
                    for (z = 0; z < zn; z++) {
                        if((!za[z].del) && (za[z].v==uw)) break;
                    }
                    if(z < zn) continue;
                    if(get_edge_from_source(src, cov, NULL, max_hang, min_ovlp, (t0.v^1), ((t0.ul>>32)^1), &t1)) {
                        p = asg_arc_pushp(fg->g); *p = t0; 
                        p->ul<<=32; p->ul>>=32; p->ul |= (uv<<32); p->v = uw;

                        p = asg_arc_pushp(fg->g); *p = t1;
                        p->ul<<=32; p->ul>>=32; p->ul |= ((uw^1)<<32); p->v = uv^1;
                        nist++;
                    }
                }
            }
        }


        uv = (k<<1)+1; rv = Uc_beg((*u))^1;
        x = &(src[rv>>1]); 
        za = asg_arc_a(ug->g, uv); 
        zn = asg_arc_n(ug->g, uv); 
        for (i = 0; i < x->length; i++) {
            h = &(x->buffer[i]);
            // if(!(h->el)) continue;
            sq = &(cov[Get_qn(*h)]); st = &(cov[Get_tn(*h)]);
            if(st->del || rg->seq[Get_tn(*h)].del) continue;
            r = ma_hit2arc(h, sq->e - sq->s, st->e - st->s, max_hang, 
                                asm_opt.max_hang_rate, min_ovlp, &t0);
        
            ///if it is a contained read, skip
            if(r < 0) continue;
            if((t0.ul>>32) != rv) continue;
            rw = t0.v;
            if(idx[rw>>1] == ((uint32_t)-1)) continue;
            if(!(get_edge_from_source(src, cov, NULL, max_hang, min_ovlp, t0.ul>>32, t0.v, &t0))) continue;

            m = idx[rw>>1]; assert((srt.a[m]>>33) == (rw>>1));
            for (; m < srt.n && (srt.a[m]>>33) == (rw>>1); m++) {
                if(rw == (srt.a[m]>>32)) {
                    uw = (uint32_t)srt.a[m];
                    if(uv == uw) continue;
                    for (z = 0; z < zn; z++) {
                        if((!za[z].del) && (za[z].v==uw)) break;
                    }
                    if(z < zn) continue;
                    if(get_edge_from_source(src, cov, NULL, max_hang, min_ovlp, (t0.v^1), ((t0.ul>>32)^1), &t1)) {
                        p = asg_arc_pushp(fg->g); *p = t0; 
                        p->ul<<=32; p->ul>>=32; p->ul |= (uv<<32); p->v = uw;

                        p = asg_arc_pushp(fg->g); *p = t1;
                        p->ul<<=32; p->ul>>=32; p->ul |= ((uw^1)<<32); p->v = uv^1;
                        nist++;
                    }
                }
            }
        }
    }

    if(nist) {
        free(fg->g->idx);
        fg->g->idx = 0;
        fg->g->is_srt = 0;
        asg_cleanup(fg->g);
        asg_symm(fg->g);
        asg_arc_del_trans(fg->g, gap_fuzz);
        ///some of old edges might be lost due the transitive reduction
        recall_arcs(fg->g, ug->g);
    }

    kv_destroy(srt); free(idx);
    return fg;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movl %r9d, 0x14(%rsp)
movl %r8d, 0x10(%rsp)
movq %rcx, %rbp
movq %rdx, 0x30(%rsp)
movq %rdi, %r15
movq %rsi, 0xc8(%rsp)
movl 0x14(%rsi), %r12d
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
shlq $0x2, %r12
movq %r12, %rdi
callq 0x2280
movq %rax, 0x78(%rsp)
movq %rax, %rdi
movl $0xff, %esi
movq %r12, %rdx
callq 0x20e0
movq %r15, %rdi
callq 0xc815c
movq %rax, %rbx
addq $0x18, %rax
movq %rax, 0x70(%rsp)
movq 0x18(%rbx), %rdi
callq 0xa02fa
cmpq $0x0, (%rbx)
movq %r15, 0xa8(%rsp)
movq %rbx, 0x68(%rsp)
je 0xd1287
movq %rbx, %r8
xorl %ebx, %ebx
movl $0x2, %r14d
movq $0x0, 0x18(%rsp)
xorl %eax, %eax
xorl %edi, %edi
movq 0x10(%r15), %rcx
leaq (%rbx,%rbx,4), %rdx
movq 0x70(%rsp), %rsi
movq (%rsi), %rsi
movq 0x20(%rsi), %rsi
movb $0x0, 0x4(%rsi,%rbx,8)
cmpl $0x0, (%rcx,%rdx,8)
js 0xd1279
leaq (%rcx,%rdx,8), %r12
cmpl $0x0, 0x10(%r12)
je 0xd1279
movq 0x18(%r12), %rcx
movq (%rcx), %r13
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
andq %rcx, %r13
cmpq %rax, 0x18(%rsp)
jne 0xd11f1
leaq (%rax,%rax), %r15
testq %rax, %rax
cmoveq %r14, %r15
leaq (,%r15,8), %rsi
callq 0x2370
movq %rax, %rdi
movq %r15, %rax
leaq (%rbx,%rbx), %r15
orq %r15, %r13
movq 0x18(%rsp), %rdx
leaq 0x1(%rdx), %rcx
movq %r13, (%rdi,%rdx,8)
movq 0x18(%r12), %rdx
movl 0x10(%r12), %esi
decl %esi
movq (%rdx,%rsi,8), %r12
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
andq %rdx, %r12
cmpq %rax, %rcx
jne 0xd1245
leaq (%rax,%rax), %r13
testq %rax, %rax
cmoveq %r14, %r13
leaq (,%r13,8), %rsi
callq 0x2370
movq %rax, %rdi
movq %r13, %rax
movq 0x68(%rsp), %r8
movabsq $0x100000000, %rcx      # imm = 0x100000000
xorq %rcx, %r12
orq %r12, %r15
orq $0x1, %r15
movq 0x18(%rsp), %rcx
movq %r15, 0x8(%rdi,%rcx,8)
addq $0x2, %rcx
movq %rcx, 0x18(%rsp)
movq 0xa8(%rsp), %r15
incq %rbx
cmpq (%r8), %rbx
jb 0xd1184
jmp 0xd1292
xorl %edi, %edi
movq $0x0, 0x18(%rsp)
movq %rdi, 0x8(%rsp)
movq 0x18(%rsp), %rbx
leaq (%rdi,%rbx,8), %rsi
callq 0x9d53f
movq 0x8(%rsp), %r9
movq 0x68(%rsp), %r8
testq %rbx, %rbx
je 0xd1301
movq 0x18(%rsp), %rax
leaq 0x1(%rax), %rcx
cmpq $0x3, %rcx
movl $0x2, %eax
cmovaeq %rcx, %rax
movl $0x1, %ecx
xorl %edx, %edx
movq 0x78(%rsp), %rdi
cmpq %rcx, 0x18(%rsp)
je 0xd12eb
movq (%r9,%rdx,8), %rsi
xorq (%r9,%rcx,8), %rsi
shrq $0x21, %rsi
je 0xd12f9
movq (%r9,%rdx,8), %rsi
shrq $0x21, %rsi
movl %edx, (%rdi,%rsi,4)
movq %rcx, %rdx
incq %rcx
cmpq %rcx, %rax
jne 0xd12d6
movq (%r8), %rax
movq %rax, 0xd0(%rsp)
testq %rax, %rax
je 0xd1b65
movq $0x0, 0x90(%rsp)
xorl %esi, %esi
movq %rbp, 0x38(%rsp)
movq 0x10(%r15), %rax
leaq (%rsi,%rsi,4), %rcx
cmpl $0x0, (%rax,%rcx,8)
movq 0x30(%rsp), %rdx
movq %rsi, 0xd8(%rsp)
js 0xd1b41
leaq (%rax,%rcx,8), %rcx
movl 0x10(%rcx), %eax
testl %eax, %eax
je 0xd1b41
leaq (%rsi,%rsi), %rdi
movq %rcx, 0x98(%rsp)
movq 0x18(%rcx), %rcx
decl %eax
movq (%rcx,%rax,8), %rcx
movq %rcx, %rax
shrq $0x21, %rax
leaq (%rax,%rax,2), %rax
cmpl $0x0, 0xc(%rdx,%rax,8)
movq %rdi, 0xb8(%rsp)
je 0xd1742
shrq $0x20, %rcx
movq %rcx, 0xb0(%rsp)
leaq (%rdx,%rax,8), %r14
movq 0x18(%r15), %rax
movq 0x8(%rax), %rcx
movq 0x28(%rax), %rax
movq %rsi, %rdx
shlq $0x4, %rdx
movq (%rax,%rdx), %rax
movl %eax, %edx
shrq $0x20, %rax
shlq $0x21, %rsi
movq %rsi, 0x80(%rsp)
movl %edi, %esi
orl $0x1, %esi
movl %esi, 0xc4(%rsp)
movq %rdx, 0x40(%rsp)
leaq (,%rdx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
movq %rdx, 0xa0(%rsp)
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %r12
addq $0xc, %r12
xorl %ebx, %ebx
movq (%r14), %rdx
leaq (%rbx,%rbx,4), %rsi
movl 0xc(%rdx,%rsi,8), %edi
leaq (%rdi,%rdi,2), %rcx
movl (%rbp,%rcx,4), %eax
testl %eax, %eax
js 0xd1729
movq 0xc8(%rsp), %r8
movq 0x20(%r8), %r8
cmpl $0x0, (%r8,%rdi,8)
js 0xd1729
leaq (%rdx,%rsi,8), %rdi
movl 0x4(%rdi), %edx
leaq (%rdx,%rdx,2), %rdx
leaq (,%rdx,4), %rdx
addq %rbp, %rdx
leaq (%rbp,%rcx,4), %rcx
movl 0x4(%rdx), %esi
movl (%rdx), %edx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andl %r8d, %edx
subl %edx, %esi
movl 0x4(%rcx), %edx
subl %eax, %edx
leaq 0x1b92f9(%rip), %rax    # 0x28a758
movss 0x158(%rax), %xmm0
movl 0x10(%rsp), %ecx
movl 0x14(%rsp), %r8d
leaq 0x50(%rsp), %r9
callq 0xa159b
testl %eax, %eax
js 0xd1724
movq 0x50(%rsp), %r9
shrq $0x20, %r9
cmpq 0xb0(%rsp), %r9
jne 0xd1724
movl 0x58(%rsp), %edx
movl %edx, %ecx
shrl %ecx
movq 0x78(%rsp), %rax
movl (%rax,%rcx,4), %r13d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %r13
je 0xd1724
movq %rcx, 0x48(%rsp)
movq 0x30(%rsp), %rdi
movq %rbp, %rsi
movl 0x10(%rsp), %ecx
movl 0x14(%rsp), %r8d
leaq 0x50(%rsp), %rax
pushq %rax
movq %rdx, 0x28(%rsp)
pushq %rdx
callq 0xb2ced
addq $0x10, %rsp
testl %eax, %eax
je 0xd1724
movq 0x8(%rsp), %r9
movq (%r9,%r13,8), %rax
shrq $0x21, %rax
movq 0x48(%rsp), %rsi
cmpl %esi, %eax
jne 0xd1bc8
cmpq %r13, 0x18(%rsp)
movq 0x20(%rsp), %rdx
jbe 0xd1729
movl 0x54(%rsp), %eax
movl 0x58(%rsp), %ecx
xorl $0x1, %ecx
movl %ecx, 0x2c(%rsp)
xorl $0x1, %eax
movq %rax, 0x88(%rsp)
movq (%r9,%r13,8), %rbp
movq %rbp, %rax
shrq $0x21, %rax
cmpl %esi, %eax
jne 0xd173b
movq %rbp, %rax
shrq $0x20, %rax
cmpl %edx, %eax
jne 0xd170f
movl %ebp, %eax
cmpq %rax, 0xb8(%rsp)
je 0xd170f
cmpq $0x0, 0x40(%rsp)
movq 0xa0(%rsp), %rcx
je 0xd158e
xorl %eax, %eax
cmpl $0x0, (%r12,%rax)
js 0xd1585
cmpl %ebp, -0x4(%r12,%rax)
je 0xd170f
addq $0x18, %rax
cmpq %rax, %rcx
jne 0xd1573
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl 0x10(%rsp), %ecx
movl 0x14(%rsp), %r8d
movl 0x2c(%rsp), %r9d
leaq 0xe0(%rsp), %rax
pushq %rax
pushq 0x90(%rsp)
callq 0xb2ced
addq $0x10, %rsp
testl %eax, %eax
je 0xd1700
movq 0x70(%rsp), %rax
movq (%rax), %r15
movl 0x4(%r15), %ecx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %ecx
movl (%r15), %eax
cmpl %eax, %ecx
jne 0xd1606
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x10, %eax
cmovel %eax, %ecx
movl %ecx, (%r15)
movq 0x8(%r15), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2370
movq %rax, 0x8(%r15)
movq 0x8(%r15), %rax
movl 0x4(%r15), %ecx
movl %ecx, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
leal 0x1(%rcx), %esi
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl %edi, %esi
andl $0x80000000, %ecx       # imm = 0x80000000
orl %esi, %ecx
movl %ecx, 0x4(%r15)
leaq (%rdx,%rdx,2), %rcx
movups 0x50(%rsp), %xmm0
movups %xmm0, (%rax,%rcx,8)
movq 0x60(%rsp), %rdx
movq %rdx, 0x10(%rax,%rcx,8)
movl (%rax,%rcx,8), %edx
orq 0x80(%rsp), %rdx
movq %rdx, (%rax,%rcx,8)
movl %ebp, 0x8(%rax,%rcx,8)
movl 0x4(%r15), %ecx
andl %edi, %ecx
movl (%r15), %eax
cmpl %eax, %ecx
jne 0xd1688
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x10, %eax
cmovel %eax, %ecx
movl %ecx, (%r15)
movq 0x8(%r15), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2370
movq %rax, 0x8(%r15)
movq 0x8(%r15), %rax
movl 0x4(%r15), %ecx
movl %ecx, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
leal 0x1(%rcx), %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %esi, %ecx
movl %ecx, 0x4(%r15)
leaq (%rdx,%rdx,2), %rcx
movups 0xe0(%rsp), %xmm0
movups %xmm0, (%rax,%rcx,8)
movq 0xf0(%rsp), %rdx
movq %rdx, 0x10(%rax,%rcx,8)
movl (%rax,%rcx,8), %edx
shlq $0x20, %rbp
orq %rdx, %rbp
movabsq $0x100000000, %rdx      # imm = 0x100000000
xorq %rdx, %rbp
movq %rbp, (%rax,%rcx,8)
movl 0xc4(%rsp), %edx
movl %edx, 0x8(%rax,%rcx,8)
incq 0x90(%rsp)
movq 0xa8(%rsp), %r15
movq 0x8(%rsp), %r9
movq 0x20(%rsp), %rdx
movq 0x48(%rsp), %rsi
incq %r13
cmpq 0x18(%rsp), %r13
movq 0x38(%rsp), %rbp
jne 0xd152f
jmp 0xd1729
movq 0x8(%rsp), %r9
incq %rbx
movl 0xc(%r14), %eax
cmpq %rax, %rbx
jb 0xd13f6
jmp 0xd1742
movq 0x38(%rsp), %rbp
jmp 0xd1729
movq 0x98(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
movq %rax, 0xb0(%rsp)
shrq $0x21, %rax
leaq (%rax,%rax,2), %rax
movq 0x30(%rsp), %rcx
cmpl $0x0, 0xc(%rcx,%rax,8)
je 0xd1b41
movq 0xb8(%rsp), %rdx
movq %rdx, %rsi
orq $0x1, %rsi
leaq (%rcx,%rax,8), %r14
movq 0x18(%r15), %rax
movq 0x8(%rax), %rcx
movq 0x28(%rax), %rax
movq 0x8(%rax,%rdx,8), %rax
movl %eax, %edx
shrq $0x20, %rax
movq %rsi, 0x48(%rsp)
shlq $0x20, %rsi
movq %rsi, 0x80(%rsp)
movq %rdx, 0xa0(%rsp)
leaq (,%rdx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
movq %rdx, 0x98(%rsp)
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %r13
addq $0xc, %r13
xorl %r12d, %r12d
movq (%r14), %rdx
leaq (%r12,%r12,4), %rsi
movl 0xc(%rdx,%rsi,8), %edi
leaq (%rdi,%rdi,2), %rcx
movl (%rbp,%rcx,4), %eax
testl %eax, %eax
js 0xd1b28
movq 0xc8(%rsp), %r8
movq 0x20(%r8), %r8
cmpl $0x0, (%r8,%rdi,8)
js 0xd1b28
leaq (%rdx,%rsi,8), %rdi
movl 0x4(%rdi), %edx
leaq (%rdx,%rdx,2), %rdx
leaq (,%rdx,4), %rdx
addq %rbp, %rdx
leaq (%rbp,%rcx,4), %rcx
movl 0x4(%rdx), %esi
movl (%rdx), %edx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andl %r8d, %edx
subl %edx, %esi
movl 0x4(%rcx), %edx
subl %eax, %edx
leaq 0x1b8f18(%rip), %rax    # 0x28a758
movss 0x158(%rax), %xmm0
movl 0x10(%rsp), %ecx
movl 0x14(%rsp), %r8d
leaq 0x50(%rsp), %r9
callq 0xa159b
testl %eax, %eax
js 0xd1b23
movq 0x50(%rsp), %r9
movq %r9, %rax
xorq 0xb0(%rsp), %rax
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
andq %rcx, %rax
movabsq $0x100000000, %rcx      # imm = 0x100000000
cmpq %rcx, %rax
jne 0xd1b23
movl 0x58(%rsp), %edx
movl %edx, %ecx
shrl %ecx
movq 0x78(%rsp), %rax
movl (%rax,%rcx,4), %ebx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %rbx
je 0xd1b23
movq %rcx, 0x20(%rsp)
shrq $0x20, %r9
movq 0x30(%rsp), %rdi
movq %rbp, %rsi
movl 0x10(%rsp), %ecx
movl 0x14(%rsp), %r8d
leaq 0x50(%rsp), %rax
pushq %rax
movq %rdx, 0x48(%rsp)
pushq %rdx
callq 0xb2ced
addq $0x10, %rsp
testl %eax, %eax
je 0xd1b23
movq 0x8(%rsp), %r9
movq (%r9,%rbx,8), %rax
shrq $0x21, %rax
movq 0x20(%rsp), %rsi
cmpl %esi, %eax
jne 0xd1ba9
cmpq %rbx, 0x18(%rsp)
movq 0x40(%rsp), %rdx
jbe 0xd1b28
movl 0x54(%rsp), %eax
movl 0x58(%rsp), %ecx
xorl $0x1, %ecx
movl %ecx, 0x2c(%rsp)
xorl $0x1, %eax
movq %rax, 0x88(%rsp)
movq (%r9,%rbx,8), %rbp
movq %rbp, %rax
shrq $0x21, %rax
cmpl %esi, %eax
jne 0xd1b3a
movq %rbp, %rax
shrq $0x20, %rax
cmpl %edx, %eax
jne 0xd1b0e
movl %ebp, %eax
cmpq %rax, 0x48(%rsp)
je 0xd1b0e
cmpq $0x0, 0xa0(%rsp)
movq 0x98(%rsp), %rcx
je 0xd198c
xorl %eax, %eax
cmpl $0x0, (%r13,%rax)
js 0xd1983
cmpl %ebp, -0x4(%r13,%rax)
je 0xd1b0e
addq $0x18, %rax
cmpq %rax, %rcx
jne 0xd1970
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl 0x10(%rsp), %ecx
movl 0x14(%rsp), %r8d
movl 0x2c(%rsp), %r9d
leaq 0xe0(%rsp), %rax
pushq %rax
pushq 0x90(%rsp)
callq 0xb2ced
addq $0x10, %rsp
testl %eax, %eax
je 0xd1aff
movq 0x70(%rsp), %rax
movq (%rax), %r15
movl 0x4(%r15), %ecx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %ecx
movl (%r15), %eax
cmpl %eax, %ecx
jne 0xd1a04
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x10, %eax
cmovel %eax, %ecx
movl %ecx, (%r15)
movq 0x8(%r15), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2370
movq %rax, 0x8(%r15)
movq 0x8(%r15), %rax
movl 0x4(%r15), %ecx
movl %ecx, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
leal 0x1(%rcx), %esi
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl %edi, %esi
andl $0x80000000, %ecx       # imm = 0x80000000
orl %esi, %ecx
movl %ecx, 0x4(%r15)
leaq (%rdx,%rdx,2), %rcx
movups 0x50(%rsp), %xmm0
movups %xmm0, (%rax,%rcx,8)
movq 0x60(%rsp), %rdx
movq %rdx, 0x10(%rax,%rcx,8)
movl (%rax,%rcx,8), %edx
orq 0x80(%rsp), %rdx
movq %rdx, (%rax,%rcx,8)
movl %ebp, 0x8(%rax,%rcx,8)
movl 0x4(%r15), %ecx
andl %edi, %ecx
movl (%r15), %eax
cmpl %eax, %ecx
jne 0xd1a86
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x10, %eax
cmovel %eax, %ecx
movl %ecx, (%r15)
movq 0x8(%r15), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2370
movq %rax, 0x8(%r15)
movq 0x8(%r15), %rax
movl 0x4(%r15), %ecx
movl %ecx, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
leal 0x1(%rcx), %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %esi, %ecx
movl %ecx, 0x4(%r15)
leaq (%rdx,%rdx,2), %rcx
movups 0xe0(%rsp), %xmm0
movups %xmm0, (%rax,%rcx,8)
movq 0xf0(%rsp), %rdx
movq %rdx, 0x10(%rax,%rcx,8)
movl (%rax,%rcx,8), %edx
shlq $0x20, %rbp
orq %rdx, %rbp
movabsq $0x100000000, %rdx      # imm = 0x100000000
xorq %rdx, %rbp
movq %rbp, (%rax,%rcx,8)
movq 0xb8(%rsp), %rdx
movl %edx, 0x8(%rax,%rcx,8)
incq 0x90(%rsp)
movq 0xa8(%rsp), %r15
movq 0x8(%rsp), %r9
movq 0x40(%rsp), %rdx
movq 0x20(%rsp), %rsi
incq %rbx
cmpq 0x18(%rsp), %rbx
movq 0x38(%rsp), %rbp
jne 0xd192c
jmp 0xd1b28
movq 0x8(%rsp), %r9
incq %r12
movl 0xc(%r14), %eax
cmpq %rax, %r12
jb 0xd17d7
jmp 0xd1b41
movq 0x38(%rsp), %rbp
jmp 0xd1b28
movq 0xd8(%rsp), %rsi
incq %rsi
cmpq 0xd0(%rsp), %rsi
jne 0xd1328
cmpq $0x0, 0x90(%rsp)
jne 0xd1b8e
movq %r9, %rdi
callq 0x2220
movq 0x78(%rsp), %rdi
callq 0x2220
movq 0x68(%rsp), %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x70(%rsp), %rdi
movl 0x130(%rsp), %esi
movq %r15, %rdx
callq 0x10ea4
movq 0x8(%rsp), %r9
jmp 0xd1b65
leaq 0x15980a(%rip), %rdi    # 0x22b3ba
leaq 0x1580ea(%rip), %rsi    # 0x229ca1
leaq 0x159816(%rip), %rcx    # 0x22b3d4
movl $0x4d0b, %edx           # imm = 0x4D0B
callq 0x2110
leaq 0x1597eb(%rip), %rdi    # 0x22b3ba
leaq 0x1580cb(%rip), %rsi    # 0x229ca1
leaq 0x1597f7(%rip), %rcx    # 0x22b3d4
movl $0x4ce2, %edx           # imm = 0x4CE2
callq 0x2110