// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: identify_bubbles(ma_ug_t*, bubble_type*, unsigned char*, kv_u_trans_t*)
void identify_bubbles(ma_ug_t* ug, bubble_type* bub, uint8_t *r_het_flag, kv_u_trans_t *ref)
{
    asg_cleanup(ug->g);
    if (!ug->g->is_symm) asg_symm(ug->g);
    uint32_t v, n_vtx = ug->g->n_seq * 2, i, k, mode = (((uint32_t)-1)<<2);
    uint32_t beg, sink, n, *a, n_occ;
    uint64_t pathLen;
    bub->ug = ug; 
    bub->b_bub = bub->b_end_bub = bub->tangle_bub = bub->cross_bub = bub->mess_bub = 0;
    if(bub->round_id == 0)
    {
        buf_t b; memset(&b, 0, sizeof(buf_t)); b.a = (binfo_t*)calloc(n_vtx, sizeof(binfo_t));
        uint64_t tLen = get_bub_pop_max_dist_advance(ug->g, &b);
        kv_init(bub->list); kv_init(bub->num); kv_init(bub->pathLen);
        kv_init(bub->b_s_idx); kv_malloc(bub->b_s_idx, ug->g->n_seq); 
        bub->b_ug = NULL; kv_init(bub->chain_weight);
        bub->b_s_idx.n = ug->g->n_seq;
        memset(bub->b_s_idx.a, -1, bub->b_s_idx.n * sizeof(uint64_t));
        CALLOC(bub->index, n_vtx);
        for (i = 0; i < ug->g->n_seq; i++) ug->g->seq[i].c = 0;
        for (v = 0; v < n_vtx; ++v) 
        {
            if(ug->g->seq[v>>1].del) continue;
            if(asg_arc_n(ug->g, v) < 2) continue;
            if((bub->index[v]&(uint32_t)3) != 0) continue;
            if(asg_bub_pop1_primary_trio(ug->g, NULL, v, tLen, &b, (uint32_t)-1, (uint32_t)-1, 0, NULL, NULL, NULL, 0, 0, NULL))
            {
                //beg is v, end is b.S.a[0]
                //note b.b include end, does not include beg
                for (i = 0; i < b.b.n; i++)
                {
                    if(b.b.a[i]==v || b.b.a[i]==b.S.a[0]) continue;
                    bub->index[b.b.a[i]] &= mode; bub->index[b.b.a[i]] += 1;
                    bub->index[b.b.a[i]^1] &= mode; bub->index[b.b.a[i]^1] += 1;
                }
                bub->index[v] &= mode; bub->index[v] += 2;
                bub->index[b.S.a[0]^1] &= mode; bub->index[b.S.a[0]^1] += 3;
            }
        }

        kvec_t_u32_warp stack, result;
        kv_init(stack.a); kv_init(result.a);
        for (v = 0; v < n_vtx; ++v) 
        {
            if((bub->index[v]&(uint32_t)3) !=2) continue;
            if(asg_bub_pop1_primary_trio(ug->g, ug, v, tLen, &b, (uint32_t)-1, (uint32_t)-1, 0, &pathLen, NULL, NULL, 0, 0, NULL))
            {   
                //note b.b include end, does not include beg
                i = b.b.n + 1;
                if(b.b.n == 2 || b.b.n == 3 || b.b.n == 5)
                {
                    for (i = 0; i < b.b.n; i++)
                    {
                        if(b.b.a[i]==v || b.b.a[i]==b.S.a[0]) continue;
                        dfs_bubble(ug->g, &stack, &result, b.b.a[i]>>1, v>>1, b.S.a[0]>>1);
                        if((result.a.n + 3) != b.b.n && (result.a.n + 2) != b.b.n) break;
                    }
                }

                if(i == b.b.n)
                {
                    kv_push(uint32_t, bub->num, v);
                }
                else
                {
                    kv_push(uint32_t, bub->num, v + (1<<31));
                }
            }
        }
        kv_destroy(stack.a); kv_destroy(result.a);
        radix_sort_u32(bub->num.a, bub->num.a + bub->num.n);
        bub->s_bub = 0;
        for (k = 0; k < bub->num.n; k++)
        {
            if((bub->num.a[k]>>31) == 0) bub->s_bub++;
            v = (bub->num.a[k]<<1)>>1;
            bub->num.a[k] = bub->list.n;
            if(asg_bub_pop1_primary_trio(ug->g, ug, v, tLen, &b, (uint32_t)-1, (uint32_t)-1, 0, &pathLen, NULL, NULL, 0, 0, NULL))
            {
                kv_push(uint64_t, bub->pathLen, pathLen);
                //beg is v, end is b.S.a[0]
                kv_push(uint32_t, bub->list, v);
                kv_push(uint32_t, bub->list, b.S.a[0]^1);
                
                //note b.b include end, does not include beg
                for (i = 0; i < b.b.n; i++)
                {
                    if(b.b.a[i]==v || b.b.a[i]==b.S.a[0]) continue;
                    kv_push(uint32_t, bub->list, b.b.a[i]);
                }
            }
        }
        kv_push(uint32_t, bub->num, bub->list.n);
        free(b.a); free(b.S.a); free(b.T.a); free(b.b.a); free(b.e.a);
        bub->f_bub = bub->num.n - 1; ///bub->s_bub = bub->num.n - 1;
        
        for (i = 0; i < ug->g->n_seq; i++)
        {
            bub->index[i] = get_unitig_het_arb(ug, i, r_het_flag, ref, 20, M_het(*bub), P_het(*bub), (uint32_t)-1);
        }
        for (i = 0; i < bub->f_bub; i++)
        {
            get_bubbles(bub, i, &beg, &sink, &a, &n, &pathLen);
            for (v = n_occ = 0; v < n; v++)
            {
                bub->index[(a[v]>>1)] = i;
                n_occ += ug->u.a[a[v]>>1].n;
            }

            // if((pathLen*2) >= ug->g->seq[beg>>1].len && (pathLen*2) >= ug->g->seq[sink>>1].len)
            // {
            //     bub->index[(beg>>1)] = (uint32_t)-1;
            //     bub->index[(sink>>1)] = (uint32_t)-1;
            // }

            if(n_occ > 3)
            {
                if(bub->index[(beg>>1)] != M_het(*bub)) bub->index[(beg>>1)] = (uint32_t)-1;
                if(bub->index[(sink>>1)] != M_het(*bub)) bub->index[(sink>>1)] = (uint32_t)-1;
            }
            
            
            v = beg>>1;
            if(bub->b_s_idx.a[v] == (uint64_t)-1)
            {
                bub->b_s_idx.a[v] <<= 32;
                bub->b_s_idx.a[v] |= i;
            }
            else if((bub->b_s_idx.a[v] & 0xffffffff00000000) == 0xffffffff00000000)
            {
                bub->b_s_idx.a[v] <<= 32;
                bub->b_s_idx.a[v] |= i;
            }


            v = sink>>1;
            if(bub->b_s_idx.a[v] == (uint64_t)-1)
            {
                bub->b_s_idx.a[v] <<= 32;
                bub->b_s_idx.a[v] |= i;
            }
            else if((bub->b_s_idx.a[v] & 0xffffffff00000000) == 0xffffffff00000000)
            {
                bub->b_s_idx.a[v] <<= 32;
                bub->b_s_idx.a[v] |= i;
            }        
        }
        for (i = 0; i < ug->g->n_seq; i++)
        {
            if(bub->index[i] == M_het(*bub)) bub->index[i] = P_het(*bub);
        }
    }
    else
    {
        bub->num.n = bub->f_bub + 1; 
        bub->pathLen.n = bub->f_bub;
        bub->list.n = bub->num.a[bub->num.n-1];
        update_bub_b_s_idx(bub);
        bub->check_het = 0;
        asg_destroy(bub->b_g); bub->b_g = NULL;
        ma_ug_destroy(bub->b_ug); bub->b_ug = NULL;
        kv_destroy(bub->chain_weight); kv_init(bub->chain_weight);
    }
    bub->b_g = NULL;
    bub->b_ug = NULL;
    build_bub_graph(ug, bub);
    // fprintf(stderr, "-bub->index[18759]: %u, bub->num.n: %u\n",  (uint32_t)bub->index[18759], bub->num.n);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rcx, %r12
movq %rdx, %rbp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
callq 0xa0a7d
movq 0x18(%r14), %r15
movl 0x14(%r15), %r13d
testl %r13d, %r13d
js 0x13e8e4
movq %r15, %rdi
callq 0xa0c1e
movq 0x18(%r14), %r15
movl 0x14(%r15), %r13d
movq %r14, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x88(%rbx)
movups %xmm0, 0x98(%rbx)
movq $0x0, 0xa8(%rbx)
cmpl $0x0, 0x8(%rbx)
movq %r14, 0x50(%rsp)
je 0x13e993
movq 0x40(%rbx), %rax
movq 0x80(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x30(%rbx)
movq %rcx, 0x48(%rbx)
movl (%rax,%rcx,4), %eax
movq %rax, 0x18(%rbx)
movq %rbx, %rdi
callq 0x13f2d9
movl $0x0, 0xb0(%rbx)
movq 0xb8(%rbx), %rdi
callq 0xa0494
xorl %r14d, %r14d
movq %r14, 0xb8(%rbx)
movq 0xc0(%rbx), %rdi
callq 0xa0761
movq %r14, 0xc0(%rbx)
movq 0xd8(%rbx), %rdi
callq 0x2220
movq %r14, 0xd8(%rbx)
movq 0x50(%rsp), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0xc8(%rbx)
jmp 0x13f2b5
movq %rbp, 0x68(%rsp)
movq %r12, 0x70(%rsp)
addl %r13d, %r13d
leaq 0xa8(%rsp), %r12
movups %xmm0, 0x58(%r12)
movups %xmm0, 0x48(%r12)
movups %xmm0, 0x38(%r12)
movups %xmm0, 0x28(%r12)
movups %xmm0, 0x18(%r12)
movups %xmm0, 0x8(%r12)
movl %r13d, %ebp
movl $0x1c, %esi
movq %rbp, %rdi
callq 0x2120
movq %rax, (%r12)
movq %r15, %rdi
movq %r12, %rsi
callq 0xc0162
movq %rax, 0x48(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
movups %xmm0, 0x28(%rbx)
movups %xmm0, 0x38(%rbx)
movups %xmm0, 0x48(%rbx)
movups %xmm0, 0x58(%rbx)
movups %xmm0, 0x68(%rbx)
movq 0x18(%r14), %r14
movl 0x14(%r14), %eax
movl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
andq %r15, %rax
movq %rax, 0x68(%rbx)
movl 0x14(%r14), %edi
andq %r15, %rdi
shlq $0x3, %rdi
callq 0x2280
movq %rax, 0x70(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0xc0(%rbx)
movups %xmm0, 0xd0(%rbx)
movl 0x14(%r14), %edx
andq %r15, %rdx
movq %rdx, 0x60(%rbx)
shlq $0x3, %rdx
movq %rax, %rdi
movl $0xff, %esi
callq 0x20e0
movl $0x4, %esi
movq %rbp, 0x40(%rsp)
movq %rbp, %rdi
callq 0x2120
movq %rax, (%rbx)
testl $0x7fffffff, 0x14(%r14) # imm = 0x7FFFFFFF
je 0x13ea9d
movq 0x20(%r14), %rax
xorl %ecx, %ecx
movb $0x0, 0x4(%rax,%rcx,8)
incq %rcx
movl 0x14(%r14), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
cmpq %rdx, %rcx
jb 0x13ea86
testl %r13d, %r13d
je 0x13edbc
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x50(%rsp), %r14
movq 0x40(%rsp), %rbp
movq 0x18(%r14), %rdi
movq 0x20(%rdi), %rax
movl %r12d, %ecx
shrl %ecx
cmpl $0x0, (%rax,%rcx,8)
js 0x13ebbb
movq 0x28(%rdi), %rax
testl $0xfffffffe, (%rax,%r12,8) # imm = 0xFFFFFFFE
je 0x13ebbb
movq (%rbx), %rax
testb $0x3, (%rax,%r12,4)
jne 0x13ebbb
movq %r15, 0x38(%rsp)
movl %r15d, 0x30(%rsp)
movl %r15d, 0x28(%rsp)
movq %r15, 0x20(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movl %r15d, 0x8(%rsp)
movl $0xffffffff, (%rsp)     # imm = 0xFFFFFFFF
xorl %esi, %esi
movl %r12d, %edx
movq 0x48(%rsp), %rcx
leaq 0xa8(%rsp), %r8
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0xc02d6
testq %rax, %rax
je 0x13ebbb
movq 0xc0(%rsp), %rax
movq 0xe0(%rsp), %rcx
testq %rcx, %rcx
je 0x13eb96
movq 0xf0(%rsp), %rdx
xorl %esi, %esi
movl (%rdx,%rsi,4), %edi
cmpq %rdi, %r12
je 0x13eb8c
cmpl (%rax), %edi
je 0x13eb8c
movq (%rbx), %r8
andl $-0x4, (%r8,%rdi,4)
movl (%rdx,%rsi,4), %edi
incl (%r8,%rdi,4)
movl (%rdx,%rsi,4), %edi
xorq $0x1, %rdi
andl $-0x4, (%r8,%rdi,4)
movl (%rdx,%rsi,4), %edi
xorq $0x1, %rdi
incl (%r8,%rdi,4)
incq %rsi
movl %esi, %edi
cmpq %rdi, %rcx
ja 0x13eb5a
movq (%rbx), %rcx
movl (%rcx,%r12,4), %edx
andl $-0x4, %edx
orl $0x2, %edx
movl %edx, (%rcx,%r12,4)
movl (%rax), %edx
xorq $0x1, %rdx
andl $-0x4, (%rcx,%rdx,4)
movl (%rax), %eax
xorq $0x1, %rax
addl $0x3, (%rcx,%rax,4)
incq %r12
cmpq %rbp, %r12
jne 0x13eab6
xorl %r15d, %r15d
xorps %xmm0, %xmm0
movaps %xmm0, 0x110(%rsp)
movq %r15, 0x120(%rsp)
movaps %xmm0, 0x80(%rsp)
movq %r15, 0x90(%rsp)
movl $0x0, %edi
testl %r13d, %r13d
je 0x13ede9
xorl %r12d, %r12d
movq (%rbx), %rax
movl (%rax,%r12,4), %eax
andl $0x3, %eax
cmpl $0x2, %eax
jne 0x13ed9e
movq 0x18(%r14), %rdi
movl %r15d, 0x30(%rsp)
movl %r15d, 0x28(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
leaq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
movl %r15d, 0x8(%rsp)
movq $0x0, 0x38(%rsp)
movl $0xffffffff, (%rsp)     # imm = 0xFFFFFFFF
movq %r14, %rsi
movl %r12d, %edx
movq 0x48(%rsp), %rcx
leaq 0xa8(%rsp), %r8
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0xc02d6
testq %rax, %rax
je 0x13ed9e
movq 0xe0(%rsp), %rdx
leal 0x1(%rdx), %ebp
cmpq $0x5, %rdx
ja 0x13ed05
movl $0x2c, %eax
btq %rdx, %rax
jae 0x13ed05
movl %r12d, %r13d
shrl %r13d
xorl %ebp, %ebp
movq 0xf0(%rsp), %rax
movl (%rax,%rbp,4), %ecx
cmpq %rcx, %r12
je 0x13ecfe
movq 0xc0(%rsp), %rax
movl (%rax), %r9d
cmpl %r9d, %ecx
je 0x13ecfe
movq 0x18(%r14), %rdi
shrl %ecx
shrl %r9d
leaq 0x110(%rsp), %rsi
leaq 0x80(%rsp), %rdx
movl %r13d, %r8d
callq 0x13e4b7
movq 0x80(%rsp), %rax
leaq 0x3(%rax), %rcx
movq 0xe0(%rsp), %rdx
cmpq %rdx, %rcx
setne %cl
addq $0x2, %rax
cmpq %rdx, %rax
setne %al
testb %al, %cl
jne 0x13ed05
incl %ebp
cmpq %rbp, %rdx
ja 0x13ec95
movl %ebp, %edi
movq 0x30(%rbx), %rcx
movq 0x38(%rbx), %rsi
movq 0x40(%rbx), %rax
cmpq %rdi, %rdx
jne 0x13ed58
cmpq %rsi, %rcx
movq 0x40(%rsp), %rbp
jne 0x13ed4a
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x38(%rbx)
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x40(%rbx)
movq 0x30(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x30(%rbx)
movl %r12d, (%rax,%rcx,4)
jmp 0x13ed9e
cmpq %rsi, %rcx
movq 0x40(%rsp), %rbp
jne 0x13ed8a
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x38(%rbx)
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x40(%rbx)
movq 0x30(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x30(%rbx)
movl %r12d, %edx
orl $0x80000000, %edx       # imm = 0x80000000
movl %edx, (%rax,%rcx,4)
incq %r12
cmpq %rbp, %r12
jne 0x13ebfe
movq 0x120(%rsp), %rdi
movq 0x90(%rsp), %r15
jmp 0x13ede9
xorps %xmm0, %xmm0
movaps %xmm0, 0x110(%rsp)
xorl %r15d, %r15d
movq %r15, 0x120(%rsp)
movaps %xmm0, 0x80(%rsp)
movq %r15, 0x90(%rsp)
xorl %edi, %edi
movq 0x50(%rsp), %r14
callq 0x2220
movq %r15, %rdi
callq 0x2220
movq 0x30(%rbx), %rax
movq 0x40(%rbx), %rdi
leaq (%rdi,%rax,4), %rsi
callq 0x137c5c
movq $0x0, 0x78(%rbx)
cmpq $0x0, 0x30(%rbx)
je 0x13f01d
leaq 0x18(%rbx), %r13
xorl %eax, %eax
xorl %ebp, %ebp
movq 0x40(%rbx), %rcx
movl (%rcx,%rax,4), %r15d
testl %r15d, %r15d
js 0x13ee33
incq 0x78(%rbx)
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
movl (%r13), %edx
movl %edx, (%rcx,%rax,4)
movq 0x18(%r14), %rdi
xorl %eax, %eax
movl %eax, 0x30(%rsp)
movl %eax, 0x28(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
leaq 0x58(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movl %eax, 0x8(%rsp)
movq $0x0, 0x38(%rsp)
movl $0xffffffff, (%rsp)     # imm = 0xFFFFFFFF
movq %r14, %rsi
movl %r15d, %edx
movq 0x48(%rsp), %rcx
leaq 0xa8(%rsp), %r8
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0xc02d6
testq %rax, %rax
je 0x13f004
movq 0x48(%rbx), %rcx
movq 0x58(%rbx), %rax
cmpq 0x50(%rbx), %rcx
jne 0x13eed2
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x50(%rbx)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x58(%rbx)
movq 0x48(%rbx), %rcx
movq 0x58(%rsp), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, 0x48(%rbx)
movq %rdx, (%rax,%rcx,8)
movq 0x18(%rbx), %rdx
movq 0x20(%rbx), %rcx
movq 0x28(%rbx), %rax
cmpq %rcx, %rdx
jne 0x13ef20
leaq (%rdx,%rdx), %rsi
testq %rdx, %rdx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x20(%rbx)
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x28(%rbx)
movq 0x18(%rbx), %rdx
movq 0x20(%rbx), %rcx
leaq 0x1(%rdx), %rsi
movq %rsi, (%r13)
movl %r15d, (%rax,%rdx,4)
cmpq %rcx, %rsi
jne 0x13ef59
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x20(%rbx)
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x28(%rbx)
movq 0x18(%rbx), %rsi
movq 0xc0(%rsp), %rcx
movl (%rcx), %ecx
xorl $0x1, %ecx
leaq 0x1(%rsi), %rdx
movq %rdx, (%r13)
movl %ecx, (%rax,%rsi,4)
movq 0xe0(%rsp), %rcx
testq %rcx, %rcx
je 0x13f004
movl $0x1, %r12d
movq 0xf0(%rsp), %rsi
xorl %r14d, %r14d
movl (%rsi,%r14,4), %edi
cmpl %r15d, %edi
je 0x13eff9
movq 0xc0(%rsp), %r8
cmpl (%r8), %edi
je 0x13eff9
cmpq 0x20(%rbx), %rdx
jne 0x13efe7
leaq (%rdx,%rdx), %rsi
testq %rdx, %rdx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x20(%rbx)
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x28(%rbx)
movq 0xe0(%rsp), %rcx
movq 0xf0(%rsp), %rsi
movq 0x18(%rbx), %rdx
movl (%rsi,%r14,4), %edi
leaq 0x1(%rdx), %r8
movq %r8, (%r13)
movl %edi, (%rax,%rdx,4)
movq %r8, %rdx
movl %r12d, %r14d
incl %r12d
cmpq %r14, %rcx
ja 0x13ef93
incl %ebp
movq 0x30(%rbx), %rcx
movq %rbp, %rax
cmpq %rbp, %rcx
movq 0x50(%rsp), %r14
ja 0x13ee22
jmp 0x13f01f
xorl %ecx, %ecx
movq 0x40(%rbx), %rax
cmpq 0x38(%rbx), %rcx
jne 0x13f051
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %esi
cmovneq %rdx, %rsi
movq %rsi, 0x38(%rbx)
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x40(%rbx)
movq 0x30(%rbx), %rcx
movl 0x18(%rbx), %edx
leaq 0x1(%rcx), %rsi
movq %rsi, 0x30(%rbx)
movl %edx, (%rax,%rcx,4)
movq 0xa8(%rsp), %rdi
callq 0x2220
movq 0xc0(%rsp), %rdi
callq 0x2220
movq 0xd8(%rsp), %rdi
callq 0x2220
movq 0xf0(%rsp), %rdi
callq 0x2220
movq 0x108(%rsp), %rdi
callq 0x2220
movq 0x30(%rbx), %rcx
movq %rcx, 0x48(%rsp)
leaq -0x1(%rcx), %rax
movq %rax, 0x60(%rsp)
movq %rax, 0x80(%rbx)
movq 0x18(%r14), %rbp
movl 0x14(%rbp), %eax
testl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %r14, %r12
movq 0x70(%rsp), %r13
movq 0x68(%rsp), %r14
je 0x13f132
movq 0x48(%rsp), %rax
incl %eax
movl %eax, 0x40(%rsp)
movq (%rbx), %rax
movq %rax, 0x78(%rsp)
xorl %r15d, %r15d
movq 0x48(%rsp), %rax
movl %eax, (%rsp)
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
movq %r12, %rdi
movl %r15d, %esi
movq %r14, %rdx
movq %r13, %rcx
movl $0x14, %r8d
movl 0x40(%rsp), %r9d
callq 0x13e800
movq 0x78(%rsp), %rcx
movl %eax, (%rcx,%r15,4)
incq %r15
movl 0x14(%rbp), %eax
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpq %rcx, %r15
jb 0x13f0ea
movq %rbp, 0x40(%rsp)
cmpq $0x0, 0x60(%rsp)
movq %r12, %rdi
je 0x13f278
movabsq $-0x100000001, %r15     # imm = 0xFFFFFFFEFFFFFFFF
movq 0x28(%rbx), %rcx
movq 0x40(%rbx), %rdx
movq 0x58(%rbx), %rax
movq %rax, 0x48(%rsp)
movq 0x70(%rbx), %r12
xorl %r8d, %r8d
movl (%rdx,%r8,4), %r11d
movl 0x4(%rdx,%r8,4), %eax
subl %r11d, %eax
leal 0x1(%r11), %r9d
movl (%rcx,%r11,4), %r10d
movl (%rcx,%r9,4), %r9d
movq 0x48(%rsp), %rsi
movq (%rsi,%r8,8), %r14
movq %r14, 0x58(%rsp)
addl $-0x2, %eax
je 0x13f20f
movq %r15, %rdi
leaq (%rcx,%r11,4), %r11
movq (%rbx), %r14
movq 0x50(%rsp), %rsi
movq 0x10(%rsi), %r15
movl %eax, %r13d
xorl %ebp, %ebp
xorl %eax, %eax
movl 0x8(%r11,%rbp,4), %esi
shrl %esi
movl %r8d, (%r14,%rsi,4)
movl 0x8(%r11,%rbp,4), %esi
shrl %esi
leaq (%rsi,%rsi,4), %rsi
addl 0x10(%r15,%rsi,8), %eax
incq %rbp
cmpq %rbp, %r13
jne 0x13f1ad
cmpl $0x3, %eax
movq %rdi, %r15
jbe 0x13f20f
movq (%rbx), %r11
movq 0x30(%rbx), %rax
shrl %r10d
movl (%r11,%r10,4), %esi
incq %rax
cmpq %rsi, %rax
je 0x13f1f6
movl $0xffffffff, (%r11,%r10,4) # imm = 0xFFFFFFFF
movl %r9d, %r14d
shrl %r14d
movl (%r11,%r14,4), %esi
cmpq %rsi, %rax
je 0x13f212
movl $0xffffffff, (%r11,%r14,4) # imm = 0xFFFFFFFF
jmp 0x13f212
shrl %r10d
movq 0x50(%rsp), %rdi
movq (%r12,%r10,8), %rax
cmpq $-0x1, %rax
je 0x13f22f
cmpq %r15, %rax
jbe 0x13f23a
shlq $0x20, %rax
orq %r8, %rax
jmp 0x13f236
leaq (%r15,%r8), %rax
incq %rax
movq %rax, (%r12,%r10,8)
shrl %r9d
movq (%r12,%r9,8), %rax
cmpq $-0x1, %rax
je 0x13f255
cmpq %r15, %rax
jbe 0x13f260
shlq $0x20, %rax
orq %r8, %rax
jmp 0x13f25c
leaq (%r15,%r8), %rax
incq %rax
movq %rax, (%r12,%r9,8)
incl %r8d
cmpq %r8, 0x80(%rbx)
ja 0x13f168
movq 0x40(%rsp), %rax
movl 0x14(%rax), %eax
testl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq 0x40(%rsp), %r10
je 0x13f2b5
movq (%rbx), %rcx
movq 0x30(%rbx), %rdx
leaq 0x1(%rdx), %rsi
xorl %r9d, %r9d
movl (%rcx,%r9,4), %r8d
cmpq %r8, %rsi
jne 0x13f2a3
movl %edx, (%rcx,%r9,4)
movl 0x14(%r10), %eax
incq %r9
movl %eax, %r8d
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
cmpq %r8, %r9
jb 0x13f292
xorps %xmm0, %xmm0
movups %xmm0, 0xb8(%rbx)
movq %rbx, %rsi
callq 0x13f39b
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq