// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: find_bubble_tangle(bubble_type*, ma_ug_t*, unsigned char*, unsigned char*, unsigned int, double, double, kvec_t_u32_warp*, kvec_t_u32_warp*, kvec_t_u32_warp*, kvec_t_u32_warp*, unsigned char*, unsigned int*, unsigned int*, unsigned int*, unsigned int*, unsigned int*, unsigned int*)
int find_bubble_tangle(bubble_type* bub, ma_ug_t* ug, uint8_t* is_vis, uint8_t* is_vis2, 
uint32_t v, double side_rate, double total_rate, kvec_t_u32_warp* stack, 
kvec_t_u32_warp* stack2, kvec_t_u32_warp* res_btg, kvec_t_u32_warp* res_utg, uint8_t* chain_flag, 
uint32_t* r_b_utg_beg, uint32_t* r_b_utg_sink, uint32_t* r_b_tg_beg, uint32_t* r_b_tg_sink,
uint32_t* r_utg_beg, uint32_t* r_utg_sink)
{
    (*r_b_utg_beg) = (*r_b_utg_sink) = (*r_b_tg_beg) = (*r_b_tg_sink) = (*r_utg_beg) = (*r_utg_sink) = (uint32_t)-1;
    ma_ug_t *bub_ug = bub->b_ug;
    ma_utg_t *u = NULL;
    uint32_t tan_occ = 0, cur, ncur, i, k, no_root = 0, v_occ, c_occ, utg_occ, w, btg_beg, btg_sink, utg_beg, utg_sink, is_t, extra_check;
    stack->a.n = 0;
    asg_arc_t *acur = NULL;

    memset(is_vis, 0, bub_ug->g->n_seq<<1);
    stack->a.n = 0;
    kv_push(uint32_t, stack->a, v);
    v_occ = get_btg_occ(bub, v>>1);
    while (stack->a.n > 0)
    {
        stack->a.n--;
        cur = stack->a.a[stack->a.n];
        if(is_vis[cur]) continue;
    
        c_occ = 0;
        if(no_root && cur == v) return 0;
        if(no_root && is_vis[cur] == 0 && is_vis[cur^1] == 0)
        {
            c_occ = get_btg_occ(bub, cur>>1);
            ///assume v_occ is the beg node, c_occ is the end node, which means tan_occ cannot be too large
            if((tan_occ*side_rate) < c_occ && (tan_occ*total_rate) < (c_occ + v_occ))
            {
                if(check_bubble_tangle(bub, bub->b_ug, v, cur^1, side_rate, total_rate, v_occ, c_occ, 
                is_vis2, stack2, NULL, NULL, NULL))
                {
                    check_bubble_tangle(bub, bub->b_ug, v, cur^1, side_rate, total_rate, v_occ, c_occ, 
                    is_vis2, stack2, res_btg, NULL, NULL);

                    for (k = 0; k < res_btg->a.n; k++) 
                    {
                        set_b_utg_weight_flag(bub, NULL, res_btg->a.a[k], chain_flag, 0, NULL);
                    }
                    btg_beg = v; btg_sink = cur^1;///b_utg id

                    u = &(bub_ug->u.a[btg_beg>>1]);
                    if((btg_beg&1)==1)
                    {
                        get_bubbles(bub, (u->a[0]>>32)>>1, (((u->a[0]>>32)&1)^1)==1?&w:NULL, 
                                                    (((u->a[0]>>32)&1)^1) == 0?&w:NULL, NULL, NULL, NULL);
                        (*r_b_tg_beg) = u->a[0]>>32;
                    } 
                    else
                    {
                        get_bubbles(bub, (u->a[u->n-1]>>32)>>1, ((u->a[u->n-1]>>32)&1)==1?&w:NULL, 
                                                    ((u->a[u->n-1]>>32)&1) == 0?&w:NULL, NULL, NULL, NULL);
                        (*r_b_tg_beg) = u->a[u->n-1]>>32;
                    }
                    utg_beg = w^1; ///ug id


                    u = &(bub_ug->u.a[btg_sink>>1]);
                    if((btg_sink&1)==1)
                    {
                        get_bubbles(bub, (u->a[0]>>32)>>1, (((u->a[0]>>32)&1)^1)==1?&w:NULL, 
                                                    (((u->a[0]>>32)&1)^1) == 0?&w:NULL, NULL, NULL, NULL);
                        (*r_b_tg_sink) = u->a[0]>>32;
                    } 
                    else
                    {
                        get_bubbles(bub, (u->a[u->n-1]>>32)>>1, ((u->a[u->n-1]>>32)&1)==1?&w:NULL, 
                                                    ((u->a[u->n-1]>>32)&1) == 0?&w:NULL, NULL, NULL, NULL);
                        (*r_b_tg_sink) = u->a[u->n-1]>>32;
                    }
                    utg_sink = w^1; ///ug id

                    is_t = check_bubble_tangle(NULL, ug, utg_beg, utg_sink, side_rate, total_rate, 
                    (uint32_t)-1, (uint32_t)-1, is_vis2, stack2, res_utg, chain_flag, &extra_check);

                    if(is_t == 1 && extra_check == 0)
                    {
                        for (k = utg_occ = 0; k < res_utg->a.n; k++) 
                        {
                            if(IF_HOM((res_utg->a.a[k]>>1), *bub)) continue;
                            utg_occ += ug->u.a[res_utg->a.a[k]>>1].n;
                        }

                        if(utg_occ*total_rate >= (v_occ+c_occ)) is_t = 0;
                    }

                    for (k = 0; k < res_btg->a.n; k++) 
                    {
                        set_b_utg_weight_flag(bub, NULL, res_btg->a.a[k], chain_flag, 1, NULL);
                    }
                    
                    if(is_t)
                    {
                        (*r_b_utg_beg) = btg_beg;
                        (*r_b_utg_sink) = btg_sink;
                        (*r_utg_beg) = utg_beg;
                        (*r_utg_sink) = utg_sink;
                        return is_t;
                    } 
                }
            }
        }
        
        is_vis[cur] = 1; 
        if(cur != (v^1))
        {
            ncur = asg_arc_n(bub_ug->g, cur);
            acur = asg_arc_a(bub_ug->g, cur);
            for (i = 0; i < ncur; i++)
            {
                if(acur[i].del) continue;
                if(acur[i].v == v) return 0;
                if(is_vis[acur[i].v]) continue;
                kv_push(uint32_t, stack->a, acur[i].v);
            }
        }
        

        if(no_root) tan_occ += c_occ;
        if((tan_occ*side_rate) >= v_occ) return 0;
        no_root = 1;
    }

    if(tan_occ*side_rate >= v_occ) return 0;
    if(tan_occ*total_rate >= v_occ) return 0;
    //let one end as a tangle
    if(check_bubble_tangle(bub, bub->b_ug, v, (uint32_t)-1, side_rate, total_rate, v_occ, (uint32_t)-1, 
                    is_vis2, stack2, res_btg, NULL, NULL) == 0)
    {
        return 0;
    }

    for (k = 0; k < res_btg->a.n; k++) 
    {
        set_b_utg_weight_flag(bub, NULL, res_btg->a.a[k], chain_flag, 0, NULL);
    }

    btg_beg = v;
    u = &(bub_ug->u.a[btg_beg>>1]);
    if((btg_beg&1)==1)
    {
        get_bubbles(bub, (u->a[0]>>32)>>1, (((u->a[0]>>32)&1)^1)==1?&w:NULL, 
                                    (((u->a[0]>>32)&1)^1) == 0?&w:NULL, NULL, NULL, NULL);
        (*r_b_tg_beg) = u->a[0]>>32;
    } 
    else
    {
        get_bubbles(bub, (u->a[u->n-1]>>32)>>1, ((u->a[u->n-1]>>32)&1)==1?&w:NULL, 
                                    ((u->a[u->n-1]>>32)&1) == 0?&w:NULL, NULL, NULL, NULL);
        (*r_b_tg_beg) = u->a[u->n-1]>>32;
    }
    utg_beg = w^1;

    is_t = check_bubble_tangle(NULL, ug, utg_beg, (uint32_t)-1, side_rate, total_rate, 
                    (uint32_t)-1, (uint32_t)-1, is_vis2, stack2, res_utg, chain_flag, &extra_check);
    
    if(is_t == 1 && extra_check == 0)
    {
        for (k = utg_occ = 0; k < res_utg->a.n; k++) 
        {
            if(IF_HOM((res_utg->a.a[k]>>1), *bub)) continue;
            utg_occ += ug->u.a[res_utg->a.a[k]>>1].n;
        }

        if(utg_occ*total_rate >= v_occ) is_t = 0;
    }
    
    for (k = 0; k < res_btg->a.n; k++) 
    {
        set_b_utg_weight_flag(bub, NULL, res_btg->a.a[k], chain_flag, 1, NULL);
    }

    if(is_t)
    {
        (*r_b_utg_beg) = btg_beg;
        (*r_utg_beg) = utg_beg;
    }
    return is_t;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r9, %r13
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
movl %r8d, 0x4(%rsp)
movq %rcx, 0x38(%rsp)
movq %rdx, %r9
movq %rsi, 0x48(%rsp)
movq %rdi, %rbp
movq 0x118(%rsp), %rsi
movq 0x110(%rsp), %r14
movq 0x108(%rsp), %r8
movq 0x100(%rsp), %rdx
movq 0xf8(%rsp), %rdi
movq 0xf0(%rsp), %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, (%rsi)
movl %eax, (%r14)
movl %eax, (%r8)
movl %eax, (%rdx)
movl %eax, (%rdi)
movl %eax, (%rcx)
movq 0xc0(%rbp), %rax
xorl %ebx, %ebx
movq %rbx, (%r13)
movq %rax, 0x58(%rsp)
movq 0x18(%rax), %rax
movl 0x14(%rax), %eax
addl %eax, %eax
movslq %eax, %rdx
movq %r9, 0x28(%rsp)
movq %r9, %rdi
xorl %esi, %esi
callq 0x20e0
movq %rbx, (%r13)
cmpq %rbx, 0x8(%r13)
je 0x14da6d
movq 0x10(%r13), %rax
xorl %ebx, %ebx
jmp 0x14da8b
movq $0x2, 0x8(%r13)
movq 0x10(%r13), %rdi
movl $0x8, %esi
callq 0x2370
movq %rax, 0x10(%r13)
movq (%r13), %rbx
leaq 0x1(%rbx), %rcx
movq %rcx, (%r13)
movl 0x4(%rsp), %r12d
movl %r12d, (%rax,%rbx,4)
shrl %r12d
movq %rbp, %rdi
movl %r12d, %esi
callq 0x14d3d2
movl %eax, %ecx
incq %rbx
jne 0x14dacb
movl %ecx, %eax
cvtsi2sd %rax, %xmm3
xorpd %xmm2, %xmm2
movl 0x4(%rsp), %edx
movsd 0x8(%rsp), %xmm0
jmp 0x14e0a2
movq %rbp, 0x18(%rsp)
movl %r12d, %eax
movl %ecx, 0x44(%rsp)
movl %ecx, %ecx
cvtsi2sd %rcx, %xmm3
xorl %r14d, %r14d
leaq (%rax,%rax,4), %rax
movq %rax, 0x90(%rsp)
xorl %eax, %eax
movl 0x4(%rsp), %edx
movsd 0x8(%rsp), %xmm0
movsd %xmm3, 0x20(%rsp)
movq 0x28(%rsp), %r8
movl %r12d, 0x6c(%rsp)
movq %rbx, %rcx
decq %rbx
movq %rbx, (%r13)
movq 0x10(%r13), %rsi
movl -0x4(%rsi,%rcx,4), %ebp
cmpb $0x0, (%r8,%rbp)
jne 0x14de16
testl %eax, %eax
je 0x14db32
cmpl %edx, %ebp
je 0x14e330
xorl %r12d, %r12d
testl %eax, %eax
je 0x14dd1c
movq %rbp, %r15
xorq $0x1, %r15
cmpb $0x0, (%r8,%r15)
jne 0x14dd1c
movl %ebp, %ebx
shrl %ebx
movq 0x18(%rsp), %rdi
movl %ebx, %esi
callq 0x14d3d2
movsd 0x8(%rsp), %xmm0
movl %r14d, %ecx
xorps %xmm3, %xmm3
cvtsi2sd %rcx, %xmm3
movl %eax, %r12d
movapd %xmm3, %xmm1
mulsd %xmm0, %xmm1
movl %eax, %eax
xorps %xmm2, %xmm2
cvtsi2sd %rax, %xmm2
ucomisd %xmm1, %xmm2
jbe 0x14dd0d
movq %rbx, 0x50(%rsp)
movsd 0x10(%rsp), %xmm1
mulsd %xmm1, %xmm3
movl %r12d, %eax
movl 0x44(%rsp), %ebx
addl %ebx, %eax
xorps %xmm4, %xmm4
cvtsi2sd %rax, %xmm4
ucomisd %xmm3, %xmm4
movl 0x4(%rsp), %edx
xorpd %xmm2, %xmm2
jbe 0x14dd11
movsd %xmm4, 0x70(%rsp)
movq 0x18(%rsp), %rdi
movq 0xc0(%rdi), %rsi
subq $0x30, %rsp
movupd %xmm2, 0x10(%rsp)
movq 0x100(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x68(%rsp), %rax
movq %rax, (%rsp)
movq $0x0, 0x20(%rsp)
movl %r15d, %ecx
movl %ebx, %r8d
movl %r12d, %r9d
callq 0x14d45e
addq $0x30, %rsp
testl %eax, %eax
je 0x14de24
movq %r14, 0x88(%rsp)
movq 0x18(%rsp), %rdi
movq 0xc0(%rdi), %rsi
subq $0x30, %rsp
xorpd %xmm0, %xmm0
movupd %xmm0, 0x18(%rsp)
movq 0x108(%rsp), %r14
movq %r14, 0x10(%rsp)
movq 0x100(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x68(%rsp), %rax
movq %rax, (%rsp)
movl 0x34(%rsp), %edx
movq %r15, 0xa8(%rsp)
movl %r15d, %ecx
movsd 0x38(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movl %ebx, %r8d
movl %r12d, %r9d
callq 0x14d45e
addq $0x30, %rsp
cmpq $0x0, (%r14)
movq 0xe8(%rsp), %r15
je 0x14dcbf
movl $0x1, %ebx
xorl %eax, %eax
movq 0x10(%r14), %rdx
movl (%rdx,%rax,4), %edx
movq 0x18(%rsp), %rdi
xorl %esi, %esi
movq %r15, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x14d241
movl %ebx, %eax
incl %ebx
cmpq %rax, (%r14)
ja 0x14dc9a
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x90(%rsp), %rdx
movq 0x18(%rax,%rdx,8), %rcx
testb $0x1, 0x4(%rsp)
jne 0x14de33
leaq (%rax,%rdx,8), %rdx
movl 0x10(%rdx), %edx
decl %edx
movq (%rcx,%rdx,8), %rsi
movq %rsi, %rdx
shrq $0x21, %rdx
btq $0x20, %rsi
movq 0x18(%rsp), %r8
movq 0x40(%r8), %rcx
movl (%rcx,%rdx,4), %edi
sbbl $-0x1, %edi
jmp 0x14de51
movl 0x4(%rsp), %edx
movsd 0x20(%rsp), %xmm3
movq 0x28(%rsp), %r8
movq %r14, %r15
movb $0x1, (%r8,%rbp)
movl %ebp, %eax
xorl %edx, %eax
cmpl $0x1, %eax
je 0x14ddec
movq 0x58(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x28(%rcx), %rax
movq (%rax,%rbp,8), %rax
testl %eax, %eax
je 0x14ddec
movq 0x8(%rcx), %rcx
movq %rax, %rsi
shrq $0x20, %rsi
movl %eax, %eax
leaq (%rsi,%rsi,2), %rsi
leaq (%rcx,%rsi,8), %rbx
addq $0x8, %rbx
shlq $0x3, %rax
leaq (%rax,%rax,2), %rbp
xorl %r14d, %r14d
cmpl $0x0, 0x4(%rbx,%r14)
js 0x14dde3
movl (%rbx,%r14), %ecx
cmpl %edx, %ecx
je 0x14e330
cmpb $0x0, (%r8,%rcx)
jne 0x14dde3
movq (%r13), %rdi
movq 0x10(%r13), %rax
cmpq 0x8(%r13), %rdi
jne 0x14ddd8
leaq (%rdi,%rdi), %rsi
testq %rdi, %rdi
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r13)
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x28(%rsp), %r8
movsd 0x20(%rsp), %xmm3
movsd 0x8(%rsp), %xmm0
movl 0x4(%rsp), %edx
movq %rax, 0x10(%r13)
movl (%rbx,%r14), %ecx
movq (%r13), %rdi
leaq 0x1(%rdi), %rsi
movq %rsi, (%r13)
movl %ecx, (%rax,%rdi,4)
addq $0x18, %r14
cmpq %r14, %rbp
jne 0x14dd6e
addl %r15d, %r12d
xorps %xmm1, %xmm1
cvtsi2sd %r12, %xmm1
mulsd %xmm0, %xmm1
ucomisd %xmm3, %xmm1
jae 0x14e330
movq (%r13), %rbx
movl $0x1, %eax
movl %r12d, %r14d
movl 0x6c(%rsp), %r12d
testq %rbx, %rbx
jne 0x14db09
jmp 0x14e086
movl 0x4(%rsp), %edx
movsd 0x8(%rsp), %xmm0
jmp 0x14dd11
movq (%rcx), %rsi
movq 0x18(%rsp), %r8
movq 0x40(%r8), %rcx
movq %rsi, %rdx
shrq $0x21, %rdx
movl (%rcx,%rdx,4), %edi
btq $0x20, %rsi
adcl $0x0, %edi
movsd 0x10(%rsp), %xmm1
movq 0x48(%rsp), %rbx
movsd 0x8(%rsp), %xmm0
movq 0xe0(%rsp), %r10
movq 0x28(%r8), %r8
movl %edi, %edi
movl (%r8,%rdi,4), %edx
shrq $0x20, %rsi
movq 0x100(%rsp), %rdi
movl %esi, (%rdi)
movq 0x50(%rsp), %rsi
leaq (%rsi,%rsi,4), %rdi
movq 0x18(%rax,%rdi,8), %rsi
testb $0x1, %bpl
jne 0x14dead
movq (%rsi), %rax
movq %rax, %rsi
shrq $0x21, %rsi
movl (%rcx,%rsi,4), %ecx
btq $0x20, %rax
adcl $0x0, %ecx
jmp 0x14decc
leaq (%rax,%rdi,8), %rax
movl 0x10(%rax), %eax
decl %eax
movq (%rsi,%rax,8), %rax
movq %rax, %rsi
shrq $0x21, %rsi
btq $0x20, %rax
movl (%rcx,%rsi,4), %ecx
sbbl $-0x1, %ecx
xorl $0x1, %edx
movl %ecx, %ecx
movl (%r8,%rcx,4), %r8d
shrq $0x20, %rax
movq 0x108(%rsp), %rcx
movl %eax, (%rcx)
xorl $0x1, %r8d
subq $0x8, %rsp
xorl %edi, %edi
movq %rbx, %rsi
movl %edx, 0x70(%rsp)
movl %r8d, 0x6c(%rsp)
movl %r8d, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
leaq 0x3c(%rsp), %rax
pushq %rax
pushq 0xf8(%rsp)
pushq %r10
pushq 0xf0(%rsp)
pushq 0x60(%rsp)
callq 0x14d45e
addq $0x30, %rsp
testl %eax, %eax
movq %r12, 0x80(%rsp)
je 0x14dfca
cmpl $0x0, 0x34(%rsp)
jne 0x14dfca
movq 0xe0(%rsp), %rsi
movq (%rsi), %rax
testq %rax, %rax
movsd 0x10(%rsp), %xmm1
je 0x14dfaf
movq 0x18(%rsp), %rdx
movq (%rdx), %rcx
movq 0x80(%rdx), %rdx
movq 0x10(%rsi), %rsi
incq %rdx
xorl %edi, %edi
xorl %r8d, %r8d
movsd 0x70(%rsp), %xmm2
movl (%rsi,%rdi,4), %r9d
shrl %r9d
movl (%rcx,%r9,4), %r10d
cmpq %r10, %rdx
jb 0x14df9a
movq 0x10(%rbx), %r10
leaq (%r9,%r9,4), %r9
addl 0x10(%r10,%r9,8), %r8d
incq %rdi
movl %edi, %r9d
cmpq %r9, %rax
ja 0x14df7d
movl %r8d, %eax
cvtsi2sd %rax, %xmm0
jmp 0x14dfb9
xorpd %xmm0, %xmm0
movsd 0x70(%rsp), %xmm2
mulsd %xmm1, %xmm0
movl $0x1, %eax
ucomisd %xmm2, %xmm0
jb 0x14dfca
xorl %eax, %eax
movl %eax, 0x50(%rsp)
movq 0xd8(%rsp), %r15
cmpq $0x0, (%r15)
movq 0x18(%rsp), %r12
movq 0xe8(%rsp), %r14
je 0x14e016
movl $0x1, %ebx
xorl %eax, %eax
movq 0x10(%r15), %rdx
movl (%rdx,%rax,4), %edx
movq %r12, %rdi
xorl %esi, %esi
movq %r14, %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x14d241
movl %ebx, %eax
incl %ebx
cmpq %rax, (%r15)
ja 0x14dff0
cmpl $0x0, 0x50(%rsp)
movl 0x4(%rsp), %edx
movsd 0x8(%rsp), %xmm0
movsd 0x20(%rsp), %xmm3
movq 0x88(%rsp), %r14
movq 0x28(%rsp), %r8
movq 0x80(%rsp), %r12
je 0x14dd1c
movq 0xf0(%rsp), %rax
movl %edx, (%rax)
movq 0xf8(%rsp), %rax
movq 0x78(%rsp), %rcx
movl %ecx, (%rax)
movq 0x110(%rsp), %rax
movl 0x68(%rsp), %ecx
movl %ecx, (%rax)
movq 0x118(%rsp), %rax
movl 0x64(%rsp), %ecx
movl %ecx, (%rax)
movl $0x1, %r15d
jmp 0x14e333
movl %r14d, %eax
xorps %xmm2, %xmm2
cvtsi2sd %rax, %xmm2
movq 0x110(%rsp), %r14
movq 0x18(%rsp), %rbp
movl 0x44(%rsp), %ecx
movapd %xmm2, %xmm1
mulsd %xmm0, %xmm1
xorl %r15d, %r15d
ucomisd %xmm3, %xmm1
movq 0xe8(%rsp), %r13
jae 0x14e333
movsd 0x10(%rsp), %xmm1
mulsd %xmm1, %xmm2
ucomisd %xmm3, %xmm2
jae 0x14e333
movsd %xmm3, 0x20(%rsp)
movq 0xc0(%rbp), %rsi
subq $0x30, %rsp
xorpd %xmm2, %xmm2
movupd %xmm2, 0x18(%rsp)
movq 0x108(%rsp), %rbx
movq %rbx, 0x10(%rsp)
movq 0x100(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x68(%rsp), %rax
movq %rax, (%rsp)
movq %rbp, %rdi
movl %ecx, %r8d
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0x14d45e
addq $0x30, %rsp
testl %eax, %eax
je 0x14e333
cmpq $0x0, (%rbx)
je 0x14e166
movq %rbx, %r15
movl $0x1, %ebx
xorl %eax, %eax
movq 0x10(%r15), %rcx
movl (%rcx,%rax,4), %edx
movq %rbp, %rdi
xorl %esi, %esi
movq %r13, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x14d241
movl %ebx, %eax
incl %ebx
cmpq %rax, (%r15)
ja 0x14e143
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rcx
movl %r12d, %eax
leaq (%rax,%rax,4), %rdx
movq 0x18(%rcx,%rdx,8), %rax
testb $0x1, 0x4(%rsp)
jne 0x14e1a7
leaq (%rcx,%rdx,8), %rcx
movl 0x10(%rcx), %ecx
decl %ecx
movq (%rax,%rcx,8), %rax
movq %rax, %rcx
shrq $0x21, %rcx
btq $0x20, %rax
movq 0x40(%rbp), %rdx
movl (%rdx,%rcx,4), %ecx
sbbl $-0x1, %ecx
jmp 0x14e1c0
movq (%rax), %rax
movq 0x40(%rbp), %rcx
movq %rax, %rdx
shrq $0x21, %rdx
movl (%rcx,%rdx,4), %ecx
btq $0x20, %rax
adcl $0x0, %ecx
movsd 0x10(%rsp), %xmm1
movq 0x48(%rsp), %rbx
movq 0x38(%rsp), %r10
movsd 0x8(%rsp), %xmm0
movq 0xe0(%rsp), %r11
movq 0xd0(%rsp), %r15
movq 0x28(%rbp), %rdx
movl %ecx, %ecx
movl (%rdx,%rcx,4), %edx
shrq $0x20, %rax
movq 0x100(%rsp), %rcx
movl %eax, (%rcx)
xorl $0x1, %edx
subq $0x8, %rsp
leaq 0x3c(%rsp), %rax
xorl %edi, %edi
movq %rbx, %rsi
movl %edx, 0x30(%rsp)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
pushq %rax
pushq %r13
pushq %r11
pushq %r15
pushq %r10
callq 0x14d45e
addq $0x30, %rsp
movl %eax, %r15d
testl %eax, %eax
je 0x14e2d6
cmpl $0x0, 0x34(%rsp)
jne 0x14e2d6
movq 0xe0(%rsp), %rsi
movq (%rsi), %rax
testq %rax, %rax
je 0x14e2b3
movq (%rbp), %rcx
movq 0x80(%rbp), %rdx
movq 0x10(%rsi), %rsi
incq %rdx
xorl %edi, %edi
xorl %r8d, %r8d
movsd 0x10(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
movl (%rsi,%rdi,4), %r9d
shrl %r9d
movl (%rcx,%r9,4), %r10d
cmpq %r10, %rdx
jb 0x14e29b
movq 0x10(%rbx), %r10
leaq (%r9,%r9,4), %r9
addl 0x10(%r10,%r9,8), %r8d
incq %rdi
movl %edi, %r9d
cmpq %r9, %rax
ja 0x14e27e
movl %r8d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
jmp 0x14e2c3
xorpd %xmm0, %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
mulsd %xmm1, %xmm0
movl $0x1, %r15d
ucomisd %xmm2, %xmm0
jb 0x14e2d6
xorl %r15d, %r15d
movq 0xd8(%rsp), %r12
cmpq $0x0, (%r12)
je 0x14e314
movl $0x1, %ebx
xorl %eax, %eax
movq 0x10(%r12), %rcx
movl (%rcx,%rax,4), %edx
movq %rbp, %rdi
xorl %esi, %esi
movq %r13, %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x14d241
movl %ebx, %eax
incl %ebx
cmpq %rax, (%r12)
ja 0x14e2ec
testl %r15d, %r15d
je 0x14e330
movl 0x4(%rsp), %eax
movq 0xf0(%rsp), %rcx
movl %eax, (%rcx)
movl 0x28(%rsp), %eax
movl %eax, (%r14)
jmp 0x14e333
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq