// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: bub_complex(asg_t*, ma_ug_t*, bubble_type*, unsigned int, ma_hit_t_alloc*, ma_sub_t*, kvec_t_u32_warp*, int, int, unsigned char*, unsigned char*, kv_asg_arc_t*, buf_t*, unsigned long)
int bub_complex(asg_t *sg, ma_ug_t *ug, bubble_type* bub, uint32_t bid, ma_hit_t_alloc* sources, ma_sub_t *coverage_cut, kvec_t_u32_warp* stack, 
int max_hang, int min_ovlp, uint8_t* trio_flag, uint8_t* vis_flag, kv_asg_arc_t* e, buf_t *b, uint64_t tLen)
{
    if(bid >= bub->f_bub) return 0;
    uint32_t beg_utg, sink_utg, *a = NULL, n, begRid, sinkRid, i, k_i, k_j, k_v, rID/**, cur_flag, pre_flag, after_flag**/;
    int is_switch_0, is_switch_1;
    ma_utg_t* nsu = NULL;
    get_bubbles(bub, bid, &beg_utg, &sink_utg, &a, &n, NULL);
    if(beg_utg == (uint32_t)-1 || sink_utg == (uint32_t)-1) return 0;
    if(beg_utg&1)
    {
        begRid = ug->u.a[beg_utg>>1].start^1;
    }
    else
    {
        begRid = ug->u.a[beg_utg>>1].end^1;
    }

    if(sink_utg&1)
    {
        sinkRid = ug->u.a[sink_utg>>1].start;
    }
    else
    {
        sinkRid = ug->u.a[sink_utg>>1].end;
    }


    
    is_switch_0 = is_switch_1 = 1;
    asg_bub_pop1_primary_trio_switch_check(ug->g, ug, beg_utg, tLen, b, FATHER, DROP, 0, NULL, NULL, &is_switch_0);

    if(is_switch_0 == 0)
    {
        asg_bub_pop1_primary_trio_switch_check(ug->g, ug, beg_utg, tLen, b, MOTHER, DROP, 0, NULL, NULL, &is_switch_1);
    } 
    

    for (k_i = 0; k_i < n; k_i++)
    {
        nsu = &(ug->u.a[a[k_i]>>1]);
        for (k_j = 0; k_j < nsu->n; k_j++)
        {
            rID = nsu->a[k_j]>>33;
            if(R_INF.trio_flag[rID] == DROP) R_INF.trio_flag[rID] = AMBIGU;
        }
    }
    /*******************************for debug************************************/
    // for (i = 0; i < sg->n_seq; i++)
    // {
    //     if(R_INF.trio_flag[i] == DROP) fprintf(stderr, "ERROR-1\n");
    // }
    /*******************************for debug************************************/
    
    if(is_switch_0 == 0 && is_switch_1 == 0) return 0;

    asg_arc_t *acur = NULL;
    uint32_t cur, ncur, v, n_vx = sg->n_seq<<1;
    stack->a.n = 0; 
    memset(vis_flag, 0, n_vx);

    kv_push(uint32_t, stack->a, begRid);
    while (stack->a.n > 0)
    {
        stack->a.n--;
        cur = stack->a.a[stack->a.n];
        ncur = asg_arc_n(sg, cur);
        acur = asg_arc_a(sg, cur);
        vis_flag[cur] = 1;
        for (i = 0; i < ncur; i++)
        {
            if(acur[i].del) continue;
            if(vis_flag[acur[i].v]) continue;
            if(acur[i].v == sinkRid) continue;
            kv_push(uint32_t, stack->a, acur[i].v);
        }
    }
    vis_flag[sinkRid] = 1;


    ma_hit_t_alloc* x = NULL;
    ma_hit_t *h = NULL;
    ma_sub_t *sq = NULL;
    ma_sub_t *st = NULL;
    int32_t r;
    asg_arc_t t;
    

    for (k_i = 0; k_i < n; k_i++)
    {
        nsu = &(ug->u.a[a[k_i]>>1]);
        for (k_j = 0; k_j < nsu->n; k_j++)
        {
            rID = nsu->a[k_j]>>33;
            for (k_v = 0; k_v < 2; k_v++)
            {
                v = (rID<<1) + k_v;
                if(vis_flag[v] == 0) continue;
                x = &(sources[v>>1]);
                for (i = 0; i < x->length; i++)
                {
                    h = &(x->buffer[i]);
                    sq = &(coverage_cut[Get_qn(*h)]);
                    st = &(coverage_cut[Get_tn(*h)]);
                    if(st->del || sg->seq[Get_tn(*h)].del) continue;
                    r = ma_hit2arc(h, sq->e - sq->s, st->e - st->s, max_hang, 
                                        asm_opt.max_hang_rate, min_ovlp, &t);
                
                    ///if it is a contained read, skip
                    if(r < 0) continue;
                    if((t.ul>>32) != v) continue;
                    if(vis_flag[t.ul>>32] == 0 || vis_flag[t.v] == 0) continue;
                    kv_push(asg_arc_t, *e, t);
                    get_edge_from_source(sources, coverage_cut, NULL, max_hang, min_ovlp, 
                                (t.v^1), ((t.ul>>32)^1), &t);
                    kv_push(asg_arc_t, *e, t);
                }

            }
        }
    }

    return 1;
    
    /**
    for (v = 0; v < n_vx; v++)
    {
        if(vis_flag[v] == 0) continue;
        fprintf(stderr, "v: %u, n_vx: %u\n", v, n_vx);
        x = &(sources[v>>1]);
        for (i = 0; i < x->length; i++)
        {
            fprintf(stderr, "i: %u, x->length: %u\n", i, x->length);
            h = &(x->buffer[i]);
            sq = &(coverage_cut[Get_qn(*h)]);
            st = &(coverage_cut[Get_tn(*h)]);
            if(st->del || sg->seq[Get_tn(*h)].del) continue;
            r = ma_hit2arc(h, sq->e - sq->s, st->e - st->s, max_hang, 
                                asm_opt.max_hang_rate, min_ovlp, &t);
        
            ///if it is a contained read, skip
            if(r < 0) continue;
            if((t.ul>>32) != v) continue;
            if(vis_flag[t.ul>>32] == 0 || vis_flag[t.v] == 0) continue;
            kv_push(asg_arc_t, *e, t);
            get_edge_from_source(sources, coverage_cut, NULL, max_hang, min_ovlp, 
                        (t.v^1), ((t.ul>>32)^1), &t);
            kv_push(asg_arc_t, *e, t);
        }
    }
    **/
    

    /*******************************for debug************************************/
    // uint32_t utg_occ = 0, rtg_occ = 0;
    // for (i = 0; i < n; i++)
    // {
    //     utg_occ += ug->u.a[a[i]>>1].n;
    // }

    // for (i = 0; i < n_vx; i++)
    // {
    //     if(vis_flag[i]) rtg_occ++;
    // }
    
    // fprintf(stderr, "bid: %u, rtg_occ: %u, utg_occ: %u\n", bid, rtg_occ, utg_occ);
    // if(rtg_occ != utg_occ + 2) fprintf(stderr, "ERROR\n");
    /*******************************for debug************************************/
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq 0x48(%rbp), %rax
movq 0x40(%rbp), %rax
movq 0x38(%rbp), %rax
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %eax
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movl -0x24(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpq 0x80(%rcx), %rax
jb 0x15aa5c
movl $0x0, -0x4(%rbp)
jmp 0x15b355
movq $0x0, -0x48(%rbp)
movq $0x0, -0x78(%rbp)
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, %esi
leaq -0x3c(%rbp), %rdx
leaq -0x40(%rbp), %rcx
leaq -0x48(%rbp), %r8
leaq -0x4c(%rbp), %r9
xorl %eax, %eax
movq $0x0, (%rsp)
callq 0x1c4b20
cmpl $-0x1, -0x3c(%rbp)
je 0x15aaa0
cmpl $-0x1, -0x40(%rbp)
jne 0x15aaac
movl $0x0, -0x4(%rbp)
jmp 0x15b355
movl -0x3c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x15aad8
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x3c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
xorl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x15aaf7
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x3c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
xorl $0x1, %eax
movl %eax, -0x50(%rbp)
movl -0x40(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x15ab20
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x40(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x54(%rbp)
jmp 0x15ab3c
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x40(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x54(%rbp)
movl $0x1, -0x70(%rbp)
movl $0x1, -0x6c(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movl -0x3c(%rbp), %edx
movq 0x48(%rbp), %rcx
movq 0x40(%rbp), %r8
movl $0x1, %r9d
xorl %eax, %eax
xorl %eax, %eax
leaq -0x6c(%rbp), %rax
movl $0x5, (%rsp)
movl $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x135a60
cmpl $0x0, -0x6c(%rbp)
jne 0x15abf0
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movl -0x3c(%rbp), %edx
movq 0x48(%rbp), %rcx
movq 0x40(%rbp), %r8
movl $0x2, %r9d
xorl %eax, %eax
xorl %eax, %eax
leaq -0x70(%rbp), %rax
movl $0x5, (%rsp)
movl $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x135a60
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jae 0x15ac93
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x48(%rbp), %rcx
movl -0x5c(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
movq -0x78(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x15ac83
movq -0x78(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x60(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movl %eax, -0x68(%rbp)
leaq 0x26a67c(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movl -0x68(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x5, %eax
jne 0x15ac76
leaq 0x26a665(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movl -0x68(%rbp), %ecx
movb $0x0, (%rax,%rcx)
jmp 0x15ac78
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x15ac2b
jmp 0x15ac85
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x15abf7
cmpl $0x0, -0x6c(%rbp)
jne 0x15acab
cmpl $0x0, -0x70(%rbp)
jne 0x15acab
movl $0x0, -0x4(%rbp)
jmp 0x15b355
movq $0x0, -0x80(%rbp)
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shll %eax
movl %eax, -0x90(%rbp)
movq 0x10(%rbp), %rax
movq $0x0, (%rax)
movq 0x30(%rbp), %rdi
movl -0x90(%rbp), %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x2100
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x15ad56
movq 0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x15ad15
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xd8(%rbp)
jmp 0x15ad23
movl $0x2, %eax
movq %rax, -0xd8(%rbp)
jmp 0x15ad23
movq -0xd8(%rbp), %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x50(%rbp), %edx
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movl %edx, (%rax,%rcx,4)
jmp 0x15ad77
movq 0x10(%rbp), %rax
cmpq $0x0, (%rax)
jbe 0x15af1e
movq 0x10(%rbp), %rax
movq (%rax), %rcx
addq $-0x1, %rcx
movq %rcx, (%rax)
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rbp), %rcx
movq (%rcx), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x84(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x84(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x88(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x84(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movq 0x30(%rbp), %rax
movl -0x84(%rbp), %ecx
movb $0x1, (%rax,%rcx)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x88(%rbp), %eax
jae 0x15af19
movq -0x80(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x15ae2e
jmp 0x15af0b
movq 0x30(%rbp), %rax
movq -0x80(%rbp), %rcx
movl -0x58(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
cmpb $0x0, (%rax,%rcx)
je 0x15ae4e
jmp 0x15af0b
movq -0x80(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0x54(%rbp), %eax
jne 0x15ae69
jmp 0x15af0b
jmp 0x15ae6b
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x15aedc
movq 0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x15ae9b
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xe0(%rbp)
jmp 0x15aea9
movl $0x2, %eax
movq %rax, -0xe0(%rbp)
jmp 0x15aea9
movq -0xe0(%rbp), %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x80(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %edx
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movl %edx, (%rax,%rcx,4)
jmp 0x15af0b
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x15ae01
jmp 0x15ad77
movq 0x30(%rbp), %rax
movl -0x54(%rbp), %ecx
movb $0x1, (%rax,%rcx)
movq $0x0, -0x98(%rbp)
movq $0x0, -0xa0(%rbp)
movq $0x0, -0xa8(%rbp)
movq $0x0, -0xb0(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jae 0x15b34e
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x48(%rbp), %rcx
movl -0x5c(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
movq -0x78(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x15b33e
movq -0x78(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x60(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movl %eax, -0x68(%rbp)
movl $0x0, -0x64(%rbp)
cmpl $0x2, -0x64(%rbp)
jae 0x15b32e
movl -0x68(%rbp), %eax
shll %eax
addl -0x64(%rbp), %eax
movl %eax, -0x8c(%rbp)
movq 0x30(%rbp), %rax
movl -0x8c(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x15afed
jmp 0x15b320
movq -0x30(%rbp), %rax
movl -0x8c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
movq -0x98(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x15b31e
movq -0x98(%rbp), %rax
movq (%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movq -0x38(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
movl %ecx, %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
movq -0x38(%rbp), %rax
movq -0xa0(%rbp), %rcx
movl 0xc(%rcx), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x15b0aa
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0xa0(%rbp), %rcx
movl 0xc(%rcx), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x15b0af
jmp 0x15b310
movq -0xa0(%rbp), %rdi
movq -0xa8(%rbp), %rax
movl 0x4(%rax), %esi
movq -0xa8(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %esi
movq -0xb0(%rbp), %rax
movl 0x4(%rax), %edx
movq -0xb0(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %edx
movl 0x18(%rbp), %ecx
leaq 0x269704(%rip), %rax    # 0x3c47f8
movss 0x158(%rax), %xmm0
movl 0x20(%rbp), %r8d
leaq -0xd0(%rbp), %r9
callq 0xd0300
movl %eax, -0xb4(%rbp)
cmpl $0x0, -0xb4(%rbp)
jge 0x15b120
jmp 0x15b310
movq -0xd0(%rbp), %rax
shrq $0x20, %rax
movl -0x8c(%rbp), %ecx
cmpq %rcx, %rax
je 0x15b13b
jmp 0x15b310
movq 0x30(%rbp), %rax
movq -0xd0(%rbp), %rcx
shrq $0x20, %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x15b166
movq 0x30(%rbp), %rax
movl -0xc8(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x15b16b
jmp 0x15b310
jmp 0x15b16d
movq 0x38(%rbp), %rax
movq (%rax), %rax
movq 0x38(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x15b1db
movq 0x38(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x15b19d
movq 0x38(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xe8(%rbp)
jmp 0x15b1ab
movl $0x2, %eax
movq %rax, -0xe8(%rbp)
jmp 0x15b1ab
movq -0xe8(%rbp), %rcx
movq 0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x38(%rbp), %rax
imulq $0x18, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x38(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0xd0(%rbp), %rcx
movq %rcx, (%rax)
movq -0xc8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xc0(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl 0x18(%rbp), %ecx
movl 0x20(%rbp), %r8d
movl -0xc8(%rbp), %r9d
xorl $0x1, %r9d
movq -0xd0(%rbp), %rax
shrq $0x20, %rax
xorq $0x1, %rax
movl %eax, %r10d
xorl %eax, %eax
movl %eax, %edx
leaq -0xd0(%rbp), %rax
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xe9560
movq 0x38(%rbp), %rax
movq (%rax), %rax
movq 0x38(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x15b2ce
movq 0x38(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x15b290
movq 0x38(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xf0(%rbp)
jmp 0x15b29e
movl $0x2, %eax
movq %rax, -0xf0(%rbp)
jmp 0x15b29e
movq -0xf0(%rbp), %rcx
movq 0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x38(%rbp), %rax
imulq $0x18, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x38(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0xd0(%rbp), %rcx
movq %rcx, (%rax)
movq -0xc8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xc0(%rbp), %rcx
movq %rcx, 0x10(%rax)
jmp 0x15b310
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x15b010
jmp 0x15b320
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x15afbd
jmp 0x15b330
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x15af90
jmp 0x15b340
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x15af5c
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopw %cs:(%rax,%rax)