// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: ulg_arc_cut_z(ul_resolve_t*, ma_ug_t*, unsigned int, unsigned int, float, float, unsigned int, float, unsigned int, unsigned int, unsigned int*, asg64_v*, asg64_v*)
uint32_t ulg_arc_cut_z(ul_resolve_t *uidx, ma_ug_t *ug, uint32_t max_ext, uint32_t max_ext_hifi, 
float len_rat, float small_occ_rate, uint32_t raw_ug_occ, float raw_match_rate, uint32_t is_trio, 
uint32_t skip_hom, 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, wt, z, i, k, kv, nv, kw, kwt, nw, cnt = 0, n_vtx = g->n_seq<<1, ul, vp[2], wp[2];
    asg_arc_t *av, *aw, *ve, *we, *wte; uint64_t w_q, w_t, pb, raw_ul, raw_hifi;

    b = (in?(in):(&tx)); ub = (ib?(ib):(&tb));
    for (v = b->n = 0; v < n_vtx; ++v) {
        if (g->seq[v>>1].del) continue;
        av = asg_arc_a(g, v); nv = asg_arc_n(g, v);
        if (nv < 2) continue;
        for (i = kv = 0; i < nv && kv <= 2; ++i) {
            if(av[i].del) continue; kv++;
        }
        if(kv != 2) continue;
        for (i = 0; i < nv; ++i) {
            if(av[i].del) continue; 
            kw = get_arcs(ug->g, av[i].v^1, NULL, 0);
            // if((v>>1) == 16783) {
            //     fprintf(stderr, "sss[M::%s::] v>>1::%u, v&1::%u, av[i].v>>1::%u, av[i].v&1::%u, kw::%u\n", 
            //     __func__, v>>1, v&1, av[i].v>>1, av[i].v&1, kw);
            // }
            if(kw == 2) {
                kv_push(uint64_t, *b, ((uint64_t)(av-g->arc+i)));
            } else if(kw == 1) {
                ub->n = 0;
                if(get_ul_path_info(uidx, ug, av[i].v, NULL, NULL, NULL, NULL, NULL, ub)==TWO_INPUT) {
                    for (z = raw_ul = 0; z < ub->n; z++) {
                        get_iug_u_raw_occ(uidx, ub->a[z]>>1, &ul, NULL); raw_ul += ul;
                    }
                    kv_push(uint64_t, *b, ((raw_ul<<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); 
        nw = asg_arc_n(g, w); aw = asg_arc_a(g, w); 
        if(nv <= 1 && nw <= 1) continue;

        vp[0] = v^1; vp[1] = (uint32_t)-1;
        ve = &(g->arc[(uint32_t)b->a[k]]);
        for (i = kv = 0; i < nv; ++i) {
            if(av[i].del) continue; 
            if(av[i].v != (w^1)) vp[1] = av[i].v;
            kv++;
        }

        wp[0] = w^1; wp[1] = (uint32_t)-1;
        for (i = kw = 0, we = NULL; i < nw; ++i) {
            if (aw[i].del) continue;
            if (aw[i].v == (v^1)) we = &(aw[i]);
            else wp[1] = aw[i].v;
            kw++;
        }
        if(kv <= 1 && kw <= 1) continue;
        if(kv != 2 || kw > 2) continue;
        // if((v>>1) == 16783) {
        //     fprintf(stderr, "bbb[M::%s::] v>>1::%u, v&1::%u, w>>1::%u, w&1::%u, kv::%u, kw::%u\n", 
        //     __func__, v>>1, v&1, w>>1, w&1, kv, kw);
        // }
        raw_ul = 0; wt = w; wte = we; kwt = kw; pb = b->n; ub->n = 0;
        if(kw == 1) {
            if(get_ul_path_info(uidx, ug, w^1, &wt, NULL, NULL, NULL, NULL, b)==TWO_INPUT) {
                for (z = pb, raw_ul = 0; z < b->n; z++) {
                    get_iug_u_raw_occ(uidx, b->a[z]>>1, &ul, NULL); raw_ul += ul;
                }
                ul = wt; get_arcs(ug->g, wt, &wt, 1); wt = ug->g->arc[wt].v^1;
                wp[0] = wt^1; wp[1] = (uint32_t)-1;
                nw = asg_arc_n(g, wt); aw = asg_arc_a(g, wt); 
                for (i = kwt = 0; i < nw; ++i) {
                    if (aw[i].del) continue;
                    if (aw[i].v == (ul^1)) wte = &(aw[i]);
                    else wp[1] = aw[i].v;
                    kwt++;
                }
                // if((v>>1) == 16783) {
                //     fprintf(stderr, "bbb[M::%s::] v>>1::%u, v&1::%u, w>>1::%u, w&1::%u, wt>>1::%u, wt&1::%u, kwt::%u\n", 
                //     __func__, v>>1, v&1, w>>1, w&1, wt>>1, wt&1, kwt);
                // }
                nw = asg_arc_n(g, w); aw = asg_arc_a(g, w); 
            } else {
                b->n = pb;
                continue;
            }
        }
        // if((v>>1) == 16783) {
        //     fprintf(stderr, "bbb[M::%s::] v>>1::%u, v&1::%u, raw_ul::%lu, max_ext::%u, ***1***\n", 
        //     __func__, v>>1, v&1, raw_ul, max_ext);
        // }
        assert(kv == 2 && kwt == 2);
        if(raw_ul <= max_ext && get_remove_hifi_occ(uidx, max_ext_hifi, b->a + pb, b->n - pb, ub, NULL)) {
            raw_hifi = get_ug_integer_seq_occ(uidx, b->a + pb, b->n - pb, ub);
            // if((v>>1) == 16783) {
            //     fprintf(stderr, "bbb[M::%s::] v>>1::%u, v&1::%u, ***2***\n", 
            //     __func__, v>>1, v&1);
            // }

            b->n = pb;
            if(raw_ul > 0) {
                if(!ul_occ_check(uidx, ug, raw_ul, raw_hifi, vp[0], small_occ_rate, b, ub)) continue;
                if(!ul_occ_check(uidx, ug, raw_ul, raw_hifi, vp[1], small_occ_rate, b, ub)) continue;
                if(!ul_occ_check(uidx, ug, raw_ul, raw_hifi, wp[0], small_occ_rate, b, ub)) continue;
                if(!ul_occ_check(uidx, ug, raw_ul, raw_hifi, wp[1], small_occ_rate, b, ub)) continue;
            }
            
            // if((v>>1) == 16783) {
            //     fprintf(stderr, "bbb[M::%s::] v>>1::%u, v&1::%u, ***3***\n", 
            //     __func__, v>>1, v&1);
            // }
            pb = b->n; ub->n = 0;
            get_ul_arc_supports(uidx, ve, b, ub, skip_hom, &w_q, &w_t);
            b->n = pb; ub->n = 0;
            if((w_q == (uint64_t)-1) || (w_q > w_t*len_rat)) continue;

            // if((v>>1) == 16783) {
            //     fprintf(stderr, "bbb[M::%s::] v>>1::%u, v&1::%u, ***4***\n", 
            //     __func__, v>>1, v&1);
            // }

            pb = b->n; ub->n = 0;
            get_ul_arc_supports(uidx, wte, b, ub, skip_hom, &w_q, &w_t);
            b->n = pb; ub->n = 0;
            if((w_q == (uint64_t)-1) || (w_q > w_t*len_rat)) continue;

            // if((v>>1) == 16783) {
            //     fprintf(stderr, "bbb[M::%s::] v>>1::%u, v&1::%u, ***5***\n", 
            //     __func__, v>>1, v&1);
            // }

            if(!ul_homo_path_check(uidx, ug, vp[0], wp[1], raw_ug_occ, raw_match_rate, b, ub)) continue;


            // if((v>>1) == 16783) {
            //     fprintf(stderr, "bbb[M::%s::] v>>1::%u, v&1::%u, ***6***\n", 
            //     __func__, v>>1, v&1);
            // }
            if(!ul_homo_path_check(uidx, ug, wp[0], vp[1], raw_ug_occ, raw_match_rate, b, ub)) continue;

            // if((v>>1) == 16783) {
            //     fprintf(stderr, "bbb[M::%s::] v>>1::%u, v&1::%u, ***7***\n", 
            //     __func__, v>>1, v&1);
            // }

            if(kw == 1) {
                get_ul_path_info(uidx, ug, w^1, &wt, NULL, NULL, NULL, NULL, b);
                for (z = pb; z < b->n; z++) ulg_seq_del(ug, (b->a[z]>>1));
            }
            ve->del = we->del = 1; cnt++;
        }

        b->n = pb;
    }



    if(!in) free(tx.a); if(!ib) free(tb.a);
    if (cnt > 0) asg_cleanup(g);
    // fprintf(stderr, "[M::%s::] cnt::%u\n", __func__, cnt);
    return cnt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movss %xmm2, 0x70(%rsp)
movl %r8d, 0xb4(%rsp)
movss %xmm1, 0x50(%rsp)
movss %xmm0, 0x74(%rsp)
movl %ecx, 0x88(%rsp)
movl %edx, 0x54(%rsp)
movq %rsi, %r14
movq 0x158(%rsp), %rcx
movq 0x150(%rsp), %rsi
xorps %xmm0, %xmm0
leaq 0xd0(%rsp), %r8
movaps %xmm0, (%r8)
xorl %edx, %edx
movq %rdx, 0x10(%r8)
leaq 0xf0(%rsp), %r11
movq %rdx, 0x10(%r11)
movaps %xmm0, (%r11)
movq 0x18(%r14), %r9
movl 0x14(%r9), %eax
addl %eax, %eax
testq %rsi, %rsi
movq %rsi, %r10
cmoveq %r8, %r10
testq %rcx, %rcx
movq %r11, 0x20(%rsp)
cmoveq %r11, %rcx
movq %rcx, 0x40(%rsp)
movq %rdi, 0x38(%rsp)
movq %rdx, (%r10)
testl %eax, %eax
movq %r9, 0x28(%rsp)
movq %r14, 0x58(%rsp)
movq %r10, 0x30(%rsp)
je 0x207813
movq 0x158(%rsp), %rcx
testq %rcx, %rcx
movq 0x20(%rsp), %rdx
cmovneq %rcx, %rdx
movq %rdx, 0x20(%rsp)
movq 0x150(%rsp), %r15
testq %r15, %r15
leaq 0xd0(%rsp), %rcx
cmoveq %rcx, %r15
movl %eax, %eax
movq %rax, 0x60(%rsp)
xorl %ebp, %ebp
movq 0x20(%r9), %rax
movl %ebp, %ecx
shrl %ecx
cmpl $0x0, (%rax,%rcx,8)
js 0x207805
movq 0x28(%r9), %rax
movq (%rax,%rbp,8), %rax
testl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
je 0x207805
movq 0x8(%r9), %rdx
movq %rax, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rsi
leaq (%rdx,%rsi,8), %rbx
movl %eax, %ecx
leaq (%rdx,%rsi,8), %rdx
addq $0xc, %rdx
xorl %edi, %edi
movl $0x1, %esi
movl %edi, %r8d
movl (%rdx), %edi
notl %edi
shrl $0x1f, %edi
addl %r8d, %edi
cmpq %rcx, %rsi
jae 0x207622
addq $0x18, %rdx
incq %rsi
cmpl $0x3, %edi
jb 0x207604
cmpl $0x2, %edi
jne 0x207805
movl %eax, %r13d
xorl %r12d, %r12d
leaq (%r12,%r12,2), %rax
cmpl $0x0, 0xc(%rbx,%rax,8)
js 0x2077f9
leaq (%rbx,%rax,8), %rcx
movq 0x18(%r14), %rax
movl 0x8(%rcx), %edx
movq %rdx, %rcx
xorq $0x1, %rcx
movq 0x28(%rax), %rsi
movq (%rsi,%rcx,8), %rcx
movq %rcx, %rsi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
andq %rdi, %rsi
je 0x207691
shrq $0x20, %rcx
movq 0x8(%rax), %rdi
xorl %eax, %eax
movl %ecx, %r8d
leaq (%r8,%r8,2), %r8
movl 0xc(%rdi,%r8,8), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %eax
incq %rcx
decq %rsi
jne 0x207671
jmp 0x207693
xorl %eax, %eax
cmpl $0x1, %eax
je 0x2076fa
cmpl $0x2, %eax
jne 0x2077f9
movq 0x8(%r15), %rax
cmpq %rax, (%r10)
jne 0x2076d9
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%r15)
movq 0x10(%r15), %rdi
shlq $0x3, %rsi
callq 0x2370
movq 0x30(%rsp), %r10
movq 0x28(%rsp), %r9
movq %rax, 0x10(%r15)
movq %rbx, %rax
subq 0x8(%r9), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
addq %r12, %rax
jmp 0x2077e7
movq 0x40(%rsp), %rax
movq $0x0, (%rax)
movq %rax, 0x10(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq 0x38(%rsp), %rdi
movq %r14, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x202015
movabsq $0x1fffffffe, %r8       # imm = 0x1FFFFFFFE
movq 0x30(%rsp), %r10
movq 0x28(%rsp), %r9
cmpl $0x1, %eax
jne 0x2077f9
movq 0x40(%rsp), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x207788
movq 0x20(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x38(%rsp), %rdx
movq 0x258(%rdx), %rdx
xorl %esi, %esi
xorl %r14d, %r14d
movq (%rcx,%rsi,8), %rdi
andq %r8, %rdi
movl (%rdx,%rdi,2), %edi
addq %rdi, %r14
incq %rsi
movl %esi, %edi
cmpq %rdi, %rax
ja 0x20776b
shlq $0x20, %r14
jmp 0x20778b
xorl %r14d, %r14d
movq 0x8(%r15), %rax
cmpq %rax, (%r10)
jne 0x2077c3
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%r15)
movq 0x10(%r15), %rdi
shlq $0x3, %rsi
callq 0x2370
movq 0x30(%rsp), %r10
movq 0x28(%rsp), %r9
movq %rax, 0x10(%r15)
movq %rbx, %rax
subq 0x8(%r9), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
addq %r12, %rax
orq %r14, %rax
movq 0x58(%rsp), %r14
movq 0x10(%r15), %rcx
movq (%r10), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, (%r10)
movq %rax, (%rcx,%rdx,8)
incq %r12
cmpq %r13, %r12
jne 0x207631
incq %rbp
cmpq 0x60(%rsp), %rbp
jne 0x2075bb
movq 0x150(%rsp), %rax
testq %rax, %rax
leaq 0xd0(%rsp), %r13
cmovneq %rax, %r13
movq 0x10(%r13), %rdi
movq (%r10), %rax
leaq (%rdi,%rax,8), %rsi
callq 0x1e3b6a
movq 0x30(%rsp), %r10
movq 0x28(%rsp), %rdi
movq (%r10), %r15
testq %r15, %r15
movl $0x0, %eax
movq %rax, 0x90(%rsp)
je 0x2080fd
movl 0x54(%rsp), %eax
movq %rax, 0xc8(%rsp)
movl 0x88(%rsp), %eax
movq %rax, 0xc0(%rsp)
xorl %eax, %eax
movq $0x0, 0x90(%rsp)
xorl %ebx, %ebx
movq %r13, 0x20(%rsp)
movq 0x8(%rdi), %rdx
movq 0x10(%r13), %rcx
movl (%rcx,%rax,8), %eax
leaq (%rax,%rax,2), %rax
cmpl $0x0, 0xc(%rdx,%rax,8)
js 0x207d9a
leaq (%rdx,%rax,8), %r9
movq (%r9), %r14
movq 0x20(%rdi), %rax
movq %r14, %rcx
shrq $0x21, %rcx
cmpl $0x0, (%rax,%rcx,8)
js 0x207d9a
movl 0x8(%r9), %r12d
movl %r12d, %ecx
shrl %ecx
cmpl $0x0, (%rax,%rcx,8)
js 0x207d9a
shrq $0x20, %r14
movq %r12, %rax
xorq $0x1, %rax
movq 0x28(%rdi), %rcx
movq (%rcx,%r14,8), %r8
movq (%rcx,%rax,8), %rsi
cmpl $0x1, %r8d
ja 0x2078fc
cmpl $0x2, %esi
jb 0x207d9a
movq %r12, 0x60(%rsp)
movq %r9, 0x88(%rsp)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %r13d, %r13d
movl $0x0, %ecx
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
testl %r8d, %r8d
je 0x207964
movq %r8, %rcx
shrq $0x20, %rcx
movl %r8d, %r8d
leaq (%rcx,%rcx,2), %rcx
leaq (%rdx,%rcx,8), %r11
addq $0xc, %r11
shlq $0x3, %r8
leaq (%r8,%r8,2), %r8
xorl %r9d, %r9d
xorl %ecx, %ecx
cmpl $0x0, (%r11,%r9)
js 0x20795b
movl -0x4(%r11,%r9), %r12d
cmpl 0x60(%rsp), %r12d
cmovnel %r12d, %r10d
incl %ecx
addq $0x18, %r9
cmpq %r9, %r8
jne 0x207944
movl %r10d, 0x54(%rsp)
xorl $0x1, %r14d
testl %esi, %esi
je 0x2079b5
movq %rsi, %r8
shrq $0x20, %r8
leaq (%r8,%r8,2), %r8
leaq (%rdx,%r8,8), %rdx
movl %esi, %esi
xorl %r9d, %r9d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %r13d, %r13d
movq 0x30(%rsp), %r10
cmpl $0x0, 0xc(%rdx)
js 0x2079aa
movl 0x8(%rdx), %r8d
cmpl %r14d, %r8d
cmovnel %r8d, %ebp
cmoveq %rdx, %r9
incl %r13d
addq $0x18, %rdx
decq %rsi
jne 0x207992
jmp 0x2079bd
xorl %r9d, %r9d
movq 0x30(%rsp), %r10
cmpl $0x2, %ecx
setb %dl
cmpl $0x2, %r13d
setb %sil
testb %sil, %dl
jne 0x207d95
cmpl $0x2, %ecx
setne %cl
cmpl $0x3, %r13d
setae %dl
orb %cl, %dl
jne 0x207d95
movl %eax, 0x4c(%rsp)
movq 0x40(%rsp), %rax
movq $0x0, (%rax)
cmpl $0x1, %r13d
jne 0x207a87
movq %r9, 0x80(%rsp)
movq %r10, 0x10(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq 0x38(%rsp), %r12
movq %r12, %rdi
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
leaq 0x4c(%rsp), %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
movq %r10, %rbp
callq 0x202015
cmpl $0x1, %eax
jne 0x207aa5
movq (%rbp), %rax
movl %r15d, %esi
cmpq %rsi, %rax
movabsq $0x1fffffffe, %r8       # imm = 0x1FFFFFFFE
jbe 0x207ab2
movq 0x20(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x258(%r12), %rdx
leal 0x1(%r15), %edi
xorl %r9d, %r9d
movq (%rcx,%rsi,8), %rsi
andq %r8, %rsi
movl (%rdx,%rsi,2), %esi
addq %rsi, %r9
movl %edi, %esi
incl %edi
cmpq %rsi, %rax
ja 0x207a6f
jmp 0x207ab5
movl %r13d, %eax
movq 0x60(%rsp), %rcx
movl %ecx, %edx
movq %r9, %r11
movq $0x0, 0x98(%rsp)
jmp 0x207b7f
movq 0x28(%rsp), %rdi
movq %rbp, %r10
jmp 0x207d92
xorl %r9d, %r9d
movq %r9, 0x98(%rsp)
movl 0x4c(%rsp), %esi
movq 0x58(%rsp), %rax
movq 0x18(%rax), %rbp
movq %rbp, %rdi
movl %esi, %r12d
leaq 0x4c(%rsp), %rdx
movl $0x1, %ecx
callq 0x1e50d4
movq 0x8(%rbp), %rax
movl 0x4c(%rsp), %ecx
leaq (%rcx,%rcx,2), %rcx
movl 0x8(%rax,%rcx,8), %edx
movq %rdx, %rax
xorq $0x1, %rax
movl %eax, 0x4c(%rsp)
movq 0x28(%rsp), %rdi
movq 0x28(%rdi), %rcx
movq (%rcx,%rax,8), %rax
testl %eax, %eax
je 0x207b68
movq %rdx, 0x78(%rsp)
movq %rax, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
addq 0x8(%rdi), %rcx
movl %eax, %edx
xorl %eax, %eax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x80(%rsp), %r9
movq %r9, %r11
movq 0x30(%rsp), %r10
cmpl $0x0, 0xc(%rcx)
js 0x207b58
movl 0x8(%rcx), %esi
movl %esi, %r8d
xorl %r12d, %r8d
cmpl $0x1, %r8d
cmovnel %esi, %ebp
cmoveq %rcx, %r11
incl %eax
addq $0x18, %rcx
decq %rdx
jne 0x207b3c
movq 0x78(%rsp), %rdx
jmp 0x207b7f
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %eax, %eax
movq 0x80(%rsp), %r9
movq %r9, %r11
movq 0x30(%rsp), %r10
cmpl $0x2, %eax
jne 0x20815c
movq 0xc8(%rsp), %rax
cmpq %rax, 0x98(%rsp)
ja 0x207d92
movq %rdx, 0x78(%rsp)
movq %r11, 0xb8(%rsp)
movq %r9, 0x80(%rsp)
leaq (,%r15,8), %rax
movq 0x20(%rsp), %rcx
movq 0x10(%rcx), %rdx
movq %rax, 0x68(%rsp)
addq %rax, %rdx
movq (%r10), %rcx
subq %r15, %rcx
movq 0x38(%rsp), %rdi
movq 0xc0(%rsp), %rsi
movq 0x40(%rsp), %r8
xorl %r9d, %r9d
movq %r10, %r12
callq 0x22129a
testq %rax, %rax
je 0x207d8a
movq 0x68(%rsp), %rsi
movq 0x20(%rsp), %rax
addq 0x10(%rax), %rsi
movq (%r12), %rdx
subq %r15, %rdx
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rcx
callq 0x206d75
movq %r15, (%r12)
movq 0x98(%rsp), %rdx
testq %rdx, %rdx
movq %r12, %r10
je 0x207d14
movq 0x40(%rsp), %rcx
movq %rcx, (%rsp)
movq 0x38(%rsp), %rdi
movq 0x58(%rsp), %r15
movq %r15, %rsi
movq %rax, 0x68(%rsp)
movq %rax, %rcx
movl %r14d, %r8d
movss 0x50(%rsp), %xmm0
movq %rdx, %r12
movq %r10, %r9
callq 0x206dc7
testl %eax, %eax
je 0x2080d7
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %rdi
movq %r15, %rsi
movl %r12d, %edx
movq 0x68(%rsp), %rcx
movl 0x54(%rsp), %r8d
movss 0x50(%rsp), %xmm0
movq 0x30(%rsp), %r9
callq 0x206dc7
testl %eax, %eax
je 0x2080d7
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %rdi
movq %r15, %rsi
movl %r12d, %edx
movq 0x68(%rsp), %rcx
movq 0x78(%rsp), %r8
movss 0x50(%rsp), %xmm0
movq 0x30(%rsp), %r9
callq 0x206dc7
testl %eax, %eax
je 0x2080d7
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %rdi
movq %r15, %rsi
movl %r12d, %edx
movq 0x68(%rsp), %rcx
movl %ebp, %r8d
movss 0x50(%rsp), %xmm0
movq 0x30(%rsp), %r15
movq %r15, %r9
callq 0x206dc7
testl %eax, %eax
movq %r15, %r10
je 0x207ebb
movq (%r10), %r15
xorl %eax, %eax
movq 0x40(%rsp), %r12
movq %rax, (%r12)
leaq 0xa0(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %rdi
movq 0x88(%rsp), %rsi
movq %r10, %rdx
movq %r12, %rcx
movl 0x140(%rsp), %r8d
leaq 0xa8(%rsp), %r9
callq 0x204934
movq 0x30(%rsp), %r10
movq %r15, (%r10)
xorl %eax, %eax
movq %rax, (%r12)
movq 0xa8(%rsp), %rax
cmpq $-0x1, %rax
je 0x207ebb
testq %rax, %rax
movq 0x28(%rsp), %rdi
js 0x207db0
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
jmp 0x207dc8
movq 0x28(%rsp), %rdi
movq %r12, %r10
movq %r15, (%r10)
movq 0x20(%rsp), %r13
incl %ebx
movq (%r10), %r15
movq %rbx, %rax
cmpq %rbx, %r15
ja 0x20788d
jmp 0x2080fd
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
movq 0xb8(%rsp), %rsi
movq 0xa0(%rsp), %rax
testq %rax, %rax
js 0x207de4
cvtsi2ss %rax, %xmm1
jmp 0x207df9
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm1
mulss 0x74(%rsp), %xmm1
ucomiss %xmm1, %xmm0
ja 0x207d95
movq (%r10), %r15
movq 0x40(%rsp), %r12
xorl %eax, %eax
movq %rax, (%r12)
leaq 0xa0(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %rdi
movq %r10, %rdx
movq %r12, %rcx
movl 0x140(%rsp), %r8d
leaq 0xa8(%rsp), %r9
callq 0x204934
movq 0x30(%rsp), %r10
movq %r15, (%r10)
xorl %eax, %eax
movq %rax, (%r12)
movq 0xa8(%rsp), %rax
cmpq $-0x1, %rax
je 0x207ebb
testq %rax, %rax
movss 0x70(%rsp), %xmm0
js 0x207e6c
cvtsi2ss %rax, %xmm2
jmp 0x207e81
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm2
addss %xmm2, %xmm2
movq 0xa0(%rsp), %rax
testq %rax, %rax
js 0x207e98
xorps %xmm1, %xmm1
cvtsi2ss %rax, %xmm1
jmp 0x207eb0
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm1, %xmm1
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm1
mulss 0x74(%rsp), %xmm1
ucomiss %xmm1, %xmm2
jbe 0x207ec5
movq 0x28(%rsp), %rdi
jmp 0x207d95
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %rdi
movq 0x58(%rsp), %rsi
movl %r14d, %edx
movl %ebp, %ecx
movl 0xb4(%rsp), %ebp
movl %ebp, %r8d
movq %r10, %r9
movq %r10, %r14
callq 0x20709b
testl %eax, %eax
je 0x2080eb
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %rdi
movq %r14, %r9
movq 0x58(%rsp), %r14
movq %r14, %rsi
movq 0x78(%rsp), %rdx
movl 0x54(%rsp), %ecx
movl %ebp, %r8d
movss 0x70(%rsp), %xmm0
callq 0x20709b
testl %eax, %eax
je 0x2080d7
cmpl $0x1, %r13d
movq 0x30(%rsp), %r10
jne 0x2080a3
movq %r14, %r13
movq %r10, 0x10(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq 0x38(%rsp), %rdi
movq %r14, %rsi
movq 0x60(%rsp), %rdx
leaq 0x4c(%rsp), %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x202015
movq 0x30(%rsp), %r10
movl %r15d, %eax
cmpq %rax, (%r10)
jbe 0x2080a3
movl %r15d, %r14d
movq 0x20(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq (%rcx,%rax,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
xorl %esi, %esi
leaq (%rsi,%rax), %rdi
movq 0x28(%rdx), %r8
movq (%r8,%rdi,8), %r9
movq %r9, %r8
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
andq %r10, %r8
je 0x208049
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), %r12
movq (%r12,%r11,8), %r12
movq %r12, %r11
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
andq %r13, %r11
je 0x208041
movq 0x8(%rdx), %r13
shrq $0x20, %r12
shlq $0x3, %r11
leaq (%r11,%r11,2), %r11
leaq (%r12,%r12,2), %r12
leaq 0xc(,%r12,8), %r12
addq %r13, %r12
xorl %r13d, %r13d
movl -0x4(%r12,%r13), %ebp
xorl %edi, %ebp
cmpl $0x1, %ebp
jne 0x208038
orb $-0x80, 0x3(%r12,%r13)
addq $0x18, %r13
cmpq %r13, %r11
jne 0x208026
incq %r10
cmpq %r8, %r10
jne 0x207fdb
leaq 0x1(%rsi), %rdi
testq %rsi, %rsi
movq %rdi, %rsi
je 0x207faa
movq 0x58(%rsp), %r13
movq 0x10(%r13), %rax
shlq $0x3, %rcx
leaq (%rcx,%rcx,4), %r12
movq 0x18(%rax,%r12), %rdi
callq 0x2220
movq 0x10(%r13), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax,%r12)
movups %xmm0, (%rax,%r12)
movq $0x0, 0x20(%rax,%r12)
incl %r14d
movq %r14, %rax
movq 0x30(%rsp), %r10
cmpq %r14, (%r10)
ja 0x207f81
movq 0x80(%rsp), %rax
orb $-0x80, 0xf(%rax)
movq 0x88(%rsp), %rax
orb $-0x80, 0xf(%rax)
movq 0x90(%rsp), %rax
incl %eax
movq %rax, 0x90(%rsp)
movq 0x28(%rsp), %rdi
jmp 0x207d92
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %r13
movq 0x30(%rsp), %r10
jmp 0x207d9a
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %r13
movq %r14, %r10
jmp 0x207d9a
cmpq $0x0, 0x150(%rsp)
jne 0x20811a
movq 0xe0(%rsp), %rdi
callq 0x2220
movq 0x28(%rsp), %rdi
cmpq $0x0, 0x158(%rsp)
movq 0x90(%rsp), %rbx
jne 0x20813f
movq 0x100(%rsp), %rdi
callq 0x2220
movq 0x28(%rsp), %rdi
testl %ebx, %ebx
je 0x208148
callq 0xa02fa
movl %ebx, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x33fe4(%rip), %rdi     # 0x23c147
leaq 0x311bb(%rip), %rsi     # 0x239325
leaq 0x33fea(%rip), %rcx     # 0x23c15b
movl $0x28c2, %edx           # imm = 0x28C2
callq 0x2110