// File: chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: get_node_boundary_advance(R_to_U*, ma_hit_t_alloc*, ma_sub_t*, asg_t*, unsigned long*, int, int, ma_utg_t*, ma_utg_t*, unsigned int, unsigned int, long long, long long, long long, long long, unsigned int, unsigned int, kvec_asg_arc_t_offset*, kvec_t_i32_warp*, kvec_t_i32_warp*, asg_arc_t*, asg_arc_t*)
void get_node_boundary_advance(R_to_U* ruIndex, ma_hit_t_alloc* reverse_sources, ma_sub_t *coverage_cut, 
asg_t *read_g, uint64_t* position_index, int max_hang, int min_ovlp, ma_utg_t *xReads, ma_utg_t *yReads,
uint32_t xUid, uint32_t yUid, long long xBegIndex, long long xEndIndex, long long yBegIndex, 
long long yEndIndex, uint32_t dir, uint32_t rev, kvec_asg_arc_t_offset* u_buffer, 
kvec_t_i32_warp* tailIndex, kvec_t_i32_warp* prevIndex, asg_arc_t* reture_t_f, asg_arc_t* reture_t_r)
{
    long long k, j, offset, m;
    ma_hit_t_alloc *xR = NULL;
    ma_hit_t *h = NULL;
    ma_sub_t *sq = NULL, *st = NULL;
    int r, index;
    asg_arc_t t_f, t_r;
    uint32_t rId, Hap_uId, is_Unitig, v, w, v_dir, w_dir;
    uint64_t tmp;
    asg_arc_t_offset t_offset;
    reture_t_f->del = reture_t_r->del = 1;
    u_buffer->a.n = 0;


    for (k = xBegIndex; k <= xEndIndex; k++)
    {
        xR = &(reverse_sources[xReads->a[k]>>33]);
        for (j = 0; j < xR->length; j++)
        {
            h = &(xR->buffer[j]);
            sq = &(coverage_cut[Get_qn(*h)]);
            st = &(coverage_cut[Get_tn(*h)]);
            if(st->del || read_g->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_f);
            ///if it is a contained overlap, skip
            if(r < 0) continue;

            rId = t_f.v>>1;
            if(read_g->seq[rId].del == 1) continue;
            ///there are two cases: 
            ///1. read at primary contigs, get_R_to_U() return its corresponding contig Id  
            ///2. read at alternative contigs, get_R_to_U() return (uint32_t)-1
            get_R_to_U(ruIndex, rId, &Hap_uId, &is_Unitig);
            if(is_Unitig == 0 || Hap_uId == (uint32_t)-1) continue;
            if(Hap_uId != yUid) continue;

            v = xReads->a[k]>>32;
            get_R_to_U(ruIndex, v>>1, &Hap_uId, &is_Unitig);
            if(is_Unitig == 0 || Hap_uId == (uint32_t)-1) continue;
            if(Hap_uId != xUid) continue;
            if((uint32_t)(position_index[v>>1]) != k) continue;

            w = (yReads->a[(uint32_t)(position_index[rId])])>>32;

            v_dir = ((t_f.ul>>32)==v)?1:0;
            w_dir = (t_f.v == w)?1:0;
            if(rev == 0 && v_dir != w_dir) continue;
            if(rev == 1 && v_dir == w_dir) continue;
            if(dir == v_dir) continue;

            /****************************may have bugs********************************/
            offset = (uint32_t)(position_index[rId]);
            if(offset < yBegIndex || offset > yEndIndex) continue;
            /****************************may have bugs********************************/
        
            /************************get reverse edge*************************/
            index = get_specific_overlap(&(reverse_sources[Get_tn(*h)]), Get_tn(*h), Get_qn(*h));
            if(index == -1) continue;
            h = &(reverse_sources[Get_tn(*h)].buffer[index]);
            sq = &(coverage_cut[Get_qn(*h)]);
            st = &(coverage_cut[Get_tn(*h)]);
            if(st->del || read_g->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_r);
            if(r < 0) continue;
            /************************get reverse edge*************************/

            tmp = get_xy_pos(read_g, &t_f, v, w, xReads->len, yReads->len, position_index, &(t_f.el));
            if(((tmp>>32) == (uint32_t)-1) || (((uint32_t)tmp) == (uint32_t)-1)) continue;

            t_offset.Off = tmp;
            t_offset.x = t_f;
            t_offset.weight = 1;
            kv_push(asg_arc_t_offset, u_buffer->a, t_offset);

        }
    }

    if(u_buffer->a.n == 0) return;

    qsort(u_buffer->a.a, u_buffer->a.n, sizeof(asg_arc_t_offset), cmp_hap_alignment_chaining);

    for (k = 1, m = 1; k < (long long)u_buffer->a.n; k++)
    {
        if(u_buffer->a.a[m-1].Off == u_buffer->a.a[k].Off)
        {
            u_buffer->a.a[m-1].weight += u_buffer->a.a[k].weight;
            if(u_buffer->a.a[k].x.ol > u_buffer->a.a[m-1].x.ol)
            {
                u_buffer->a.a[m-1].x = u_buffer->a.a[k].x;
            }
            continue;
        }
        u_buffer->a.a[m] = u_buffer->a.a[k];
        m++;
    }
    u_buffer->a.n = m;

    quick_LIS(u_buffer->a.a, u_buffer->a.n, tailIndex, prevIndex);

    if(tailIndex->a.n == 0) return;

    if(dir == 0)
    {
        for (k = 0; k < (long long)tailIndex->a.n; k++)
        {
            v = u_buffer->a.a[tailIndex->a.a[k]].x.v>>1;
            w = u_buffer->a.a[tailIndex->a.a[k]].x.ul>>33;
            index = get_specific_overlap(&(reverse_sources[v]), v, w);
            if(index == -1) continue;
            h = &(reverse_sources[v].buffer[index]);
            sq = &(coverage_cut[Get_qn(*h)]);
            st = &(coverage_cut[Get_tn(*h)]);
            if(st->del || read_g->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_r);
            if(r < 0) continue;

            (*reture_t_f) = u_buffer->a.a[tailIndex->a.a[k]].x;
            (*reture_t_r) = t_r;
            return;
        }
    }
    else
    {
        for (k = tailIndex->a.n-1; k >= 0; k--)
        {
            v = u_buffer->a.a[tailIndex->a.a[k]].x.v>>1;
            w = u_buffer->a.a[tailIndex->a.a[k]].x.ul>>33;
            index = get_specific_overlap(&(reverse_sources[v]), v, w);
            if(index == -1) continue;
            h = &(reverse_sources[v].buffer[index]);
            sq = &(coverage_cut[Get_qn(*h)]);
            st = &(coverage_cut[Get_tn(*h)]);
            if(st->del || read_g->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_r);
            if(r < 0) continue;

            (*reture_t_f) = u_buffer->a.a[tailIndex->a.a[k]].x;
            (*reture_t_r) = t_r;
            return;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq 0x88(%rbp), %rax
movq 0x80(%rbp), %rax
movq 0x78(%rbp), %rax
movq 0x70(%rbp), %rax
movq 0x68(%rbp), %rax
movl 0x60(%rbp), %eax
movl 0x58(%rbp), %eax
movq 0x50(%rbp), %rax
movq 0x48(%rbp), %rax
movq 0x40(%rbp), %rax
movq 0x38(%rbp), %rax
movl 0x30(%rbp), %eax
movl 0x28(%rbp), %eax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
movq 0x88(%rbp), %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xc(%rax)
movq 0x80(%rbp), %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xc(%rax)
movq 0x68(%rbp), %rax
movq $0x0, (%rax)
movq 0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq 0x40(%rbp), %rax
jg 0x17e066
movq -0x10(%rbp), %rax
movq 0x18(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x38(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x58(%rbp), %rcx
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
jge 0x17e053
movq -0x58(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movq -0x60(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
movl %ecx, %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq -0x60(%rbp), %rcx
movl 0xc(%rcx), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x17dba3
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x60(%rbp), %rcx
movl 0xc(%rcx), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x17dba8
jmp 0x17e042
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rax
movl 0x4(%rax), %esi
movq -0x68(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %esi
movq -0x70(%rbp), %rax
movl 0x4(%rax), %edx
movq -0x70(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %edx
movl -0x2c(%rbp), %ecx
leaq 0x246c1a(%rip), %rax    # 0x3c47f8
movss 0x158(%rax), %xmm0
movl 0x10(%rbp), %r8d
leaq -0x90(%rbp), %r9
callq 0x172eb0
movl %eax, -0x74(%rbp)
cmpl $0x0, -0x74(%rbp)
jge 0x17dc04
jmp 0x17e042
movl -0x88(%rbp), %eax
shrl %eax
movl %eax, -0xac(%rbp)
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movl -0xac(%rbp), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x1, %eax
jne 0x17dc30
jmp 0x17e042
movq -0x8(%rbp), %rdi
movl -0xac(%rbp), %esi
leaq -0xb0(%rbp), %rdx
leaq -0xb4(%rbp), %rcx
callq 0xd3d50
cmpl $0x0, -0xb4(%rbp)
je 0x17dc5f
cmpl $-0x1, -0xb0(%rbp)
jne 0x17dc64
jmp 0x17e042
movl -0xb0(%rbp), %eax
cmpl 0x30(%rbp), %eax
je 0x17dc74
jmp 0x17e042
movq 0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0xb8(%rbp)
movq -0x8(%rbp), %rdi
movl -0xb8(%rbp), %esi
shrl %esi
leaq -0xb0(%rbp), %rdx
leaq -0xb4(%rbp), %rcx
callq 0xd3d50
cmpl $0x0, -0xb4(%rbp)
je 0x17dcbf
cmpl $-0x1, -0xb0(%rbp)
jne 0x17dcc4
jmp 0x17e042
movl -0xb0(%rbp), %eax
cmpl 0x28(%rbp), %eax
je 0x17dcd4
jmp 0x17e042
movq -0x28(%rbp), %rax
movl -0xb8(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
cmpq -0x38(%rbp), %rax
je 0x17dcf3
jmp 0x17e042
movq 0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x28(%rbp), %rcx
movl -0xac(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0xbc(%rbp)
movq -0x90(%rbp), %rdx
shrq $0x20, %rdx
movl -0xb8(%rbp), %eax
movl %eax, %esi
xorl %eax, %eax
movl $0x1, %ecx
cmpq %rsi, %rdx
cmovel %ecx, %eax
movl %eax, -0xc0(%rbp)
movl -0x88(%rbp), %edx
movl -0xbc(%rbp), %esi
xorl %eax, %eax
movl $0x1, %ecx
cmpl %esi, %edx
cmovel %ecx, %eax
movl %eax, -0xc4(%rbp)
cmpl $0x0, 0x60(%rbp)
jne 0x17dd76
movl -0xc0(%rbp), %eax
cmpl -0xc4(%rbp), %eax
je 0x17dd76
jmp 0x17e042
cmpl $0x1, 0x60(%rbp)
jne 0x17dd8f
movl -0xc0(%rbp), %eax
cmpl -0xc4(%rbp), %eax
jne 0x17dd8f
jmp 0x17e042
movl 0x58(%rbp), %eax
cmpl -0xc0(%rbp), %eax
jne 0x17dd9f
jmp 0x17e042
movq -0x28(%rbp), %rax
movl -0xac(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq 0x48(%rbp), %rax
jl 0x17ddc7
movq -0x48(%rbp), %rax
cmpq 0x50(%rbp), %rax
jle 0x17ddcc
jmp 0x17e042
movq -0x10(%rbp), %rdi
movq -0x60(%rbp), %rax
movl 0xc(%rax), %eax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movq -0x60(%rbp), %rax
movl 0xc(%rax), %esi
movq -0x60(%rbp), %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, %edx
callq 0xce1b0
movl %eax, -0x78(%rbp)
cmpl $-0x1, -0x78(%rbp)
jne 0x17de05
jmp 0x17e042
movq -0x10(%rbp), %rax
movq -0x60(%rbp), %rcx
movl 0xc(%rcx), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0x78(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movq -0x60(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
movl %ecx, %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq -0x60(%rbp), %rcx
movl 0xc(%rcx), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x17de83
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x60(%rbp), %rcx
movl 0xc(%rcx), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x17de88
jmp 0x17e042
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rax
movl 0x4(%rax), %esi
movq -0x68(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %esi
movq -0x70(%rbp), %rax
movl 0x4(%rax), %edx
movq -0x70(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %edx
movl -0x2c(%rbp), %ecx
leaq 0x24693a(%rip), %rax    # 0x3c47f8
movss 0x158(%rax), %xmm0
movl 0x10(%rbp), %r8d
leaq -0xa8(%rbp), %r9
callq 0x172eb0
movl %eax, -0x74(%rbp)
cmpl $0x0, -0x74(%rbp)
jge 0x17dee4
jmp 0x17e042
movq -0x20(%rbp), %rdi
movl -0xb8(%rbp), %edx
movl -0xbc(%rbp), %ecx
movq 0x18(%rbp), %rax
movl (%rax), %r8d
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq 0x20(%rbp), %rax
movl (%rax), %r9d
andl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
movq -0x28(%rbp), %r10
leaq -0x90(%rbp), %rax
addq $0x12, %rax
leaq -0x90(%rbp), %rsi
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x1859f0
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
shrq $0x20, %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
je 0x17df5c
movq -0xd0(%rbp), %rax
cmpl $-0x1, %eax
jne 0x17df61
jmp 0x17e042
movq -0xd0(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq $0x1, -0xd8(%rbp)
movq 0x68(%rbp), %rax
movq (%rax), %rax
movq 0x68(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x17e00f
movq 0x68(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x17dfd1
movq 0x68(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x100(%rbp)
jmp 0x17dfdf
movl $0x2, %eax
movq %rax, -0x100(%rbp)
jmp 0x17dfdf
movq -0x100(%rbp), %rcx
movq 0x68(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x68(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x68(%rbp), %rax
imulq $0x28, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x68(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x68(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x68(%rbp), %rcx
movq (%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, (%rcx)
imulq $0x28, %rax, %rax
addq %rax, %rdi
leaq -0xf8(%rbp), %rsi
movl $0x28, %edx
callq 0x2180
jmp 0x17e042
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x17db22
jmp 0x17e055
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x17dae9
movq 0x68(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x17e075
jmp 0x17e60d
movq 0x68(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x68(%rbp), %rax
movq (%rax), %rsi
movl $0x28, %edx
leaq -0xd9f0(%rip), %rcx     # 0x1706a0
callq 0x23e0
movq $0x1, -0x38(%rbp)
movq $0x1, -0x50(%rbp)
movq -0x38(%rbp), %rax
movq 0x68(%rbp), %rcx
cmpq (%rcx), %rax
jge 0x17e1e0
movq 0x68(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rcx
subq $0x1, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq 0x68(%rbp), %rcx
movq 0x10(%rcx), %rcx
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rcx
cmpq 0x18(%rcx), %rax
jne 0x17e199
movq 0x68(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movq 0x20(%rax), %rcx
movq 0x68(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rdx
subq $0x1, %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
addq 0x20(%rax), %rcx
movq %rcx, 0x20(%rax)
movq 0x68(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq 0x68(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x50(%rbp), %rdx
subq $0x1, %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
movl 0xc(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jle 0x17e197
movq 0x68(%rbp), %rax
movq 0x10(%rax), %rcx
imulq $0x28, -0x38(%rbp), %rax
addq %rax, %rcx
movq 0x68(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rdx
subq $0x1, %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
jmp 0x17e1cf
movq 0x68(%rbp), %rax
movq 0x10(%rax), %rsi
imulq $0x28, -0x38(%rbp), %rax
addq %rax, %rsi
movq 0x68(%rbp), %rax
movq 0x10(%rax), %rdi
imulq $0x28, -0x50(%rbp), %rax
addq %rax, %rdi
movl $0x28, %edx
callq 0x2180
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x17e0a5
movq -0x50(%rbp), %rcx
movq 0x68(%rbp), %rax
movq %rcx, (%rax)
movq 0x68(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x68(%rbp), %rax
movq (%rax), %rax
movl %eax, %esi
movq 0x70(%rbp), %rdx
movq 0x78(%rbp), %rcx
callq 0x1732b0
movq 0x70(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x17e218
jmp 0x17e60d
cmpl $0x0, 0x58(%rbp)
jne 0x17e41a
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq 0x70(%rbp), %rcx
cmpq (%rcx), %rax
jge 0x17e415
movq 0x68(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x70(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x38(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
shrl %eax
movl %eax, -0xb8(%rbp)
movq 0x68(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x70(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x38(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x21, %rax
movl %eax, -0xbc(%rbp)
movq -0x10(%rbp), %rdi
movl -0xb8(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl -0xb8(%rbp), %esi
movl -0xbc(%rbp), %edx
callq 0xce1b0
movl %eax, -0x78(%rbp)
cmpl $-0x1, -0x78(%rbp)
jne 0x17e2c1
jmp 0x17e404
movq -0x10(%rbp), %rax
movl -0xb8(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0x78(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movq -0x60(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
movl %ecx, %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq -0x60(%rbp), %rcx
movl 0xc(%rcx), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x17e33e
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x60(%rbp), %rcx
movl 0xc(%rcx), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x17e343
jmp 0x17e404
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rax
movl 0x4(%rax), %esi
movq -0x68(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %esi
movq -0x70(%rbp), %rax
movl 0x4(%rax), %edx
movq -0x70(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %edx
movl -0x2c(%rbp), %ecx
leaq 0x24647f(%rip), %rax    # 0x3c47f8
movss 0x158(%rax), %xmm0
movl 0x10(%rbp), %r8d
leaq -0xa8(%rbp), %r9
callq 0x172eb0
movl %eax, -0x74(%rbp)
cmpl $0x0, -0x74(%rbp)
jge 0x17e39c
jmp 0x17e404
movq 0x68(%rbp), %rax
movq 0x10(%rax), %rcx
movq 0x70(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rdx
movslq (%rax,%rdx,4), %rax
imulq $0x28, %rax, %rax
addq %rax, %rcx
movq 0x80(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
movq 0x88(%rbp), %rax
movq -0xa8(%rbp), %rcx
movq %rcx, (%rax)
movq -0xa0(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x98(%rbp), %rcx
movq %rcx, 0x10(%rax)
jmp 0x17e60d
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x17e22a
jmp 0x17e60d
movq 0x70(%rbp), %rax
movq (%rax), %rax
subq $0x1, %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jl 0x17e60b
movq 0x68(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x70(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x38(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
shrl %eax
movl %eax, -0xb8(%rbp)
movq 0x68(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x70(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x38(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x21, %rax
movl %eax, -0xbc(%rbp)
movq -0x10(%rbp), %rdi
movl -0xb8(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl -0xb8(%rbp), %esi
movl -0xbc(%rbp), %edx
callq 0xce1b0
movl %eax, -0x78(%rbp)
cmpl $-0x1, -0x78(%rbp)
jne 0x17e4ba
jmp 0x17e5fa
movq -0x10(%rbp), %rax
movl -0xb8(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0x78(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movq -0x60(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
movl %ecx, %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq -0x60(%rbp), %rcx
movl 0xc(%rcx), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x17e537
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x60(%rbp), %rcx
movl 0xc(%rcx), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x17e53c
jmp 0x17e5fa
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rax
movl 0x4(%rax), %esi
movq -0x68(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %esi
movq -0x70(%rbp), %rax
movl 0x4(%rax), %edx
movq -0x70(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %edx
movl -0x2c(%rbp), %ecx
leaq 0x246286(%rip), %rax    # 0x3c47f8
movss 0x158(%rax), %xmm0
movl 0x10(%rbp), %r8d
leaq -0xa8(%rbp), %r9
callq 0x172eb0
movl %eax, -0x74(%rbp)
cmpl $0x0, -0x74(%rbp)
jge 0x17e595
jmp 0x17e5fa
movq 0x68(%rbp), %rax
movq 0x10(%rax), %rcx
movq 0x70(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rdx
movslq (%rax,%rdx,4), %rax
imulq $0x28, %rax, %rax
addq %rax, %rcx
movq 0x80(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
movq 0x88(%rbp), %rax
movq -0xa8(%rbp), %rcx
movq %rcx, (%rax)
movq -0xa0(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x98(%rbp), %rcx
movq %rcx, 0x10(%rax)
jmp 0x17e60d
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x17e429
jmp 0x17e60d
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw %cs:(%rax,%rax)