// File: /workspace/github_cpp_makefile_star2_O1/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
movl %r9d, 0x14(%rsp)
movq %r8, 0x20(%rsp)
movq %rcx, 0x30(%rsp)
movq %rdx, %r9
movq %rsi, 0x28(%rsp)
movq %rdi, 0x60(%rsp)
movq 0x148(%rsp), %rax
movq 0x140(%rsp), %rcx
movq 0x128(%rsp), %rdx
orb $-0x80, 0xf(%rax)
orb $-0x80, 0xf(%rcx)
movq 0xf8(%rsp), %rcx
movq $0x0, (%rdx)
cmpq 0x100(%rsp), %rcx
movq %r9, 0x8(%rsp)
jg 0x10e6dc
movq 0xd8(%rsp), %rax
movq 0x18(%rax), %rax
movq %rcx, 0x40(%rsp)
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
leaq (%rax,%rax,2), %rax
movq 0x28(%rsp), %rcx
cmpl $0x0, 0xc(%rcx,%rax,8)
je 0x10e6c2
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,8), %rbx
xorl %r14d, %r14d
xorl %r13d, %r13d
movq (%rbx), %rbp
movl 0xc(%rbp,%r14), %edx
leaq (%rdx,%rdx,2), %rcx
movl (%r9,%rcx,4), %eax
testl %eax, %eax
js 0x10e3a8
movq 0x30(%rsp), %rsi
movq 0x20(%rsi), %r15
cmpl $0x0, (%r15,%rdx,8)
js 0x10e3a8
leaq (%r14,%rbp), %rdi
movl 0x4(%rbp,%r14), %edx
leaq (%rdx,%rdx,2), %rdx
leaq (%r9,%rdx,4), %rdx
leaq (%r9,%rcx,4), %rcx
movl 0x4(%rdx), %esi
movl (%rdx), %edx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andl %r8d, %edx
subl %edx, %esi
movl 0x4(%rcx), %edx
subl %eax, %edx
leaq 0x17c4ec(%rip), %rax    # 0x28a758
movss 0x158(%rax), %xmm0
movl 0x14(%rsp), %ecx
movl 0xd0(%rsp), %r8d
leaq 0x68(%rsp), %r9
callq 0x107fb9
movq 0x8(%rsp), %r9
testl %eax, %eax
js 0x10e3a8
movl 0x70(%rsp), %eax
movl %eax, 0x4(%rsp)
movl %eax, %r12d
shrl %r12d
cmpl $0x0, (%r15,%r12,8)
js 0x10e3a8
movq 0x60(%rsp), %rdi
movl %r12d, %esi
leaq 0x1c(%rsp), %rdx
leaq 0x18(%rsp), %rcx
callq 0xa306f
movq 0x8(%rsp), %r9
cmpl $0x0, 0x18(%rsp)
je 0x10e3a8
movl 0x1c(%rsp), %eax
cmpl $-0x1, %eax
je 0x10e3a8
cmpl 0xf0(%rsp), %eax
jne 0x10e3a8
movq 0xd8(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x40(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
movq %rsi, %r15
shrq $0x21, %rsi
movq 0x60(%rsp), %rdi
movq %rsi, 0x38(%rsp)
leaq 0x1c(%rsp), %rdx
leaq 0x18(%rsp), %rcx
callq 0xa306f
movq 0x8(%rsp), %r9
cmpl $0x0, 0x18(%rsp)
je 0x10e3a8
movl 0x1c(%rsp), %eax
cmpl $-0x1, %eax
je 0x10e3a8
cmpl 0xe8(%rsp), %eax
jne 0x10e3a8
movq 0x20(%rsp), %rax
movq 0x38(%rsp), %rcx
movl (%rax,%rcx,8), %eax
cmpq 0x40(%rsp), %rax
jne 0x10e3a8
shrq $0x20, %r15
movq 0xe0(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x20(%rsp), %rax
movl (%rax,%r12,8), %eax
movq (%rcx,%rax,8), %r10
movq %r10, %r8
shrq $0x20, %r8
movq 0x68(%rsp), %r12
shrq $0x20, %r12
movq %r15, 0x58(%rsp)
cmpq %r15, %r12
sete %dl
cmpl %r8d, 0x4(%rsp)
sete %cl
xorb %dl, %cl
cmpl $0x0, 0x120(%rsp)
jne 0x10e3c0
testb %cl, %cl
je 0x10e3c0
incq %r13
movl 0xc(%rbx), %eax
addq $0x28, %r14
cmpq %rax, %r13
jb 0x10e20f
jmp 0x10e6c2
xorl %edx, %edx
cmpl 0x58(%rsp), %r12d
sete %sil
cmpl $0x1, 0x120(%rsp)
setne %dil
orb %cl, %dil
testb $0x1, %dil
je 0x10e3a8
movb %sil, %dl
cmpl 0x118(%rsp), %edx
je 0x10e3a8
cmpq 0x108(%rsp), %rax
setl %cl
cmpq 0x110(%rsp), %rax
setg %al
orb %cl, %al
jne 0x10e3a8
movl 0x4(%rbp,%r14), %edx
movl 0xc(%rbp,%r14), %esi
leaq (%rsi,%rsi,2), %rax
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,8), %rdi
movq %r8, 0x50(%rsp)
movq %r10, %r15
callq 0xa04f9
movq 0x8(%rsp), %r9
cmpl $-0x1, %eax
je 0x10e3a8
movl 0xc(%rbp,%r14), %ecx
leaq (%rcx,%rcx,2), %rcx
movq 0x28(%rsp), %rdx
movq (%rdx,%rcx,8), %rcx
cltq
leaq (%rax,%rax,4), %rsi
movl 0xc(%rcx,%rsi,8), %edi
leaq (%rdi,%rdi,2), %rdx
movl (%r9,%rdx,4), %eax
testl %eax, %eax
js 0x10e3a8
movq 0x30(%rsp), %r8
movq 0x20(%r8), %rbp
cmpl $0x0, (%rbp,%rdi,8)
js 0x10e3a8
leaq (%rcx,%rsi,8), %rdi
movl 0x4(%rdi), %ecx
leaq (%rcx,%rcx,2), %rcx
leaq (%r9,%rcx,4), %rcx
leaq (%r9,%rdx,4), %rdx
movl 0x4(%rcx), %esi
movl (%rcx), %ecx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andl %r8d, %ecx
subl %ecx, %esi
movl 0x4(%rdx), %edx
subl %eax, %edx
leaq 0x17c2b1(%rip), %rax    # 0x28a758
movss 0x158(%rax), %xmm0
movl 0x14(%rsp), %ecx
movl 0xd0(%rsp), %r8d
leaq 0x80(%rsp), %r9
callq 0x107fb9
movq 0x50(%rsp), %rdx
movq 0x8(%rsp), %r9
testl %eax, %eax
js 0x10e3a8
movq %r15, 0x48(%rsp)
movq 0xd8(%rsp), %rax
movl (%rax), %r8d
movl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
andl %r11d, %r8d
movq 0xe0(%rsp), %rax
movl (%rax), %edi
andl %r11d, %edi
movq 0x58(%rsp), %rax
cmpl %eax, %r12d
jne 0x10e52d
movq 0x20(%rsp), %rax
movq 0x38(%rsp), %r15
movl 0x4(%rax,%r15,8), %eax
movl (%rbp,%r15,8), %ecx
andl %r11d, %ecx
leal (%rax,%rcx), %r12d
decl %r12d
xorl %r15d, %r15d
jmp 0x10e54c
xorl %eax, %r12d
cmpl $0x1, %r12d
jne 0x10e676
movq 0x20(%rsp), %rax
movq 0x38(%rsp), %rcx
movl 0x4(%rax,%rcx,8), %r12d
movb $0x1, %r15b
movl 0x4(%rsp), %eax
cmpl %edx, %eax
jne 0x10e575
movq 0x48(%rsp), %rcx
shrq $0x21, %rcx
movq 0x20(%rsp), %rax
movl 0x4(%rax,%rcx,8), %eax
movl 0x74(%rsp), %ecx
andl %r11d, %ecx
addl %ecx, %eax
decl %eax
xorl %ecx, %ecx
jmp 0x10e5ac
xorl %edx, %eax
cmpl $0x1, %eax
jne 0x10e6a0
movq 0x48(%rsp), %rsi
shrq $0x21, %rsi
movq 0x30(%rsp), %rax
movq 0x20(%rax), %rax
movl (%rax,%rsi,8), %eax
andl %r11d, %eax
movl 0x74(%rsp), %ecx
andl %r11d, %ecx
movq 0x20(%rsp), %rdx
addl 0x4(%rdx,%rsi,8), %eax
subl %ecx, %eax
movb $0x1, %cl
movl %ecx, %edx
xorb %r15b, %dl
movb %dl, 0x7a(%rsp)
cmpb %cl, %r15b
je 0x10e5c7
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl %edi, %eax
jae 0x10e5c9
notl %eax
addl %edi, %eax
movl %eax, %ecx
cmpl %r8d, %r12d
movl %r12d, %r15d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovael %eax, %r15d
cmpl %edi, %ecx
movl %ecx, %ebp
cmovael %eax, %ebp
cmpl %r8d, %r12d
jae 0x10e3a8
cmpl %edi, %ecx
jae 0x10e3a8
movq 0x128(%rsp), %r12
movq 0x8(%r12), %rax
cmpq %rax, (%r12)
jne 0x10e634
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rcx
movq %rcx, 0x8(%r12)
movq 0x10(%r12), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,4), %rsi
callq 0x2370
movq 0x8(%rsp), %r9
movq %rax, 0x10(%r12)
shlq $0x20, %r15
orq %r15, %rbp
movq (%r12), %rax
movq 0x10(%r12), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%r12)
leaq (%rax,%rax,4), %rax
movq 0x78(%rsp), %rdx
movq %rdx, 0x10(%rcx,%rax,8)
movups 0x68(%rsp), %xmm0
movups %xmm0, (%rcx,%rax,8)
movq %rbp, 0x18(%rcx,%rax,8)
movq $0x1, 0x20(%rcx,%rax,8)
jmp 0x10e3a8
movl %edi, %ebp
movl %r8d, %r15d
callq 0x13cb6
movl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
movl %r15d, %r8d
movl %ebp, %edi
movq 0x50(%rsp), %rdx
movq 0x8(%rsp), %r9
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x10e528
movl %edi, %ebp
movl %r8d, 0x4(%rsp)
callq 0x13cd8
movl 0x4(%rsp), %r8d
movl %ebp, %edi
movq 0x8(%rsp), %r9
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x10e571
movq 0x40(%rsp), %rcx
leaq 0x1(%rcx), %rax
cmpq 0x100(%rsp), %rcx
movq %rax, %rcx
jne 0x10e1d3
movq 0x128(%rsp), %r15
movq (%r15), %rsi
testq %rsi, %rsi
je 0x10e9e2
movq 0x138(%rsp), %r13
movq 0x130(%rsp), %r12
movq 0x10(%r15), %rdi
leaq -0x8836(%rip), %rcx     # 0x105ed5
movl $0x28, %ebx
movl $0x28, %edx
callq 0x23f0
movl $0x1, %esi
cmpq $0x2, (%r15)
jl 0x10e7af
movl $0x1, %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq 0x10(%r15), %rdx
leaq (%rsi,%rsi,4), %rdi
movq -0x10(%rdx,%rdi,8), %r9
leaq (%rdx,%rbx), %r8
cmpq 0x18(%rdx,%rbx), %r9
jne 0x10e785
leaq (%rdx,%rdi,8), %r9
movq 0x20(%rdx,%rbx), %r10
addq %r10, -0x8(%r9)
movl 0xc(%rdx,%rbx), %r10d
andl %ecx, %r10d
movl -0x1c(%r9), %r9d
andl %ecx, %r9d
cmpl %r9d, %r10d
jbe 0x10e7a3
leaq (%rdx,%rdi,8), %rdx
addq $-0x28, %rdx
movq 0x10(%r8), %rdi
movq %rdi, 0x10(%rdx)
movups (%r8), %xmm0
movups %xmm0, (%rdx)
jmp 0x10e7a3
movq 0x20(%r8), %r9
movq %r9, 0x20(%rdx,%rdi,8)
movups (%r8), %xmm0
movups 0x10(%r8), %xmm1
movups %xmm1, 0x10(%rdx,%rdi,8)
movups %xmm0, (%rdx,%rdi,8)
incq %rsi
incq %rax
addq $0x28, %rbx
cmpq (%r15), %rax
jl 0x10e733
movq %rsi, (%r15)
movq 0x10(%r15), %rdi
movq %r12, %rdx
movq %r13, %rcx
callq 0x108131
movq (%r12), %rbx
testq %rbx, %rbx
je 0x10e9e2
cmpl $0x0, 0x118(%rsp)
je 0x10e8be
decq %rbx
js 0x10e9e2
leaq 0x17bf6c(%rip), %r14    # 0x28a758
leaq 0x80(%rsp), %r13
movq 0x10(%r15), %rax
movq 0x10(%r12), %rcx
movslq (%rcx,%rbx,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 0x28(%rsp), %rcx
leaq (%rcx,%rax,8), %rbp
movq %rbp, %rdi
callq 0xa04f9
movq 0x8(%rsp), %r9
cmpl $-0x1, %eax
je 0x10e8a9
movq (%rbp), %rcx
cltq
leaq (%rax,%rax,4), %rsi
movl 0xc(%rcx,%rsi,8), %edi
leaq (%rdi,%rdi,2), %rdx
movl (%r9,%rdx,4), %eax
testl %eax, %eax
js 0x10e8a9
movq 0x30(%rsp), %r8
movq 0x20(%r8), %r8
cmpl $0x0, (%r8,%rdi,8)
js 0x10e8a9
leaq (%rcx,%rsi,8), %rdi
movl 0x4(%rdi), %ecx
leaq (%rcx,%rcx,2), %rcx
leaq (%r9,%rcx,4), %rcx
leaq (%r9,%rdx,4), %rdx
movl 0x4(%rcx), %esi
movl (%rcx), %ecx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andl %r8d, %ecx
subl %ecx, %esi
movl 0x4(%rdx), %edx
subl %eax, %edx
movss 0x158(%r14), %xmm0
movl 0x14(%rsp), %ecx
movl 0xd0(%rsp), %r8d
movq %r13, %r9
callq 0x107fb9
testl %eax, %eax
jns 0x10e99a
leaq -0x1(%rbx), %rax
testq %rbx, %rbx
movq %rax, %rbx
jg 0x10e7f4
jmp 0x10e9e2
cmpq $0x0, (%r12)
jle 0x10e9e2
xorl %ebx, %ebx
leaq 0x17be86(%rip), %r14    # 0x28a758
leaq 0x80(%rsp), %r13
movq 0x10(%r15), %rax
movq 0x10(%r12), %rcx
movslq (%rcx,%rbx,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 0x28(%rsp), %rcx
leaq (%rcx,%rax,8), %rbp
movq %rbp, %rdi
callq 0xa04f9
movq 0x8(%rsp), %r9
cmpl $-0x1, %eax
je 0x10e98b
movq (%rbp), %rcx
cltq
leaq (%rax,%rax,4), %rsi
movl 0xc(%rcx,%rsi,8), %edi
leaq (%rdi,%rdi,2), %rdx
movl (%r9,%rdx,4), %eax
testl %eax, %eax
js 0x10e98b
movq 0x30(%rsp), %r8
movq 0x20(%r8), %r8
cmpl $0x0, (%r8,%rdi,8)
js 0x10e98b
leaq (%rcx,%rsi,8), %rdi
movl 0x4(%rdi), %ecx
leaq (%rcx,%rcx,2), %rcx
leaq (%r9,%rcx,4), %rcx
leaq (%r9,%rdx,4), %rdx
movl 0x4(%rcx), %esi
movl (%rcx), %ecx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andl %r8d, %ecx
subl %ecx, %esi
movl 0x4(%rdx), %edx
subl %eax, %edx
movss 0x158(%r14), %xmm0
movl 0x14(%rsp), %ecx
movl 0xd0(%rsp), %r8d
movq %r13, %r9
callq 0x107fb9
testl %eax, %eax
jns 0x10e99a
incq %rbx
cmpq (%r12), %rbx
jl 0x10e8da
jmp 0x10e9e2
movq 0x10(%r15), %rax
movq 0x10(%r12), %rcx
movslq (%rcx,%rbx,4), %rcx
leaq (%rcx,%rcx,4), %rcx
movq 0x10(%rax,%rcx,8), %rdx
movq 0x140(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movups (%rax,%rcx,8), %xmm0
movups %xmm0, (%rsi)
movq 0x90(%rsp), %rax
movq 0x148(%rsp), %rcx
movq %rax, 0x10(%rcx)
movups 0x80(%rsp), %xmm0
movups %xmm0, (%rcx)
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq