// File: /workspace/github_cpp_makefile_star2_O3/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, 0x78(%rsp)
movl %r8d, 0xb4(%rsp)
movss %xmm1, 0x5c(%rsp)
movss %xmm0, 0x7c(%rsp)
movl %ecx, %r14d
movl %edx, %r13d
movq %rsi, %rbp
movq %rdi, 0x38(%rsp)
movq 0x158(%rsp), %rcx
movq 0x150(%rsp), %r15
xorps %xmm0, %xmm0
leaq 0xd0(%rsp), %rbx
movaps %xmm0, (%rbx)
xorl %edx, %edx
movq %rdx, 0x10(%rbx)
leaq 0xf0(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movaps %xmm0, (%rsi)
movq 0x18(%rbp), %r9
movl 0x14(%r9), %eax
addl %eax, %eax
testq %r15, %r15
movq %r15, %r10
cmoveq %rbx, %r10
testq %rcx, %rcx
cmoveq %rsi, %rcx
movq %rcx, 0x40(%rsp)
movq $0x0, 0x90(%rsp)
movq %rdx, (%r10)
movl $0x0, %ecx
testl %eax, %eax
movq %r9, 0x28(%rsp)
movq %rbp, 0x60(%rsp)
movq %r10, 0x20(%rsp)
je 0x212d3c
movl %r13d, 0x88(%rsp)
movl %r14d, 0x50(%rsp)
movq 0x158(%rsp), %rcx
testq %rcx, %rcx
cmovneq %rcx, %rsi
movq %rsi, 0x30(%rsp)
testq %r15, %r15
cmoveq %rbx, %r15
movl %eax, %eax
movq %rax, 0x70(%rsp)
xorl %r13d, %r13d
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
movq 0x20(%r9), %rax
movl %r13d, %ecx
shrl %ecx
cmpl $0x0, (%rax,%rcx,8)
js 0x212d0e
movq 0x28(%r9), %rax
movq (%rax,%r13,8), %rax
testl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
je 0x212d0e
movq 0x8(%r9), %rcx
movq %rax, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rcx,%rdx,8), %rbx
movl %eax, %r14d
leaq (%rcx,%rdx,8), %rax
addq $0xc, %rax
xorl %edx, %edx
movl $0x1, %ecx
movl %edx, %esi
movl (%rax), %edx
notl %edx
shrl $0x1f, %edx
addl %esi, %edx
cmpq %r14, %rcx
jae 0x212b13
addq $0x18, %rax
incq %rcx
cmpl $0x3, %edx
jb 0x212af7
cmpl $0x2, %edx
jne 0x212d0e
xorl %r12d, %r12d
leaq (%r12,%r12,2), %rax
cmpl $0x0, 0xc(%rbx,%rax,8)
js 0x212d02
leaq (%rbx,%rax,8), %rax
movq 0x18(%rbp), %rsi
movl 0x8(%rax), %edx
movq %rdx, %rax
xorq $0x1, %rax
movq 0x28(%rsi), %rcx
movq (%rcx,%rax,8), %rax
movq %rax, %rcx
andq %r11, %rcx
je 0x212d02
shrq $0x20, %rax
movq 0x8(%rsi), %rdi
xorl %esi, %esi
movl %eax, %r8d
leaq (%r8,%r8,2), %r8
movl 0xc(%rdi,%r8,8), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %esi
incq %rax
decq %rcx
jne 0x212b5e
cmpl $0x1, %esi
je 0x212bfa
cmpl $0x2, %esi
jne 0x212d02
movq (%r10), %rcx
movq 0x10(%r15), %rax
cmpq 0x8(%r15), %rcx
jne 0x212bce
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r15)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
movq 0x20(%rsp), %r10
movq 0x28(%rsp), %r9
movq %rax, 0x10(%r15)
movq (%r10), %rcx
movq %rbx, %rdx
subq 0x8(%r9), %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
addq %r12, %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%r10)
movq %rdx, (%rax,%rcx,8)
jmp 0x212d02
movq 0x40(%rsp), %rax
movq $0x0, (%rax)
movq %rax, 0x10(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq 0x38(%rsp), %rdi
movq %rbp, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x20d67b
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
movabsq $0x1fffffffe, %r8       # imm = 0x1FFFFFFFE
movq 0x20(%rsp), %r10
movq 0x28(%rsp), %r9
cmpl $0x1, %eax
jne 0x212d02
movq 0x40(%rsp), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x212c8d
movq 0x30(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x38(%rsp), %rdx
movq 0x258(%rdx), %rdx
xorl %esi, %esi
xorl %ebp, %ebp
movq (%rcx,%rsi,8), %rdi
andq %r8, %rdi
movl (%rdx,%rdi,2), %edi
addq %rdi, %rbp
incq %rsi
movl %esi, %edi
cmpq %rdi, %rax
ja 0x212c70
shlq $0x20, %rbp
jmp 0x212c8f
xorl %ebp, %ebp
movq (%r10), %rcx
movq 0x10(%r15), %rax
cmpq 0x8(%r15), %rcx
jne 0x212cd3
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r15)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
movq 0x20(%rsp), %r10
movq 0x28(%rsp), %r9
movq %rax, 0x10(%r15)
movq (%r10), %rcx
movq %rbx, %rdx
subq 0x8(%r9), %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
addq %r12, %rdx
orq %rbp, %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%r10)
movq %rdx, (%rax,%rcx,8)
movq 0x60(%rsp), %rbp
incq %r12
cmpq %r14, %r12
jne 0x212b1f
incq %r13
cmpq 0x70(%rsp), %r13
jne 0x212aac
movq (%r10), %rcx
movq 0x150(%rsp), %r15
leaq 0xd0(%rsp), %rbx
movl 0x50(%rsp), %r14d
movl 0x88(%rsp), %r13d
testq %r15, %r15
cmovneq %r15, %rbx
movq 0x10(%rbx), %rdi
leaq (%rdi,%rcx,8), %rsi
callq 0x1ee586
movq 0x20(%rsp), %r10
movq 0x28(%rsp), %rdi
movq (%r10), %r12
testq %r12, %r12
je 0x2135f2
movl %r13d, %eax
movq %rax, 0xc8(%rsp)
movl %r14d, %eax
movq %rax, 0xc0(%rsp)
xorl %eax, %eax
movq $0x0, 0x90(%rsp)
xorl %r15d, %r15d
movq %rbx, 0x30(%rsp)
movq 0x8(%rdi), %rdx
movq 0x10(%rbx), %rcx
movl (%rcx,%rax,8), %eax
leaq (%rax,%rax,2), %rax
cmpl $0x0, 0xc(%rdx,%rax,8)
js 0x213285
leaq (%rdx,%rax,8), %r9
movq (%r9), %rbp
movq 0x20(%rdi), %rax
movq %rbp, %rcx
shrq $0x21, %rcx
cmpl $0x0, (%rax,%rcx,8)
js 0x213285
movl 0x8(%r9), %r11d
movl %r11d, %ecx
shrl %ecx
cmpl $0x0, (%rax,%rcx,8)
js 0x213285
shrq $0x20, %rbp
movq %r11, %rax
xorq $0x1, %rax
movq 0x28(%rdi), %rcx
movq (%rcx,%rbp,8), %r8
movq (%rcx,%rax,8), %rsi
cmpl $0x1, %r8d
ja 0x212e01
cmpl $0x2, %esi
jb 0x213285
movq %r11, 0x70(%rsp)
movq %r9, 0x88(%rsp)
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
xorl %ebx, %ebx
movl $0x0, %ecx
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testl %r8d, %r8d
je 0x212e69
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 0x212e60
movl -0x4(%r11,%r9), %r10d
cmpl 0x70(%rsp), %r10d
cmovnel %r10d, %r14d
incl %ecx
addq $0x18, %r9
cmpq %r9, %r8
jne 0x212e49
xorl $0x1, %ebp
testl %esi, %esi
je 0x212eb3
movq %rsi, %r8
shrq $0x20, %r8
leaq (%r8,%r8,2), %r8
leaq (%rdx,%r8,8), %rdx
movl %esi, %esi
xorl %r9d, %r9d
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
xorl %ebx, %ebx
movq 0x20(%rsp), %r10
cmpl $0x0, 0xc(%rdx)
js 0x212ea8
movl 0x8(%rdx), %r8d
cmpl %ebp, %r8d
cmovnel %r8d, %r13d
cmoveq %rdx, %r9
incl %ebx
addq $0x18, %rdx
decq %rsi
jne 0x212e91
jmp 0x212ebb
xorl %r9d, %r9d
movq 0x20(%rsp), %r10
cmpl $0x2, %ecx
setb %dl
cmpl $0x2, %ebx
setb %sil
testb %sil, %dl
jne 0x213280
cmpl $0x2, %ecx
setne %cl
cmpl $0x3, %ebx
setae %dl
orb %cl, %dl
jne 0x213280
movl %eax, 0x4c(%rsp)
movq 0x40(%rsp), %rax
movq $0x0, (%rax)
cmpl $0x1, %ebx
jne 0x212f84
movq %r9, 0x98(%rsp)
movq %r10, 0x10(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq 0x38(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x70(%rsp), %rdx
leaq 0x4c(%rsp), %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
movq %r10, %r13
callq 0x20d67b
cmpl $0x1, %eax
jne 0x212f9c
movq (%r13), %rax
movl %r12d, %esi
cmpq %rsi, %rax
movabsq $0x1fffffffe, %r8       # imm = 0x1FFFFFFFE
jbe 0x212fa9
movq 0x30(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x38(%rsp), %rdx
movq 0x258(%rdx), %rdx
leal 0x1(%r12), %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 0x212f6c
jmp 0x212fac
movl %ebx, %eax
movq 0x70(%rsp), %rcx
movq %r9, %r11
movq $0x0, 0x68(%rsp)
jmp 0x213069
movq 0x28(%rsp), %rdi
movq %r13, %r10
jmp 0x21327d
xorl %r9d, %r9d
movq %r9, 0x68(%rsp)
movl 0x4c(%rsp), %esi
movq 0x60(%rsp), %rax
movq 0x18(%rax), %r13
movq %r13, %rdi
movl %esi, 0x50(%rsp)
leaq 0x4c(%rsp), %rdx
movl $0x1, %ecx
callq 0x1efacc
movq 0x8(%r13), %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
movq 0x20(%rsp), %r10
movq 0x98(%rsp), %r9
je 0x213651
movq %rdx, 0x80(%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, %r13d      # imm = 0xFFFFFFFF
movq %r9, %r11
cmpl $0x0, 0xc(%rcx)
js 0x213058
movl 0x8(%rcx), %esi
movl %esi, %r8d
xorl 0x50(%rsp), %r8d
cmpl $0x1, %r8d
cmovnel %esi, %r13d
cmoveq %rcx, %r11
incl %eax
addq $0x18, %rcx
decq %rdx
jne 0x213039
movq 0x80(%rsp), %rcx
cmpl $0x2, %eax
jne 0x213651
movq 0x68(%rsp), %rax
cmpq 0xc8(%rsp), %rax
ja 0x21327d
movq %r11, 0xb8(%rsp)
movq %rcx, 0x80(%rsp)
movq %r9, 0x98(%rsp)
leaq (,%r12,8), %rax
movq 0x30(%rsp), %rcx
movq 0x10(%rcx), %rdx
movq %rax, 0x50(%rsp)
addq %rax, %rdx
movq (%r10), %rcx
subq %r12, %rcx
movq 0x38(%rsp), %rdi
movq 0xc0(%rsp), %rsi
movq 0x40(%rsp), %r8
xorl %r9d, %r9d
callq 0x22c98c
testq %rax, %rax
je 0x213273
movq 0x50(%rsp), %rsi
movq 0x30(%rsp), %rax
addq 0x10(%rax), %rsi
movq 0x20(%rsp), %rax
movq (%rax), %rdx
subq %r12, %rdx
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rcx
callq 0x212269
movq 0x20(%rsp), %r9
movq %r12, (%r9)
movq 0x68(%rsp), %rdx
testq %rdx, %rdx
je 0x213205
movq %rax, %rcx
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %rdi
movq 0x60(%rsp), %r12
movq %r12, %rsi
movq %rcx, 0x50(%rsp)
movl %ebp, %r8d
movss 0x5c(%rsp), %xmm0
movq %rdx, 0x68(%rsp)
callq 0x2122bb
testl %eax, %eax
je 0x2135cc
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %rdi
movq %r12, %rsi
movq 0x68(%rsp), %rdx
movq 0x50(%rsp), %rcx
movl %r14d, %r8d
movss 0x5c(%rsp), %xmm0
movq 0x20(%rsp), %r9
callq 0x2122bb
testl %eax, %eax
je 0x2135cc
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %rdi
movq %r12, %rsi
movq 0x68(%rsp), %rdx
movq 0x50(%rsp), %rcx
movq 0x80(%rsp), %r8
movss 0x5c(%rsp), %xmm0
movq 0x20(%rsp), %r9
callq 0x2122bb
testl %eax, %eax
je 0x2135cc
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %rdi
movq %r12, %rsi
movq 0x68(%rsp), %rdx
movq 0x50(%rsp), %rcx
movl %r13d, %r8d
movss 0x5c(%rsp), %xmm0
movq 0x20(%rsp), %r9
callq 0x2122bb
testl %eax, %eax
je 0x2135cc
movq 0x20(%rsp), %r9
movq (%r9), %r12
xorl %eax, %eax
movq 0x40(%rsp), %rcx
movq %rax, (%rcx)
leaq 0xa0(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %rdi
movq 0x88(%rsp), %rsi
movq %r9, %rdx
movl 0x140(%rsp), %r8d
leaq 0xa8(%rsp), %r9
callq 0x20fe1a
movq 0x20(%rsp), %r10
movq %r12, (%r10)
xorl %eax, %eax
movq 0x40(%rsp), %rcx
movq %rax, (%rcx)
movq 0xa8(%rsp), %rax
cmpq $-0x1, %rax
je 0x2133ad
testq %rax, %rax
js 0x21329c
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
jmp 0x2132b4
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %r10
movq %r12, (%r10)
movq 0x30(%rsp), %rbx
incl %r15d
movq (%r10), %r12
movq %r15, %rax
cmpq %r15, %r12
ja 0x212d92
jmp 0x2135f2
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
movq 0x38(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movq 0xa0(%rsp), %rax
testq %rax, %rax
js 0x2132d5
cvtsi2ss %rax, %xmm1
jmp 0x2132ea
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm1
mulss 0x7c(%rsp), %xmm1
ucomiss %xmm1, %xmm0
ja 0x2133ad
movq (%r10), %r12
leaq 0xa0(%rsp), %rax
movq %rax, (%rsp)
movq %r10, %rdx
movq 0x40(%rsp), %rcx
movl 0x140(%rsp), %r8d
leaq 0xa8(%rsp), %r9
callq 0x20fe1a
movq 0x20(%rsp), %r10
movq %r12, (%r10)
movq 0x40(%rsp), %rax
movq $0x0, (%rax)
movq 0xa8(%rsp), %rax
cmpq $-0x1, %rax
je 0x2133ad
testq %rax, %rax
movss 0x78(%rsp), %xmm0
js 0x213359
cvtsi2ss %rax, %xmm2
jmp 0x21336e
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm2
addss %xmm2, %xmm2
movq 0x38(%rsp), %rdx
movq 0xa0(%rsp), %rax
testq %rax, %rax
js 0x21338a
xorps %xmm1, %xmm1
cvtsi2ss %rax, %xmm1
jmp 0x2133a2
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm1, %xmm1
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm1
mulss 0x7c(%rsp), %xmm1
ucomiss %xmm1, %xmm2
jbe 0x2133b7
movq 0x28(%rsp), %rdi
jmp 0x213280
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movq %rdx, %rdi
movq 0x60(%rsp), %rsi
movl %ebp, %edx
movl %r13d, %ecx
movl 0xb4(%rsp), %ebp
movl %ebp, %r8d
movq %r10, %r9
movq %r10, %r13
callq 0x21258d
testl %eax, %eax
je 0x2135e0
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x80(%rsp), %rdx
movl %r14d, %ecx
movl %ebp, %r8d
movss 0x78(%rsp), %xmm0
movq %r13, %r9
callq 0x21258d
testl %eax, %eax
je 0x2135cc
cmpl $0x1, %ebx
movq 0x60(%rsp), %r13
movq 0x20(%rsp), %r10
jne 0x213598
movq %r10, 0x10(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq 0x38(%rsp), %rdi
movq %r13, %rsi
movq 0x70(%rsp), %rdx
leaq 0x4c(%rsp), %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x20d67b
movq 0x20(%rsp), %r10
movl %r12d, %eax
cmpq %rax, (%r10)
jbe 0x213598
movl %r12d, %ebx
movq 0x30(%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
movb $0x1, %sil
xorl %edi, %edi
orq %rax, %rdi
movq 0x28(%rdx), %r8
movq (%r8,%rdi,8), %r9
movq %r9, %r8
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
andq %r10, %r8
je 0x21353b
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), %r14
movq (%r14,%r11,8), %r14
movq %r14, %r11
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
andq %r13, %r11
je 0x213533
movq 0x8(%rdx), %r13
shrq $0x20, %r14
shlq $0x3, %r11
leaq (%r11,%r11,2), %r11
leaq (%r14,%r14,2), %r14
leaq 0xc(,%r14,8), %r14
addq %r13, %r14
xorl %r13d, %r13d
movl -0x4(%r14,%r13), %ebp
xorl %edi, %ebp
cmpl $0x1, %ebp
jne 0x21352a
orb $-0x80, 0x3(%r14,%r13)
addq $0x18, %r13
cmpq %r13, %r11
jne 0x213518
incq %r10
cmpq %r8, %r10
jne 0x2134cd
movl $0x1, %edi
testb $0x1, %sil
movl $0x0, %esi
jne 0x21349d
movq 0x60(%rsp), %r13
movq 0x10(%r13), %rax
shlq $0x3, %rcx
leaq (%rcx,%rcx,4), %r14
movq 0x18(%rax,%r14), %rdi
callq 0x2220
movq 0x10(%r13), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax,%r14)
movups %xmm0, (%rax,%r14)
movq $0x0, 0x20(%rax,%r14)
incl %ebx
movq %rbx, %rax
movq 0x20(%rsp), %r10
cmpq %rbx, (%r10)
ja 0x213471
movq 0x98(%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 0x21327d
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rbx
movq 0x20(%rsp), %r10
jmp 0x213285
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rbx
movq %r13, %r10
jmp 0x213285
cmpq $0x0, 0x150(%rsp)
jne 0x21360f
movq 0xe0(%rsp), %rdi
callq 0x2220
movq 0x28(%rsp), %rdi
cmpq $0x0, 0x158(%rsp)
movq 0x90(%rsp), %rbx
jne 0x213634
movq 0x100(%rsp), %rdi
callq 0x2220
movq 0x28(%rsp), %rdi
testl %ebx, %ebx
je 0x21363d
callq 0xa0a7d
movl %ebx, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x34dd3(%rip), %rdi     # 0x24842b
leaq 0x31faa(%rip), %rsi     # 0x245609
leaq 0x34dd9(%rip), %rcx     # 0x24843f
movl $0x28c2, %edx           # imm = 0x28C2
callq 0x2110