// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: asg_arc_cut_length(asg_t*, asg64_v*, int, float, float, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, ma_hit_t_alloc*, R_to_U*, unsigned int*)
void asg_arc_cut_length(asg_t *g, asg64_v *in, int32_t max_ext, float len_rat, float ou_rat, uint32_t is_ou, uint32_t is_trio, 
uint32_t is_topo, uint32_t min_diff, uint32_t min_ou, ma_hit_t_alloc *rev, R_to_U* rI, uint32_t *max_drop_len)
{
    asg64_v tx = {0,0,0}, *b = NULL;
    uint32_t i, k, v, w, n_vtx = g->n_seq<<1, nv, nw, kv, kw, trioF = (uint32_t)-1, ntrioF = (uint32_t)-1, ol_max, ou_max, to_del, cnt = 0, mm_ol, mm_ou;
    asg_arc_t *av, *aw, *ve, *we, *vl_max, *wl_max;

    if(in) b = in;
    else b = &tx;
	b->n = 0;

    for (v = 0; v < n_vtx; ++v) {
        // if((v>>1)==17078) fprintf(stderr, "[M::%s::] v:%u, del:%u, seq_vis:%u\n", __func__, v, g->seq[v>>1].del, g->seq_vis[v]);
        if (g->seq[v>>1].del) continue;
        if(g->seq_vis[v] == 0) {
            av = asg_arc_a(g, v); nv = asg_arc_n(g, v);
            if (nv < 2) continue;

            for (i = kv = 0; i < nv; ++i) {
                if(av[i].del) continue;
                kv++;
            }
            if(kv < 2) continue;

            for (i = 0; i < nv; ++i) {
                if(av[i].del) continue;
                // if((av[i].ul>>33)==287) {
                //     fprintf(stderr, "++++++%.*s(%c)\t%.*s(%c)\tol:%u\tou:%u\n", 
                //     (int32_t)Get_NAME_LENGTH(R_INF, (av[i].ul>>33)), Get_NAME(R_INF, (av[i].ul>>33)), "+-"[(av[i].ul>>32)&1], 
                //     (int32_t)Get_NAME_LENGTH(R_INF, (av[i].v>>1)), Get_NAME(R_INF, (av[i].v>>1)), "+-"[av[i].v&1], av[i].ol, av[i].ou);
                // }
                if(max_drop_len && av[i].ol >= (*max_drop_len)) continue;
                kv_push(uint64_t, *b, (((uint64_t)av[i].ol)<<32) | ((uint64_t)(av-g->arc+i)));   
            }
        }
	}

    if(rev && rI) memset(g->seq_vis, 0, g->n_seq*2*sizeof(uint8_t));
    radix_sort_srt64(b->a, b->a + b->n);
    for (k = 0; k < b->n; k++) {
        if(g->arc[(uint32_t)b->a[k]].del) continue;

        v = g->arc[(uint32_t)b->a[k]].ul>>32; w = g->arc[(uint32_t)b->a[k]].v^1;
        if(g->seq[v>>1].del || g->seq[w>>1].del) continue;
        nv = asg_arc_n(g, v); nw = asg_arc_n(g, w);
        av = asg_arc_a(g, v); aw = asg_arc_a(g, w);
        if(nv<=1 && nw <= 1) continue;

        if(is_trio) {
            if(get_arcs(g, v, NULL, 0)<=1 && get_arcs(g, w, NULL, 0)<=1) continue;///speedup
            trioF = get_tip_trio_infor(g, v^1);
            ntrioF = (trioF==FATHER? MOTHER : (trioF==MOTHER? FATHER : (uint32_t)-1));
        }

        ve = &(g->arc[(uint32_t)b->a[k]]);
        for (i = 0; i < nw; ++i) {
            if (aw[i].v == (v^1)) {
                we = &(aw[i]);
                break;
            }
        }
        ///mm_ol and mm_ou are used to make edge with long indel more easy to be cutted
        mm_ol = MIN(ve->ol, we->ol); mm_ou = MIN(ve->ou, we->ou);

        for (i = kv = ol_max = ou_max = 0, /**ve =**/ vl_max = NULL; i < nv; ++i) {
            if(av[i].del) continue;
            // if(av[i].v == (w^1)) ve = &(av[i]);
            // if((av[i].ul>>33)==287) {
            //     fprintf(stderr, "++++++%.*s(%c)\t%.*s(%c)\tol:%u\tou:%u\n", 
            //     (int32_t)Get_NAME_LENGTH(R_INF, (av[i].ul>>33)), Get_NAME(R_INF, (av[i].ul>>33)), "+-"[(av[i].ul>>32)&1], 
            //     (int32_t)Get_NAME_LENGTH(R_INF, (av[i].v>>1)), Get_NAME(R_INF, (av[i].v>>1)), "+-"[av[i].v&1], av[i].ol, av[i].ou);
            // }
            kv++;
            if(is_trio && get_tip_trio_infor(g, av[i].v) == ntrioF) continue;
            if(ol_max < av[i].ol) ol_max = av[i].ol, vl_max = &(av[i]);
            if(ou_max < av[i].ou) ou_max = av[i].ou;
        }
        if (kv < 1) continue;
        if (kv >= 2) {
            if (mm_ol > ol_max*len_rat) continue;
            if (is_ou && mm_ou > ou_max*ou_rat && mm_ou > min_ou) continue;
            if ((mm_ol + min_diff) > ol_max) continue;
        }
        

        for (i = kw = ol_max = ou_max = 0, wl_max = NULL; i < nw; ++i) {
            if(aw[i].del) continue;
            kw++;
            if(is_trio && get_tip_trio_infor(g, aw[i].v) == ntrioF) continue;
            if(ol_max < aw[i].ol) ol_max = aw[i].ol, wl_max = &(aw[i]);
            if(ou_max < aw[i].ou) ou_max = aw[i].ou;
        }
        if (kw < 1) continue;
        if (kw >= 2) {
            if (mm_ol > ol_max*len_rat) continue;
            if (is_ou && mm_ou > ou_max*ou_rat && mm_ou > min_ou) continue;
            if ((mm_ol + min_diff) > ol_max) continue;
        }

        if (kv <= 1 && kw <= 1) continue;

        to_del = 0;
        if(is_topo) {
            if (kv > 1 && kw > 1) {
                to_del = 1;
            } else if (kw == 1) {
                if (asg_topocut_aux(g, w^1, max_ext) < max_ext) to_del = 1;
            } else if (kv == 1) {
                if (asg_topocut_aux(g, v^1, max_ext) < max_ext) to_del = 1;
            }
        }

        if(rev && rI) {
            if((to_del == 0) && vl_max && (ve->v!=vl_max->v) && (trans_path_check(ve->v, vl_max->v, g, rev, rI, max_ext, b)==0)) {
                to_del = 1;
            }
            if((to_del == 0) && wl_max && (we->v!=wl_max->v) && (trans_path_check(we->v, wl_max->v, g, rev, rI, max_ext, b)==0)) {
                to_del = 1;
            }
            if(vl_max && wl_max) assert(ve->v!=vl_max->v||we->v!=wl_max->v);
        }
        

        if (to_del) {
            ve->del = we->del = 1, ++cnt;
        }
    }
    // stats_sysm(g);
    if(!in) free(tx.a);
    if (cnt > 0) asg_cleanup(g);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %r9d, 0x94(%rsp)
movl %r8d, 0x44(%rsp)
movl %ecx, 0x60(%rsp)
movss %xmm1, 0x5c(%rsp)
movss %xmm0, 0x68(%rsp)
movl %edx, 0x40(%rsp)
xorps %xmm0, %xmm0
leaq 0xa0(%rsp), %r8
movaps %xmm0, (%r8)
xorl %ecx, %ecx
movq %rcx, 0x10(%r8)
movq %rdi, 0x10(%rsp)
movl 0x14(%rdi), %eax
addl %eax, %eax
testq %rsi, %rsi
movq %rsi, 0x98(%rsp)
cmovneq %rsi, %r8
movq %rcx, (%r8)
testl %eax, %eax
movq %r8, 0x28(%rsp)
je 0x1f2f3c
movq 0x110(%rsp), %rbp
movl %eax, %r10d
xorl %r12d, %r12d
movabsq $-0x5555555555555555, %r11 # imm = 0xAAAAAAAAAAAAAAAB
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rax
movl %r12d, %ecx
shrl %ecx
cmpl $0x0, (%rax,%rcx,8)
js 0x1f2e1a
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rax
cmpb $0x0, (%rax,%r12)
je 0x1f2e27
incq %r12
cmpq %r10, %r12
jne 0x1f2df6
jmp 0x1f2f3c
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
movq (%rax,%r12,8), %rax
testl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
je 0x1f2e1a
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq %rax, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rcx,%rdx,8), %rbx
movl %eax, %r13d
leaq (%rcx,%rdx,8), %r15
addq $0xc, %r15
xorl %eax, %eax
movq %r13, %rdx
movq %r15, %rsi
movl (%rsi), %edi
notl %edi
shrl $0x1f, %edi
addl %edi, %eax
addq $0x18, %rsi
decq %rdx
jne 0x1f2e66
cmpl $0x2, %eax
jb 0x1f2e1a
xorl %r14d, %r14d
movq %rbx, 0x38(%rsp)
movq %r13, 0x50(%rsp)
movl (%r15), %edx
testl %edx, %edx
js 0x1f2f27
testq %rbp, %rbp
je 0x1f2ea3
cmpl (%rbp), %edx
jae 0x1f2f27
movq (%r8), %rdi
movq 0x10(%r8), %rax
cmpq 0x8(%r8), %rdi
jne 0x1f2efe
leaq (%rdi,%rdi), %rsi
testq %rdi, %rdi
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r8)
shlq $0x3, %rsi
movq %rax, %rdi
movq %r10, %rbx
movq %r11, %r13
callq 0x2370
movq %r13, %r11
movq 0x50(%rsp), %r13
movq %rbx, %r10
movq 0x38(%rsp), %rbx
movq 0x28(%rsp), %r8
movq %rax, 0x10(%r8)
movl (%r15), %edx
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq (%r8), %rdi
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
shlq $0x20, %rdx
movq %rbx, %rsi
subq %rcx, %rsi
sarq $0x3, %rsi
imulq %r11, %rsi
addq %r14, %rsi
orq %rdx, %rsi
leaq 0x1(%rdi), %rdx
movq %rdx, (%r8)
movq %rsi, (%rax,%rdi,8)
incq %r14
addq $0x18, %r15
cmpq %r14, %r13
jne 0x1f2e8a
jmp 0x1f2e1a
cmpq $0x0, 0x100(%rsp)
setne %al
cmpq $0x0, 0x108(%rsp)
setne %bl
andb %al, %bl
cmpb $0x1, %bl
jne 0x1f2f75
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rdi
movl 0x14(%rax), %edx
addl %edx, %edx
xorl %esi, %esi
callq 0x20e0
movq 0x28(%rsp), %r8
movq 0x10(%r8), %rdi
movq (%r8), %rax
leaq (%rdi,%rax,8), %rsi
callq 0x1ee586
movq 0x28(%rsp), %r8
cmpq $0x0, (%r8)
je 0x1f358e
movb %bl, 0x1f(%rsp)
movl $0xffffffff, 0x50(%rsp) # imm = 0xFFFFFFFF
xorl %r14d, %r14d
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl $0x0, 0x64(%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %r15
movq 0x10(%r8), %rax
movl (%rax,%r14,8), %eax
leaq (%rax,%rax,2), %rdx
cmpl $0x0, 0xc(%r15,%rdx,8)
js 0x1f337c
movq (%r15,%rdx,8), %rdi
movq 0x10(%rsp), %rcx
movq 0x20(%rcx), %rcx
movq %rdi, %rsi
shrq $0x21, %rsi
cmpl $0x0, (%rcx,%rsi,8)
js 0x1f337c
movl 0x8(%r15,%rdx,8), %r9d
movl %r9d, %edx
shrl %edx
cmpl $0x0, (%rcx,%rdx,8)
js 0x1f337c
shrq $0x20, %rdi
movq %r9, %rcx
xorq $0x1, %rcx
movq 0x10(%rsp), %rdx
movq 0x28(%rdx), %rdx
movq (%rdx,%rdi,8), %r10
movq (%rdx,%rcx,8), %rbx
cmpl $0x1, %r10d
ja 0x1f302f
cmpl $0x2, %ebx
jb 0x1f337c
movq %rdi, 0x88(%rsp)
movq %r10, %r11
shrq $0x20, %r11
movq %rbx, 0x30(%rsp)
shrq $0x20, %rbx
cmpl $0x0, 0x44(%rsp)
je 0x1f3119
movq %r10, %rax
andq %r13, %rax
je 0x1f307e
xorl %ecx, %ecx
movq %r11, %rdx
movl %edx, %esi
leaq (%rsi,%rsi,2), %rsi
movl 0xc(%r15,%rsi,8), %esi
notl %esi
shrl $0x1f, %esi
addl %esi, %ecx
incq %rdx
decq %rax
jne 0x1f305f
cmpl $0x1, %ecx
ja 0x1f30b4
movq 0x30(%rsp), %rax
andq %r13, %rax
je 0x1f337c
xorl %ecx, %ecx
movq %rbx, %rdx
movl %edx, %esi
leaq (%rsi,%rsi,2), %rsi
movl 0xc(%r15,%rsi,8), %esi
notl %esi
shrl $0x1f, %esi
addl %esi, %ecx
incq %rdx
decq %rax
jne 0x1f3091
cmpl $0x2, %ecx
jb 0x1f337c
movq %r9, 0x80(%rsp)
movq 0x88(%rsp), %rax
movl %eax, %esi
xorl $0x1, %esi
movq 0x10(%rsp), %rbp
movq %rbp, %rdi
movq %r10, %r12
movq %r11, %r13
callq 0xac87a
movq %r13, %r11
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movq %r12, %r10
movq 0x28(%rsp), %r8
xorl %ecx, %ecx
cmpb $0x2, %al
sete %cl
cmpb $0x1, %al
leal -0x1(%rcx,%rcx), %ecx
movl $0x2, %eax
cmovel %eax, %ecx
movl %ecx, 0x50(%rsp)
movq 0x8(%rbp), %rcx
movq 0x10(%r8), %rax
movq %r14, 0x20(%rsp)
movl (%rax,%r14,8), %eax
jmp 0x1f3129
movq %r14, 0x20(%rsp)
movq %r9, 0x80(%rsp)
movq %r15, %rcx
leaq (%rbx,%rbx,2), %rdx
leaq (%r15,%rdx,8), %r12
movq 0x30(%rsp), %rdx
testl %edx, %edx
je 0x1f3162
movl %edx, %edx
movq %r12, %rsi
movq 0x88(%rsp), %r9
movl 0x8(%rsi), %edi
xorl %r9d, %edi
cmpl $0x1, %edi
je 0x1f315d
addq $0x18, %rsi
decq %rdx
jne 0x1f3147
jmp 0x1f3162
movq %rsi, 0x70(%rsp)
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rsi
movl 0xc(%rsi), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %eax
movq 0x70(%rsp), %rdx
movl 0xc(%rdx), %edi
andl %ecx, %edi
cmpl %edi, %eax
cmovbl %eax, %edi
movq %rdi, 0x48(%rsp)
movzwl 0x10(%rsi), %eax
movl $0x3fff, %ecx           # imm = 0x3FFF
andl %ecx, %eax
movzwl 0x10(%rdx), %edx
andl %ecx, %edx
cmpw %dx, %ax
cmovbl %eax, %edx
movl %edx, 0x6c(%rsp)
testl %r10d, %r10d
je 0x1f3377
movq %rsi, 0x78(%rsp)
leaq (%r11,%r11,2), %rax
leaq (%r15,%rax,8), %r15
movl %r10d, %ebp
movq $0x0, 0x38(%rsp)
xorl %r13d, %r13d
xorl %ebx, %ebx
xorl %r14d, %r14d
movl 0xc(%r15), %eax
testl %eax, %eax
js 0x1f322f
incl %r14d
cmpl $0x0, 0x44(%rsp)
je 0x1f3206
movl 0x8(%r15), %esi
movq 0x10(%rsp), %rdi
callq 0xac87a
movzbl %al, %eax
cmpl %eax, 0x50(%rsp)
jne 0x1f31fd
movq 0x28(%rsp), %r8
jmp 0x1f322f
movl 0xc(%r15), %eax
movq 0x28(%rsp), %r8
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl %eax, %ebx
cmovbel %eax, %ebx
movq 0x38(%rsp), %rax
cmovbq %r15, %rax
movq %rax, 0x38(%rsp)
movzwl 0x10(%r15), %eax
andl $0x3fff, %eax           # imm = 0x3FFF
cmpl %eax, %r13d
cmovbel %eax, %r13d
addq $0x18, %r15
decq %rbp
jne 0x1f31cd
testl %r14d, %r14d
je 0x1f3371
cmpl $0x1, %r14d
je 0x1f32b1
cvtsi2ssl 0x48(%rsp), %xmm0
cvtsi2ss %ebx, %xmm1
mulss 0x68(%rsp), %xmm1
ucomiss %xmm1, %xmm0
ja 0x1f3371
cmpl $0x0, 0x60(%rsp)
je 0x1f329b
xorps %xmm0, %xmm0
cvtsi2ss %r13d, %xmm0
movl 0x6c(%rsp), %ecx
movswl %cx, %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
mulss 0x5c(%rsp), %xmm0
ucomiss %xmm0, %xmm1
seta %al
cmpl 0xf8(%rsp), %ecx
seta %cl
testb %cl, %al
jne 0x1f3371
movl 0xf0(%rsp), %eax
movq 0x48(%rsp), %rcx
addl %ecx, %eax
cmpl %ebx, %eax
ja 0x1f3371
movq 0x30(%rsp), %rax
testl %eax, %eax
je 0x1f3371
movl %r14d, 0x30(%rsp)
movl %eax, %r15d
xorl %r11d, %r11d
xorl %ebp, %ebp
xorl %r13d, %r13d
xorl %r14d, %r14d
movl 0xc(%r12), %eax
testl %eax, %eax
js 0x1f3336
incl %r14d
cmpl $0x0, 0x44(%rsp)
je 0x1f3316
movq %r11, %rbx
movl 0x8(%r12), %esi
movq 0x10(%rsp), %rdi
callq 0xac87a
movzbl %al, %eax
cmpl %eax, 0x50(%rsp)
jne 0x1f3309
movq 0x28(%rsp), %r8
movq %rbx, %r11
jmp 0x1f3336
movl 0xc(%r12), %eax
movq 0x28(%rsp), %r8
movq %rbx, %r11
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl %eax, %r13d
cmovbel %eax, %r13d
cmovbq %r12, %r11
movzwl 0x10(%r12), %eax
andl $0x3fff, %eax           # imm = 0x3FFF
cmpl %eax, %ebp
cmovbel %eax, %ebp
addq $0x18, %r12
decq %r15
jne 0x1f32d1
testl %r14d, %r14d
movl %r14d, %eax
movq 0x20(%rsp), %r14
je 0x1f33b1
movl %eax, %edi
cmpl $0x1, %eax
jne 0x1f338d
cmpl $0x1, 0x30(%rsp)
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movq 0x80(%rsp), %rsi
je 0x1f337c
movb $0x1, %dl
xorl %ecx, %ecx
jmp 0x1f3416
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movq 0x20(%rsp), %r14
incl %r14d
cmpq %r14, (%r8)
ja 0x1f2fb1
jmp 0x1f3584
xorps %xmm0, %xmm0
cvtsi2ssl 0x48(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %r13d, %xmm1
mulss 0x68(%rsp), %xmm1
ucomiss %xmm1, %xmm0
movq 0x80(%rsp), %rsi
jbe 0x1f33b9
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
jmp 0x1f337c
cmpl $0x0, 0x60(%rsp)
je 0x1f33ef
xorps %xmm0, %xmm0
cvtsi2ss %ebp, %xmm0
movl 0x6c(%rsp), %ecx
movswl %cx, %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
mulss 0x5c(%rsp), %xmm0
ucomiss %xmm0, %xmm1
seta %al
cmpl 0xf8(%rsp), %ecx
seta %cl
testb %cl, %al
jne 0x1f33b1
movl 0xf0(%rsp), %eax
movq 0x48(%rsp), %rcx
addl %eax, %ecx
cmpl %r13d, %ecx
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
ja 0x1f337c
cmpl $0x1, 0x30(%rsp)
sete %cl
xorl %edx, %edx
movb $0x1, %al
cmpl $0x0, 0x94(%rsp)
movq 0x88(%rsp), %r9
movq 0x78(%rsp), %rbx
je 0x1f344d
cmpl $0x1, 0x30(%rsp)
setne %r10b
cmpl $0x1, %edi
setne %dil
testb %dil, %r10b
je 0x1f3451
movl $0x1, %ecx
xorl %eax, %eax
jmp 0x1f348e
xorl %ecx, %ecx
jmp 0x1f348e
movq %r11, %r15
testb %dl, %dl
jne 0x1f3463
testb %cl, %cl
je 0x1f3484
xorl $0x1, %r9d
movl %r9d, %esi
movq 0x10(%rsp), %rdi
movl 0x40(%rsp), %ebx
movl %ebx, %edx
callq 0xab75d
movq 0x28(%rsp), %r8
xorl %ecx, %ecx
cmpl %ebx, %eax
setge %al
setl %cl
jmp 0x1f3486
xorl %ecx, %ecx
movq 0x78(%rsp), %rbx
movq %r15, %r11
cmpb $0x0, 0x1f(%rsp)
je 0x1f3566
cmpq $0x0, 0x38(%rsp)
setne %dl
andb %dl, %al
cmpb $0x1, %al
jne 0x1f34ee
movl 0x8(%rbx), %edi
movq 0x38(%rsp), %rax
movl 0x8(%rax), %esi
xorl %ecx, %ecx
cmpl %esi, %edi
je 0x1f34ee
movq %r8, (%rsp)
movq 0x10(%rsp), %rdx
movq 0x100(%rsp), %rcx
movq 0x108(%rsp), %r8
movl 0x40(%rsp), %r9d
movq %r11, %r15
callq 0x1f2aa9
movq %r15, %r11
movq 0x28(%rsp), %r8
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
testl %ecx, %ecx
jne 0x1f353e
testq %r11, %r11
je 0x1f353e
movq 0x70(%rsp), %rax
movl 0x8(%rax), %edi
movl 0x8(%r11), %esi
xorl %ecx, %ecx
cmpl %esi, %edi
je 0x1f353e
movq %r8, (%rsp)
movq 0x10(%rsp), %rdx
movq 0x100(%rsp), %rcx
movq 0x108(%rsp), %r8
movl 0x40(%rsp), %r9d
movq %r11, %r15
callq 0x1f2aa9
movq %r15, %r11
movq 0x28(%rsp), %r8
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
cmpq $0x0, 0x38(%rsp)
je 0x1f3566
testq %r11, %r11
je 0x1f3566
movl 0x8(%rbx), %eax
movq 0x38(%rsp), %rdx
cmpl 0x8(%rdx), %eax
jne 0x1f3566
movq 0x70(%rsp), %rax
movl 0x8(%rax), %eax
cmpl 0x8(%r11), %eax
je 0x1f35c8
testl %ecx, %ecx
je 0x1f337c
movq 0x70(%rsp), %rax
orb $-0x80, 0xf(%rax)
orb $-0x80, 0xf(%rbx)
incl 0x64(%rsp)
jmp 0x1f337c
cmpl $0x0, 0x64(%rsp)
sete %bl
jmp 0x1f3590
movb $0x1, %bl
cmpq $0x0, 0x98(%rsp)
jne 0x1f35a8
movq 0xb0(%rsp), %rdi
callq 0x2220
testb %bl, %bl
jne 0x1f35b6
movq 0x10(%rsp), %rdi
callq 0xa0a7d
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5233d(%rip), %rdi     # 0x24590c
leaq 0x52033(%rip), %rsi     # 0x245609
leaq 0x52352(%rip), %rcx     # 0x24592f
movl $0x575, %edx            # imm = 0x575
callq 0x2110