// File: chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: normalize_hap_overlaps_advance_by_p_g_t(hap_overlaps_list*, hap_overlaps_list*, ma_ug_t*, asg_t*, ma_hit_t_alloc*, R_to_U*, p_g_t*, hap_cov_t*, double)
void normalize_hap_overlaps_advance_by_p_g_t(hap_overlaps_list* all_ovlp, hap_overlaps_list* back_all_ovlp,
ma_ug_t *ug, asg_t *read_g, ma_hit_t_alloc* reverse_sources, R_to_U* ruIndex, p_g_t *pg, hap_cov_t *cov, 
double filter_rate)
{
    hap_overlaps *x = NULL, *y = NULL;
    uint32_t v, i, uId, qn, tn;
    uint32_t types[4];
    

    types[X2Y] = Y2X; types[Y2X] = X2Y; types[XCY] = YCX; types[YCX] = XCY;
    int index;
    uint32_t k, qs, qe, ts, te, occ, as, ae, ovlp, hetLen, homLen;
    p_node_t *a = NULL;


    for (v = 0; v < all_ovlp->num; v++)
    {
        uId = v;
        for (i = 0; i < all_ovlp->x[uId].a.n; i++)
        {
            /*****************qn*****************/
            qn = all_ovlp->x[uId].a.a[i].xUid;
            qs = all_ovlp->x[uId].a.a[i].x_beg_pos;
            qe = all_ovlp->x[uId].a.a[i].x_end_pos - 1;
            get_p_nodes(pg, &a, &occ, qn);
            for (k = 0, hetLen = 0, homLen = 0; k < occ; k++)
            {
                as = a[k].baseBeg;
                ae = a[k].baseEnd;
                ovlp = ((MIN(qe, ae) >= MAX(qs, as))? MIN(qe, ae) - MAX(qs, as) + 1 : 0);
                if(homLen + hetLen > 0 && ovlp == 0) break;
                if(ovlp == 0) continue;
                if(a[k].h_status == N_HET)
                {
                    homLen += ovlp;
                } 
                else if(asm_opt.polyploidy <= 2 && (a[k].h_status&P_HET))///if(asm_opt.polyploidy <= 2 && (a[k].h_status&S_HET))
                {
                    homLen += ovlp;
                }
                else
                {
                    hetLen += ovlp;
                }                
            }

            if(hetLen <= ((hetLen + homLen) * filter_rate))
            {
                all_ovlp->x[uId].a.a[i].status = DELETE;
                continue;
            }
            /*****************qn*****************/


            /*****************tn*****************/
            tn = all_ovlp->x[uId].a.a[i].yUid;
            ts = all_ovlp->x[uId].a.a[i].y_beg_pos;
            te = all_ovlp->x[uId].a.a[i].y_end_pos - 1;
            get_p_nodes(pg, &a, &occ, tn);
            for (k = 0, hetLen = 0, homLen = 0; k < occ; k++)
            {
                as = a[k].baseBeg;
                ae = a[k].baseEnd;
                ovlp = ((MIN(te, ae) >= MAX(ts, as))? MIN(te, ae) - MAX(ts, as) + 1 : 0);
                if(homLen + hetLen > 0 && ovlp == 0) break;
                if(ovlp == 0) continue;
                if(a[k].h_status == N_HET)
                {
                    homLen += ovlp;
                } 
                else if(asm_opt.polyploidy <= 2 && (a[k].h_status&P_HET))///if(asm_opt.polyploidy <= 2 && (a[k].h_status&S_HET))
                {
                    homLen += ovlp;
                }
                else
                {
                    hetLen += ovlp;
                }                 
            }

            if(hetLen <= ((hetLen + homLen) * filter_rate))
            {
                all_ovlp->x[uId].a.a[i].status = DELETE;
                continue;
            }
            /*****************tn*****************/
        }
    }

    for (v = 0; v < all_ovlp->num; v++)
    {
        uId = v;
        k = 0;
        for (i = 0; i < all_ovlp->x[uId].a.n; i++)
        {
            if(all_ovlp->x[uId].a.a[i].status == DELETE) continue;
            all_ovlp->x[uId].a.a[k] = all_ovlp->x[uId].a.a[i];
            k++;
        }
        all_ovlp->x[uId].a.n = k;
    }


    for (v = 0; v < all_ovlp->num; v++)
    {
        uId = v;
        for (i = 0; i < all_ovlp->x[uId].a.n; i++)
        {
            qn = all_ovlp->x[uId].a.a[i].xUid;
            tn = all_ovlp->x[uId].a.a[i].yUid;
            x = &(all_ovlp->x[uId].a.a[i]);
            index = get_specific_hap_overlap(&(all_ovlp->x[tn]), tn, qn);
            if(index != -1)
            {
                y = &(all_ovlp->x[tn].a.a[index]);
                if(x->rev == y->rev && types[x->type]==y->type) continue;
                if(x->score >= y->score)
                {
                    kv_push(hap_overlaps, back_all_ovlp->x[tn].a, (*y));
                    set_reverse_hap_overlap(y, x, types);
                }
                else
                {
                    kv_push(hap_overlaps, back_all_ovlp->x[qn].a, (*x));
                    set_reverse_hap_overlap(x, y, types);
                }
            }
            else
            {
                kv_pushp(hap_overlaps, all_ovlp->x[tn].a, &y);
                set_reverse_hap_overlap(y, x, types);
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movsd %xmm0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movl $0x1, -0x70(%rbp)
movl $0x0, -0x6c(%rbp)
movl $0x3, -0x68(%rbp)
movl $0x2, -0x64(%rbp)
movq $0x0, -0xa8(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jae 0x17b439
movl -0x4c(%rbp), %eax
movl %eax, -0x54(%rbp)
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
movl -0x54(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jae 0x17b429
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x50(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x24(%rax), %eax
movl %eax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x50(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x7c(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x50(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
subl $0x1, %eax
movl %eax, -0x80(%rbp)
movq 0x10(%rbp), %rdi
movl -0x58(%rbp), %ecx
leaq -0xa8(%rbp), %rsi
leaq -0x8c(%rbp), %rdx
callq 0x17ad50
movl $0x0, -0x78(%rbp)
movl $0x0, -0x9c(%rbp)
movl $0x0, -0xa0(%rbp)
movl -0x78(%rbp), %eax
cmpl -0x8c(%rbp), %eax
jae 0x17b0dc
movq -0xa8(%rbp), %rax
movl -0x78(%rbp), %ecx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x90(%rbp)
movq -0xa8(%rbp), %rax
movl -0x78(%rbp), %ecx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x94(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x94(%rbp), %eax
ja 0x17af57
movl -0x80(%rbp), %eax
movl %eax, -0xac(%rbp)
jmp 0x17af63
movl -0x94(%rbp), %eax
movl %eax, -0xac(%rbp)
movl -0xac(%rbp), %eax
movl %eax, -0xb0(%rbp)
movl -0x7c(%rbp), %eax
cmpl -0x90(%rbp), %eax
jb 0x17af85
movl -0x7c(%rbp), %eax
movl %eax, -0xb4(%rbp)
jmp 0x17af91
movl -0x90(%rbp), %eax
movl %eax, -0xb4(%rbp)
movl -0xb0(%rbp), %eax
movl -0xb4(%rbp), %ecx
cmpl %ecx, %eax
jb 0x17b00a
movl -0x80(%rbp), %eax
cmpl -0x94(%rbp), %eax
ja 0x17afb7
movl -0x80(%rbp), %eax
movl %eax, -0xb8(%rbp)
jmp 0x17afc3
movl -0x94(%rbp), %eax
movl %eax, -0xb8(%rbp)
movl -0xb8(%rbp), %eax
movl %eax, -0xbc(%rbp)
movl -0x7c(%rbp), %eax
cmpl -0x90(%rbp), %eax
jb 0x17afe5
movl -0x7c(%rbp), %eax
movl %eax, -0xc0(%rbp)
jmp 0x17aff1
movl -0x90(%rbp), %eax
movl %eax, -0xc0(%rbp)
movl -0xbc(%rbp), %eax
movl -0xc0(%rbp), %ecx
subl %ecx, %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x17b014
xorl %eax, %eax
movl %eax, -0xc4(%rbp)
jmp 0x17b014
movl -0xc4(%rbp), %eax
movl %eax, -0x98(%rbp)
movl -0xa0(%rbp), %eax
addl -0x9c(%rbp), %eax
cmpl $0x0, %eax
jbe 0x17b03f
cmpl $0x0, -0x98(%rbp)
jne 0x17b03f
jmp 0x17b0dc
cmpl $0x0, -0x98(%rbp)
jne 0x17b04d
jmp 0x17b0ce
movq -0xa8(%rbp), %rax
movl -0x78(%rbp), %ecx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x14(%rax)
jne 0x17b078
movl -0x98(%rbp), %eax
addl -0xa0(%rbp), %eax
movl %eax, -0xa0(%rbp)
jmp 0x17b0cc
leaq 0x249779(%rip), %rax    # 0x3c47f8
cmpl $0x2, 0x1bc(%rax)
jg 0x17b0b8
movq -0xa8(%rbp), %rax
movl -0x78(%rbp), %ecx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x17b0b8
movl -0x98(%rbp), %eax
addl -0xa0(%rbp), %eax
movl %eax, -0xa0(%rbp)
jmp 0x17b0ca
movl -0x98(%rbp), %eax
addl -0x9c(%rbp), %eax
movl %eax, -0x9c(%rbp)
jmp 0x17b0cc
jmp 0x17b0ce
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x17aeff
movl -0x9c(%rbp), %eax
movl %eax, %ecx
movl %ecx, %eax
cvtsi2sd %rcx, %xmm1
movl -0xa0(%rbp), %ecx
addl %ecx, %eax
cvtsi2sd %rax, %xmm0
mulsd -0x38(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x17b12b
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x50(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movb $0x2, 0x2(%rax)
jmp 0x17b41b
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x50(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x28(%rax), %eax
movl %eax, -0x5c(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x50(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, -0x84(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x50(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
subl $0x1, %eax
movl %eax, -0x88(%rbp)
movq 0x10(%rbp), %rdi
movl -0x5c(%rbp), %ecx
leaq -0xa8(%rbp), %rsi
leaq -0x8c(%rbp), %rdx
callq 0x17ad50
movl $0x0, -0x78(%rbp)
movl $0x0, -0x9c(%rbp)
movl $0x0, -0xa0(%rbp)
movl -0x78(%rbp), %eax
cmpl -0x8c(%rbp), %eax
jae 0x17b3cd
movq -0xa8(%rbp), %rax
movl -0x78(%rbp), %ecx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x90(%rbp)
movq -0xa8(%rbp), %rax
movl -0x78(%rbp), %ecx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x94(%rbp)
movl -0x88(%rbp), %eax
cmpl -0x94(%rbp), %eax
ja 0x17b236
movl -0x88(%rbp), %eax
movl %eax, -0xc8(%rbp)
jmp 0x17b242
movl -0x94(%rbp), %eax
movl %eax, -0xc8(%rbp)
movl -0xc8(%rbp), %eax
movl %eax, -0xcc(%rbp)
movl -0x84(%rbp), %eax
cmpl -0x90(%rbp), %eax
jb 0x17b26a
movl -0x84(%rbp), %eax
movl %eax, -0xd0(%rbp)
jmp 0x17b276
movl -0x90(%rbp), %eax
movl %eax, -0xd0(%rbp)
movl -0xcc(%rbp), %eax
movl -0xd0(%rbp), %ecx
cmpl %ecx, %eax
jb 0x17b2fb
movl -0x88(%rbp), %eax
cmpl -0x94(%rbp), %eax
ja 0x17b2a2
movl -0x88(%rbp), %eax
movl %eax, -0xd4(%rbp)
jmp 0x17b2ae
movl -0x94(%rbp), %eax
movl %eax, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
movl %eax, -0xd8(%rbp)
movl -0x84(%rbp), %eax
cmpl -0x90(%rbp), %eax
jb 0x17b2d6
movl -0x84(%rbp), %eax
movl %eax, -0xdc(%rbp)
jmp 0x17b2e2
movl -0x90(%rbp), %eax
movl %eax, -0xdc(%rbp)
movl -0xd8(%rbp), %eax
movl -0xdc(%rbp), %ecx
subl %ecx, %eax
addl $0x1, %eax
movl %eax, -0xe0(%rbp)
jmp 0x17b305
xorl %eax, %eax
movl %eax, -0xe0(%rbp)
jmp 0x17b305
movl -0xe0(%rbp), %eax
movl %eax, -0x98(%rbp)
movl -0xa0(%rbp), %eax
addl -0x9c(%rbp), %eax
cmpl $0x0, %eax
jbe 0x17b330
cmpl $0x0, -0x98(%rbp)
jne 0x17b330
jmp 0x17b3cd
cmpl $0x0, -0x98(%rbp)
jne 0x17b33e
jmp 0x17b3bf
movq -0xa8(%rbp), %rax
movl -0x78(%rbp), %ecx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x14(%rax)
jne 0x17b369
movl -0x98(%rbp), %eax
addl -0xa0(%rbp), %eax
movl %eax, -0xa0(%rbp)
jmp 0x17b3bd
leaq 0x249488(%rip), %rax    # 0x3c47f8
cmpl $0x2, 0x1bc(%rax)
jg 0x17b3a9
movq -0xa8(%rbp), %rax
movl -0x78(%rbp), %ecx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x17b3a9
movl -0x98(%rbp), %eax
addl -0xa0(%rbp), %eax
movl %eax, -0xa0(%rbp)
jmp 0x17b3bb
movl -0x98(%rbp), %eax
addl -0x9c(%rbp), %eax
movl %eax, -0x9c(%rbp)
jmp 0x17b3bd
jmp 0x17b3bf
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x17b1d8
movl -0x9c(%rbp), %eax
movl %eax, %ecx
movl %ecx, %eax
cvtsi2sd %rcx, %xmm1
movl -0xa0(%rbp), %ecx
addl %ecx, %eax
cvtsi2sd %rax, %xmm0
mulsd -0x38(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x17b419
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x50(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movb $0x2, 0x2(%rax)
jmp 0x17b41b
jmp 0x17b41b
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x17ae3b
jmp 0x17b42b
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x17ae1e
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jae 0x17b531
movl -0x4c(%rbp), %eax
movl %eax, -0x54(%rbp)
movl $0x0, -0x78(%rbp)
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
movl -0x54(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jae 0x17b50a
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x50(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movzbl 0x2(%rax), %eax
cmpl $0x2, %eax
jne 0x17b4ab
jmp 0x17b4fc
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rsi
movl -0x50(%rbp), %eax
shlq $0x6, %rax
addq %rax, %rsi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movl -0x78(%rbp), %eax
shlq $0x6, %rax
addq %rax, %rdi
movl $0x40, %edx
callq 0x2180
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x17b464
movl -0x78(%rbp), %eax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x54(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x17b440
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jae 0x17ba39
movl -0x4c(%rbp), %eax
movl %eax, -0x54(%rbp)
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
movl -0x54(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jae 0x17ba29
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x50(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x24(%rax), %eax
movl %eax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x50(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x28(%rax), %eax
movl %eax, -0x5c(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x50(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl -0x5c(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl -0x5c(%rbp), %esi
movl -0x58(%rbp), %edx
callq 0x17a150
movl %eax, -0x74(%rbp)
cmpl $-0x1, -0x74(%rbp)
je 0x17b8eb
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movslq -0x74(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
movq -0x48(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x17b65b
movq -0x40(%rbp), %rax
movzbl 0x1(%rax), %eax
movl -0x70(%rbp,%rax,4), %eax
movq -0x48(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
cmpl %ecx, %eax
jne 0x17b65b
jmp 0x17ba1b
movq -0x40(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x48(%rbp), %rcx
cmpq 0x30(%rcx), %rax
jl 0x17b7ae
jmp 0x17b673
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movl -0x5c(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jne 0x17b750
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
je 0x17b6db
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xe8(%rbp)
jmp 0x17b6e9
movl $0x2, %eax
movq %rax, -0xe8(%rbp)
jmp 0x17b6e9
movq -0xe8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x5c(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
shlq $0x6, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x5c(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x48(%rbp), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl -0x5c(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq (%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, (%rcx)
shlq $0x6, %rax
addq %rax, %rdi
movl $0x40, %edx
callq 0x2180
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x17a1d0
jmp 0x17b8e6
jmp 0x17b7b0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movl -0x58(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jne 0x17b88d
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
je 0x17b818
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xf0(%rbp)
jmp 0x17b826
movl $0x2, %eax
movq %rax, -0xf0(%rbp)
jmp 0x17b826
movq -0xf0(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x58(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
shlq $0x6, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x58(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x40(%rbp), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl -0x58(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq (%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, (%rcx)
shlq $0x6, %rax
addq %rax, %rdi
movl $0x40, %edx
callq 0x2180
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x17a1d0
jmp 0x17ba19
jmp 0x17b8ed
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
movl -0x5c(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jne 0x17b9ca
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
je 0x17b955
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xf8(%rbp)
jmp 0x17b963
movl $0x2, %eax
movq %rax, -0xf8(%rbp)
jmp 0x17b963
movq -0xf8(%rbp), %rcx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x5c(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
shlq $0x6, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x5c(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rdx
movl -0x5c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x17a1d0
jmp 0x17ba1b
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x17b555
jmp 0x17ba2b
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x17b538
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopw %cs:(%rax,%rax)