// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: ulg_arc_cut_misjoin(ul_resolve_t*, ma_ug_t*, int, unsigned int, float, unsigned int, unsigned int, unsigned int*, asg64_v*, asg64_v*)
uint32_t ulg_arc_cut_misjoin(ul_resolve_t *uidx, ma_ug_t *ug, int32_t max_ext, uint32_t max_ext_hifi, 
float len_rat, uint32_t is_trio, uint32_t topo_level, uint32_t *max_drop_len, asg64_v *in, asg64_v *ib)
{
    asg64_v tx = {0,0,0}, tb = {0,0,0}, *b = NULL, *ub = NULL; asg_t *g = ug->g;
    uint32_t v, w, i, k, kv, nv, kw, nw, cnt = 0, n_vtx = g->n_seq<<1, mm_ul, ul_max, to_del;
    asg_arc_t *av, *aw, *ve, *we; uint32_t ul_cnt, pb;

    b = (in?(in):(&tx)); ub = (ib?(ib):(&tb));
    for (v = b->n = 0; v < n_vtx; ++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, ul_max = -1; i < nv; ++i) {
                if(av[i].del) continue; kv++;
                get_ul_path_info(uidx, ug, av[i].v, NULL, NULL, &ul_cnt, NULL, NULL, NULL);
                if(ul_cnt > ul_max) ul_max = ul_cnt;
            }
            // if((v>>1) == 5958) {
            //     fprintf(stderr, "[M::%s::] v>>1::%u, v&1::%u, kv::%u, ul_max::%u\n", 
            //     __func__, v>>1, v&1, kv, ul_max);
            // }
            if(kv < 2 || ul_max == 0) continue; //note: ul_cnt/ul_max might be 0

            for (i = 0; i < nv; ++i) {
                if(av[i].del) continue;
                get_ul_path_info(uidx, ug, av[i].v, NULL, NULL, &ul_cnt, NULL, NULL, NULL);
                // if((v>>1) == 5958) {
                //     fprintf(stderr, "+++[M::%s::] v>>1::%u, v&1::%u, av[i].v>>1::%u, av[i].v&1::%u, ul_cnt::%u\n", 
                //     __func__, v>>1, v&1, av[i].v>>1, av[i].v&1, ul_cnt);
                // }
                if(ul_cnt > 0) ul_cnt = ul_max/ul_cnt;
                else ul_cnt = ul_max<<2;
                ul_cnt = ((uint32_t)-1) - ul_cnt;
                kv_push(uint64_t, *b, (((uint64_t)ul_cnt)<<32) | ((uint64_t)(av-g->arc+i)));
            }
        }
    }

    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); av = asg_arc_a(g, v); 
        if(nv<=1 && asg_arc_n(g, w) <= 1) continue;

        ve = &(g->arc[(uint32_t)b->a[k]]); pb = b->n; ub->n = 0;
        get_ul_path_info(uidx, ug, ve->v, NULL, NULL, &mm_ul, NULL, NULL, NULL);
        // if((v>>1) == 5958 && (w>>1) == 11105) {
        //     fprintf(stderr, ">>>[M::%s::] v>>1::%u, v&1::%u, w>>1::%u, w&1::%u, mm_ul::%u\n", 
        //     __func__, v>>1, v&1, w>>1, w&1, mm_ul);
        // }
        if(mm_ul == 0) continue;///no UL read support this path

        for (i = kv = 0; i < nv; ++i) {
            if(av[i].del) continue; 
            kv++;
            if(av[i].v == ve->v) continue;
            get_ul_path_info(uidx, ug, av[i].v, NULL, NULL, &ul_cnt, NULL, NULL, NULL);
            // if((v>>1) == 5958 && (w>>1) == 11105) {
            //     fprintf(stderr, "*[M::%s::i->%u] v>>1::%u, v&1::%u, w>>1::%u, w&1::%u, av[i].v>>1::%u, av[i].v&1::%u, ul_cnt::%u\n", 
            //     __func__, i, v>>1, v&1, w>>1, w&1, av[i].v>>1, av[i].v&1, ul_cnt);
            // }
            if (mm_ul <= ul_cnt*len_rat) {
                ul_cnt = ((uint32_t)-1) - ul_cnt;
                kv_push(uint64_t, *b, (((uint64_t)ul_cnt)<<32)|((uint64_t)(i)));
            }
        }
        if(b->n == pb) continue;
        to_del = 0; assert(kv >= 2); 

        aw = asg_arc_a(g, w); nw = asg_arc_n(g, w);
        for (i = kw = 0, we = NULL; i < nw; ++i) {
            if (aw[i].del) continue;
            if (aw[i].v == (v^1)) we = &(aw[i]);
            kw++;
        }

        if((kv > 1 && kw > 1) || (usg_bridge_topocut_aux(uidx, ug, ve->v, max_ext, max_ext_hifi, topo_level, 0, b, ub))) {
            radix_sort_srt64(b->a + pb, b->a + b->n);
            for (i = pb; i < b->n; i++) {
                // if((v>>1) == 5958 && (w>>1) == 11105) {
                //     fprintf(stderr, "#[M::%s::srt_i->%u] v>>1::%u, v&1::%u, w>>1::%u, w&1::%u, av[(uint32_t)b->a[i]].v>>1::%u, av[(uint32_t)b->a[i]].v&1::%u\n", 
                //     __func__, (uint32_t)b->a[i], v>>1, v&1, w>>1, w&1, av[(uint32_t)b->a[i]].v>>1, av[(uint32_t)b->a[i]].v&1);
                // }
                if(usg_misjoin_topocut_aux(uidx, ug, ve->v, av[(uint32_t)b->a[i]].v, v, b, ub)) {
                    to_del = 1;
                    break;
                }
            }
        }   

        b->n = pb;
        if(to_del) {
            if(kv > 1 && kw > 1) {
                ve->del = we->del = 1; ++cnt;
            } else {
                pb = b->n; 
                get_ul_path_info(uidx, ug, ve->v, NULL, NULL, NULL, NULL, NULL, b);
                for (i = pb; i < b->n; i++) ulg_seq_del(ug, (b->a[i]>>1));
                cnt += b->n - pb; b->n = pb; 
            }
        }
    }


    if(!in) free(tx.a); if(!ib) free(tb.a);
    if (cnt > 0) asg_cleanup(g);
    return cnt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %r9d, 0x98(%rsp)
movss %xmm0, 0x9c(%rsp)
movl %ecx, 0x94(%rsp)
movl %edx, 0x90(%rsp)
movq %rsi, %r13
movq 0x128(%rsp), %rbx
xorps %xmm0, %xmm0
leaq 0xb0(%rsp), %rdx
movaps %xmm0, (%rdx)
xorl %ecx, %ecx
movq %rcx, 0x10(%rdx)
leaq 0xd0(%rsp), %r8
movq %rcx, 0x10(%r8)
movaps %xmm0, (%r8)
movq 0x18(%rsi), %rbp
movl 0x14(%rbp), %eax
addl %eax, %eax
testq %rbx, %rbx
movq %rbx, %r15
cmoveq %rdx, %r15
movq 0x130(%rsp), %rsi
testq %rsi, %rsi
cmovneq %rsi, %r8
movq %r8, 0x88(%rsp)
movq %rdi, 0x50(%rsp)
movq $0x0, 0x58(%rsp)
movq %rcx, (%r15)
movl $0x0, %ecx
testl %eax, %eax
movq %rbp, 0x60(%rsp)
movq %r13, 0x48(%rsp)
movq %rdx, 0x80(%rsp)
movq %r15, 0x28(%rsp)
je 0x20f79c
testq %rbx, %rbx
cmoveq %rdx, %rbx
movl %eax, %eax
movq %rax, 0x40(%rsp)
xorl %r12d, %r12d
movq 0x20(%rbp), %rax
movl %r12d, %ecx
shrl %ecx
cmpl $0x0, (%rax,%rcx,8)
js 0x20f60d
movq 0x30(%rbp), %rax
cmpb $0x0, (%rax,%r12)
je 0x20f61c
incq %r12
cmpq 0x40(%rsp), %r12
jne 0x20f5f3
jmp 0x20f784
movq 0x28(%rbp), %rax
movq (%rax,%r12,8), %rax
testl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
je 0x20f60d
movq 0x8(%rbp), %rcx
movq %rax, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rcx,%rdx,8), %rsi
movq %rsi, 0x70(%rsp)
movl %eax, %r15d
leaq (%rcx,%rdx,8), %r14
addq $0xc, %r14
xorl %r13d, %r13d
movq %r15, 0x30(%rsp)
movq %r14, %rbp
cmpl $0x0, (%rbp)
js 0x20f68e
incl %r13d
movl -0x4(%rbp), %edx
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
leaq 0x1c(%rsp), %r9
callq 0x20d67b
addq $0x18, %rbp
decq %r15
jne 0x20f659
cmpl $0x2, %r13d
movq 0x60(%rsp), %rbp
movq 0x28(%rsp), %r15
jb 0x20f60d
xorl %r13d, %r13d
cmpl $0x0, (%r14)
js 0x20f76d
movl -0x4(%r14), %edx
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
leaq 0x1c(%rsp), %r9
callq 0x20d67b
movl 0x1c(%rsp), %ecx
testl %ecx, %ecx
je 0x20f6fc
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %edx, %edx
divl %ecx
movl %eax, %ecx
notl %ecx
jmp 0x20f701
movl $0x3, %ecx
movl %ecx, 0x1c(%rsp)
movq (%r15), %rdx
movq 0x10(%rbx), %rax
cmpq 0x8(%rbx), %rdx
jne 0x20f73d
leaq (%rdx,%rdx), %rsi
testq %rdx, %rdx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%rbx)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x10(%rbx)
movl 0x1c(%rsp), %ecx
movq (%r15), %rdx
movq 0x70(%rsp), %rsi
subq 0x8(%rbp), %rsi
shlq $0x20, %rcx
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %rdi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdi, %rsi
addq %r13, %rsi
orq %rcx, %rsi
leaq 0x1(%rdx), %rcx
movq %rcx, (%r15)
movq %rsi, (%rax,%rdx,8)
incq %r13
addq $0x18, %r14
cmpq %r13, 0x30(%rsp)
jne 0x20f6ae
jmp 0x20f60d
movq (%r15), %rcx
movq 0x48(%rsp), %r13
movq 0x128(%rsp), %rbx
leaq 0xb0(%rsp), %rdx
testq %rbx, %rbx
cmoveq %rdx, %rbx
movq 0x10(%rbx), %rdi
leaq (%rdi,%rcx,8), %rsi
callq 0x1ee586
movq (%r15), %rcx
movq %rcx, 0x30(%rsp)
testq %rcx, %rcx
je 0x20fd47
movq 0x128(%rsp), %rax
testq %rax, %rax
movq 0x80(%rsp), %rcx
cmovneq %rax, %rcx
movq %rcx, 0x80(%rsp)
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
xorl %eax, %eax
movq $0x0, 0x58(%rsp)
xorl %esi, %esi
movq %rbx, 0xa8(%rsp)
movq 0x8(%rbp), %r15
movq 0x10(%rbx), %rcx
movl (%rcx,%rax,8), %eax
leaq (%rax,%rax,2), %rax
cmpl $0x0, 0xc(%r15,%rax,8)
js 0x20fa03
leaq (%r15,%rax,8), %rdi
movq (%rdi), %r8
movq 0x20(%rbp), %rax
movq %r8, %rcx
shrq $0x21, %rcx
cmpl $0x0, (%rax,%rcx,8)
js 0x20fa03
movl 0x8(%rdi), %edx
movl %edx, %ecx
shrl %ecx
cmpl $0x0, (%rax,%rcx,8)
js 0x20fa03
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
shrq $0x20, %r8
movq %rdx, %rsi
xorq $0x1, %rsi
movq 0x28(%rbp), %rax
movq %r8, 0x70(%rsp)
movq (%rax,%r8,8), %r14
cmpl $0x1, %r14d
ja 0x20f878
testl $0xfffffffe, (%rax,%rsi,8) # imm = 0xFFFFFFFE
je 0x20fa23
movq %rsi, 0x78(%rsp)
movq 0x88(%rsp), %rax
xorl %ecx, %ecx
movq %rcx, (%rax)
movq %rcx, 0x10(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq 0x50(%rsp), %rdi
movq %r13, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
leaq 0x6c(%rsp), %r9
callq 0x20d67b
cmpl $0x0, 0x6c(%rsp)
je 0x20fa23
testl %r14d, %r14d
je 0x20fa2d
movq %r14, %rax
shrq $0x20, %rax
leaq (%rax,%rax,2), %rax
leaq (%r15,%rax,8), %rcx
movq %rcx, 0xa0(%rsp)
movl %r14d, %edi
leaq (%r15,%rax,8), %r15
addq $0xc, %r15
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x40(%rsp), %r14
movq %rdi, 0x20(%rsp)
cmpl $0x0, (%r15)
js 0x20f9d1
incl %ebp
movl -0x4(%r15), %edx
cmpl 0x8(%r14), %edx
je 0x20f9d1
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
leaq 0x1c(%rsp), %r9
callq 0x20d67b
movl 0x6c(%rsp), %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
movl 0x1c(%rsp), %ecx
xorps %xmm1, %xmm1
cvtsi2ss %rcx, %xmm1
mulss 0x9c(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jae 0x20f962
movq 0x20(%rsp), %rdi
jmp 0x20f9d1
notl %ecx
movl %ecx, 0x1c(%rsp)
movq 0x28(%rsp), %r14
movq (%r14), %rdx
movq 0x10(%rbx), %rax
movq 0x80(%rsp), %rdi
cmpq 0x8(%rdi), %rdx
jne 0x20f9ad
leaq (%rdx,%rdx), %rsi
testq %rdx, %rdx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%rdi)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x10(%rbx)
movl 0x1c(%rsp), %ecx
movq (%r14), %rdx
movq 0x20(%rsp), %rdi
shlq $0x20, %rcx
addq %r13, %rcx
leaq 0x1(%rdx), %rsi
movq %rsi, (%r14)
movq %rcx, (%rax,%rdx,8)
movq 0xa8(%rsp), %rbx
movq 0x40(%rsp), %r14
incq %r13
addq $0x18, %r15
cmpq %r13, %rdi
jne 0x20f8f2
movq 0x28(%rsp), %r15
movq (%r15), %rax
movl 0x30(%rsp), %ecx
cmpq %rcx, %rax
movq 0x38(%rsp), %rsi
jne 0x20fa45
movq 0x60(%rsp), %rbp
movq 0x48(%rsp), %r13
jmp 0x20fa08
movq 0x28(%rsp), %r15
incl %esi
movq (%r15), %rdx
movq %rsi, %rax
movq %rdx, 0x30(%rsp)
cmpq %rsi, %rdx
ja 0x20f7fb
jmp 0x20fd47
movq 0x28(%rsp), %r15
jmp 0x20fb93
movl 0x30(%rsp), %eax
movq 0x28(%rsp), %r15
cmpq %rax, (%r15)
movq 0x38(%rsp), %rsi
je 0x20fa08
jmp 0x20fd9c
movq %rcx, 0x20(%rsp)
cmpl $0x1, %ebp
movq 0x60(%rsp), %rsi
movq 0x48(%rsp), %r13
jbe 0x20fd9c
movq 0x28(%rsi), %rcx
movl 0x78(%rsp), %edx
movq (%rcx,%rdx,8), %rdx
testl %edx, %edx
je 0x20faae
movq %rdx, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
addq 0x8(%rsi), %rcx
movl %edx, %edx
xorl %ebp, %ebp
xorl %esi, %esi
cmpl $0x0, 0xc(%rcx)
js 0x20fa9c
movl 0x8(%rcx), %edi
xorl 0x70(%rsp), %edi
cmpl $0x1, %edi
cmoveq %rcx, %rbp
incl %esi
addq $0x18, %rcx
decq %rdx
jne 0x20fa86
movb $0x1, %cl
cmpl $0x1, %esi
jbe 0x20fab0
jmp 0x20fb04
xorl %ebp, %ebp
movl 0x8(%r14), %edx
movq 0x88(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r15, 0x8(%rsp)
movl $0x0, (%rsp)
movq 0x50(%rsp), %rdi
movq %r13, %rsi
movl 0x90(%rsp), %ecx
movl 0x94(%rsp), %r8d
movl 0x98(%rsp), %r9d
callq 0x20d9d3
testl %eax, %eax
movq %r15, %r14
je 0x20fb83
movq (%r14), %rax
xorl %ecx, %ecx
movq %r14, %r15
movl %ecx, 0x78(%rsp)
movq 0x10(%rbx), %rcx
movq 0x20(%rsp), %r14
leaq (%rcx,%r14,8), %rdi
leaq (%rcx,%rax,8), %rsi
callq 0x1ee586
cmpq %r14, (%r15)
movq %r15, %r14
jbe 0x20fb83
movq 0x30(%rsp), %rax
leal 0x1(%rax), %r15d
movq 0x20(%rsp), %rax
movq 0x40(%rsp), %rcx
movl 0x8(%rcx), %edx
movq 0x10(%rbx), %rcx
movl (%rcx,%rax,8), %eax
leaq (%rax,%rax,2), %rax
movq 0xa0(%rsp), %rcx
movl 0x8(%rcx,%rax,8), %ecx
movq 0x88(%rsp), %rax
movq %rax, (%rsp)
movq 0x50(%rsp), %rdi
movq %r13, %rsi
movq 0x70(%rsp), %r8
movq %r14, %r9
callq 0x20f23d
testl %eax, %eax
jne 0x20fb9d
movl %r15d, %eax
incl %r15d
cmpq %rax, (%r14)
ja 0x20fb34
movq 0x20(%rsp), %rax
movq %rax, (%r14)
movq 0x60(%rsp), %rbp
movq %r14, %r15
movq 0x38(%rsp), %rsi
jmp 0x20fa08
movq 0x20(%rsp), %rax
movq %rax, (%r14)
cmpb $0x0, 0x78(%rsp)
movq %r14, %r15
je 0x20fbcd
orb $-0x80, 0xf(%rbp)
movq 0x40(%rsp), %rax
orb $-0x80, 0xf(%rax)
movq 0x58(%rsp), %rax
incl %eax
movq %rax, 0x58(%rsp)
jmp 0x20fd3d
movq %rax, %r14
movq 0x40(%rsp), %rax
movl 0x8(%rax), %edx
movq %r15, 0x10(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq 0x50(%rsp), %rdi
movq %r13, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x20d67b
movq (%r15), %rax
cmpq %r14, %rax
jbe 0x20fd25
movq 0x20(%rsp), %rcx
movq 0x30(%rsp), %r14
movq 0x10(%rbx), %rax
movq (%rax,%rcx,8), %rax
movq %rax, %rcx
shrq %rcx
movq 0x18(%r13), %rdx
movq 0x20(%rdx), %rsi
movl %ecx, %ecx
orl $0x80000000, (%rsi,%rcx,8) # imm = 0x80000000
andl $-0x2, %eax
movb $0x1, %sil
xorl %edi, %edi
orq %rax, %rdi
movq 0x28(%rdx), %r8
movq (%r8,%rdi,8), %r9
movq %r9, %r8
andq %r12, %r8
je 0x20fcc4
shrq $0x20, %r9
leaq (%r9,%r9,2), %r9
shlq $0x3, %r9
addq 0x8(%rdx), %r9
xorl %r10d, %r10d
leaq (%r10,%r10,2), %r11
orb $-0x80, 0xf(%r9,%r11,8)
movl 0x8(%r9,%r11,8), %r11d
xorq $0x1, %r11
movq 0x28(%rdx), %r15
movq (%r15,%r11,8), %r15
movq %r15, %r11
andq %r12, %r11
je 0x20fcbc
movq 0x8(%rdx), %r13
shrq $0x20, %r15
shlq $0x3, %r11
leaq (%r11,%r11,2), %r11
leaq (%r15,%r15,2), %r15
leaq 0xc(,%r15,8), %r15
addq %r13, %r15
xorl %r13d, %r13d
movl -0x4(%r15,%r13), %ebp
xorl %edi, %ebp
cmpl $0x1, %ebp
jne 0x20fcb3
orb $-0x80, 0x3(%r15,%r13)
addq $0x18, %r13
cmpq %r13, %r11
jne 0x20fca1
incq %r10
cmpq %r8, %r10
jne 0x20fc5c
movl $0x1, %edi
testb $0x1, %sil
movl $0x0, %esi
jne 0x20fc36
movq 0x48(%rsp), %r13
movq 0x10(%r13), %rax
shlq $0x3, %rcx
leaq (%rcx,%rcx,4), %r15
movq 0x18(%rax,%r15), %rdi
callq 0x2220
movq 0x10(%r13), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax,%r15)
movups %xmm0, (%rax,%r15)
movq $0x0, 0x20(%rax,%r15)
incl %r14d
movq 0x28(%rsp), %r15
movq (%r15), %rax
movq %r14, %rcx
cmpq %r14, %rax
ja 0x20fc0f
subl 0x30(%rsp), %eax
movq 0x58(%rsp), %rcx
addl %eax, %ecx
movq %rcx, 0x58(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%r15)
movq 0x60(%rsp), %rbp
jmp 0x20fb93
cmpq $0x0, 0x128(%rsp)
jne 0x20fd5f
movq 0xc0(%rsp), %rdi
callq 0x2220
cmpq $0x0, 0x130(%rsp)
movq 0x58(%rsp), %rbx
jne 0x20fd7c
movq 0xe0(%rsp), %rdi
callq 0x2220
testl %ebx, %ebx
je 0x20fd88
movq %rbp, %rdi
callq 0xa0a7d
movl %ebx, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3836a(%rip), %rdi     # 0x24810d
leaq 0x3585f(%rip), %rsi     # 0x245609
leaq 0x38364(%rip), %rcx     # 0x248115
movl $0x2528, %edx           # imm = 0x2528
callq 0x2110