// File: /workspace/github_cpp_makefile_star2_O1/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 $0x88, %rsp
movq %r9, %r13
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x18(%rsp)
movl %r8d, %ebx
movq %rcx, 0x50(%rsp)
movq %rdx, %r12
movq %rsi, 0x40(%rsp)
movq 0x108(%rsp), %r10
movq 0x100(%rsp), %rcx
movq 0xf8(%rsp), %r9
movq 0xf0(%rsp), %rsi
movq 0xe8(%rsp), %r8
movq 0xe0(%rsp), %rdx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, (%r10)
movl %eax, (%rcx)
movl %eax, (%r9)
movl %eax, (%rsi)
movl %eax, (%r8)
movl %eax, (%rdx)
movq %rdi, (%rsp)
movq 0xc0(%rdi), %rax
xorl %ebp, %ebp
movq %rbp, (%r13)
movq %rax, 0x60(%rsp)
movq 0x18(%rax), %rax
movl 0x14(%rax), %eax
addl %eax, %eax
movslq %eax, %rdx
movq %r12, %rdi
xorl %esi, %esi
callq 0x20e0
movq %rbp, (%r13)
cmpq %rbp, 0x8(%r13)
jne 0x14742e
movq $0x2, 0x8(%r13)
movq 0x10(%r13), %rdi
movl $0x8, %esi
callq 0x2370
movq %rax, 0x10(%r13)
movq 0xd8(%rsp), %r15
movq (%r13), %rax
movq 0x10(%r13), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%r13)
movl %ebx, (%rcx,%rax,4)
movl %ebx, %esi
shrl %esi
movq (%rsp), %rdi
movq %rsi, 0x78(%rsp)
callq 0x146d7f
movl %eax, %r8d
movl %eax, %r14d
cvtsi2sd %r14, %xmm2
movl $0x2, %r10d
xorl %eax, %eax
movl %ebx, %edx
movl %ebx, 0x8(%rsp)
movsd 0x18(%rsp), %xmm0
movq (%r13), %rcx
decq %rcx
cmpq $-0x1, %rcx
je 0x147ae6
movq %rcx, (%r13)
movq 0x10(%r13), %rsi
movl (%rsi,%rcx,4), %ebx
decq %rcx
cmpb $0x0, (%r12,%rbx)
jne 0x147481
cmpl %edx, %ebx
sete %cl
testb %cl, %al
jne 0x147c20
xorl %r11d, %r11d
testb $0x1, %al
movq %rbp, 0x48(%rsp)
je 0x1476d5
movq %rbx, %r15
xorq $0x1, %r15
cmpb $0x0, (%r12,%r15)
jne 0x1476d5
movsd %xmm2, 0x28(%rsp)
movq %r14, 0x38(%rsp)
movl %r8d, 0xc(%rsp)
movl %ebx, %esi
shrl %esi
movq (%rsp), %rdi
movq %rsi, 0x58(%rsp)
callq 0x146d7f
movsd 0x18(%rsp), %xmm0
movl %ebp, %ecx
xorps %xmm3, %xmm3
cvtsi2sd %rcx, %xmm3
movl %eax, %r11d
movapd %xmm3, %xmm1
mulsd %xmm0, %xmm1
movl %eax, %eax
xorps %xmm2, %xmm2
cvtsi2sd %rax, %xmm2
ucomisd %xmm1, %xmm2
jbe 0x1476bb
movsd 0x10(%rsp), %xmm1
mulsd %xmm1, %xmm3
movl %r11d, %eax
movl 0xc(%rsp), %r8d
addl %r8d, %eax
xorps %xmm2, %xmm2
cvtsi2sd %rax, %xmm2
ucomisd %xmm3, %xmm2
movl 0x8(%rsp), %edx
jbe 0x1476c4
movsd %xmm2, 0x70(%rsp)
movq (%rsp), %rdi
movq 0xc0(%rdi), %rsi
subq $0x30, %rsp
xorpd %xmm2, %xmm2
movupd %xmm2, 0x10(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x80(%rsp), %rbp
movq %rbp, (%rsp)
movq $0x0, 0x20(%rsp)
movl %r15d, %ecx
movl %r8d, %r14d
movl %r11d, %r9d
movq %r11, 0x60(%rsp)
callq 0x146e0b
addq $0x30, %rsp
testl %eax, %eax
je 0x1477ea
movq %r15, %rcx
movq (%rsp), %rdi
movq 0xc0(%rdi), %rsi
subq $0x30, %rsp
xorpd %xmm0, %xmm0
movupd %xmm0, 0x18(%rsp)
movq 0xf8(%rsp), %r15
movq %r15, 0x10(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %rbp, (%rsp)
movl 0x38(%rsp), %edx
movq %rcx, 0xb0(%rsp)
movsd 0x48(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movl %r14d, %r8d
movq 0x60(%rsp), %r9
callq 0x146e0b
addq $0x30, %rsp
cmpq $0x0, (%r15)
je 0x147644
movl $0x1, %ebp
xorl %eax, %eax
movq 0x10(%r15), %rcx
movl (%rcx,%rax,4), %edx
movq (%rsp), %rdi
xorl %esi, %esi
movq 0xd8(%rsp), %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x146be0
movl %ebp, %eax
incl %ebp
cmpq %rax, (%r15)
ja 0x14761b
movq 0xd8(%rsp), %rbp
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x78(%rsp), %rcx
leaq (%rcx,%rcx,4), %rdx
movq 0x18(%rax,%rdx,8), %rcx
testb $0x1, 0x8(%rsp)
jne 0x147812
leaq (%rax,%rdx,8), %rsi
movl 0x10(%rsi), %edx
decl %edx
movq (%rcx,%rdx,8), %rdi
movq %rdi, %rdx
shrq $0x21, %rdx
movabsq $0x100000000, %r8       # imm = 0x100000000
testq %r8, %rdi
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm0
movq 0xd0(%rsp), %r10
jne 0x14784c
movq (%rsp), %rdi
movq 0x40(%rdi), %rdi
movl (%rdi,%rdx,4), %edx
incl %edx
jmp 0x147857
movl 0x8(%rsp), %edx
movl 0xc(%rsp), %r8d
movq 0x38(%rsp), %r14
movsd 0x28(%rsp), %xmm2
movl $0x2, %r10d
movb $0x1, (%r12,%rbx)
movl %ebx, %eax
xorl %edx, %eax
cmpl $0x1, %eax
je 0x1477bd
movq 0x60(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x28(%rcx), %rax
movq (%rax,%rbx,8), %rax
testl %eax, %eax
je 0x1477bd
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 %r15d, %r15d
movl %r8d, 0xc(%rsp)
movsd %xmm2, 0x28(%rsp)
movq %r11, 0x30(%rsp)
cmpl $0x0, 0x4(%rbx,%r15)
js 0x1477b0
movl (%rbx,%r15), %eax
cmpl %edx, %eax
je 0x147c20
cmpb $0x0, (%r12,%rax)
jne 0x1477b0
movq 0x8(%r13), %rax
cmpq %rax, (%r13)
jne 0x147799
leaq (%rax,%rax), %rsi
testq %rax, %rax
cmoveq %r10, %rsi
movq %rsi, 0x8(%r13)
movq 0x10(%r13), %rdi
shlq $0x2, %rsi
callq 0x2370
movq 0x30(%rsp), %r11
movl $0x2, %r10d
movsd 0x28(%rsp), %xmm2
movl 0xc(%rsp), %r8d
movsd 0x18(%rsp), %xmm0
movl 0x8(%rsp), %edx
movq %rax, 0x10(%r13)
movl (%rbx,%r15), %eax
movq (%r13), %rcx
movq 0x10(%r13), %rdi
leaq 0x1(%rcx), %rsi
movq %rsi, (%r13)
movl %eax, (%rdi,%rcx,4)
addq $0x18, %r15
cmpq %r15, %rbp
jne 0x147734
addl 0x48(%rsp), %r11d
xorps %xmm1, %xmm1
cvtsi2sd %r11, %xmm1
mulsd %xmm0, %xmm1
movb $0x1, %al
ucomisd %xmm2, %xmm1
movl %r11d, %ebp
movq 0xd8(%rsp), %r15
jb 0x14747a
jmp 0x147c20
movl 0x8(%rsp), %edx
movsd 0x18(%rsp), %xmm0
movl %r14d, %r8d
movq 0x38(%rsp), %r14
movsd 0x28(%rsp), %xmm2
movl $0x2, %r10d
movq 0x30(%rsp), %r11
jmp 0x1476d5
movq (%rcx), %rsi
movq %rsi, %rdx
shrq $0x21, %rdx
movabsq $0x100000000, %rdi      # imm = 0x100000000
testq %rdi, %rsi
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm0
movq 0xd0(%rsp), %r10
jne 0x147870
movq (%rsp), %rdi
movq 0x40(%rdi), %rsi
movl (%rsi,%rdx,4), %edx
jmp 0x14787d
movq (%rsp), %rdi
movq 0x40(%rdi), %rdi
movl (%rdi,%rdx,4), %edx
movl %edx, %edx
shlq $0x2, %rdx
movq (%rsp), %rdi
addq 0x28(%rdi), %rdx
movl 0x10(%rsi), %esi
decl %esi
leaq (%rcx,%rsi,8), %rcx
jmp 0x147885
movq (%rsp), %rdi
movq 0x40(%rdi), %rsi
movl (%rsi,%rdx,4), %edx
incl %edx
shlq $0x2, %rdx
addq 0x28(%rdi), %rdx
movl (%rdx), %r8d
movl 0x4(%rcx), %ecx
movq 0xf0(%rsp), %rdx
movl %ecx, (%rdx)
movq 0x58(%rsp), %rcx
leaq (%rcx,%rcx,4), %rdx
movq 0x18(%rax,%rdx,8), %rcx
testb $0x1, %bl
jne 0x1478ce
movq (%rcx), %rdx
movq %rdx, %rax
shrq $0x21, %rax
movabsq $0x100000000, %rsi      # imm = 0x100000000
testq %rsi, %rdx
jne 0x147900
movq (%rsp), %rsi
movq 0x40(%rsi), %rdx
movl (%rdx,%rax,4), %eax
jmp 0x14790d
leaq (%rax,%rdx,8), %rdx
movl 0x10(%rdx), %eax
decl %eax
movq (%rcx,%rax,8), %rsi
movq %rsi, %rax
shrq $0x21, %rax
movabsq $0x100000000, %rdi      # imm = 0x100000000
testq %rdi, %rsi
jne 0x147917
movq (%rsp), %rsi
movq 0x40(%rsi), %rsi
movl (%rsi,%rax,4), %eax
incl %eax
jmp 0x147922
movq (%rsp), %rsi
movq 0x40(%rsi), %rdx
movl (%rdx,%rax,4), %eax
incl %eax
shlq $0x2, %rax
addq 0x28(%rsi), %rax
jmp 0x147939
movq (%rsp), %rsi
movq 0x40(%rsi), %rsi
movl (%rsi,%rax,4), %eax
movl %eax, %eax
shlq $0x2, %rax
movq (%rsp), %rsi
addq 0x28(%rsi), %rax
movl 0x10(%rdx), %edx
decl %edx
leaq (%rcx,%rdx,8), %rcx
xorl $0x1, %r8d
movl (%rax), %r9d
movl 0x4(%rcx), %eax
movq 0xf8(%rsp), %rcx
movl %eax, (%rcx)
xorl $0x1, %r9d
subq $0x8, %rsp
xorl %edi, %edi
movq 0x48(%rsp), %rsi
movl %r8d, 0x74(%rsp)
movl %r8d, %edx
movl %r9d, 0x70(%rsp)
movl %r9d, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
leaq 0x2c(%rsp), %rax
pushq %rax
pushq %rbp
pushq %r10
pushq 0xe0(%rsp)
pushq 0x78(%rsp)
callq 0x146e0b
addq $0x30, %rsp
testl %eax, %eax
je 0x147a30
cmpl $0x0, 0x24(%rsp)
jne 0x147a30
movq 0xd0(%rsp), %rsi
movq (%rsi), %rax
testq %rax, %rax
movsd 0x10(%rsp), %xmm1
je 0x147a15
movq (%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 0x147a00
movq 0x40(%rsp), %r10
movq 0x10(%r10), %r10
leaq (%r9,%r9,4), %r9
addl 0x10(%r10,%r9,8), %r8d
incq %rdi
movl %edi, %r9d
cmpq %r9, %rax
ja 0x1479de
movl %r8d, %eax
cvtsi2sd %rax, %xmm0
jmp 0x147a1f
xorpd %xmm0, %xmm0
movsd 0x70(%rsp), %xmm2
mulsd %xmm1, %xmm0
movl $0x1, %eax
ucomisd %xmm2, %xmm0
jb 0x147a30
xorl %eax, %eax
movl %eax, 0x58(%rsp)
movq 0xc8(%rsp), %r14
cmpq $0x0, (%r14)
je 0x147a73
movq %rbp, %r15
movl $0x1, %ebp
xorl %eax, %eax
movq 0x10(%r14), %rdx
movl (%rdx,%rax,4), %edx
movq (%rsp), %rdi
xorl %esi, %esi
movq %r15, %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x146be0
movl %ebp, %eax
incl %ebp
cmpq %rax, (%r14)
ja 0x147a4c
cmpl $0x0, 0x58(%rsp)
movl 0x8(%rsp), %edx
movsd 0x18(%rsp), %xmm0
movl 0xc(%rsp), %r8d
movq 0x38(%rsp), %r14
movsd 0x28(%rsp), %xmm2
movl $0x2, %r10d
movq 0x30(%rsp), %r11
movq 0x80(%rsp), %rcx
je 0x1476d5
movq 0xe0(%rsp), %rax
movl %edx, (%rax)
movq 0xe8(%rsp), %rax
movl %ecx, (%rax)
movq 0x100(%rsp), %rax
movl 0x6c(%rsp), %ecx
movl %ecx, (%rax)
movq 0x108(%rsp), %rax
movl 0x68(%rsp), %ecx
movl %ecx, (%rax)
movl $0x1, %r12d
jmp 0x147daa
movl %ebp, %eax
xorps %xmm2, %xmm2
cvtsi2sd %rax, %xmm2
movapd %xmm2, %xmm1
xorps %xmm3, %xmm3
cvtsi2sd %r14, %xmm3
mulsd %xmm0, %xmm1
xorl %r12d, %r12d
ucomisd %xmm3, %xmm1
jae 0x147daa
movsd 0x10(%rsp), %xmm1
mulsd %xmm1, %xmm2
ucomisd %xmm3, %xmm2
jae 0x147daa
movsd %xmm3, 0x48(%rsp)
movq (%rsp), %rdi
movq 0xc0(%rdi), %rsi
subq $0x30, %rsp
xorpd %xmm2, %xmm2
movupd %xmm2, 0x18(%rsp)
movq 0xf8(%rsp), %r13
movq %r13, 0x10(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x80(%rsp), %rax
movq %rax, (%rsp)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0x146e0b
addq $0x30, %rsp
testl %eax, %eax
je 0x147daa
cmpq $0x0, (%r13)
je 0x147bb5
movl $0x1, %ebx
xorl %eax, %eax
movq 0x10(%r13), %rcx
movl (%rcx,%rax,4), %edx
movq (%rsp), %rdi
xorl %esi, %esi
movq %r15, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x146be0
movl %ebx, %eax
incl %ebx
cmpq %rax, (%r13)
ja 0x147b90
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x78(%rsp), %rax
leaq (%rax,%rax,4), %rdx
movq 0x18(%rcx,%rdx,8), %rax
testb $0x1, 0x8(%rsp)
jne 0x147c28
leaq (%rcx,%rdx,8), %rcx
movl 0x10(%rcx), %ecx
decl %ecx
leaq (%rax,%rcx,8), %rax
movq (%rax), %rcx
movq %rcx, %rdx
shrq $0x21, %rdx
btq $0x20, %rcx
movq (%rsp), %rsi
movq 0x40(%rsi), %rcx
movl (%rcx,%rdx,4), %ecx
sbbl $-0x1, %ecx
shlq $0x2, %rcx
addq 0x28(%rsi), %rcx
movsd 0x10(%rsp), %xmm1
movq 0x40(%rsp), %rbx
movsd 0x18(%rsp), %xmm0
movq 0xd0(%rsp), %r10
jmp 0x147c67
xorl %r12d, %r12d
jmp 0x147daa
movq (%rax), %rcx
movq %rcx, %rdx
shrq $0x21, %rdx
btq $0x20, %rcx
movq (%rsp), %rsi
movq 0x28(%rsi), %rcx
movq 0x40(%rsi), %rsi
movl (%rsi,%rdx,4), %edx
movsd 0x10(%rsp), %xmm1
movq 0x40(%rsp), %rbx
movsd 0x18(%rsp), %xmm0
movq 0xd0(%rsp), %r10
jae 0x147c63
incl %edx
leaq (%rcx,%rdx,4), %rcx
movl (%rcx), %ebp
movl 0x4(%rax), %eax
movq 0xf0(%rsp), %rcx
movl %eax, (%rcx)
xorl $0x1, %ebp
subq $0x8, %rsp
xorl %edi, %edi
movq %rbx, %rsi
movl %ebp, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
leaq 0x2c(%rsp), %rax
pushq %rax
pushq %r15
pushq %r10
pushq 0xe0(%rsp)
pushq 0x78(%rsp)
callq 0x146e0b
addq $0x30, %rsp
movl %eax, %r12d
testl %eax, %eax
je 0x147d57
cmpl $0x0, 0x24(%rsp)
jne 0x147d57
movq 0xd0(%rsp), %rsi
movq (%rsi), %rax
testq %rax, %rax
je 0x147d34
movq (%rsp), %rdx
movq (%rdx), %rcx
movq 0x80(%rdx), %rdx
movq 0x10(%rsi), %rsi
incq %rdx
xorl %edi, %edi
xorl %r8d, %r8d
movsd 0x10(%rsp), %xmm1
movsd 0x48(%rsp), %xmm2
movl (%rsi,%rdi,4), %r9d
shrl %r9d
movl (%rcx,%r9,4), %r10d
cmpq %r10, %rdx
jb 0x147d1c
movq 0x10(%rbx), %r10
leaq (%r9,%r9,4), %r9
addl 0x10(%r10,%r9,8), %r8d
incq %rdi
movl %edi, %r9d
cmpq %r9, %rax
ja 0x147cff
movl %r8d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
jmp 0x147d44
xorpd %xmm0, %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x48(%rsp), %xmm2
mulsd %xmm1, %xmm0
movl $0x1, %r12d
ucomisd %xmm2, %xmm0
jb 0x147d57
xorl %r12d, %r12d
cmpq $0x0, (%r13)
je 0x147d8d
movl $0x1, %ebx
xorl %eax, %eax
movq 0x10(%r13), %rcx
movl (%rcx,%rax,4), %edx
movq (%rsp), %rdi
xorl %esi, %esi
movq %r15, %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x146be0
movl %ebx, %eax
incl %ebx
cmpq %rax, (%r13)
ja 0x147d65
testl %r12d, %r12d
je 0x147daa
movl 0x8(%rsp), %eax
movq 0xe0(%rsp), %rcx
movl %eax, (%rcx)
movq 0x100(%rsp), %rax
movl %ebp, (%rax)
movl %r12d, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq