// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: flat_bubbles(asg_t*, unsigned char*)
void flat_bubbles(asg_t *sg, uint8_t* r_het)
{
    ma_ug_t *ug = NULL;
    ug = ma_ug_gen(sg);
    ma_utg_t *u = NULL; 
    uint32_t n_vtx = ug->g->n_seq<<1, v, convex, i, k, ori, is_het_b, is_het_s, n_pop = 0, pass_b, pass_s;
    long long nodeLen, baseLen, max_stop_nodeLen, max_stop_baseLen;
    buf_t b; memset(&b, 0, sizeof(buf_t)); b.a = (binfo_t*)calloc(n_vtx, sizeof(binfo_t));
    uint8_t* bs_flag = (uint8_t*)calloc(n_vtx, 1);
    uint64_t tLen = get_bub_pop_max_dist_advance(ug->g, &b), path, hom_occ, het_occ;
    
    for (v = 0; v < ug->g->n_seq; ++v) 
    {
        if(ug->g->seq[v].del) continue;
        ug->g->seq[v].c = PRIMARY_LABLE;
        EvaluateLen(ug->u, v) = ug->u.a[v].n;
    }

    n_pop = 1; ///round = 0;
    while(n_pop > 0)
    {
        for (v = n_pop = 0; v < n_vtx; ++v) 
        {
            if(ug->g->seq[v>>1].del) continue;
            if(asg_arc_n(ug->g, v) < 2) continue;
            if(get_real_length(ug->g, v, NULL) < 2) continue;
            if(bs_flag[v] == 1) continue;
            if(bs_flag[v] == 0) bs_flag[v] = 1;

            if(asg_bub_pop1_primary_trio(ug->g, ug, v, tLen, &b, (uint32_t)-1, (uint32_t)-1, 0, NULL, NULL, NULL, 0, 0, NULL))
            {
                //note b.b include end, does not include beg
                for (i = path = 0; i < b.b.n; i++)
                {
                    if((b.b.a[i]>>1) == (v>>1) || (b.b.a[i]>>1) == (b.S.a[0]>>1))
                    {
                        continue;
                    }
                    path += ug->u.a[b.b.a[i]>>1].n;
                }



                bs_flag[v] = 2; bs_flag[b.S.a[0]^1] = 2;
                is_het_b = is_het_s = pass_b = pass_s = 0;
                //beg is v, end is b.S.a[0]
                b.b.n = 0;
                get_unitig(ug->g, NULL, v^1, &convex, &nodeLen, &baseLen, &max_stop_nodeLen, 
                                                                        &max_stop_baseLen, 1, &b);
                
                
                for (i = hom_occ = het_occ = 0; i < b.b.n; i++)
                {
                    u = &(ug->u.a[b.b.a[i]>>1]);
                    ori = b.b.a[i]&1;
                    for (k = 0; k < u->n; k++)
                    {
                        if(r_het[(ori == 1?(u->a[u->n-k-1]>>33):(u->a[k]>>33))] == N_HET)
                        {
                            hom_occ++;
                        }
                        else
                        {
                            het_occ++;
                        }
                        if(het_occ > ((het_occ+hom_occ)*0.85))
                        {
                            is_het_b = (het_occ+hom_occ);
                        }

                        if((het_occ+hom_occ) == MAX((path+1),5))
                        {
                            if(het_occ > ((het_occ+hom_occ)*0.7))
                            {
                                pass_b = 1;
                            }
                        }
                    }
                }
                if(pass_b == 0) continue;
                

                b.b.n = 0;
                get_unitig(ug->g, NULL, b.S.a[0], &convex, &nodeLen, &baseLen, &max_stop_nodeLen, 
                                                                        &max_stop_baseLen, 1, &b);
                for (i = hom_occ = het_occ= 0; i < b.b.n; i++)
                {
                    u = &(ug->u.a[b.b.a[i]>>1]);
                    ori = b.b.a[i]&1;
                    for (k = 0; k < u->n; k++)
                    {
                        if(r_het[(ori == 1?(u->a[u->n-k-1]>>33):(u->a[k]>>33))] == N_HET)
                        {
                            hom_occ++;
                        }
                        else
                        {
                            het_occ++;
                        }
                        if(het_occ > ((het_occ+hom_occ)*0.85))
                        {
                            is_het_s = (het_occ+hom_occ);
                        }

                        if((het_occ+hom_occ) == MAX((path+1),5))
                        {
                            if(het_occ > ((het_occ+hom_occ)*0.7))
                            {
                                pass_s = 1;
                            }
                        }
                    }
                }
                if(pass_s == 0) continue;


                if(is_het_b > path && is_het_s > path && (is_het_b+is_het_s)>(path<<2))
                {
                    asg_bub_pop1_primary_trio(ug->g, ug, v, tLen, &b, (uint32_t)-1, (uint32_t)-1, 1, NULL, NULL, NULL, 0, 0, NULL);
                    n_pop++;
                }
            }
        }
        ///round++;
    }

    /*******************************for debug************************************/
    // kvec_t(uint64_t) occ_sort; kv_init(occ_sort);
    // for (v = n_pop = 0; v < ug->g->n_seq; ++v) 
    // {
    //     if(ug->g->seq[v].del) continue;
    //     if(ug->g->seq[v].c != ALTER_LABLE) continue;
    //     u = &(ug->u.a[v]);
        
    //     kv_push(uint64_t, occ_sort, (uint64_t)((uint32_t)(-1) - (uint32_t)(u->n)) << 32 | (v));
    // }
    // radix_sort_arch64(occ_sort.a, occ_sort.a + occ_sort.n);
    // for (i = 0; i < occ_sort.n; ++i) 
    // {
    //     fprintf(stderr, "-utg%.6ul, n=%u\n", ((uint32_t)occ_sort.a[i])+1, 
    //                                         (uint32_t)(-1) - (uint32_t)(occ_sort.a[i]>>32));
    // }
    // kv_destroy(occ_sort);
    /*******************************for debug************************************/

    clean_sg_by_utg(sg, ug);

    free(b.a); free(b.S.a); free(b.T.a); free(b.b.a); free(b.e.a);
    ma_ug_destroy(ug); free(bs_flag); 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0xe5910
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shll %eax
movl %eax, -0x24(%rbp)
movl $0x0, -0x44(%rbp)
leaq -0xd8(%rbp), %rdi
xorl %esi, %esi
movl $0x68, %edx
callq 0x2100
movl -0x24(%rbp), %eax
movl %eax, %edi
movl $0x1c, %esi
callq 0x2140
movq %rax, -0xd8(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x2140
movq %rax, -0xe0(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0xd8(%rbp), %rsi
callq 0xfde50
movq %rax, -0xe8(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl 0x14(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jae 0x16292a
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movl -0x28(%rbp), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1628e1
jmp 0x16291f
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movl -0x28(%rbp), %ecx
movb $0x0, 0x4(%rax,%rcx,8)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x28(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %ecx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x28(%rbp), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x1628ad
movl $0x1, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jbe 0x163188
movl $0x0, -0x44(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x163183
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movl -0x28(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x162978
jmp 0x163175
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl -0x28(%rbp), %ecx
movq (%rax,%rcx,8), %rax
cmpl $0x2, %eax
jae 0x162995
jmp 0x163175
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x28(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x166b50
cmpl $0x2, %eax
jge 0x1629b3
jmp 0x163175
movq -0xe0(%rbp), %rax
movl -0x28(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x1, %eax
jne 0x1629cb
jmp 0x163175
movq -0xe0(%rbp), %rax
movl -0x28(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x1629ec
movq -0xe0(%rbp), %rax
movl -0x28(%rbp), %ecx
movb $0x1, (%rax,%rcx)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movl -0x28(%rbp), %edx
movq -0xe8(%rbp), %rcx
leaq -0xd8(%rbp), %r8
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
xorl %eax, %eax
xorl %eax, %eax
movl $0xffffffff, (%rsp)     # imm = 0xFFFFFFFF
movl $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x0, 0x28(%rsp)
movl $0x0, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
callq 0xfe040
cmpq $0x0, %rax
je 0x163173
movq $0x0, -0xf0(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpq -0xa0(%rbp), %rax
jae 0x162af7
movq -0x90(%rbp), %rax
movl -0x30(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shrl %eax
movl -0x28(%rbp), %ecx
shrl %ecx
cmpl %ecx, %eax
je 0x162ab9
movq -0x90(%rbp), %rax
movl -0x30(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shrl %eax
movq -0xc0(%rbp), %rcx
movl (%rcx), %ecx
shrl %ecx
cmpl %ecx, %eax
jne 0x162abb
jmp 0x162aec
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x90(%rbp), %rcx
movl -0x30(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
addq -0xf0(%rbp), %rax
movq %rax, -0xf0(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x162a77
movq -0xe0(%rbp), %rax
movl -0x28(%rbp), %ecx
movb $0x2, (%rax,%rcx)
movq -0xe0(%rbp), %rax
movq -0xc0(%rbp), %rcx
movl (%rcx), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movb $0x2, (%rax,%rcx)
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x3c(%rbp)
movq $0x0, -0xa0(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x28(%rbp), %edx
xorl $0x1, %edx
xorl %eax, %eax
movl %eax, %esi
leaq -0x2c(%rbp), %rcx
leaq -0x58(%rbp), %r8
leaq -0x60(%rbp), %r9
leaq -0x68(%rbp), %r11
leaq -0x70(%rbp), %r10
leaq -0xd8(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x166c30
movq $0x0, -0x100(%rbp)
movq $0x0, -0xf8(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpq -0xa0(%rbp), %rax
jae 0x162df1
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x90(%rbp), %rcx
movl -0x30(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x90(%rbp), %rax
movl -0x30(%rbp), %ecx
movl (%rax,%rcx,4), %eax
andl $0x1, %eax
movl %eax, -0x38(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x162de1
movq -0x10(%rbp), %rax
movq %rax, -0x108(%rbp)
cmpl $0x1, -0x38(%rbp)
jne 0x162c41
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl -0x34(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movq %rax, -0x110(%rbp)
jmp 0x162c5b
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x34(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movq %rax, -0x110(%rbp)
movq -0x108(%rbp), %rax
movq -0x110(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x162c86
movq -0xf8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xf8(%rbp)
jmp 0x162c98
movq -0x100(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
movq %rax, %xmm0
movaps 0x21f365(%rip), %xmm3   # 0x382010
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x21f369(%rip), %xmm2   # 0x382020
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0xf8(%rbp), %rcx
addq %rcx, %rax
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
movsd 0x223b78(%rip), %xmm2   # 0x386868
mulsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x162d0b
movq -0x100(%rbp), %rax
addq -0xf8(%rbp), %rax
movl %eax, -0x3c(%rbp)
movq -0x100(%rbp), %rax
addq -0xf8(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0xf0(%rbp), %rax
addq $0x1, %rax
cmpq $0x5, %rax
jb 0x162d45
movq -0xf0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x120(%rbp)
jmp 0x162d53
movl $0x5, %eax
movq %rax, -0x120(%rbp)
jmp 0x162d53
movq -0x118(%rbp), %rax
movq -0x120(%rbp), %rcx
cmpq %rcx, %rax
jne 0x162dd1
movq -0x100(%rbp), %rax
movq %rax, %xmm0
movaps 0x21f297(%rip), %xmm3   # 0x382010
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x21f29b(%rip), %xmm2   # 0x382020
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0xf8(%rbp), %rcx
addq %rcx, %rax
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
movsd 0x21f46a(%rip), %xmm2   # 0x382228
mulsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x162dcf
movl $0x1, -0x48(%rbp)
jmp 0x162dd1
jmp 0x162dd3
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x162bf8
jmp 0x162de3
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x162baa
cmpl $0x0, -0x48(%rbp)
jne 0x162dfc
jmp 0x163175
movq $0x0, -0xa0(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0xc0(%rbp), %rax
movl (%rax), %edx
xorl %eax, %eax
movl %eax, %esi
leaq -0x2c(%rbp), %rcx
leaq -0x58(%rbp), %r8
leaq -0x60(%rbp), %r9
leaq -0x68(%rbp), %r11
leaq -0x70(%rbp), %r10
leaq -0xd8(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x166c30
movq $0x0, -0x100(%rbp)
movq $0x0, -0xf8(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpq -0xa0(%rbp), %rax
jae 0x1630b6
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x90(%rbp), %rcx
movl -0x30(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x90(%rbp), %rax
movl -0x30(%rbp), %ecx
movl (%rax,%rcx,4), %eax
andl $0x1, %eax
movl %eax, -0x38(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x1630a6
movq -0x10(%rbp), %rax
movq %rax, -0x128(%rbp)
cmpl $0x1, -0x38(%rbp)
jne 0x162f06
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl -0x34(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movq %rax, -0x130(%rbp)
jmp 0x162f20
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x34(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movq %rax, -0x130(%rbp)
movq -0x128(%rbp), %rax
movq -0x130(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x162f4b
movq -0xf8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xf8(%rbp)
jmp 0x162f5d
movq -0x100(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
movq %rax, %xmm0
movaps 0x21f0a0(%rip), %xmm3   # 0x382010
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x21f0a4(%rip), %xmm2   # 0x382020
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0xf8(%rbp), %rcx
addq %rcx, %rax
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
movsd 0x2238b3(%rip), %xmm2   # 0x386868
mulsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x162fd0
movq -0x100(%rbp), %rax
addq -0xf8(%rbp), %rax
movl %eax, -0x40(%rbp)
movq -0x100(%rbp), %rax
addq -0xf8(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0xf0(%rbp), %rax
addq $0x1, %rax
cmpq $0x5, %rax
jb 0x16300a
movq -0xf0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x140(%rbp)
jmp 0x163018
movl $0x5, %eax
movq %rax, -0x140(%rbp)
jmp 0x163018
movq -0x138(%rbp), %rax
movq -0x140(%rbp), %rcx
cmpq %rcx, %rax
jne 0x163096
movq -0x100(%rbp), %rax
movq %rax, %xmm0
movaps 0x21efd2(%rip), %xmm3   # 0x382010
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x21efd6(%rip), %xmm2   # 0x382020
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0xf8(%rbp), %rcx
addq %rcx, %rax
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
movsd 0x21f1a5(%rip), %xmm2   # 0x382228
mulsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x163094
movl $0x1, -0x4c(%rbp)
jmp 0x163096
jmp 0x163098
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x162ebd
jmp 0x1630a8
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x162e6f
cmpl $0x0, -0x4c(%rbp)
jne 0x1630c1
jmp 0x163175
movl -0x3c(%rbp), %eax
cmpq -0xf0(%rbp), %rax
jbe 0x163171
movl -0x40(%rbp), %eax
cmpq -0xf0(%rbp), %rax
jbe 0x163171
movl -0x3c(%rbp), %eax
addl -0x40(%rbp), %eax
movl %eax, %eax
movq -0xf0(%rbp), %rcx
shlq $0x2, %rcx
cmpq %rcx, %rax
jbe 0x163171
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movl -0x28(%rbp), %edx
movq -0xe8(%rbp), %rcx
leaq -0xd8(%rbp), %r8
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
xorl %eax, %eax
xorl %eax, %eax
movl $0xffffffff, (%rsp)     # imm = 0xFFFFFFFF
movl $0x1, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x0, 0x28(%rsp)
movl $0x0, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
callq 0xfe040
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x163173
jmp 0x163175
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x162949
jmp 0x162931
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x162250
movq -0xd8(%rbp), %rdi
callq 0x2210
movq -0xc0(%rbp), %rdi
callq 0x2210
movq -0xa8(%rbp), %rdi
callq 0x2210
movq -0x90(%rbp), %rdi
callq 0x2210
movq -0x78(%rbp), %rdi
callq 0x2210
movq -0x18(%rbp), %rdi
callq 0xcd6f0
movq -0xe0(%rbp), %rdi
callq 0x2210
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
nopl (%rax)