// File: 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
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
movq 0x58(%rbp), %rax
movq 0x50(%rbp), %rax
movq 0x48(%rbp), %rax
movq 0x40(%rbp), %rax
movq 0x38(%rbp), %rax
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x20(%rbp)
movq %rsi, -0x28(%rbp)
movq %rdx, -0x30(%rbp)
movq %rcx, -0x38(%rbp)
movl %r8d, -0x3c(%rbp)
movsd %xmm0, -0x48(%rbp)
movsd %xmm1, -0x50(%rbp)
movq %r9, -0x58(%rbp)
movq 0x58(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq 0x50(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq 0x48(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq 0x40(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq 0x38(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq 0x30(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq -0x20(%rbp), %rax
movq 0xc0(%rax), %rax
movq %rax, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
movl $0x0, -0x80(%rbp)
movq -0x58(%rbp), %rax
movq $0x0, (%rax)
movq $0x0, -0xb0(%rbp)
movq -0x30(%rbp), %rdi
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shll %eax
movslq %eax, %rdx
xorl %esi, %esi
callq 0x2100
movq -0x58(%rbp), %rax
movq $0x0, (%rax)
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq -0x58(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x1e12ab
movq -0x58(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1e126a
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xb8(%rbp)
jmp 0x1e1278
movl $0x2, %eax
movq %rax, -0xb8(%rbp)
jmp 0x1e1278
movq -0xb8(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x3c(%rbp), %edx
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rdi
movl -0x3c(%rbp), %esi
shrl %esi
callq 0x1e0800
movl %eax, -0x84(%rbp)
movq -0x58(%rbp), %rax
cmpq $0x0, (%rax)
jbe 0x1e1d42
movq -0x58(%rbp), %rax
movq (%rax), %rcx
addq $-0x1, %rcx
movq %rcx, (%rax)
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rcx), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x70(%rbp)
movq -0x30(%rbp), %rax
movl -0x70(%rbp), %ecx
cmpb $0x0, (%rax,%rcx)
je 0x1e131e
jmp 0x1e12de
movl $0x0, -0x88(%rbp)
cmpl $0x0, -0x80(%rbp)
je 0x1e1342
movl -0x70(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jne 0x1e1342
movl $0x0, -0x14(%rbp)
jmp 0x1e2242
cmpl $0x0, -0x80(%rbp)
je 0x1e1b62
movq -0x30(%rbp), %rax
movl -0x70(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x1e1b62
movq -0x30(%rbp), %rax
movl -0x70(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x1e1b62
movq -0x20(%rbp), %rdi
movl -0x70(%rbp), %esi
shrl %esi
callq 0x1e0800
movl %eax, -0x88(%rbp)
movl -0x6c(%rbp), %eax
cvtsi2sd %rax, %xmm1
movsd -0x48(%rbp), %xmm0
mulsd %xmm0, %xmm1
movl -0x88(%rbp), %eax
cvtsi2sd %rax, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1e1b60
movl -0x6c(%rbp), %eax
cvtsi2sd %rax, %xmm1
movsd -0x50(%rbp), %xmm0
mulsd %xmm0, %xmm1
movl -0x88(%rbp), %eax
movl -0x84(%rbp), %ecx
addl %ecx, %eax
cvtsi2sd %rax, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1e1b60
movq -0x20(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0xc0(%rax), %rsi
movl -0x3c(%rbp), %edx
movl -0x70(%rbp), %ecx
xorl $0x1, %ecx
movsd -0x48(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
movl -0x84(%rbp), %r8d
movl -0x88(%rbp), %r9d
movq -0x38(%rbp), %r10
movq 0x10(%rbp), %rax
xorl %r11d, %r11d
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
callq 0x1e0900
cmpl $0x0, %eax
je 0x1e1b5e
movq -0x20(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0xc0(%rax), %rsi
movl -0x3c(%rbp), %edx
movl -0x70(%rbp), %ecx
xorl $0x1, %ecx
movsd -0x48(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
movl -0x84(%rbp), %r8d
movl -0x88(%rbp), %r9d
movq -0x38(%rbp), %r11
movq 0x10(%rbp), %r10
movq 0x18(%rbp), %rax
xorl %ebx, %ebx
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
callq 0x1e0900
movl $0x0, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movq 0x18(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x1e14f5
movq -0x20(%rbp), %rdi
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x7c(%rbp), %ecx
movl (%rax,%rcx,4), %edx
movq 0x28(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
xorl %r8d, %r8d
movq %r9, %rsi
callq 0x1e0580
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x1e14b8
movl -0x3c(%rbp), %eax
movl %eax, -0x94(%rbp)
movl -0x70(%rbp), %eax
xorl $0x1, %eax
movl %eax, -0x98(%rbp)
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x94(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movl -0x94(%rbp), %eax
andl $0x1, %eax
cmpl $0x1, %eax
jne 0x1e1628
movq -0x20(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
shrq %rax
movq %rax, -0xc0(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
andq $0x1, %rax
xorq $0x1, %rax
cmpq $0x1, %rax
jne 0x1e158a
leaq -0x90(%rbp), %rax
movq %rax, -0xd0(%rbp)
jmp 0x1e1595
xorl %eax, %eax
movq %rax, -0xd0(%rbp)
jmp 0x1e1595
movq -0xd0(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
andq $0x1, %rax
xorq $0x1, %rax
cmpq $0x0, %rax
jne 0x1e15d0
leaq -0x90(%rbp), %rax
movq %rax, -0xe0(%rbp)
jmp 0x1e15db
xorl %eax, %eax
movq %rax, -0xe0(%rbp)
jmp 0x1e15db
movq -0xd8(%rbp), %rdx
movq -0xc0(%rbp), %rsi
movq -0xc8(%rbp), %rdi
movq -0xe0(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
movq $0x0, (%rsp)
callq 0x1c4b20
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, %ecx
movq 0x40(%rbp), %rax
movl %ecx, (%rax)
jmp 0x1e173e
movq -0x20(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x68(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
shrq %rax
movq %rax, -0xe8(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x68(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
andq $0x1, %rax
cmpq $0x1, %rax
jne 0x1e168f
leaq -0x90(%rbp), %rax
movq %rax, -0xf8(%rbp)
jmp 0x1e169a
xorl %eax, %eax
movq %rax, -0xf8(%rbp)
jmp 0x1e169a
movq -0xf8(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x68(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
andq $0x1, %rax
cmpq $0x0, %rax
jne 0x1e16de
leaq -0x90(%rbp), %rax
movq %rax, -0x108(%rbp)
jmp 0x1e16e9
xorl %eax, %eax
movq %rax, -0x108(%rbp)
jmp 0x1e16e9
movq -0x100(%rbp), %rdx
movq -0xe8(%rbp), %rsi
movq -0xf0(%rbp), %rdi
movq -0x108(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
movq $0x0, (%rsp)
callq 0x1c4b20
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x68(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, %ecx
movq 0x40(%rbp), %rax
movl %ecx, (%rax)
movl -0x90(%rbp), %eax
xorl $0x1, %eax
movl %eax, -0x9c(%rbp)
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x98(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movl -0x98(%rbp), %eax
andl $0x1, %eax
cmpl $0x1, %eax
jne 0x1e186b
movq -0x20(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
shrq %rax
movq %rax, -0x110(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
andq $0x1, %rax
xorq $0x1, %rax
cmpq $0x1, %rax
jne 0x1e17cd
leaq -0x90(%rbp), %rax
movq %rax, -0x120(%rbp)
jmp 0x1e17d8
xorl %eax, %eax
movq %rax, -0x120(%rbp)
jmp 0x1e17d8
movq -0x120(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
andq $0x1, %rax
xorq $0x1, %rax
cmpq $0x0, %rax
jne 0x1e1813
leaq -0x90(%rbp), %rax
movq %rax, -0x130(%rbp)
jmp 0x1e181e
xorl %eax, %eax
movq %rax, -0x130(%rbp)
jmp 0x1e181e
movq -0x128(%rbp), %rdx
movq -0x110(%rbp), %rsi
movq -0x118(%rbp), %rdi
movq -0x130(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
movq $0x0, (%rsp)
callq 0x1c4b20
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, %ecx
movq 0x48(%rbp), %rax
movl %ecx, (%rax)
jmp 0x1e1981
movq -0x20(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x68(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
shrq %rax
movq %rax, -0x138(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x68(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
andq $0x1, %rax
cmpq $0x1, %rax
jne 0x1e18d2
leaq -0x90(%rbp), %rax
movq %rax, -0x148(%rbp)
jmp 0x1e18dd
xorl %eax, %eax
movq %rax, -0x148(%rbp)
jmp 0x1e18dd
movq -0x148(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x68(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
andq $0x1, %rax
cmpq $0x0, %rax
jne 0x1e1921
leaq -0x90(%rbp), %rax
movq %rax, -0x158(%rbp)
jmp 0x1e192c
xorl %eax, %eax
movq %rax, -0x158(%rbp)
jmp 0x1e192c
movq -0x150(%rbp), %rdx
movq -0x138(%rbp), %rsi
movq -0x140(%rbp), %rdi
movq -0x158(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
movq $0x0, (%rsp)
callq 0x1c4b20
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x68(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, %ecx
movq 0x48(%rbp), %rax
movl %ecx, (%rax)
movl -0x90(%rbp), %eax
xorl $0x1, %eax
movl %eax, -0xa0(%rbp)
movq -0x28(%rbp), %rsi
movl -0x9c(%rbp), %edx
movl -0xa0(%rbp), %ecx
movsd -0x48(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
movq -0x38(%rbp), %r14
movq 0x10(%rbp), %rbx
movq 0x20(%rbp), %r11
movq 0x28(%rbp), %r10
xorl %eax, %eax
movl %eax, %edi
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
leaq -0xa8(%rbp), %rax
movl %r9d, %r8d
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x1e0900
movl %eax, -0xa4(%rbp)
cmpl $0x1, -0xa4(%rbp)
jne 0x1e1ace
cmpl $0x0, -0xa8(%rbp)
jne 0x1e1ace
movl $0x0, -0x8c(%rbp)
movl $0x0, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movq 0x20(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x1e1a95
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x7c(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movq -0x20(%rbp), %rcx
movq 0x80(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jbe 0x1e1a5a
jmp 0x1e1a8a
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x7c(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
addl -0x8c(%rbp), %eax
movl %eax, -0x8c(%rbp)
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x1e1a1c
movl -0x8c(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd -0x50(%rbp), %xmm1
mulsd %xmm1, %xmm0
movl -0x84(%rbp), %eax
movl -0x88(%rbp), %ecx
addl %ecx, %eax
cvtsi2sd %rax, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1e1acc
movl $0x0, -0xa4(%rbp)
jmp 0x1e1ace
movl $0x0, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movq 0x18(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x1e1b15
movq -0x20(%rbp), %rdi
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x7c(%rbp), %ecx
movl (%rax,%rcx,4), %edx
movq 0x28(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movl $0x1, %r8d
movq %r9, %rsi
callq 0x1e0580
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x1e1ad5
cmpl $0x0, -0xa4(%rbp)
je 0x1e1b5c
movl -0x94(%rbp), %ecx
movq 0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0x98(%rbp), %ecx
movq 0x38(%rbp), %rax
movl %ecx, (%rax)
movl -0x9c(%rbp), %ecx
movq 0x50(%rbp), %rax
movl %ecx, (%rax)
movl -0xa0(%rbp), %ecx
movq 0x58(%rbp), %rax
movl %ecx, (%rax)
movl -0xa4(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x1e2242
jmp 0x1e1b5e
jmp 0x1e1b60
jmp 0x1e1b62
movq -0x30(%rbp), %rax
movl -0x70(%rbp), %ecx
movb $0x1, (%rax,%rcx)
movl -0x70(%rbp), %eax
movl -0x3c(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
je 0x1e1cf6
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl -0x70(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x74(%rbp)
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq -0x60(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x28(%rcx), %rcx
movl -0x70(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xb0(%rbp)
movl $0x0, -0x78(%rbp)
movl -0x78(%rbp), %eax
cmpl -0x74(%rbp), %eax
jae 0x1e1cf4
movq -0xb0(%rbp), %rax
movl -0x78(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1e1bf9
jmp 0x1e1ce6
movq -0xb0(%rbp), %rax
movl -0x78(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0x3c(%rbp), %eax
jne 0x1e1c1e
movl $0x0, -0x14(%rbp)
jmp 0x1e2242
movq -0x30(%rbp), %rax
movq -0xb0(%rbp), %rcx
movl -0x78(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
cmpb $0x0, (%rax,%rcx)
je 0x1e1c41
jmp 0x1e1ce6
jmp 0x1e1c43
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq -0x58(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x1e1cb4
movq -0x58(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1e1c73
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x160(%rbp)
jmp 0x1e1c81
movl $0x2, %eax
movq %rax, -0x160(%rbp)
jmp 0x1e1c81
movq -0x160(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xb0(%rbp), %rax
movl -0x78(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %edx
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movl %edx, (%rax,%rcx,4)
jmp 0x1e1ce6
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x1e1bcc
jmp 0x1e1cf6
cmpl $0x0, -0x80(%rbp)
je 0x1e1d08
movl -0x88(%rbp), %eax
addl -0x6c(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movl -0x84(%rbp), %eax
cvtsi2sd %rax, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1e1d36
movl $0x0, -0x14(%rbp)
jmp 0x1e2242
movl $0x1, -0x80(%rbp)
jmp 0x1e12de
movl -0x6c(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movl -0x84(%rbp), %eax
cvtsi2sd %rax, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1e1d70
movl $0x0, -0x14(%rbp)
jmp 0x1e2242
movl -0x6c(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd -0x50(%rbp), %xmm1
mulsd %xmm1, %xmm0
movl -0x84(%rbp), %eax
cvtsi2sd %rax, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1e1d9e
movl $0x0, -0x14(%rbp)
jmp 0x1e2242
movq -0x20(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0xc0(%rax), %rsi
movl -0x3c(%rbp), %edx
movsd -0x48(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
movl -0x84(%rbp), %r8d
movq -0x38(%rbp), %r11
movq 0x10(%rbp), %r10
movq 0x18(%rbp), %rax
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movl %r9d, %ecx
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
callq 0x1e0900
cmpl $0x0, %eax
jne 0x1e1e0e
movl $0x0, -0x14(%rbp)
jmp 0x1e2242
movl $0x0, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movq 0x18(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x1e1e52
movq -0x20(%rbp), %rdi
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x7c(%rbp), %ecx
movl (%rax,%rcx,4), %edx
movq 0x28(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
xorl %r8d, %r8d
movq %r9, %rsi
callq 0x1e0580
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x1e1e15
movl -0x3c(%rbp), %eax
movl %eax, -0x94(%rbp)
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x94(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movl -0x94(%rbp), %eax
andl $0x1, %eax
cmpl $0x1, %eax
jne 0x1e1f79
movq -0x20(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
shrq %rax
movq %rax, -0x168(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
andq $0x1, %rax
xorq $0x1, %rax
cmpq $0x1, %rax
jne 0x1e1edb
leaq -0x90(%rbp), %rax
movq %rax, -0x178(%rbp)
jmp 0x1e1ee6
xorl %eax, %eax
movq %rax, -0x178(%rbp)
jmp 0x1e1ee6
movq -0x178(%rbp), %rax
movq %rax, -0x180(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
andq $0x1, %rax
xorq $0x1, %rax
cmpq $0x0, %rax
jne 0x1e1f21
leaq -0x90(%rbp), %rax
movq %rax, -0x188(%rbp)
jmp 0x1e1f2c
xorl %eax, %eax
movq %rax, -0x188(%rbp)
jmp 0x1e1f2c
movq -0x180(%rbp), %rdx
movq -0x168(%rbp), %rsi
movq -0x170(%rbp), %rdi
movq -0x188(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
movq $0x0, (%rsp)
callq 0x1c4b20
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, %ecx
movq 0x40(%rbp), %rax
movl %ecx, (%rax)
jmp 0x1e208f
movq -0x20(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x68(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
shrq %rax
movq %rax, -0x190(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x68(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
andq $0x1, %rax
cmpq $0x1, %rax
jne 0x1e1fe0
leaq -0x90(%rbp), %rax
movq %rax, -0x1a0(%rbp)
jmp 0x1e1feb
xorl %eax, %eax
movq %rax, -0x1a0(%rbp)
jmp 0x1e1feb
movq -0x1a0(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x68(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
andq $0x1, %rax
cmpq $0x0, %rax
jne 0x1e202f
leaq -0x90(%rbp), %rax
movq %rax, -0x1b0(%rbp)
jmp 0x1e203a
xorl %eax, %eax
movq %rax, -0x1b0(%rbp)
jmp 0x1e203a
movq -0x1a8(%rbp), %rdx
movq -0x190(%rbp), %rsi
movq -0x198(%rbp), %rdi
movq -0x1b0(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
movq $0x0, (%rsp)
callq 0x1c4b20
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x68(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, %ecx
movq 0x40(%rbp), %rax
movl %ecx, (%rax)
movl -0x90(%rbp), %eax
xorl $0x1, %eax
movl %eax, -0x9c(%rbp)
movq -0x28(%rbp), %rsi
movl -0x9c(%rbp), %edx
movsd -0x48(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
movq -0x38(%rbp), %r14
movq 0x10(%rbp), %rbx
movq 0x20(%rbp), %r11
movq 0x28(%rbp), %r10
xorl %eax, %eax
movl %eax, %edi
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
leaq -0xa8(%rbp), %rax
movl %r9d, %ecx
movl %r9d, %r8d
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x1e0900
movl %eax, -0xa4(%rbp)
cmpl $0x1, -0xa4(%rbp)
jne 0x1e21d1
cmpl $0x0, -0xa8(%rbp)
jne 0x1e21d1
movl $0x0, -0x8c(%rbp)
movl $0x0, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movq 0x20(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x1e21a0
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x7c(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movq -0x20(%rbp), %rcx
movq 0x80(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jbe 0x1e2165
jmp 0x1e2195
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x7c(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
addl -0x8c(%rbp), %eax
movl %eax, -0x8c(%rbp)
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x1e2127
movl -0x8c(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd -0x50(%rbp), %xmm1
mulsd %xmm1, %xmm0
movl -0x84(%rbp), %eax
cvtsi2sd %rax, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1e21cf
movl $0x0, -0xa4(%rbp)
jmp 0x1e21d1
movl $0x0, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movq 0x18(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x1e2218
movq -0x20(%rbp), %rdi
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x7c(%rbp), %ecx
movl (%rax,%rcx,4), %edx
movq 0x28(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movl $0x1, %r8d
movq %r9, %rsi
callq 0x1e0580
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x1e21d8
cmpl $0x0, -0xa4(%rbp)
je 0x1e2239
movl -0x94(%rbp), %ecx
movq 0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0x9c(%rbp), %ecx
movq 0x50(%rbp), %rax
movl %ecx, (%rax)
movl -0xa4(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
popq %r14
popq %rbp
retq
nopw %cs:(%rax,%rax)