// File: /workspace/github_cpp_makefile_star2_O1/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, 0x94(%rsp)
movl %r8d, 0x54(%rsp)
movl %ecx, 0x6c(%rsp)
movss %xmm1, 0x64(%rsp)
movss %xmm0, 0x70(%rsp)
movl %edx, 0x4c(%rsp)
xorps %xmm0, %xmm0
leaq 0xa0(%rsp), %rdx
movaps %xmm0, (%rdx)
xorl %ecx, %ecx
movq %rcx, 0x10(%rdx)
movl 0x14(%rdi), %eax
addl %eax, %eax
testq %rsi, %rsi
movq %rsi, 0x98(%rsp)
cmovneq %rsi, %rdx
movq %rdx, 0x80(%rsp)
movq %rcx, (%rdx)
testl %eax, %eax
movq %rdi, 0x20(%rsp)
je 0x1e8e2f
movq 0x118(%rsp), %rbp
movl %eax, %r10d
xorl %r13d, %r13d
movq 0x20(%rdi), %rax
movl %r13d, %ecx
shrl %ecx
cmpl $0x0, (%rax,%rcx,8)
js 0x1e8e23
cmpl $0x0, 0x100(%rsp)
je 0x1e8c61
movq 0x30(%rdi), %rax
cmpb $0x0, (%rax,%r13)
jne 0x1e8e23
movq 0x28(%rdi), %rax
movq (%rax,%r13,8), %rsi
cmpl $0x2, %esi
jb 0x1e8e23
movq 0x8(%rdi), %rcx
movq %rsi, %rax
shrq $0x20, %rax
leaq (%rax,%rax,2), %rdx
leaq (%rcx,%rdx,8), %rax
movq %rax, 0x40(%rsp)
movl %esi, %eax
leaq 0xc(%rcx,%rdx,8), %r12
movq %rax, 0x18(%rsp)
leaq (,%rax,8), %rax
leaq (%rax,%rax,2), %rax
xorl %r11d, %r11d
xorl %r9d, %r9d
movl (%r12,%r11), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %r9d
addq $0x18, %r11
cmpq %r11, %rax
jne 0x1e8ca8
cmpl $0x2, %r9d
movq 0x18(%rsp), %r11
jb 0x1e8e23
leaq (%rcx,%rdx,8), %rcx
addq $0x10, %rcx
xorl %r9d, %r9d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %r15d, %r15d
movl -0x4(%rcx,%r9), %r8d
testl %r8d, %r8d
js 0x1e8d03
testb $0x40, 0x1(%rcx,%r9)
jne 0x1e8cfc
cmpl %edx, %r8d
cmovbl %r8d, %edx
jmp 0x1e8d03
cmpl %r15d, %r8d
cmoval %r8d, %r15d
addq $0x18, %r9
cmpq %r9, %rax
jne 0x1e8ce1
cmpl %edx, %r15d
jbe 0x1e8e23
xorl %r14d, %r14d
movq %rsi, 0x10(%rsp)
movl (%r12), %eax
testl %eax, %eax
js 0x1e8e13
testb $0x40, 0x5(%r12)
jne 0x1e8e13
cmpl %r15d, %eax
jae 0x1e8e13
testq %rbp, %rbp
je 0x1e8d4c
cmpl (%rbp), %eax
jae 0x1e8e13
movq 0x40(%rsp), %rdi
movl %r14d, %edx
movq 0x108(%rsp), %rcx
movq %r10, %rbx
callq 0x1e8acf
movq 0x18(%rsp), %r11
movq 0x10(%rsp), %rsi
movq %rbx, %r10
movq 0x20(%rsp), %rdi
testl %eax, %eax
je 0x1e8e13
movq 0x80(%rsp), %rbp
movq 0x8(%rbp), %rax
cmpq %rax, (%rbp)
jne 0x1e8dc7
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%rbp)
movq 0x10(%rbp), %rdi
shlq $0x3, %rsi
callq 0x2370
movq 0x18(%rsp), %r11
movq 0x10(%rsp), %rsi
movq %rbx, %r10
movq 0x20(%rsp), %rdi
movq %rax, 0x10(%rbp)
movl (%r12), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %eax
shlq $0x20, %rax
movq 0x40(%rsp), %rcx
subq 0x8(%rdi), %rcx
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
addq %r14, %rcx
orq %rax, %rcx
movq 0x10(%rbp), %rax
movq (%rbp), %rdx
leaq 0x1(%rdx), %r8
movq %r8, (%rbp)
movq %rcx, (%rax,%rdx,8)
movq 0x118(%rsp), %rbp
incq %r14
addq $0x18, %r12
cmpq %r14, %r11
jne 0x1e8d1d
incq %r13
cmpq %r10, %r13
jne 0x1e8c35
cmpq $0x0, 0x108(%rsp)
setne %al
cmpq $0x0, 0x110(%rsp)
setne %bl
andb %al, %bl
cmpb $0x1, %bl
jne 0x1e8e63
movq 0x20(%rsp), %rax
movq 0x30(%rax), %rdi
movl 0x14(%rax), %edx
addl %edx, %edx
xorl %esi, %esi
callq 0x20e0
movq 0x80(%rsp), %r13
movq 0x10(%r13), %rdi
movq (%r13), %rax
leaq (%rdi,%rax,8), %rsi
callq 0x1e3b6a
cmpq $0x0, (%r13)
je 0x1e9653
movb %bl, 0xb(%rsp)
movl $0xffffffff, 0x50(%rsp) # imm = 0xFFFFFFFF
xorl %r12d, %r12d
movl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
movl $0x0, 0x68(%rsp)
movq 0x20(%rsp), %r10
movq 0x8(%r10), %r14
movq 0x10(%r13), %rax
movl (%rax,%r12,8), %eax
leaq (%rax,%rax,2), %rcx
cmpl $0x0, 0xc(%r14,%rcx,8)
js 0x1e8f06
movq (%r14,%rcx,8), %rsi
movq 0x20(%r10), %rax
movq %rsi, %rdx
shrq $0x21, %rdx
cmpl $0x0, (%rax,%rdx,8)
js 0x1e8f06
movl 0x8(%r14,%rcx,8), %edi
movl %edi, %ecx
shrl %ecx
cmpl $0x0, (%rax,%rcx,8)
js 0x1e8f06
shrq $0x20, %rsi
movq %rdi, %rcx
xorq $0x1, %rcx
movq 0x28(%r10), %rax
movq (%rax,%rsi,8), %rbx
movq (%rax,%rcx,8), %rdx
cmpl $0x1, %ebx
ja 0x1e8f14
cmpl $0x2, %edx
jae 0x1e8f14
incl %r12d
cmpq %r12, (%r13)
ja 0x1e8ea9
jmp 0x1e9649
movq %rsi, 0x40(%rsp)
movq %rdx, %r15
shrq $0x20, %r15
cmpl $0x0, 0x54(%rsp)
movq %rdx, 0x38(%rsp)
je 0x1e8fed
movq 0x40(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
andq %rdx, %rcx
je 0x1e8f6b
shrq $0x20, %rax
xorl %edx, %edx
movl %eax, %esi
leaq (%rsi,%rsi,2), %rsi
movl 0xc(%r14,%rsi,8), %esi
notl %esi
shrl $0x1f, %esi
addl %esi, %edx
incq %rax
decq %rcx
jne 0x1e8f4c
cmpl $0x1, %edx
ja 0x1e8fa2
movq 0x38(%rsp), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
andq %rcx, %rax
je 0x1e8f06
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 0x1e8f7f
cmpl $0x2, %ecx
jb 0x1e8f06
movq %rdi, 0x88(%rsp)
movq 0x40(%rsp), %rax
movl %eax, %esi
xorl $0x1, %esi
movq %r10, %rdi
movq %r8, %rbp
callq 0xab815
movq %rbp, %r8
movl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
movq 0x20(%rsp), %r10
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 0x38(%rsp), %rdx
jmp 0x1e8ff5
movq %rdi, 0x88(%rsp)
leaq (%r15,%r15,2), %rax
movq 0x10(%r13), %rcx
movl (%rcx,%r12,8), %ecx
leaq (%rcx,%rcx,2), %rdi
shlq $0x3, %rdi
addq 0x8(%r10), %rdi
leaq (%r14,%rax,8), %rax
movq %rax, 0x18(%rsp)
movl %edx, %ecx
testl %edx, %edx
movq 0x40(%rsp), %rsi
je 0x1e9038
movl 0x8(%rax), %edx
xorl %esi, %edx
cmpl $0x1, %edx
je 0x1e9035
addq $0x18, %rax
decl %ecx
jne 0x1e9021
jmp 0x1e9038
movq %rax, %r8
movl 0xc(%rdi), %eax
andl %r11d, %eax
movl 0xc(%r8), %ecx
andl %r11d, %ecx
cmpl %ecx, %eax
cmovbl %eax, %ecx
movq %rcx, 0x58(%rsp)
movzwl 0x10(%rdi), %eax
movl $0x3fff, %ecx           # imm = 0x3FFF
andl %ecx, %eax
movzwl 0x10(%r8), %edx
andl %ecx, %edx
cmpw %dx, %ax
cmovbl %eax, %edx
movl %edx, 0x74(%rsp)
testl %ebx, %ebx
movq %r8, 0x28(%rsp)
je 0x1e920d
movq %rbx, %rax
shrq $0x20, %rax
leaq (%rax,%rax,2), %rax
leaq (%r14,%rax,8), %r13
movl %ebx, %r14d
xorl %ebx, %ebx
movq $0x0, 0x78(%rsp)
movl $0x0, 0x30(%rsp)
movl $0x0, 0xc(%rsp)
xorl %r15d, %r15d
movq 0x18(%rsp), %rdx
movq %rdi, 0x10(%rsp)
leaq (%rbx,%rbx,2), %rcx
movl 0xc(%r13,%rcx,8), %eax
testl %eax, %eax
js 0x1e91ed
leaq (,%rcx,8), %rbp
addq %r13, %rbp
incl %r15d
movl 0x8(%rbp), %esi
cmpl 0x8(%rdi), %esi
je 0x1e91ed
testb $0x40, 0x11(%rbp)
je 0x1e91ed
movl 0xc(%rdi), %ecx
andl %r11d, %ecx
cmpl %ecx, %eax
jle 0x1e91ed
cmpl $0x0, 0x54(%rsp)
je 0x1e9121
movq %r10, %rdi
callq 0xab815
movq 0x28(%rsp), %r8
movl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
movq 0x20(%rsp), %r10
movzbl %al, %eax
cmpl %eax, 0x50(%rsp)
je 0x1e91e3
movl 0x8(%rbp), %eax
movl %eax, %ecx
shrl %ecx
leaq (%rcx,%rcx,2), %rdx
movq 0x108(%rsp), %rdi
movl 0xc(%rdi,%rdx,8), %ecx
testl %ecx, %ecx
setne %sil
je 0x1e91e3
leaq (%rdi,%rdx,8), %rdx
andl $0x1, %eax
movq 0x10(%rsp), %rdi
xorl 0x8(%rdi), %eax
movq (%rdx), %rdx
movl 0xc(%rdx), %edi
movl 0x18(%rdx), %r8d
shrdl $0x1f, %edi, %r8d
cmpl %eax, %r8d
je 0x1e9191
addq $0x40, %rdx
leal -0x1(%rcx), %edi
xorl %esi, %esi
cmpl %esi, %edi
je 0x1e91de
movl -0xc(%rdx), %r8d
movl (%rdx), %r9d
shrdl $0x1f, %r8d, %r9d
addq $0x28, %rdx
incl %esi
cmpl %eax, %r9d
jne 0x1e9170
cmpl %ecx, %esi
setb %sil
testb %sil, %sil
movq 0x28(%rsp), %r8
movq 0x18(%rsp), %rdx
je 0x1e91d7
movl 0xc(%rbp), %eax
andl %r11d, %eax
movl 0xc(%rsp), %ecx
cmpl %eax, %ecx
cmovbel %eax, %ecx
movl %ecx, 0xc(%rsp)
movq 0x78(%rsp), %rax
cmovbq %rbp, %rax
movq %rax, 0x78(%rsp)
movzwl 0x10(%rbp), %eax
andl $0x3fff, %eax           # imm = 0x3FFF
movl 0x30(%rsp), %ecx
cmpl %eax, %ecx
cmovbel %eax, %ecx
movl %ecx, 0x30(%rsp)
movq 0x10(%rsp), %rdi
jmp 0x1e91ed
movq 0x28(%rsp), %r8
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rdx
incq %rbx
cmpq %r14, %rbx
jne 0x1e90b2
cvtsi2ssl 0x30(%rsp), %xmm0
movq 0x80(%rsp), %r13
movl 0xc(%rsp), %esi
jmp 0x1e9223
xorps %xmm0, %xmm0
xorl %r15d, %r15d
xorl %esi, %esi
movq $0x0, 0x78(%rsp)
movq 0x18(%rsp), %rdx
testl %r15d, %r15d
je 0x1e8f06
cmpl $0x1, %r15d
jne 0x1e93bd
movq 0x38(%rsp), %rax
testl %eax, %eax
je 0x1e9424
movl %eax, %r13d
xorl %ebx, %ebx
movq $0x0, 0x30(%rsp)
movl $0x0, 0xc(%rsp)
movl $0x0, 0x38(%rsp)
xorl %r14d, %r14d
movq %rdi, 0x10(%rsp)
leaq (%rbx,%rbx,2), %rcx
movl 0xc(%rdx,%rcx,8), %eax
testl %eax, %eax
js 0x1e939a
leaq (%rdx,%rcx,8), %rbp
incl %r14d
movl 0x8(%rbp), %esi
cmpl 0x8(%r8), %esi
je 0x1e939a
testb $0x40, 0x11(%rbp)
je 0x1e939a
movl 0xc(%r8), %ecx
andl %r11d, %ecx
cmpl %ecx, %eax
jle 0x1e939a
cmpl $0x0, 0x54(%rsp)
je 0x1e92d2
movq %r10, %rdi
callq 0xab815
movq 0x28(%rsp), %r8
movl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
movq 0x20(%rsp), %r10
movzbl %al, %eax
cmpl %eax, 0x50(%rsp)
je 0x1e9390
movl 0x8(%rbp), %eax
movl %eax, %ecx
shrl %ecx
leaq (%rcx,%rcx,2), %rdx
movq 0x108(%rsp), %rdi
movl 0xc(%rdi,%rdx,8), %ecx
testl %ecx, %ecx
setne %sil
je 0x1e9390
leaq (%rdi,%rdx,8), %rdx
andl $0x1, %eax
xorl 0x8(%r8), %eax
movq (%rdx), %rdx
movl 0xc(%rdx), %edi
movl 0x18(%rdx), %r8d
shrdl $0x1f, %edi, %r8d
cmpl %eax, %r8d
je 0x1e933e
addq $0x40, %rdx
leal -0x1(%rcx), %edi
xorl %esi, %esi
cmpl %esi, %edi
je 0x1e938b
movl -0xc(%rdx), %r8d
movl (%rdx), %r9d
shrdl $0x1f, %r8d, %r9d
addq $0x28, %rdx
incl %esi
cmpl %eax, %r9d
jne 0x1e931d
cmpl %ecx, %esi
setb %sil
testb %sil, %sil
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rdx
je 0x1e9384
movl 0xc(%rbp), %eax
andl %r11d, %eax
movl 0x38(%rsp), %ecx
cmpl %eax, %ecx
cmovbel %eax, %ecx
movl %ecx, 0x38(%rsp)
movq 0x30(%rsp), %rax
cmovbq %rbp, %rax
movq %rax, 0x30(%rsp)
movzwl 0x10(%rbp), %eax
andl $0x3fff, %eax           # imm = 0x3FFF
movl 0xc(%rsp), %ecx
cmpl %eax, %ecx
cmovbel %eax, %ecx
movl %ecx, 0xc(%rsp)
movq 0x28(%rsp), %r8
jmp 0x1e939a
movq 0x28(%rsp), %r8
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rdx
incq %rbx
cmpq %r13, %rbx
jne 0x1e9269
xorps %xmm0, %xmm0
cvtsi2ssl 0xc(%rsp), %xmm0
movq 0x80(%rsp), %r13
movl 0x38(%rsp), %edx
jmp 0x1e9435
cvtsi2ssl 0x58(%rsp), %xmm1
cvtsi2ss %esi, %xmm2
mulss 0x70(%rsp), %xmm2
ucomiss %xmm2, %xmm1
ja 0x1e8f06
cmpl $0x0, 0x6c(%rsp)
je 0x1e9409
movl 0x74(%rsp), %ecx
movswl %cx, %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
mulss 0x64(%rsp), %xmm0
ucomiss %xmm0, %xmm1
seta %al
cmpl 0xf8(%rsp), %ecx
seta %cl
testb %cl, %al
jne 0x1e8f06
movl 0xf0(%rsp), %eax
movq 0x58(%rsp), %rcx
addl %ecx, %eax
cmpl %esi, %eax
jbe 0x1e9236
jmp 0x1e8f06
xorps %xmm0, %xmm0
xorl %r14d, %r14d
xorl %edx, %edx
movq $0x0, 0x30(%rsp)
testl %r14d, %r14d
je 0x1e8f06
cmpl $0x1, %r14d
jne 0x1e9483
movl %r15d, %eax
xorl $0x1, %eax
movl %r14d, %ecx
xorl $0x1, %ecx
orl %eax, %ecx
je 0x1e8f06
movb $0x1, %al
cmpl $0x0, 0x94(%rsp)
je 0x1e94f0
cmpl $0x1, %r15d
setne %cl
cmpl $0x1, %r14d
setne %dl
testb %dl, %cl
je 0x1e94f9
movl $0x1, %ecx
xorl %eax, %eax
jmp 0x1e94f2
xorps %xmm1, %xmm1
cvtsi2ssl 0x58(%rsp), %xmm1
xorps %xmm2, %xmm2
cvtsi2ss %edx, %xmm2
mulss 0x70(%rsp), %xmm2
ucomiss %xmm2, %xmm1
ja 0x1e8f06
cmpl $0x0, 0x6c(%rsp)
je 0x1e94d5
movl 0x74(%rsp), %ecx
movswl %cx, %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
mulss 0x64(%rsp), %xmm0
ucomiss %xmm0, %xmm1
seta %al
cmpl 0xf8(%rsp), %ecx
seta %cl
testb %cl, %al
jne 0x1e8f06
movl 0xf0(%rsp), %eax
movq 0x58(%rsp), %rcx
addl %eax, %ecx
cmpl %edx, %ecx
jbe 0x1e9444
jmp 0x1e8f06
xorl %ecx, %ecx
movb 0xb(%rsp), %bpl
jmp 0x1e9554
cmpl $0x1, %r14d
movb 0xb(%rsp), %bpl
je 0x1e951a
cmpl $0x1, %r15d
jne 0x1e954d
movq 0x40(%rsp), %rax
xorl $0x1, %eax
movq %rax, 0x88(%rsp)
movq %rdi, %r14
movq %r10, %rdi
movq 0x88(%rsp), %rsi
movl 0x4c(%rsp), %ebx
movl %ebx, %edx
callq 0xaa77e
movq %r14, %rdi
movl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
movq 0x20(%rsp), %r10
xorl %ecx, %ecx
cmpl %ebx, %eax
setge %al
setl %cl
jmp 0x1e954f
xorl %ecx, %ecx
movq 0x28(%rsp), %r8
testb %bpl, %bpl
movq 0x78(%rsp), %r14
movq 0x30(%rsp), %r15
je 0x1e962f
movq %rdi, %rbx
testq %r14, %r14
setne %dl
andb %dl, %al
cmpb $0x1, %al
jne 0x1e95bb
movl 0x8(%rbx), %edi
movl 0x8(%r14), %esi
xorl %ecx, %ecx
cmpl %esi, %edi
je 0x1e95bb
movq %r13, (%rsp)
movq %r10, %rdx
movq 0x108(%rsp), %rcx
movq 0x110(%rsp), %r8
movl 0x4c(%rsp), %r9d
callq 0x1e7fa4
movq 0x28(%rsp), %r8
movl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
movq 0x20(%rsp), %r10
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
testl %ecx, %ecx
jne 0x1e960a
testq %r15, %r15
je 0x1e960a
movl 0x8(%r8), %edi
movl 0x8(%r15), %esi
xorl %ecx, %ecx
cmpl %esi, %edi
je 0x1e960a
movq %r13, (%rsp)
movq %r10, %rdx
movq 0x108(%rsp), %rcx
movq 0x110(%rsp), %r8
movl 0x4c(%rsp), %r9d
callq 0x1e7fa4
movq 0x28(%rsp), %r8
movl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
movq 0x20(%rsp), %r10
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
testq %r14, %r14
je 0x1e962c
testq %r15, %r15
movq %rbx, %rdi
je 0x1e962f
movl 0x8(%rdi), %eax
cmpl 0x8(%r14), %eax
jne 0x1e962f
movl 0x8(%r8), %eax
cmpl 0x8(%r15), %eax
jne 0x1e962f
jmp 0x1e9695
movq %rbx, %rdi
testl %ecx, %ecx
je 0x1e8f06
orb $-0x80, 0xf(%r8)
orb $-0x80, 0xf(%rdi)
incl 0x68(%rsp)
jmp 0x1e8f06
cmpl $0x0, 0x68(%rsp)
sete %bl
jmp 0x1e965a
movb $0x1, %bl
movq 0x20(%rsp), %r10
cmpq $0x0, 0x98(%rsp)
jne 0x1e9677
movq 0xb0(%rsp), %rdi
callq 0x2220
movq 0x20(%rsp), %r10
testb %bl, %bl
jne 0x1e9683
movq %r10, %rdi
callq 0xa02fa
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4ff8c(%rip), %rdi     # 0x239628
leaq 0x4fc82(%rip), %rsi     # 0x239325
leaq 0x5003e(%rip), %rcx     # 0x2396e8
movl $0x61b, %edx            # imm = 0x61B
callq 0x2110