// File: /workspace/github_cpp_makefile_star2_O2/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 $0xa8, %rsp
movq %r9, %r13
movsd %xmm1, 0x48(%rsp)
movsd %xmm0, 0x38(%rsp)
movl %r8d, %r15d
movq %rcx, 0x58(%rsp)
movq %rdx, %rbp
movq %rsi, 0x88(%rsp)
movq %rdi, %r12
movq 0x128(%rsp), %rax
orl $-0x1, (%rax)
movq 0x120(%rsp), %rax
orl $-0x1, (%rax)
movq 0x118(%rsp), %rax
orl $-0x1, (%rax)
movq 0x110(%rsp), %rax
orl $-0x1, (%rax)
movq 0x108(%rsp), %rax
orl $-0x1, (%rax)
movq 0x100(%rsp), %rax
orl $-0x1, (%rax)
movq 0xc0(%rdi), %rax
andq $0x0, (%r9)
movq %rax, 0x90(%rsp)
movq 0x18(%rax), %rax
movl 0x14(%rax), %eax
addl %eax, %eax
movslq %eax, %rdx
xorl %ebx, %ebx
movq %rbp, %rdi
xorl %esi, %esi
callq 0x20e0
andq $0x0, (%r13)
cmpq %rbx, 0x8(%r13)
je 0x10596a
movq 0x10(%r13), %rax
xorl %ecx, %ecx
jmp 0x105986
movq $0x2, 0x8(%r13)
movq 0x10(%r13), %rdi
pushq $0x8
popq %rsi
callq 0x2370
movq %rax, 0x10(%r13)
movq (%r13), %rcx
leaq 0x1(%rcx), %r14
movq %r14, (%r13)
movl %r15d, (%rax,%rcx,4)
movl %r15d, 0x28(%rsp)
movl %r15d, %esi
shrl %esi
movq %r12, 0x30(%rsp)
movq %r12, %rdi
movq %rsi, 0x98(%rsp)
callq 0x10535b
movl %eax, 0x64(%rsp)
movl %eax, %eax
cvtsi2sd %rax, %xmm3
xorl %eax, %eax
xorl %ebx, %ebx
movsd 0x38(%rsp), %xmm0
movsd %xmm3, 0x40(%rsp)
decq %r14
movl %ebx, %r12d
cmpq $-0x1, %r14
je 0x105fb7
movq %r14, (%r13)
movq 0x10(%r13), %rcx
movl (%rcx,%r14,4), %r15d
decq %r14
cmpb $0x0, (%rbp,%r15)
jne 0x1059cf
cmpl 0x28(%rsp), %r15d
sete %cl
testb %cl, %al
jne 0x106283
movq $0x0, 0xa0(%rsp)
testb $0x1, %al
je 0x105c11
movq %r15, %rax
xorq $0x1, %rax
cmpb $0x0, (%rbp,%rax)
jne 0x105c11
movq %rax, 0x80(%rsp)
movl %r15d, %esi
shrl %esi
movq 0x30(%rsp), %rdi
movq %rsi, 0x78(%rsp)
callq 0x10535b
movsd 0x38(%rsp), %xmm0
cvtsi2sd %r12, %xmm3
movl %eax, %r14d
movapd %xmm3, %xmm1
mulsd %xmm0, %xmm1
movl %eax, %eax
cvtsi2sd %rax, %xmm2
ucomisd %xmm1, %xmm2
movq %r14, 0xa0(%rsp)
jbe 0x105c0b
movsd 0x48(%rsp), %xmm1
mulsd %xmm1, %xmm3
movl %r14d, %eax
movl 0x64(%rsp), %r12d
addl %r12d, %eax
cvtsi2sd %rax, %xmm4
ucomisd %xmm3, %xmm4
xorpd %xmm2, %xmm2
jbe 0x105c0b
movsd %xmm4, 0x70(%rsp)
movq 0x30(%rsp), %rdi
movq 0xc0(%rdi), %rsi
movupd %xmm2, 0x10(%rsp)
movq 0xe0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rax
movq %rax, (%rsp)
andq $0x0, 0x20(%rsp)
movl 0x28(%rsp), %edx
movq 0x80(%rsp), %rcx
movl %r12d, %r8d
movl %r14d, %r9d
callq 0x1053d5
testl %eax, %eax
je 0x105c05
movl %r12d, %r8d
movq 0x30(%rsp), %rdi
movq 0xc0(%rdi), %rsi
xorpd %xmm0, %xmm0
movupd %xmm0, 0x18(%rsp)
movq 0xe8(%rsp), %r12
movq %r12, 0x10(%rsp)
movq 0xe0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rax
movq %rax, (%rsp)
movl 0x28(%rsp), %edx
movq 0x80(%rsp), %rcx
movsd 0x38(%rsp), %xmm0
movsd 0x48(%rsp), %xmm1
movl %r14d, %r9d
callq 0x1053d5
xorl %eax, %eax
movl %eax, %r14d
cmpq %r14, (%r12)
jbe 0x105b7f
movq 0x10(%r12), %rax
movl (%rax,%r14,4), %edx
movq 0x30(%rsp), %rdi
xorl %esi, %esi
movq 0xf8(%rsp), %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x10519d
leal 0x1(%r14), %eax
jmp 0x105b4d
movq 0x90(%rsp), %rax
movq 0x10(%rax), %rcx
imulq $0x28, 0x98(%rsp), %rax
leaq (%rcx,%rax), %r14
movq %rcx, 0x68(%rsp)
movq 0x18(%rcx,%rax), %rax
testb $0x1, 0x28(%rsp)
jne 0x105cf5
movl 0x10(%r14), %ecx
decl %ecx
movq (%rax,%rcx,8), %rdx
movq %rdx, %rsi
shrq $0x21, %rsi
movabsq $0x100000000, %rax      # imm = 0x100000000
andq %rax, %rdx
leaq 0x2c(%rsp), %rax
cmovneq %rax, %rdx
movl $0x0, %ecx
cmoveq %rax, %rcx
andq $0x0, (%rsp)
movq 0x30(%rsp), %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xf6ab5
movl 0x10(%r14), %eax
decl %eax
shlq $0x3, %rax
addq 0x18(%r14), %rax
jmp 0x105d37
movsd 0x38(%rsp), %xmm0
movsd 0x40(%rsp), %xmm3
movb $0x1, (%rbp,%r15)
movl %r15d, %eax
xorl 0x28(%rsp), %eax
cmpl $0x1, %eax
jne 0x105c4d
movq 0xa0(%rsp), %rcx
addl %ebx, %ecx
cvtsi2sd %rcx, %xmm1
mulsd %xmm0, %xmm1
ucomisd %xmm3, %xmm1
jae 0x106283
movq (%r13), %r14
movb $0x1, %al
movl %ecx, %ebx
jmp 0x1059cc
movq 0x90(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rcx
movq 0x28(%rax), %rax
movq (%rax,%r15,8), %rax
movl %eax, %edx
shrq $0x20, %rax
imulq $0x18, %rdx, %r15
imulq $0x18, %rax, %rax
leaq (%rcx,%rax), %r12
addq $0x8, %r12
xorl %r14d, %r14d
cmpq %r14, %r15
je 0x105c23
cmpl $0x0, 0x4(%r12,%r14)
js 0x105cef
movl (%r12,%r14), %ecx
cmpl 0x28(%rsp), %ecx
je 0x106283
cmpb $0x0, (%rbp,%rcx)
jne 0x105cef
movq (%r13), %rdx
movq 0x10(%r13), %rax
cmpq 0x8(%r13), %rdx
jne 0x105ce4
leaq (%rdx,%rdx), %rsi
testq %rdx, %rdx
pushq $0x2
popq %rcx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r13)
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x2370
movsd 0x40(%rsp), %xmm3
movsd 0x38(%rsp), %xmm0
movq %rax, 0x10(%r13)
movl (%r12,%r14), %ecx
movq (%r13), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, (%r13)
movl %ecx, (%rax,%rdx,4)
addq $0x18, %r14
jmp 0x105c7e
movq (%rax), %rcx
movq %rcx, %rsi
shrq $0x21, %rsi
movabsq $0x100000000, %rax      # imm = 0x100000000
andq %rax, %rcx
movl $0x0, %edx
leaq 0x2c(%rsp), %rax
cmoveq %rax, %rdx
cmovneq %rax, %rcx
andq $0x0, (%rsp)
movq 0x30(%rsp), %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xf6ab5
movq 0x18(%r14), %rax
movl 0x4(%rax), %eax
movq 0x110(%rsp), %rcx
movl %eax, (%rcx)
movl 0x2c(%rsp), %r12d
imulq $0x28, 0x78(%rsp), %rax
movq 0x68(%rsp), %rcx
leaq (%rcx,%rax), %r14
movq 0x18(%rcx,%rax), %rax
testb $0x1, %r15b
jne 0x105da7
movq (%rax), %rcx
movq %rcx, %rsi
shrq $0x21, %rsi
movabsq $0x100000000, %rax      # imm = 0x100000000
andq %rax, %rcx
movl $0x0, %edx
leaq 0x2c(%rsp), %rax
cmoveq %rax, %rdx
cmovneq %rax, %rcx
andq $0x0, (%rsp)
movq 0x30(%rsp), %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xf6ab5
movq 0x18(%r14), %rax
jmp 0x105dfa
movl 0x10(%r14), %ecx
decl %ecx
movq (%rax,%rcx,8), %rdx
movq %rdx, %rsi
shrq $0x21, %rsi
movabsq $0x100000000, %rax      # imm = 0x100000000
andq %rax, %rdx
leaq 0x2c(%rsp), %rax
cmovneq %rax, %rdx
movl $0x0, %ecx
cmoveq %rax, %rcx
andq $0x0, (%rsp)
movq 0x30(%rsp), %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xf6ab5
movl 0x10(%r14), %eax
decl %eax
shlq $0x3, %rax
addq 0x18(%r14), %rax
xorl $0x1, %r12d
movl 0x4(%rax), %eax
movq 0x118(%rsp), %rcx
movl %eax, (%rcx)
movl 0x2c(%rsp), %ecx
xorl $0x1, %ecx
leaq 0x54(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xe0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rax
movq %rax, (%rsp)
xorl %edi, %edi
movq 0x88(%rsp), %rsi
movl %r12d, %edx
movl %ecx, 0x68(%rsp)
movsd 0x38(%rsp), %xmm0
movsd 0x48(%rsp), %xmm1
pushq $-0x1
popq %r8
movl %r8d, %r9d
callq 0x1053d5
testl %eax, %eax
je 0x105f09
cmpl $0x0, 0x54(%rsp)
movsd 0x38(%rsp), %xmm0
movsd 0x40(%rsp), %xmm3
jne 0x105f15
movq 0xf0(%rsp), %r9
movq (%r9), %rax
xorl %ecx, %ecx
xorl %edx, %edx
movsd 0x48(%rsp), %xmm1
movsd 0x70(%rsp), %xmm4
movl %ecx, %ecx
cmpq %rcx, %rax
jbe 0x105ef1
movq 0x10(%r9), %rsi
movl (%rsi,%rcx,4), %esi
shrl %esi
movq 0x30(%rsp), %r8
movq (%r8), %rdi
movq 0x80(%r8), %r8
movl (%rdi,%rsi,4), %edi
incq %r8
cmpq %rdi, %r8
jb 0x105eed
movq 0x88(%rsp), %rdi
movq 0x10(%rdi), %rdi
imulq $0x28, %rsi, %rsi
addl 0x10(%rdi,%rsi), %edx
incl %ecx
jmp 0x105eaf
movl %edx, %eax
cvtsi2sd %rax, %xmm2
mulsd %xmm1, %xmm2
ucomisd %xmm4, %xmm2
pushq $0x1
popq %rax
jb 0x105f15
xorl %eax, %eax
jmp 0x105f15
movsd 0x38(%rsp), %xmm0
movsd 0x40(%rsp), %xmm3
movl %eax, 0x78(%rsp)
movl %r12d, 0x70(%rsp)
xorl %eax, %eax
movq 0xe8(%rsp), %r12
movl %eax, %r14d
cmpq %r14, (%r12)
jbe 0x105f67
movq 0x10(%r12), %rax
movl (%rax,%r14,4), %edx
movq 0x30(%rsp), %rdi
xorl %esi, %esi
movq 0xf8(%rsp), %rcx
pushq $0x1
popq %r8
xorl %r9d, %r9d
callq 0x10519d
movsd 0x40(%rsp), %xmm3
movsd 0x38(%rsp), %xmm0
leal 0x1(%r14), %eax
jmp 0x105f28
cmpl $0x0, 0x78(%rsp)
movq 0x80(%rsp), %rdx
je 0x105c11
movl 0x28(%rsp), %eax
movq 0x100(%rsp), %rcx
movl %eax, (%rcx)
movq 0x108(%rsp), %rax
movl %edx, (%rax)
movq 0x120(%rsp), %rax
movl 0x70(%rsp), %ecx
movl %ecx, (%rax)
movq 0x128(%rsp), %rax
movl 0x68(%rsp), %ecx
movl %ecx, (%rax)
pushq $0x1
popq %r15
jmp 0x106286
cvtsi2sd %r12, %xmm2
movapd %xmm2, %xmm1
mulsd %xmm0, %xmm1
xorl %r15d, %r15d
ucomisd %xmm3, %xmm1
jae 0x106286
movsd 0x48(%rsp), %xmm1
mulsd %xmm1, %xmm2
ucomisd %xmm3, %xmm2
jae 0x106286
movq 0x30(%rsp), %r12
movq 0xc0(%r12), %rsi
xorpd %xmm2, %xmm2
movupd %xmm2, 0x18(%rsp)
movq 0xe8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xe0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rax
movq %rax, (%rsp)
pushq $-0x1
popq %rcx
movq %r12, %rdi
movl 0x28(%rsp), %r14d
movl %r14d, %edx
movl 0x64(%rsp), %r8d
movl %ecx, %r9d
callq 0x1053d5
testl %eax, %eax
je 0x106286
xorl %eax, %eax
movq 0x88(%rsp), %r13
movq 0xe8(%rsp), %r15
movl %eax, %ebx
cmpq %rbx, (%r15)
jbe 0x10607f
movq 0x10(%r15), %rax
movl (%rax,%rbx,4), %edx
movq %r12, %rdi
xorl %esi, %esi
movq 0xf8(%rsp), %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x10519d
leal 0x1(%rbx), %eax
jmp 0x106054
movq 0x90(%rsp), %rax
movq 0x10(%rax), %rax
imulq $0x28, 0x98(%rsp), %rcx
leaq (%rax,%rcx), %rbx
movq 0x18(%rax,%rcx), %rax
testb $0x1, %r14b
jne 0x1060f1
movl 0x10(%rbx), %ecx
decl %ecx
movq (%rax,%rcx,8), %rax
movq %rax, %rsi
shrq $0x21, %rsi
xorl %edi, %edi
movabsq $0x100000000, %rdx      # imm = 0x100000000
andq %rax, %rdx
leaq 0x2c(%rsp), %rcx
cmovneq %rcx, %rdx
cmovneq %rdi, %rcx
andq $0x0, (%rsp)
movq %r12, %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xf6ab5
movl 0x10(%rbx), %eax
decl %eax
shlq $0x3, %rax
addq 0x18(%rbx), %rax
jmp 0x10612e
movq (%rax), %rax
movq %rax, %rsi
shrq $0x21, %rsi
xorl %edx, %edx
movabsq $0x100000000, %rcx      # imm = 0x100000000
andq %rax, %rcx
leaq 0x2c(%rsp), %rax
cmoveq %rax, %rdx
cmovneq %rax, %rcx
andq $0x0, (%rsp)
movq %r12, %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xf6ab5
movq 0x18(%rbx), %rax
movl 0x4(%rax), %eax
movq 0x110(%rsp), %rcx
movl %eax, (%rcx)
movl 0x2c(%rsp), %ebp
xorl $0x1, %ebp
leaq 0x54(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xe0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rax
movq %rax, (%rsp)
xorl %ebx, %ebx
pushq $-0x1
popq %rcx
xorl %edi, %edi
movq %r13, %rsi
movl %ebp, %edx
movsd 0x38(%rsp), %xmm0
movsd 0x48(%rsp), %xmm1
movl %ecx, %r8d
movl %ecx, %r9d
callq 0x1053d5
movl %eax, %r15d
testl %eax, %eax
je 0x106221
cmpl $0x0, 0x54(%rsp)
movq 0xe8(%rsp), %rax
jne 0x106229
movq 0xf0(%rsp), %r9
movq (%r9), %rax
xorl %ecx, %ecx
xorl %edx, %edx
movsd 0x48(%rsp), %xmm1
movsd 0x40(%rsp), %xmm2
movl %ecx, %ecx
cmpq %rcx, %rax
jbe 0x106207
movq 0x10(%r9), %rsi
movl (%rsi,%rcx,4), %esi
shrl %esi
movq (%r12), %rdi
movq 0x80(%r12), %r8
movl (%rdi,%rsi,4), %edi
incq %r8
cmpq %rdi, %r8
jb 0x106203
movq 0x10(%r13), %rdi
imulq $0x28, %rsi, %rsi
addl 0x10(%rdi,%rsi), %edx
incl %ecx
jmp 0x1061d0
movl %edx, %eax
cvtsi2sd %rax, %xmm0
mulsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jae 0x10621e
pushq $0x1
popq %r15
jmp 0x106221
xorl %r15d, %r15d
movq 0xe8(%rsp), %rax
pushq $0x1
popq %r13
movl %ebx, %ebx
cmpq %rbx, (%rax)
jbe 0x106267
movq 0xe8(%rsp), %rax
movq 0x10(%rax), %rax
movl (%rax,%rbx,4), %edx
movq %r12, %rdi
xorl %esi, %esi
movq 0xf8(%rsp), %rcx
movl %r13d, %r8d
xorl %r9d, %r9d
callq 0x10519d
movq 0xe8(%rsp), %rax
incl %ebx
jmp 0x10622d
testl %r15d, %r15d
je 0x106283
movq 0x100(%rsp), %rax
movl %r14d, (%rax)
movq 0x120(%rsp), %rax
movl %ebp, (%rax)
jmp 0x106286
xorl %r15d, %r15d
movl %r15d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq