// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: asg_arc_cut_weak(asg_t*, asg64_v*, int, float, float, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, ma_hit_t_alloc*, R_to_U*, unsigned int*)
void asg_arc_cut_weak(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, uint32_t test_bub, 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, wz, 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, olw[2], m;
    asg_arc_t *av, *aw, *ve, *we, *vl_max, *wl_max; ma_hit_t_alloc *z = NULL;

    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((test_bub == 0) || (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 = olw[1] = 0, olw[0] = (uint32_t)-1; i < nv; ++i) {
                if(av[i].del) continue;
                if(av[i].strong) {
                    if(av[i].ol > olw[av[i].strong]) olw[av[i].strong] = av[i].ol;
                } else {
                    if(av[i].ol < olw[av[i].strong]) olw[av[i].strong] = av[i].ol;
                }
            }
            if(olw[1] <= olw[0]) continue;
            for (i = 0; i < nv; ++i) {
                if(av[i].del || av[i].strong) continue;
                if(av[i].ol >= olw[1]) continue;
                if(max_drop_len && av[i].ol >= (*max_drop_len)) continue;
                if(is_dedup_weak_arc(av, nv, i, rev)) {
                    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, vl_max = NULL; i < nv; ++i) {
            if(av[i].del) continue;
            kv++;
            if((av[i].v == ve->v) || (!av[i].strong) || (av[i].ol <= ve->ol)) continue;
            if(is_trio && get_tip_trio_infor(g, av[i].v) == ntrioF) continue;

            z = &(rev[av[i].v>>1]); wz = (ve->v^(av[i].v&1));
            for (m = 0; m < z->length; m++) {
                if((z->buffer[m].tn<<1|(z->buffer[m].rev)) == wz) break;
            }
            if(m >= z->length) 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((aw[i].v == we->v) || (!aw[i].strong) || (aw[i].ol <= we->ol)) continue;
            if(is_trio && get_tip_trio_infor(g, aw[i].v) == ntrioF) continue;

            z = &(rev[aw[i].v>>1]); wz = (we->v^(aw[i].v&1));
            for (m = 0; m < z->length; m++) {
                if((z->buffer[m].tn<<1|(z->buffer[m].rev)) == wz) break;
            }
            if(m >= z->length) 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, 0x84(%rsp)
movl %r8d, 0x64(%rsp)
movl %ecx, 0x78(%rsp)
movss %xmm1, 0x70(%rsp)
movss %xmm0, 0x80(%rsp)
movl %edx, 0x5c(%rsp)
movq 0x108(%rsp), %rcx
xorps %xmm0, %xmm0
leaq 0xa0(%rsp), %r10
movaps %xmm0, (%r10)
xorl %edx, %edx
movq %rdx, 0x10(%r10)
movl 0x14(%rdi), %eax
addl %eax, %eax
testq %rsi, %rsi
movq %rsi, 0x98(%rsp)
cmovneq %rsi, %r10
movq %rdx, (%r10)
testl %eax, %eax
movq %rdi, 0x18(%rsp)
movq %r10, 0x30(%rsp)
je 0x1f3940
movq 0x118(%rsp), %r11
movl 0x100(%rsp), %r12d
movl %eax, %eax
movq %rax, 0x48(%rsp)
xorl %r13d, %r13d
movq 0x20(%rdi), %rax
movl %r13d, %edx
shrl %edx
cmpl $0x0, (%rax,%rdx,8)
js 0x1f3932
testl %r12d, %r12d
je 0x1f3759
movq 0x30(%rdi), %rax
cmpb $0x0, (%rax,%r13)
jne 0x1f3932
movq 0x28(%rdi), %rax
movq (%rax,%r13,8), %rax
movq %rax, 0x28(%rsp)
cmpl $0x2, %eax
jb 0x1f3932
movq 0x8(%rdi), %rsi
movq 0x28(%rsp), %rdx
movq %rdx, %rax
shrq $0x20, %rax
leaq (%rax,%rax,2), %r9
leaq (%rsi,%r9,8), %rax
movq %rax, 0x38(%rsp)
movl %edx, %eax
movq %rsi, 0x10(%rsp)
leaq 0xc(%rsi,%r9,8), %rbx
movq %rax, 0x50(%rsp)
leaq (,%rax,8), %rax
leaq (%rax,%rax,2), %rax
xorl %edx, %edx
xorl %esi, %esi
movl (%rbx,%rdx), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %esi
addq $0x18, %rdx
cmpq %rdx, %rax
jne 0x1f37ad
cmpl $0x2, %esi
jb 0x1f3932
movq 0x10(%rsp), %rdx
leaq (%rdx,%r9,8), %r9
addq $0x10, %r9
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %r15d, %r15d
movl -0x4(%r9,%rsi), %r8d
testl %r8d, %r8d
js 0x1f3806
testb $0x40, 0x1(%r9,%rsi)
jne 0x1f37ff
cmpl %edx, %r8d
cmovbl %r8d, %edx
jmp 0x1f3806
cmpl %r15d, %r8d
cmoval %r8d, %r15d
addq $0x18, %rsi
cmpq %rsi, %rax
jne 0x1f37e4
cmpl %edx, %r15d
movq 0x50(%rsp), %rax
jbe 0x1f3932
xorl %r14d, %r14d
movl (%rbx), %ebp
testl %ebp, %ebp
js 0x1f3922
testb $0x40, 0x5(%rbx)
jne 0x1f3922
cmpl %r15d, %ebp
jae 0x1f3922
testq %r11, %r11
je 0x1f384b
cmpl (%r11), %ebp
jae 0x1f3922
movq %r11, %r12
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rsi
movl %r14d, %edx
callq 0x1f35e7
testl %eax, %eax
je 0x1f38b4
movq 0x30(%rsp), %r10
movq (%r10), %r8
movq 0x10(%r10), %rax
cmpq 0x8(%r10), %r8
movq 0x10(%rsp), %rsi
jne 0x1f38cb
leaq (%r8,%r8), %rsi
testq %r8, %r8
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r10)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x30(%rsp), %r10
movq %rax, 0x10(%r10)
movl (%rbx), %ebp
movq 0x18(%rsp), %rdi
movq 0x8(%rdi), %rsi
movq (%r10), %r8
jmp 0x1f38d0
movq 0x18(%rsp), %rdi
movq 0x108(%rsp), %rcx
movq 0x30(%rsp), %r10
movq %r12, %r11
jmp 0x1f3915
movq 0x18(%rsp), %rdi
movq 0x108(%rsp), %rcx
movq %r12, %r11
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
shlq $0x20, %rbp
movq 0x38(%rsp), %rdx
movq %rsi, 0x10(%rsp)
subq %rsi, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
addq %r14, %rdx
orq %rbp, %rdx
leaq 0x1(%r8), %rsi
movq %rsi, (%r10)
movq %rdx, (%rax,%r8,8)
movl 0x100(%rsp), %r12d
movq 0x50(%rsp), %rax
incq %r14
addq $0x18, %rbx
cmpq %r14, %rax
jne 0x1f3820
incq %r13
cmpq 0x48(%rsp), %r13
jne 0x1f3732
testq %rcx, %rcx
setne %al
cmpq $0x0, 0x110(%rsp)
setne %bl
andb %al, %bl
cmpb $0x1, %bl
jne 0x1f3973
movq 0x18(%rsp), %rax
movq 0x30(%rax), %rdi
movl 0x14(%rax), %edx
addl %edx, %edx
xorl %esi, %esi
callq 0x20e0
movq 0x30(%rsp), %r10
movq 0x10(%r10), %rdi
movq (%r10), %rax
leaq (%rdi,%rax,8), %rsi
callq 0x1ee586
movq 0x30(%rsp), %r11
cmpq $0x0, (%r11)
je 0x1f4158
movb %bl, 0xf(%rsp)
movl $0xffffffff, 0x60(%rsp) # imm = 0xFFFFFFFF
xorl %r12d, %r12d
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movl $0x0, 0x7c(%rsp)
movq 0x18(%rsp), %r9
movq 0x108(%rsp), %r10
movq 0x8(%r9), %r14
movq 0x10(%r11), %rax
movl (%rax,%r12,8), %eax
leaq (%rax,%rax,2), %rdx
cmpl $0x0, 0xc(%r14,%rdx,8)
js 0x1f4142
movq (%r14,%rdx,8), %rdi
movq 0x20(%r9), %rcx
movq %rdi, %rsi
shrq $0x21, %rsi
cmpl $0x0, (%rcx,%rsi,8)
js 0x1f4142
movl 0x8(%r14,%rdx,8), %esi
movl %esi, %edx
shrl %edx
cmpl $0x0, (%rcx,%rdx,8)
js 0x1f4142
shrq $0x20, %rdi
movq %rsi, %rcx
xorq $0x1, %rcx
movq 0x28(%r9), %rdx
movq (%rdx,%rdi,8), %rbx
movq (%rdx,%rcx,8), %r15
cmpl $0x1, %ebx
ja 0x1f3a2a
cmpl $0x2, %r15d
jb 0x1f4142
movq %rsi, 0x90(%rsp)
movq %rdi, 0x50(%rsp)
movq %rbx, %r13
shrq $0x20, %r13
movq %r15, 0x38(%rsp)
shrq $0x20, %r15
cmpl $0x0, 0x64(%rsp)
je 0x1f3b0f
movq %rbx, %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
andq %rcx, %rax
je 0x1f3a83
xorl %ecx, %ecx
movq %r13, %rdx
movl %edx, %esi
leaq (%rsi,%rsi,2), %rsi
movl 0xc(%r14,%rsi,8), %esi
notl %esi
shrl $0x1f, %esi
addl %esi, %ecx
incq %rdx
decq %rax
jne 0x1f3a64
cmpl $0x1, %ecx
ja 0x1f3abe
movq 0x38(%rsp), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
andq %rcx, %rax
je 0x1f4142
xorl %ecx, %ecx
movq %r15, %rdx
movl %edx, %esi
leaq (%rsi,%rsi,2), %rsi
movl 0xc(%r14,%rsi,8), %esi
notl %esi
shrl $0x1f, %esi
addl %esi, %ecx
incq %rdx
decq %rax
jne 0x1f3a9b
cmpl $0x2, %ecx
jb 0x1f4142
movq 0x50(%rsp), %rax
movl %eax, %esi
xorl $0x1, %esi
movq %r9, %rdi
callq 0xac87a
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq 0x30(%rsp), %r11
movq 0x108(%rsp), %r10
movq 0x18(%rsp), %r9
xorl %ecx, %ecx
cmpb $0x2, %al
sete %cl
cmpb $0x1, %al
leal -0x1(%rcx,%rcx), %ecx
movl $0x2, %eax
cmovel %eax, %ecx
movl %ecx, 0x60(%rsp)
movq 0x8(%r9), %rcx
movq 0x10(%r11), %rax
movl (%rax,%r12,8), %eax
jmp 0x1f3b12
movq %r14, %rcx
leaq (%r15,%r15,2), %rdx
leaq (%r14,%rdx,8), %rsi
movq 0x38(%rsp), %rdx
testl %edx, %edx
movq %rsi, 0x28(%rsp)
je 0x1f3b4a
movl %edx, %edx
movq 0x50(%rsp), %r15
movl 0x8(%rsi), %edi
xorl %r15d, %edi
cmpl $0x1, %edi
je 0x1f3b45
addq $0x18, %rsi
decq %rdx
jne 0x1f3b2f
jmp 0x1f3b4a
movq %rsi, 0x48(%rsp)
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rdi
movl 0xc(%rdi), %eax
andl %r8d, %eax
movq 0x48(%rsp), %rdx
movl 0xc(%rdx), %esi
andl %r8d, %esi
cmpl %esi, %eax
cmovbl %eax, %esi
movzwl 0x10(%rdi), %eax
movl $0x3fff, %ecx           # imm = 0x3FFF
andl %ecx, %eax
movzwl 0x10(%rdx), %edx
andl %ecx, %edx
cmpw %dx, %ax
cmovbl %eax, %edx
testl %ebx, %ebx
je 0x1f4142
movl %edx, 0x74(%rsp)
movq %rsi, 0x88(%rsp)
leaq (,%r13,2), %rax
addq %r13, %rax
leaq (%r14,%rax,8), %r13
movl %ebx, %ebx
xorl %r15d, %r15d
movq $0x0, 0x68(%rsp)
movl $0x0, 0x24(%rsp)
movl $0x0, 0x40(%rsp)
xorl %r14d, %r14d
movq %rdi, 0x10(%rsp)
movq 0x28(%rsp), %rdx
leaq (%r15,%r15,2), %rax
movl 0xc(%r13,%rax,8), %ecx
testl %ecx, %ecx
js 0x1f3cf6
leaq (,%rax,8), %rbp
addq %r13, %rbp
incl %r14d
movl 0x8(%rbp), %esi
movl 0x8(%rdi), %eax
cmpl %eax, %esi
je 0x1f3cf6
testb $0x40, 0x11(%rbp)
je 0x1f3cf6
movl 0xc(%rdi), %edx
andl %r8d, %edx
cmpl %edx, %ecx
jbe 0x1f3cf1
cmpl $0x0, 0x64(%rsp)
je 0x1f3c5b
movq %r9, %rdi
callq 0xac87a
movzbl %al, %eax
cmpl %eax, 0x60(%rsp)
jne 0x1f3c3e
movq 0x18(%rsp), %r9
movq 0x108(%rsp), %r10
movq 0x30(%rsp), %r11
jmp 0x1f3c9f
movl 0x8(%rbp), %esi
movq 0x10(%rsp), %rdi
movl 0x8(%rdi), %eax
movq 0x18(%rsp), %r9
movq 0x108(%rsp), %r10
movq 0x30(%rsp), %r11
movl %esi, %ecx
shrl %ecx
leaq (%rcx,%rcx,2), %rcx
movl 0xc(%r10,%rcx,8), %edx
testq %rdx, %rdx
je 0x1f3ca7
leaq (%r10,%rcx,8), %rcx
andl $0x1, %esi
xorl %esi, %eax
movq (%rcx), %rcx
shlq $0x3, %rdx
leaq (%rdx,%rdx,4), %rdx
xorl %esi, %esi
movl 0xc(%rcx,%rsi), %edi
movl 0x18(%rcx,%rsi), %r8d
shrdl $0x1f, %edi, %r8d
cmpl %eax, %r8d
je 0x1f3caf
addq $0x28, %rsi
cmpq %rsi, %rdx
jne 0x1f3c83
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
jmp 0x1f3cec
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
jmp 0x1f3cf1
movl 0xc(%rbp), %eax
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andl %r8d, %eax
movl 0x40(%rsp), %ecx
cmpl %eax, %ecx
cmovbel %eax, %ecx
movl %ecx, 0x40(%rsp)
movq 0x68(%rsp), %rax
cmovbq %rbp, %rax
movq %rax, 0x68(%rsp)
movzwl 0x10(%rbp), %eax
andl $0x3fff, %eax           # imm = 0x3FFF
movl 0x24(%rsp), %ecx
cmpl %eax, %ecx
cmovbel %eax, %ecx
movl %ecx, 0x24(%rsp)
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rdx
incq %r15
cmpq %rbx, %r15
jne 0x1f3bcd
testl %r14d, %r14d
je 0x1f4142
cmpl $0x1, %r14d
je 0x1f3d84
movq 0x88(%rsp), %rsi
cvtsi2ss %esi, %xmm0
movl 0x40(%rsp), %ebx
cvtsi2ss %ebx, %xmm1
mulss 0x80(%rsp), %xmm1
ucomiss %xmm1, %xmm0
ja 0x1f4142
cmpl $0x0, 0x78(%rsp)
je 0x1f3d73
xorps %xmm0, %xmm0
cvtsi2ssl 0x24(%rsp), %xmm0
movl 0x74(%rsp), %ecx
movswl %cx, %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
mulss 0x70(%rsp), %xmm0
ucomiss %xmm0, %xmm1
seta %al
cmpl 0xf8(%rsp), %ecx
seta %cl
testb %cl, %al
jne 0x1f4142
movl 0xf0(%rsp), %eax
addl %esi, %eax
cmpl %ebx, %eax
ja 0x1f4142
movq 0x38(%rsp), %rax
testl %eax, %eax
je 0x1f4142
movl %eax, %ebx
xorl %r15d, %r15d
movq $0x0, 0x40(%rsp)
movl $0x0, 0x24(%rsp)
movl $0x0, 0x38(%rsp)
xorl %r13d, %r13d
leaq (%r15,%r15,2), %rax
movl 0xc(%rdx,%rax,8), %ecx
testl %ecx, %ecx
js 0x1f3ee2
leaq (%rdx,%rax,8), %rbp
incl %r13d
movl 0x8(%rbp), %esi
movq 0x48(%rsp), %rax
movl 0x8(%rax), %eax
cmpl %eax, %esi
je 0x1f3ee2
testb $0x40, 0x11(%rbp)
je 0x1f3ee2
movq 0x48(%rsp), %rdx
movl 0xc(%rdx), %edx
andl %r8d, %edx
cmpl %edx, %ecx
jbe 0x1f3edd
cmpl $0x0, 0x64(%rsp)
je 0x1f3e47
movq %r9, %rdi
callq 0xac87a
movzbl %al, %eax
cmpl %eax, 0x60(%rsp)
jne 0x1f3e25
movq 0x18(%rsp), %r9
movq 0x108(%rsp), %r10
movq 0x30(%rsp), %r11
jmp 0x1f3e8b
movl 0x8(%rbp), %esi
movq 0x48(%rsp), %rax
movl 0x8(%rax), %eax
movq 0x18(%rsp), %r9
movq 0x108(%rsp), %r10
movq 0x30(%rsp), %r11
movq 0x10(%rsp), %rdi
movl %esi, %ecx
shrl %ecx
leaq (%rcx,%rcx,2), %rcx
movl 0xc(%r10,%rcx,8), %edx
testq %rdx, %rdx
je 0x1f3e93
leaq (%r10,%rcx,8), %rcx
andl $0x1, %esi
xorl %esi, %eax
movq (%rcx), %rcx
shlq $0x3, %rdx
leaq (%rdx,%rdx,4), %rdx
xorl %esi, %esi
movl 0xc(%rcx,%rsi), %edi
movl 0x18(%rcx,%rsi), %r8d
shrdl $0x1f, %edi, %r8d
cmpl %eax, %r8d
je 0x1f3e9b
addq $0x28, %rsi
cmpq %rsi, %rdx
jne 0x1f3e6f
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
jmp 0x1f3ed8
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
jmp 0x1f3edd
movl 0xc(%rbp), %eax
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andl %r8d, %eax
movl 0x38(%rsp), %ecx
cmpl %eax, %ecx
cmovbel %eax, %ecx
movl %ecx, 0x38(%rsp)
movq 0x40(%rsp), %rax
cmovbq %rbp, %rax
movq %rax, 0x40(%rsp)
movzwl 0x10(%rbp), %eax
andl $0x3fff, %eax           # imm = 0x3FFF
movl 0x24(%rsp), %ecx
cmpl %eax, %ecx
cmovbel %eax, %ecx
movl %ecx, 0x24(%rsp)
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rdx
incq %r15
cmpq %rbx, %r15
jne 0x1f3db2
testl %r13d, %r13d
movq 0x88(%rsp), %rdx
je 0x1f4142
cmpl $0x1, %r13d
jne 0x1f3f1a
cmpl $0x1, %r14d
movq 0x50(%rsp), %rbx
je 0x1f4142
movb $0x1, %dl
xorl %ecx, %ecx
jmp 0x1f3f99
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
movl 0x38(%rsp), %esi
xorps %xmm1, %xmm1
cvtsi2ss %esi, %xmm1
mulss 0x80(%rsp), %xmm1
ucomiss %xmm1, %xmm0
movq 0x50(%rsp), %rbx
ja 0x1f4142
cmpl $0x0, 0x78(%rsp)
je 0x1f3f7f
xorps %xmm0, %xmm0
cvtsi2ssl 0x24(%rsp), %xmm0
movl 0x74(%rsp), %ecx
movswl %cx, %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
mulss 0x70(%rsp), %xmm0
ucomiss %xmm0, %xmm1
seta %al
cmpl 0xf8(%rsp), %ecx
seta %cl
testb %cl, %al
jne 0x1f4142
movl 0xf0(%rsp), %eax
addl %eax, %edx
cmpl %esi, %edx
ja 0x1f4142
cmpl $0x1, %r14d
sete %cl
xorl %edx, %edx
movb $0x1, %al
cmpl $0x0, 0x84(%rsp)
je 0x1f3fcd
cmpl $0x1, %r14d
setne %sil
cmpl $0x1, %r13d
setne %dil
testb %dil, %sil
je 0x1f3fdb
movl $0x1, %ecx
xorl %eax, %eax
movb 0xf(%rsp), %bpl
movq 0x10(%rsp), %rdi
jmp 0x1f3fd4
xorl %ecx, %ecx
movb 0xf(%rsp), %bpl
movq 0x68(%rsp), %r14
jmp 0x1f4039
testb %dl, %dl
movb 0xf(%rsp), %bpl
movq 0x68(%rsp), %r14
jne 0x1f3ff8
testb %cl, %cl
je 0x1f4032
xorl $0x1, %ebx
movq %rbx, 0x90(%rsp)
movq %r9, %rdi
movq 0x90(%rsp), %rsi
movl 0x5c(%rsp), %ebx
movl %ebx, %edx
callq 0xab75d
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq 0x30(%rsp), %r11
movq 0x108(%rsp), %r10
movq 0x18(%rsp), %r9
xorl %ecx, %ecx
cmpl %ebx, %eax
setge %al
setl %cl
jmp 0x1f4034
xorl %ecx, %ecx
movq 0x10(%rsp), %rdi
testb %bpl, %bpl
je 0x1f412d
testq %r14, %r14
setne %dl
andb %dl, %al
cmpb $0x1, %al
jne 0x1f409b
movq 0x10(%rsp), %rax
movl 0x8(%rax), %edi
movl 0x8(%r14), %esi
xorl %ecx, %ecx
cmpl %esi, %edi
je 0x1f409b
movq %r11, (%rsp)
movq %r9, %rdx
movq %r10, %rcx
movq 0x110(%rsp), %r8
movl 0x5c(%rsp), %r9d
callq 0x1f2aa9
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq 0x30(%rsp), %r11
movq 0x108(%rsp), %r10
movq 0x18(%rsp), %r9
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
testl %ecx, %ecx
jne 0x1f40fc
movq 0x40(%rsp), %rdx
testq %rdx, %rdx
je 0x1f4101
movq 0x48(%rsp), %rax
movl 0x8(%rax), %edi
movl 0x8(%rdx), %esi
xorl %ecx, %ecx
cmpl %esi, %edi
je 0x1f4101
movq %r11, (%rsp)
movq %r9, %rdx
movq %r10, %rcx
movq 0x110(%rsp), %r8
movl 0x5c(%rsp), %r9d
callq 0x1f2aa9
movq 0x40(%rsp), %rdx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq 0x30(%rsp), %r11
movq 0x108(%rsp), %r10
movq 0x18(%rsp), %r9
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
jmp 0x1f4101
movq 0x40(%rsp), %rdx
testq %r14, %r14
je 0x1f4128
testq %rdx, %rdx
movq 0x10(%rsp), %rdi
je 0x1f412d
movl 0x8(%rdi), %eax
cmpl 0x8(%r14), %eax
jne 0x1f412d
movq 0x48(%rsp), %rax
movl 0x8(%rax), %eax
cmpl 0x8(%rdx), %eax
jne 0x1f412d
jmp 0x1f419a
movq 0x10(%rsp), %rdi
testl %ecx, %ecx
je 0x1f4142
movq 0x48(%rsp), %rax
orb $-0x80, 0xf(%rax)
orb $-0x80, 0xf(%rdi)
incl 0x7c(%rsp)
incl %r12d
cmpq %r12, (%r11)
ja 0x1f39bc
cmpl $0x0, 0x7c(%rsp)
sete %bl
jmp 0x1f415f
movb $0x1, %bl
movq 0x18(%rsp), %r9
cmpq $0x0, 0x98(%rsp)
jne 0x1f417c
movq 0xb0(%rsp), %rdi
callq 0x2220
movq 0x18(%rsp), %r9
testb %bl, %bl
jne 0x1f4188
movq %r9, %rdi
callq 0xa0a7d
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5176b(%rip), %rdi     # 0x24590c
leaq 0x51461(%rip), %rsi     # 0x245609
leaq 0x5181d(%rip), %rcx     # 0x2459cc
movl $0x61b, %edx            # imm = 0x61B
callq 0x2110