// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %rbp
movq %rsi, 0x60(%rsp)
movq %rdi, 0x90(%rsp)
movq 0x148(%rsp), %rax
movq 0x140(%rsp), %rdx
orb $-0x80, 0xf(%rax)
movq 0x128(%rsp), %rax
orb $-0x80, 0xf(%rdx)
movq 0xf8(%rsp), %rdx
movq $0x0, (%rax)
cmpq 0x100(%rsp), %rdx
jg 0x113fd0
movq %r8, 0x50(%rsp)
movq 0x130(%rsp), %rax
movq %rax, 0x78(%rsp)
movl %eax, 0x3c(%rsp)
movl %r9d, 0x4(%rsp)
movq %rcx, 0x10(%rsp)
movq %rbp, 0x8(%rsp)
movq 0xd8(%rsp), %rax
movq 0x18(%rax), %rax
movq %rdx, 0x80(%rsp)
movq (%rax,%rdx,8), %rax
shrq $0x21, %rax
leaq (%rax,%rax,2), %rax
movq 0x60(%rsp), %rdx
cmpl $0x0, 0xc(%rdx,%rax,8)
je 0x1139c2
leaq (%rdx,%rax,8), %r14
xorl %r13d, %r13d
xorl %ebx, %ebx
movq %r14, 0x18(%rsp)
movq (%r14), %r15
movl 0xc(%r15,%r13), %r12d
leaq (%r12,%r12,2), %rdx
movl (%rbp,%rdx,4), %eax
testl %eax, %eax
js 0x11334a
movq 0x20(%rcx), %rsi
cmpl $0x0, (%rsi,%r12,8)
js 0x11334a
movq %rsi, 0x48(%rsp)
leaq (,%rdx,4), %rdx
addq %rbp, %rdx
movl 0x4(%rdx), %edx
subl %eax, %edx
movq 0x18(%r15,%r13), %rax
movq %rax, 0x58(%rsp)
testl %eax, %eax
js 0x11327b
movl 0x10(%r15,%r13), %eax
movl 0x14(%r15,%r13), %edi
subl %edi, %edx
movl %edx, %esi
movl %eax, %edx
jmp 0x113289
movl 0x10(%r15,%r13), %eax
movl 0x14(%r15,%r13), %edi
subl %edi, %edx
movl %eax, %esi
movq (%r15,%r13), %r11
movq %r11, %r8
shrq $0x20, %r8
leaq (%r8,%r8,2), %r8
leaq (,%r8,4), %r8
addq %rbp, %r8
movl 0x4(%r8), %r14d
movl (%r8), %r8d
movl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
andl %r10d, %r8d
subl %r8d, %r14d
cmpl %r11d, %edx
movq %r11, 0x20(%rsp)
movl %r11d, %ebp
cmovll %edx, %ebp
movl 0x8(%r15,%r13), %r8d
movq %r14, 0x30(%rsp)
subl %r8d, %r14d
cmpl %esi, %r14d
movl %esi, %r10d
cmovll %r14d, %r10d
cmpl %r9d, %ebp
jg 0x113340
cmpl %r9d, %r10d
jg 0x113340
movl %r8d, %r11d
subl 0x20(%rsp), %r11d
cvtsi2ss %r11, %xmm1
addl %ebp, %r11d
addl %r10d, %r11d
cvtsi2ss %r11, %xmm2
leaq 0x182454(%rip), %rcx    # 0x295758
movss 0x158(%rcx), %xmm0
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
ja 0x113336
subl %eax, %edi
xorps %xmm1, %xmm1
cvtsi2ss %rdi, %xmm1
addl %ebp, %r10d
addl %edi, %r10d
xorps %xmm2, %xmm2
cvtsi2ss %r10, %xmm2
mulss %xmm2, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x113363
movl 0x4(%rsp), %r9d
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rbp
movq 0x18(%rsp), %r14
incq %rbx
movl 0xc(%r14), %eax
addq $0x28, %r13
cmpq %rax, %rbx
jb 0x11321f
jmp 0x1139c2
cmpl %esi, %r14d
setl %dil
setg %bpl
cmpl %edx, 0x20(%rsp)
setg %r14b
setl %al
orb %bpl, %r14b
cmpb $0x1, %r14b
jne 0x113336
orb %dil, %al
movq 0x8(%rsp), %rbp
movq 0x18(%rsp), %r14
je 0x1137fa
movl 0xd0(%rsp), %eax
cmpl %eax, %r11d
jl 0x1137fa
cmpl %eax, %r10d
movl 0x4(%rsp), %r9d
movq 0x10(%rsp), %rcx
jl 0x11334a
movq 0x58(%rsp), %r10
testl %r10d, %r10d
setns 0x2c(%rsp)
addl %r8d, %esi
movq 0x30(%rsp), %rax
movl %eax, %edi
subl %esi, %edi
movq 0x20(%rsp), %rax
movl %eax, %r11d
subl %edx, %r11d
setle %r8b
setg 0x28(%rsp)
cmovlel %edi, %r11d
shrl $0x10, %r10d
andl $0x4000, %r10d          # imm = 0x4000
movl 0x3c(%rsp), %edx
andl $0x3fff, %edx           # imm = 0x3FFF
orl %r10d, %edx
movzbl 0x21(%r15,%r13), %eax
shll $0xf, %eax
orl %edx, %eax
movl %eax, 0x3c(%rsp)
testl %r11d, %r11d
js 0x11334a
movl %r12d, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq 0x48(%rsp), %rax
cmpl $0x0, (%rax,%rsi,8)
js 0x11334a
movb %r8b, 0x58(%rsp)
movq %r11, 0x88(%rsp)
movq 0x90(%rsp), %rdi
movq %rsi, 0x48(%rsp)
leaq 0x44(%rsp), %rdx
leaq 0x40(%rsp), %rcx
callq 0xa3c62
cmpl $0x0, 0x40(%rsp)
je 0x1137fa
movl 0x44(%rsp), %eax
cmpl $-0x1, %eax
movl 0x4(%rsp), %r9d
movq 0x10(%rsp), %rcx
je 0x11334a
cmpl 0xf0(%rsp), %eax
jne 0x11334a
movq 0xd8(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x80(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
movq %rsi, 0x68(%rsp)
shrq $0x21, %rsi
movq 0x90(%rsp), %rdi
movq %rsi, 0x70(%rsp)
leaq 0x44(%rsp), %rdx
leaq 0x40(%rsp), %rcx
callq 0xa3c62
cmpl $0x0, 0x40(%rsp)
je 0x1137fa
movl 0x44(%rsp), %eax
cmpl $-0x1, %eax
movl 0x4(%rsp), %r9d
movq 0x10(%rsp), %rcx
je 0x11334a
cmpl 0xe8(%rsp), %eax
jne 0x11334a
movq 0x50(%rsp), %rsi
movq 0x70(%rsp), %rax
movl (%rsi,%rax,8), %eax
cmpq 0x80(%rsp), %rax
jne 0x11334a
movb 0x2c(%rsp), %al
xorb 0x28(%rsp), %al
movzbl %al, %eax
xorl %edx, %edx
movb 0x58(%rsp), %dil
movb %dil, %dl
movq 0x20(%rsp), %rdi
shrq $0x1f, %rdi
andl $-0x2, %edi
orq %rdx, %rdi
leal (%rax,%r12,2), %r12d
movq 0x68(%rsp), %r11
shrq $0x20, %r11
movq 0xe0(%rsp), %rax
movq 0x18(%rax), %rdx
movq 0x48(%rsp), %rax
movl (%rsi,%rax,8), %eax
movq (%rdx,%rax,8), %r10
movq %r10, %rsi
shrq $0x20, %rsi
movq %rdi, 0x20(%rsp)
cmpl %r11d, %edi
sete %dl
cmpl %esi, %r12d
sete %r8b
xorb %dl, %r8b
cmpl $0x0, 0x120(%rsp)
jne 0x113584
testb %r8b, %r8b
jne 0x11334a
movq %rsi, 0x58(%rsp)
xorl %edx, %edx
cmpl %r11d, 0x20(%rsp)
sete %sil
cmpl $0x1, 0x120(%rsp)
setne %dil
orb %r8b, %dil
testb $0x1, %dil
je 0x11334a
movb %sil, %dl
cmpl 0x118(%rsp), %edx
je 0x11334a
cmpq 0x108(%rsp), %rax
setl %dl
cmpq 0x110(%rsp), %rax
setg %al
orb %dl, %al
jne 0x11334a
movq %r11, 0x68(%rsp)
movq %r10, 0x48(%rsp)
movl 0x4(%r15,%r13), %edx
movl 0xc(%r15,%r13), %esi
leaq (%rsi,%rsi,2), %rax
movq 0x60(%rsp), %r14
leaq (%r14,%rax,8), %rdi
callq 0xa0c99
cmpl $-0x1, %eax
jne 0x113615
movl 0x4(%rsp), %r9d
movq 0x10(%rsp), %rcx
jmp 0x113345
movl 0xc(%r15,%r13), %ecx
leaq (%rcx,%rcx,2), %rcx
movq (%r14,%rcx,8), %rsi
cltq
leaq (%rax,%rax,4), %rdi
movl 0xc(%rsi,%rdi,8), %r8d
leaq (%r8,%r8,2), %r11
movl (%rbp,%r11,4), %edx
testl %edx, %edx
movl 0x4(%rsp), %r9d
movq 0x10(%rsp), %rcx
js 0x113345
movq 0x20(%rcx), %rax
cmpl $0x0, (%rax,%r8,8)
movq 0x18(%rsp), %r14
js 0x11334a
leaq (%rsi,%rdi,8), %r10
leaq (,%r11,4), %rcx
addq %rbp, %rcx
movl 0x4(%rcx), %ecx
subl %edx, %ecx
testb $-0x80, 0x1b(%r10)
jne 0x113689
movl 0x10(%r10), %r9d
movl 0x14(%r10), %r8d
subl %r8d, %ecx
movl %ecx, %edx
movl %r9d, %ecx
jmp 0x113697
movl 0x10(%r10), %r9d
movl 0x14(%r10), %r8d
subl %r8d, %ecx
movl %r9d, %edx
movq (%rsi,%rdi,8), %rsi
movq %rsi, %rdi
shrq $0x20, %rdi
leaq (%rdi,%rdi,2), %rdi
leaq (,%rdi,4), %r11
addq %rbp, %r11
movl 0x4(%r11), %edi
movl (%r11), %r11d
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
andl %ebp, %r11d
subl %r11d, %edi
cmpl %esi, %ecx
movl %esi, %ebp
cmovll %ecx, %ebp
movl 0x8(%r10), %r10d
movl %edi, %r14d
subl %r10d, %r14d
cmpl %edx, %r14d
movl %edx, %r11d
cmovll %r14d, %r11d
movl 0x4(%rsp), %r15d
cmpl %r15d, %ebp
jg 0x113809
cmpl %r15d, %r11d
jg 0x113336
movl %r12d, 0x2c(%rsp)
movl %r10d, %r15d
subl %esi, %r15d
cvtsi2ss %r15, %xmm1
addl %ebp, %r15d
addl %r11d, %r15d
cvtsi2ss %r15, %xmm2
leaq 0x182041(%rip), %r12    # 0x295758
movss 0x158(%r12), %xmm0
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
ja 0x113336
subl %r9d, %r8d
xorps %xmm1, %xmm1
cvtsi2ss %r8, %xmm1
addl %ebp, %r11d
addl %r8d, %r11d
xorps %xmm2, %xmm2
cvtsi2ss %r11, %xmm2
mulss %xmm2, %xmm0
ucomiss %xmm1, %xmm0
ja 0x113336
cmpl %edx, %r14d
setl %r8b
setg %bpl
cmpl %ecx, %esi
setg %r14b
setl %r9b
orb %bpl, %r14b
cmpb $0x1, %r14b
jne 0x113336
orb %r8b, %r9b
movq 0x8(%rsp), %rbp
movq 0x18(%rsp), %r14
je 0x1137fa
movl 0xd0(%rsp), %r8d
cmpl %r8d, %r15d
jl 0x1137fa
cmpl %r8d, %r11d
jl 0x1137fa
addl %r10d, %edx
subl %edx, %edi
subl %ecx, %esi
cmovlel %edi, %esi
testl %esi, %esi
js 0x1137fa
movq 0xd8(%rsp), %rcx
movl (%rcx), %r14d
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl %edx, %r14d
movq 0xe0(%rsp), %rcx
movl (%rcx), %r15d
andl %edx, %r15d
movq 0x68(%rsp), %rcx
cmpl %ecx, 0x20(%rsp)
jne 0x113811
movq 0x50(%rsp), %rcx
movq 0x70(%rsp), %rdx
movl 0x4(%rcx,%rdx,8), %ecx
movl (%rax,%rdx,8), %eax
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl %edx, %eax
leal (%rcx,%rax), %r12d
decl %r12d
movl $0x0, 0x28(%rsp)
jmp 0x113833
movl 0x4(%rsp), %r9d
movq 0x10(%rsp), %rcx
jmp 0x11334a
movl %r15d, %r9d
jmp 0x11333b
xorl 0x20(%rsp), %ecx
cmpl $0x1, %ecx
jne 0x1139a3
movq 0x50(%rsp), %rax
movq 0x70(%rsp), %rcx
movl 0x4(%rax,%rcx,8), %r12d
movb $0x1, %al
movl %eax, 0x28(%rsp)
movq 0x30(%rsp), %rbp
subl 0x88(%rsp), %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movl 0x2c(%rsp), %eax
movq 0x58(%rsp), %rcx
cmpl %ecx, %eax
jne 0x11386c
movq 0x48(%rsp), %rcx
shrq $0x21, %rcx
movq 0x50(%rsp), %rax
movl 0x4(%rax,%rcx,8), %eax
addl %ebp, %eax
decl %eax
xorl %ecx, %ecx
jmp 0x1138a2
xorl %eax, %ecx
cmpl $0x1, %ecx
jne 0x1139b3
movq 0x48(%rsp), %rdx
shrq $0x21, %rdx
movq 0x50(%rsp), %rax
movl 0x4(%rax,%rdx,8), %eax
movq 0x10(%rsp), %rcx
movq 0x20(%rcx), %rcx
movl (%rcx,%rdx,8), %ecx
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl %edx, %ecx
subl %ebp, %eax
addl %ecx, %eax
movb $0x1, %cl
movl %ecx, 0x30(%rsp)
cmpb %cl, 0x28(%rsp)
jne 0x1138b3
movl %eax, %ecx
movl %r15d, %edx
jmp 0x1138c6
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %r15d, %edx
cmpl %r15d, %eax
jae 0x1138c6
notl %eax
addl %edx, %eax
movl %eax, %ecx
movl %r12d, %esi
cmpl %r14d, %r12d
movl %r12d, %r15d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovael %eax, %r15d
cmpl %edx, %ecx
movl %ecx, %r12d
cmovael %eax, %r12d
cmpl %r14d, %esi
jae 0x113336
cmpl %edx, %ecx
jae 0x113336
movq 0x128(%rsp), %rdx
movq (%rdx), %rcx
movq 0x10(%rdx), %rax
cmpq 0x8(%rdx), %rcx
jne 0x11393a
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rdx
movq 0x128(%rsp), %r14
movq %rdx, 0x8(%r14)
shlq $0x3, %rdx
leaq (%rdx,%rdx,4), %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x10(%r14)
movq (%r14), %rcx
movq 0x20(%rsp), %rdx
shlq $0x20, %rdx
movq 0x88(%rsp), %rdi
orq %rdx, %rdi
movl 0x30(%rsp), %r8d
xorb 0x28(%rsp), %r8b
shlq $0x20, %r15
orq %r15, %r12
leaq 0x1(%rcx), %rdx
movq 0x128(%rsp), %rsi
movq %rdx, (%rsi)
leaq (%rcx,%rcx,4), %rcx
movq %rdi, (%rax,%rcx,8)
movl 0x2c(%rsp), %edx
movl %edx, 0x8(%rax,%rcx,8)
movl %ebp, 0xc(%rax,%rcx,8)
movl 0x3c(%rsp), %edx
movw %dx, 0x10(%rax,%rcx,8)
movb %r8b, 0x12(%rax,%rcx,8)
movq %r12, 0x18(%rax,%rcx,8)
movq $0x1, 0x20(%rax,%rcx,8)
jmp 0x113336
callq 0x13606
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x1137f0
callq 0x13628
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x113868
movq 0x80(%rsp), %rdx
leaq 0x1(%rdx), %rax
cmpq 0x100(%rsp), %rdx
movq %rax, %rdx
jne 0x1131e1
movq 0x128(%rsp), %r13
movq (%r13), %rsi
testq %rsi, %rsi
je 0x113fd0
movq 0x10(%r13), %rdi
leaq -0x938b(%rip), %rcx     # 0x10a674
movl $0x28, %ebx
movl $0x28, %edx
callq 0x23f0
movl $0x1, %esi
cmpq $0x2, (%r13)
jl 0x113aa0
movl $0x1, %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq 0x10(%r13), %rdi
leaq (%rsi,%rsi,4), %r8
leaq (%rdi,%r8,8), %r9
movq -0x10(%r9), %r10
leaq (%rdi,%rbx), %rdx
cmpq 0x18(%rdi,%rbx), %r10
jne 0x113a78
movq 0x20(%rdi,%rbx), %r10
addq %r10, -0x8(%r9)
movl 0xc(%rdi,%rbx), %r10d
andl %ecx, %r10d
movl -0x1c(%r9), %r9d
andl %ecx, %r9d
cmpl %r9d, %r10d
jbe 0x113a93
leaq (%rdi,%r8,8), %rdi
addq $-0x28, %rdi
movq 0x10(%rdx), %r8
movq %r8, 0x10(%rdi)
movups (%rdx), %xmm0
movups %xmm0, (%rdi)
jmp 0x113a93
movq 0x20(%rdx), %rdi
movq %rdi, 0x20(%r9)
movups (%rdx), %xmm0
movups 0x10(%rdx), %xmm1
movups %xmm1, 0x10(%r9)
movups %xmm0, (%r9)
incq %rsi
incq %rax
addq $0x28, %rbx
cmpq (%r13), %rax
jl 0x113a28
movq %rsi, (%r13)
movq 0x10(%r13), %rdi
movq 0x130(%rsp), %rbx
movq %rbx, %rdx
movq 0x138(%rsp), %rcx
callq 0x10ca61
movq (%rbx), %r12
testq %r12, %r12
je 0x113fd0
cmpl $0x0, 0x118(%rsp)
je 0x113d1d
decq %r12
js 0x113fd0
addq $0x10, 0x78(%rsp)
movl %eax, 0x18(%rsp)
movq 0x10(%r13), %rax
movq 0x78(%rsp), %rcx
movq (%rcx), %rcx
movslq (%rcx,%r12,4), %rcx
leaq (%rcx,%rcx,4), %rcx
movl 0x8(%rax,%rcx,8), %esi
shrl %esi
movq (%rax,%rcx,8), %rdx
shrq $0x21, %rdx
leaq (%rsi,%rsi,2), %rax
movq 0x60(%rsp), %rcx
leaq (%rcx,%rax,8), %rbx
movq %rbx, %rdi
callq 0xa0c99
cmpl $-0x1, %eax
je 0x113c4e
movq (%rbx), %rdx
cltq
leaq (%rax,%rax,4), %r8
movl 0xc(%rdx,%r8,8), %eax
leaq (%rax,%rax,2), %rdi
movl (%rbp,%rdi,4), %esi
testl %esi, %esi
js 0x113c4e
movq 0x10(%rsp), %rcx
movq 0x20(%rcx), %rcx
cmpl $0x0, (%rcx,%rax,8)
js 0x113c4e
leaq (%rdx,%r8,8), %rcx
leaq (,%rdi,4), %rdi
addq %rbp, %rdi
movl 0x4(%rdi), %edi
subl %esi, %edi
movq 0x18(%rcx), %rsi
testl %esi, %esi
movq %rsi, 0x20(%rsp)
js 0x113b92
movl 0x10(%rcx), %r11d
movl 0x14(%rcx), %r10d
subl %r10d, %edi
movl %edi, %r9d
movl %r11d, %edi
jmp 0x113ba0
movl 0x10(%rcx), %r11d
movl 0x14(%rcx), %r10d
subl %r10d, %edi
movl %r11d, %r9d
movq (%rdx,%r8,8), %r8
movq %r8, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (,%rdx,4), %rdx
addq %rbp, %rdx
movl 0x4(%rdx), %ebp
movl (%rdx), %edx
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andl %esi, %edx
subl %edx, %ebp
cmpl %r8d, %edi
movl %r8d, %r14d
cmovll %edi, %r14d
movl 0x8(%rcx), %ebx
movl %ebp, %edx
subl %ebx, %edx
cmpl %r9d, %edx
movl %r9d, %r15d
cmovll %edx, %r15d
movl 0x4(%rsp), %esi
cmpl %esi, %r14d
jg 0x113c49
cmpl %esi, %r15d
jg 0x113c49
movl %ebx, %r13d
subl %r8d, %r13d
cvtsi2ss %r13, %xmm1
addl %r14d, %r13d
addl %r15d, %r13d
cvtsi2ss %r13, %xmm2
leaq 0x181b4a(%rip), %rsi    # 0x295758
movss 0x158(%rsi), %xmm0
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
ja 0x113c41
subl %r11d, %r10d
xorps %xmm1, %xmm1
cvtsi2ss %r10, %xmm1
addl %r14d, %r15d
addl %r10d, %r15d
xorps %xmm2, %xmm2
cvtsi2ss %r15, %xmm2
mulss %xmm2, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x113c64
movq 0x128(%rsp), %r13
movq 0x8(%rsp), %rbp
leaq -0x1(%r12), %rax
testq %r12, %r12
movq %rax, %r12
jg 0x113aed
jmp 0x113fd0
cmpl %r9d, %edx
setl %dl
setg %r11b
cmpl %edi, %r8d
setg %r14b
setl %r10b
orb %r11b, %r14b
cmpb $0x1, %r14b
movl 0x18(%rsp), %esi
jne 0x113c41
orb %dl, %r10b
je 0x113c41
movl 0xd0(%rsp), %edx
cmpl %edx, %r13d
jl 0x113c41
cmpl %edx, %r15d
movq 0x128(%rsp), %r13
jl 0x113c49
addl %ebx, %r9d
movl %ebp, %edx
subl %r9d, %edx
movl %r8d, %r9d
subl %edi, %r9d
cmovlel %edx, %r9d
movq 0x20(%rsp), %r11
movl %r11d, %edx
shrl $0x10, %edx
andl $0x4000, %edx           # imm = 0x4000
andl $0x3fff, %esi           # imm = 0x3FFF
orl %edx, %esi
movzbl 0x21(%rcx), %edx
shll $0xf, %edx
orl %esi, %edx
movl %edx, 0x18(%rsp)
testl %r9d, %r9d
js 0x113c49
xorl %edx, %edx
cmpl %edi, %r8d
setg %r10b
setle %dl
testl %r11d, %r11d
setns %sil
subl %r9d, %ebp
shrq $0x1f, %r8
andl $-0x2, %r8d
orl %r8d, %edx
shlq $0x20, %rdx
movl %r9d, %edi
orq %rdx, %rdi
xorb %r10b, %sil
movq 0x78(%rsp), %r14
jmp 0x113f7c
testq %r12, %r12
jle 0x113fd0
movq 0x130(%rsp), %rax
leaq 0x10(%rax), %r14
xorl %r12d, %r12d
movl %eax, 0x18(%rsp)
movq %r14, 0x30(%rsp)
movq 0x10(%r13), %rax
movq (%r14), %rcx
movslq (%rcx,%r12,4), %rcx
leaq (%rcx,%rcx,4), %rcx
movl 0x8(%rax,%rcx,8), %esi
shrl %esi
movq (%rax,%rcx,8), %rdx
shrq $0x21, %rdx
leaq (%rsi,%rsi,2), %rax
movq 0x60(%rsp), %rcx
leaq (%rcx,%rax,8), %rbx
movq %rbx, %rdi
callq 0xa0c99
cmpl $-0x1, %eax
je 0x113eb4
movq (%rbx), %rdx
cltq
leaq (%rax,%rax,4), %r8
movl 0xc(%rdx,%r8,8), %eax
leaq (%rax,%rax,2), %rdi
movl (%rbp,%rdi,4), %esi
testl %esi, %esi
js 0x113eb4
movq 0x10(%rsp), %rcx
movq 0x20(%rcx), %rcx
cmpl $0x0, (%rcx,%rax,8)
js 0x113eb4
leaq (%rdx,%r8,8), %rcx
leaq (,%rdi,4), %rdi
addq %rbp, %rdi
movl 0x4(%rdi), %edi
subl %esi, %edi
movq 0x18(%rcx), %rsi
testl %esi, %esi
movq %rsi, 0x20(%rsp)
js 0x113dde
movl 0x10(%rcx), %r11d
movl 0x14(%rcx), %r10d
subl %r10d, %edi
movl %edi, %r9d
movl %r11d, %edi
jmp 0x113dec
movl 0x10(%rcx), %r11d
movl 0x14(%rcx), %r10d
subl %r10d, %edi
movl %r11d, %r9d
movq (%rdx,%r8,8), %r8
movq %r8, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (,%rdx,4), %rdx
addq %rbp, %rdx
movl 0x4(%rdx), %ebp
movl (%rdx), %edx
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andl %esi, %edx
subl %edx, %ebp
cmpl %r8d, %edi
movl %r8d, %esi
cmovll %edi, %esi
movl 0x8(%rcx), %ebx
movl %ebp, %edx
subl %ebx, %edx
cmpl %r9d, %edx
movl %r9d, %r13d
cmovll %edx, %r13d
movl 0x4(%rsp), %r15d
cmpl %r15d, %esi
jg 0x113ea7
cmpl %r15d, %r13d
jg 0x113ea7
movl %ebx, %r15d
subl %r8d, %r15d
cvtsi2ss %r15, %xmm1
addl %esi, %r15d
addl %r13d, %r15d
cvtsi2ss %r15, %xmm2
leaq 0x1818fe(%rip), %r14    # 0x295758
movss 0x158(%r14), %xmm0
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
jbe 0x113e80
movq 0x128(%rsp), %r13
movq 0x8(%rsp), %rbp
movq 0x30(%rsp), %r14
jmp 0x113eb4
subl %r11d, %r10d
xorps %xmm1, %xmm1
cvtsi2ss %r10, %xmm1
addl %esi, %r13d
addl %r10d, %r13d
xorps %xmm2, %xmm2
cvtsi2ss %r13, %xmm2
mulss %xmm2, %xmm0
ucomiss %xmm1, %xmm0
movq 0x30(%rsp), %r14
jbe 0x113ecd
movq 0x128(%rsp), %r13
movq 0x8(%rsp), %rbp
incq %r12
movq 0x130(%rsp), %rax
cmpq (%rax), %r12
jl 0x113d3e
jmp 0x113fd0
cmpl %r9d, %edx
setl %dl
setg %r10b
cmpl %edi, %r8d
setg %r11b
setl %sil
orb %r10b, %r11b
cmpb $0x1, %r11b
jne 0x113ea7
orb %dl, %sil
je 0x113ea7
movl 0xd0(%rsp), %edx
cmpl %edx, %r15d
jl 0x113ea7
cmpl %edx, %r13d
jl 0x113ea7
addl %ebx, %r9d
movl %ebp, %edx
subl %r9d, %edx
movl %r8d, %r9d
subl %edi, %r9d
cmovlel %edx, %r9d
movq 0x20(%rsp), %r11
movl %r11d, %edx
shrl $0x10, %edx
andl $0x4000, %edx           # imm = 0x4000
movl 0x18(%rsp), %esi
andl $0x3fff, %esi           # imm = 0x3FFF
orl %edx, %esi
movzbl 0x21(%rcx), %edx
shll $0xf, %edx
orl %esi, %edx
testl %r9d, %r9d
movq 0x128(%rsp), %r13
movl %edx, 0x18(%rsp)
js 0x113eaf
xorl %edx, %edx
cmpl %edi, %r8d
setg %r10b
setle %dl
testl %r11d, %r11d
setns %sil
subl %r9d, %ebp
shrq $0x1f, %r8
andl $-0x2, %r8d
orl %r8d, %edx
shlq $0x20, %rdx
movl %r9d, %edi
orq %rdx, %rdi
xorb %r10b, %sil
movb 0x20(%rcx), %cl
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movzbl %sil, %edx
leal (%rdx,%rax,2), %eax
movq 0x10(%r13), %rdx
movq (%r14), %rsi
movslq (%rsi,%r12,4), %rsi
leaq (%rsi,%rsi,4), %rsi
movq 0x10(%rdx,%rsi,8), %r8
movq 0x140(%rsp), %r9
movq %r8, 0x10(%r9)
movups (%rdx,%rsi,8), %xmm0
movups %xmm0, (%r9)
movq 0x148(%rsp), %rdx
movq %rdi, (%rdx)
movl %eax, 0x8(%rdx)
movl %ebp, 0xc(%rdx)
movl 0x18(%rsp), %eax
movw %ax, 0x10(%rdx)
movb %cl, 0x12(%rdx)
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq