// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: get_base_boundary(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, unsigned int*, unsigned int*)
void get_base_boundary(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, uint32_t* x_off, uint32_t* y_off)
{
    long long k, j, offset;
    ma_hit_t_alloc *xR = NULL;
    ma_hit_t *h = NULL;
    ma_sub_t *sq = NULL, *st = NULL;
    int32_t r;
    asg_arc_t t;
    uint32_t rId, Hap_uId, is_Unitig, v, w, v_dir, w_dir, is_found = 0, oLen = 0;
    uint64_t tmp;
    (*x_off) = (*y_off) = (uint32_t)-1;
    if(dir == 1)
    {
        for (k = xEndIndex; k >= xBegIndex; k--)
        {
            xR = &(reverse_sources[xReads->a[k]>>33]);
            is_found = 0; oLen = 0;
            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);
                ///if it is a contained overlap, skip
                if(r < 0) continue;

                rId = t.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.ul>>32)==v)?1:0;
                w_dir = (t.v == w)?1:0;
                if(rev == 0 && v_dir != w_dir) continue;
                if(rev == 1 && v_dir == w_dir) continue;

                /****************************may have bugs********************************/
                offset = (uint32_t)(position_index[rId]);
                if(offset < yBegIndex || offset > yEndIndex) continue;
                /****************************may have bugs********************************/

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

                ///if(is_found == 0 || ((uint32_t)(tmp>>32) > (*x_off) && ((uint32_t)tmp) > (*y_off)))
                if(is_found == 0 || t.ol > oLen)
                {
                    (*x_off) = tmp>>32;
                    (*y_off) = (uint32_t)tmp;
                    oLen = t.ol;
                }

                is_found = 1; 
            }
            if(is_found) return;
        }   
    }
    else
    {
        for (k = xBegIndex; k <= xEndIndex; k++)
        {
            xR = &(reverse_sources[xReads->a[k]>>33]);
            is_found = 0; oLen = 0;
            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);
                ///if it is a contained overlap, skip
                if(r < 0) continue;

                rId = t.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.ul>>32)==v)?1:0;
                w_dir = (t.v == w)?1:0;
                if(rev == 0 && v_dir != w_dir) continue;
                if(rev == 1 && v_dir == w_dir) continue;
            
                /****************************may have bugs********************************/
                offset = (uint32_t)(position_index[rId]);
                if(offset < yBegIndex || offset > yEndIndex) continue;
                /****************************may have bugs********************************/

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

                ///if(is_found == 0 || ((uint32_t)(tmp>>32) < (*x_off) && ((uint32_t)tmp) < (*y_off)))
                if(is_found == 0 || t.ol > oLen)
                {
                    (*x_off) = tmp>>32;
                    (*y_off) = (uint32_t)tmp;
                    oLen = t.ol;
                }  

                is_found = 1;         
            }
            if(is_found) return;
        }
    }


    (*x_off) = (*y_off) = (uint32_t)-1;
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r8, 0x80(%rsp)
movq %rcx, %r11
movq %rdx, %r12
movq %rdi, 0x88(%rsp)
movq 0x130(%rsp), %rdx
movq 0x128(%rsp), %rcx
movq 0x100(%rsp), %rdi
movq 0xf8(%rsp), %r8
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, (%rdx)
movl %eax, (%rcx)
movl 0x118(%rsp), %eax
cmpl $0x1, %eax
movl %r9d, 0x4(%rsp)
movq %r11, 0x18(%rsp)
movq %r12, 0x20(%rsp)
movq %rsi, 0x90(%rsp)
jne 0x10c463
cmpq %r8, %rdi
jl 0x10ca36
movq 0xd8(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax,%rdi,8), %rax
shrq $0x21, %rax
leaq (%rax,%rax,2), %rax
cmpl $0x0, 0xc(%rsi,%rax,8)
je 0x10c44e
movq %rdi, 0x60(%rsp)
leaq (%rsi,%rax,8), %rsi
xorl %ebx, %ebx
movl $0x18, %r14d
movl $0x0, 0x2c(%rsp)
xorl %ebp, %ebp
movq %rsi, 0x8(%rsp)
movq (%rsi), %r8
movl -0xc(%r8,%r14), %r13d
leaq (,%r13,2), %rcx
addq %r13, %rcx
movl (%r12,%rcx,4), %edx
testl %edx, %edx
js 0x10bf37
movq 0x20(%r11), %rax
cmpl $0x0, (%rax,%r13,8)
js 0x10bf37
movq %rax, 0x38(%rsp)
movq %rbx, 0x68(%rsp)
leaq (%r12,%rcx,4), %rcx
movl 0x4(%rcx), %ecx
subl %edx, %ecx
movq (%r8,%r14), %rax
movq %rax, 0x48(%rsp)
movq %r11, %r15
testl %eax, %eax
js 0x10bf3c
movl -0x8(%r8,%r14), %eax
movl -0x4(%r8,%r14), %edi
subl %edi, %ecx
movl %ecx, %esi
movl %eax, %ecx
jmp 0x10bf4a
jmp 0x10c026
movl -0x8(%r8,%r14), %eax
movl -0x4(%r8,%r14), %edi
subl %edi, %ecx
movl %eax, %esi
movq -0x18(%r8,%r14), %r11
movq %r11, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%r12,%rdx,4), %rdx
movl 0x4(%rdx), %ebx
movl (%rdx), %edx
movl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
andl %r10d, %edx
subl %edx, %ebx
cmpl %r11d, %ecx
movq %r11, 0x40(%rsp)
movl %r11d, %r12d
cmovll %ecx, %r12d
movl -0x10(%r8,%r14), %r8d
movl %ebx, %edx
subl %r8d, %edx
cmpl %esi, %edx
movl %esi, %r10d
cmovll %edx, %r10d
cmpl %r9d, %r12d
jg 0x10c014
cmpl %r9d, %r10d
jg 0x10c000
movl %r8d, %r11d
subl 0x40(%rsp), %r11d
cvtsi2ss %r11, %xmm1
addl %r12d, %r11d
addl %r10d, %r11d
cvtsi2ss %r11, %xmm2
leaq 0x18979f(%rip), %r9     # 0x295758
movss 0x158(%r9), %xmm0
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
movq 0x68(%rsp), %r15
ja 0x10bff1
subl %eax, %edi
xorps %xmm1, %xmm1
cvtsi2ss %rdi, %xmm1
addl %r12d, %r10d
addl %edi, %r10d
xorps %xmm2, %xmm2
cvtsi2ss %r10, %xmm2
mulss %xmm2, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x10c03e
movl %r15d, %ebx
movl 0x4(%rsp), %r9d
movq 0x18(%rsp), %r11
jmp 0x10c008
movq %r15, %r11
movq 0x68(%rsp), %rbx
movq 0x20(%rsp), %r12
movq 0x8(%rsp), %rsi
jmp 0x10c026
movq 0x68(%rsp), %rbx
movq 0x20(%rsp), %r12
movq 0x8(%rsp), %rsi
movq %r15, %r11
incq %rbp
movl 0xc(%rsi), %eax
addq $0x28, %r14
cmpq %rax, %rbp
jb 0x10bedc
jmp 0x10c42e
cmpl %esi, %edx
setl %dl
setg %r9b
cmpl %ecx, 0x40(%rsp)
setg %r12b
setl %dil
orb %r9b, %r12b
cmpb $0x1, %r12b
jne 0x10bff1
orb %dl, %dil
movq 0x20(%rsp), %r12
je 0x10c286
movl 0xd0(%rsp), %eax
cmpl %eax, %r11d
jl 0x10c286
cmpl %eax, %r10d
movl 0x4(%rsp), %r9d
movq 0x18(%rsp), %r11
jl 0x10c298
cmpl $0x0, 0x48(%rsp)
setns %dil
addl %r8d, %esi
movl %ebx, %edx
subl %esi, %edx
movq 0x40(%rsp), %rax
subl %ecx, %eax
setle %sil
setg %r8b
cmovlel %edx, %eax
testl %eax, %eax
js 0x10c298
movl %r13d, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq 0x38(%rsp), %rcx
cmpl $0x0, (%rcx,%rdx,8)
js 0x10c298
movb %r8b, 0x17(%rsp)
movb %sil, 0x28(%rsp)
movb %dil, 0x38(%rsp)
movl %eax, 0x74(%rsp)
movq 0x88(%rsp), %rdi
movq %rdx, 0x48(%rsp)
movq %rdx, %rsi
leaq 0x34(%rsp), %rdx
leaq 0x30(%rsp), %rcx
callq 0xa3c62
cmpl $0x0, 0x30(%rsp)
je 0x10c286
movl 0x34(%rsp), %eax
cmpl $-0x1, %eax
movl 0x4(%rsp), %r9d
movq 0x18(%rsp), %r11
movq 0x8(%rsp), %rsi
je 0x10c27e
cmpl 0xf0(%rsp), %eax
jne 0x10c27e
movq 0xd8(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x60(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x58(%rsp)
movq %rax, %rsi
shrq $0x21, %rsi
movq 0x88(%rsp), %rdi
movq %rsi, 0x78(%rsp)
leaq 0x34(%rsp), %rdx
leaq 0x30(%rsp), %rcx
callq 0xa3c62
cmpl $0x0, 0x30(%rsp)
je 0x10c286
movl 0x34(%rsp), %eax
cmpl $-0x1, %eax
movl 0x4(%rsp), %r9d
movq 0x18(%rsp), %r11
movq 0x8(%rsp), %rsi
je 0x10c27e
cmpl 0xe8(%rsp), %eax
jne 0x10c27e
movq 0x80(%rsp), %rdi
movq 0x78(%rsp), %rax
movq (%rdi,%rax,8), %rcx
movl %ecx, %eax
cmpq 0x60(%rsp), %rax
jne 0x10c27e
movq %rcx, 0x50(%rsp)
movb 0x38(%rsp), %al
xorb 0x17(%rsp), %al
movzbl %al, %eax
xorl %ecx, %ecx
movb 0x28(%rsp), %dl
movb %dl, %cl
movq 0x40(%rsp), %r10
shrq $0x1f, %r10
andl $-0x2, %r10d
orq %rcx, %r10
leal (%rax,%r13,2), %r8d
movq 0x58(%rsp), %rsi
shrq $0x20, %rsi
movl 0x120(%rsp), %eax
cmpl $0x1, %eax
setne %cl
testl %eax, %eax
setne %dl
movq 0xe0(%rsp), %rax
movq 0x18(%rax), %r13
movq 0x48(%rsp), %rax
movl (%rdi,%rax,8), %eax
movq (%r13,%rax,8), %r13
movq %r13, 0x38(%rsp)
shrq $0x20, %r13
movq %r10, 0x40(%rsp)
movq %rsi, 0x58(%rsp)
cmpl %esi, %r10d
sete %sil
movl %r8d, 0x48(%rsp)
cmpl %r13d, %r8d
sete %dil
xorb %sil, %dil
orb %dil, %cl
notb %dil
orb %dl, %dil
andb %cl, %dil
testb $0x1, %dil
je 0x10c298
cmpq 0x108(%rsp), %rax
setl %cl
cmpq 0x110(%rsp), %rax
setg %al
orb %cl, %al
movq 0x8(%rsp), %rsi
je 0x10c2a0
movl %r15d, %ebx
jmp 0x10c026
movl %r15d, %ebx
movl 0x4(%rsp), %r9d
movq 0x18(%rsp), %r11
jmp 0x10c00d
movl %r15d, %ebx
jmp 0x10c00d
movq 0xd8(%rsp), %rax
movl (%rax), %eax
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl %edx, %eax
movl %eax, 0x28(%rsp)
movq 0xe0(%rsp), %rax
movl (%rax), %r10d
andl %edx, %r10d
movq 0x40(%rsp), %r8
movq 0x58(%rsp), %rax
cmpl %eax, %r8d
jne 0x10c2f2
movq 0x50(%rsp), %rdi
shrq $0x20, %rdi
movq 0x20(%r11), %rax
movq 0x78(%rsp), %rcx
movl (%rax,%rcx,8), %eax
andl %edx, %eax
addl %eax, %edi
decl %edi
xorl %r12d, %r12d
jmp 0x10c30a
xorl %r8d, %eax
cmpl $0x1, %eax
jne 0x10c3d7
movq 0x50(%rsp), %rdi
shrq $0x20, %rdi
movb $0x1, %r12b
subl 0x74(%rsp), %ebx
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
movl 0x48(%rsp), %ecx
cmpl %r13d, %ecx
movq 0x80(%rsp), %rax
jne 0x10c33a
movq 0x38(%rsp), %rcx
shrq $0x21, %rcx
movl 0x4(%rax,%rcx,8), %eax
addl %ebx, %eax
decl %eax
xorl %ecx, %ecx
jmp 0x10c364
xorl %r13d, %ecx
cmpl $0x1, %ecx
jne 0x10c400
movq 0x38(%rsp), %r8
shrq $0x21, %r8
movl 0x4(%rax,%r8,8), %eax
movq 0x20(%r11), %rcx
movl (%rcx,%r8,8), %ecx
andl %edx, %ecx
subl %ebx, %eax
addl %ecx, %eax
movb $0x1, %cl
cmpb %cl, %r12b
jne 0x10c370
movq 0x20(%rsp), %r12
jmp 0x10c383
cmpl %r10d, %eax
movq 0x20(%rsp), %r12
jae 0x10c27e
notl %eax
addl %r10d, %eax
cmpl %r10d, %eax
movl %eax, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmovael %edx, %ecx
cmpl 0x28(%rsp), %edi
cmovael %edx, %edi
jae 0x10c27e
cmpl %r10d, %eax
jae 0x10c27e
cmpl $0x0, 0x2c(%rsp)
movl $0x1, 0x2c(%rsp)
je 0x10c3be
cmpl %r15d, %ebx
jbe 0x10c27e
movq 0x128(%rsp), %rax
movl %edi, (%rax)
movq 0x130(%rsp), %rax
movl %ecx, (%rax)
jmp 0x10c026
movl %r10d, %r12d
callq 0x1322d
movl %r12d, %r10d
movq 0x8(%rsp), %rsi
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq 0x18(%rsp), %r11
movl 0x4(%rsp), %r9d
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
jmp 0x10c2ed
movq %rdi, 0x50(%rsp)
movl %r10d, %r13d
callq 0x1324f
movl %r13d, %r10d
movq 0x50(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x18(%rsp), %r11
movl 0x4(%rsp), %r9d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x10c336
cmpl $0x0, 0x2c(%rsp)
movq 0x90(%rsp), %rsi
movq 0x60(%rsp), %rdi
movq 0xf8(%rsp), %r8
jne 0x10ca4f
leaq -0x1(%rdi), %rax
cmpq %r8, %rdi
movq %rax, %rdi
jg 0x10be99
jmp 0x10ca36
cmpq %rdi, %r8
jg 0x10ca36
movq 0xd8(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax,%r8,8), %rax
shrq $0x21, %rax
leaq (%rax,%rax,2), %rax
cmpl $0x0, 0xc(%rsi,%rax,8)
je 0x10ca26
movq %r8, 0x60(%rsp)
leaq (%rsi,%rax,8), %rsi
xorl %r15d, %r15d
movl $0x18, %r14d
movl $0x0, 0x2c(%rsp)
xorl %ebp, %ebp
movq %rsi, 0x8(%rsp)
movq (%rsi), %r8
movl -0xc(%r8,%r14), %r13d
leaq (,%r13,2), %rcx
addq %r13, %rcx
movl (%r12,%rcx,4), %edx
testl %edx, %edx
js 0x10c50b
movq 0x20(%r11), %rax
cmpl $0x0, (%rax,%r13,8)
js 0x10c50b
movq %rax, 0x38(%rsp)
movq %r15, 0x68(%rsp)
leaq (%r12,%rcx,4), %rcx
movl 0x4(%rcx), %ecx
subl %edx, %ecx
movq (%r8,%r14), %rax
movq %rax, 0x48(%rsp)
movq %r11, %rbx
testl %eax, %eax
js 0x10c510
movl -0x8(%r8,%r14), %eax
movl -0x4(%r8,%r14), %edi
subl %edi, %ecx
movl %ecx, %esi
movl %eax, %ecx
jmp 0x10c51e
jmp 0x10c5fd
movl -0x8(%r8,%r14), %eax
movl -0x4(%r8,%r14), %edi
subl %edi, %ecx
movl %eax, %esi
movq -0x18(%r8,%r14), %r11
movq %r11, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%r12,%rdx,4), %rdx
movl 0x4(%rdx), %r15d
movl (%rdx), %edx
movl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
andl %r10d, %edx
subl %edx, %r15d
cmpl %r11d, %ecx
movq %r11, 0x40(%rsp)
movl %r11d, %r12d
cmovll %ecx, %r12d
movl -0x10(%r8,%r14), %r8d
movl %r15d, %edx
subl %r8d, %edx
cmpl %esi, %edx
movl %esi, %r10d
cmovll %edx, %r10d
cmpl %r9d, %r12d
jg 0x10c5eb
cmpl %r9d, %r10d
jg 0x10c5d7
movl %r8d, %r11d
subl 0x40(%rsp), %r11d
cvtsi2ss %r11, %xmm1
addl %r12d, %r11d
addl %r10d, %r11d
cvtsi2ss %r11, %xmm2
leaq 0x1891c8(%rip), %r9     # 0x295758
movss 0x158(%r9), %xmm0
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
movq 0x68(%rsp), %rbx
ja 0x10c5c8
subl %eax, %edi
xorps %xmm1, %xmm1
cvtsi2ss %rdi, %xmm1
addl %r12d, %r10d
addl %edi, %r10d
xorps %xmm2, %xmm2
cvtsi2ss %r10, %xmm2
mulss %xmm2, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x10c615
movl %ebx, %r15d
movl 0x4(%rsp), %r9d
movq 0x18(%rsp), %r11
jmp 0x10c5df
movq %rbx, %r11
movq 0x68(%rsp), %r15
movq 0x20(%rsp), %r12
movq 0x8(%rsp), %rsi
jmp 0x10c5fd
movq 0x68(%rsp), %r15
movq 0x20(%rsp), %r12
movq 0x8(%rsp), %rsi
movq %rbx, %r11
incq %rbp
movl 0xc(%rsi), %eax
addq $0x28, %r14
cmpq %rax, %rbp
jb 0x10c4b0
jmp 0x10ca0a
cmpl %esi, %edx
setl %dl
setg %r9b
cmpl %ecx, 0x40(%rsp)
setg %r12b
setl %dil
orb %r9b, %r12b
cmpb $0x1, %r12b
jne 0x10c5c8
orb %dl, %dil
movq 0x20(%rsp), %r12
je 0x10c85e
movl 0xd0(%rsp), %eax
cmpl %eax, %r11d
jl 0x10c85e
cmpl %eax, %r10d
movl 0x4(%rsp), %r9d
movq 0x18(%rsp), %r11
jl 0x10c870
cmpl $0x0, 0x48(%rsp)
setns %dil
addl %r8d, %esi
movl %r15d, %edx
subl %esi, %edx
movq 0x40(%rsp), %rax
subl %ecx, %eax
setle %sil
setg %r8b
cmovlel %edx, %eax
testl %eax, %eax
js 0x10c870
movl %r13d, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq 0x38(%rsp), %rcx
cmpl $0x0, (%rcx,%rdx,8)
js 0x10c870
movb %r8b, 0x17(%rsp)
movb %sil, 0x28(%rsp)
movb %dil, 0x38(%rsp)
movl %eax, 0x74(%rsp)
movq 0x88(%rsp), %rdi
movq %rdx, 0x48(%rsp)
movq %rdx, %rsi
leaq 0x34(%rsp), %rdx
leaq 0x30(%rsp), %rcx
callq 0xa3c62
cmpl $0x0, 0x30(%rsp)
je 0x10c85e
movl 0x34(%rsp), %eax
cmpl $-0x1, %eax
movl 0x4(%rsp), %r9d
movq 0x18(%rsp), %r11
movq 0x8(%rsp), %rsi
je 0x10c856
cmpl 0xf0(%rsp), %eax
jne 0x10c856
movq 0xd8(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x60(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x58(%rsp)
movq %rax, %rsi
shrq $0x21, %rsi
movq 0x88(%rsp), %rdi
movq %rsi, 0x78(%rsp)
leaq 0x34(%rsp), %rdx
leaq 0x30(%rsp), %rcx
callq 0xa3c62
cmpl $0x0, 0x30(%rsp)
je 0x10c85e
movl 0x34(%rsp), %eax
cmpl $-0x1, %eax
movl 0x4(%rsp), %r9d
movq 0x18(%rsp), %r11
movq 0x8(%rsp), %rsi
je 0x10c856
cmpl 0xe8(%rsp), %eax
jne 0x10c856
movq 0x80(%rsp), %rdi
movq 0x78(%rsp), %rax
movq (%rdi,%rax,8), %rcx
movl %ecx, %eax
cmpq 0x60(%rsp), %rax
jne 0x10c856
movq %rcx, 0x50(%rsp)
movb 0x38(%rsp), %al
xorb 0x17(%rsp), %al
movzbl %al, %eax
xorl %ecx, %ecx
movb 0x28(%rsp), %dl
movb %dl, %cl
movq 0x40(%rsp), %r10
shrq $0x1f, %r10
andl $-0x2, %r10d
orq %rcx, %r10
leal (%rax,%r13,2), %r8d
movq 0x58(%rsp), %rsi
shrq $0x20, %rsi
movl 0x120(%rsp), %eax
cmpl $0x1, %eax
setne %cl
testl %eax, %eax
setne %dl
movq 0xe0(%rsp), %rax
movq 0x18(%rax), %r13
movq 0x48(%rsp), %rax
movl (%rdi,%rax,8), %eax
movq (%r13,%rax,8), %r13
movq %r13, 0x38(%rsp)
shrq $0x20, %r13
movq %r10, 0x40(%rsp)
movq %rsi, 0x58(%rsp)
cmpl %esi, %r10d
sete %sil
movl %r8d, 0x48(%rsp)
cmpl %r13d, %r8d
sete %dil
xorb %sil, %dil
orb %dil, %cl
notb %dil
orb %dl, %dil
andb %cl, %dil
testb $0x1, %dil
je 0x10c870
cmpq 0x108(%rsp), %rax
setl %cl
cmpq 0x110(%rsp), %rax
setg %al
orb %cl, %al
movq 0x8(%rsp), %rsi
je 0x10c878
movl %ebx, %r15d
jmp 0x10c5fd
movl %ebx, %r15d
movl 0x4(%rsp), %r9d
movq 0x18(%rsp), %r11
jmp 0x10c5e4
movl %ebx, %r15d
jmp 0x10c5e4
movq 0xd8(%rsp), %rax
movl (%rax), %eax
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl %edx, %eax
movl %eax, 0x28(%rsp)
movq 0xe0(%rsp), %rax
movl (%rax), %r10d
andl %edx, %r10d
movq 0x40(%rsp), %r8
movq 0x58(%rsp), %rax
cmpl %eax, %r8d
jne 0x10c8ca
movq 0x50(%rsp), %rdi
shrq $0x20, %rdi
movq 0x20(%r11), %rax
movq 0x78(%rsp), %rcx
movl (%rax,%rcx,8), %eax
andl %edx, %eax
addl %eax, %edi
decl %edi
xorl %r12d, %r12d
jmp 0x10c8e2
xorl %r8d, %eax
cmpl $0x1, %eax
jne 0x10c9b3
movq 0x50(%rsp), %rdi
shrq $0x20, %rdi
movb $0x1, %r12b
subl 0x74(%rsp), %r15d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
movl 0x48(%rsp), %ecx
cmpl %r13d, %ecx
movq 0x80(%rsp), %rax
jne 0x10c915
movq 0x38(%rsp), %rcx
shrq $0x21, %rcx
movl 0x4(%rax,%rcx,8), %eax
addl %r15d, %eax
decl %eax
xorl %ecx, %ecx
jmp 0x10c940
xorl %r13d, %ecx
cmpl $0x1, %ecx
jne 0x10c9dc
movq 0x38(%rsp), %r8
shrq $0x21, %r8
movl 0x4(%rax,%r8,8), %eax
movq 0x20(%r11), %rcx
movl (%rcx,%r8,8), %ecx
andl %edx, %ecx
subl %r15d, %eax
addl %ecx, %eax
movb $0x1, %cl
cmpb %cl, %r12b
jne 0x10c94c
movq 0x20(%rsp), %r12
jmp 0x10c95f
cmpl %r10d, %eax
movq 0x20(%rsp), %r12
jae 0x10c856
notl %eax
addl %r10d, %eax
cmpl %r10d, %eax
movl %eax, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmovael %edx, %ecx
cmpl 0x28(%rsp), %edi
cmovael %edx, %edi
jae 0x10c856
cmpl %r10d, %eax
jae 0x10c856
cmpl $0x0, 0x2c(%rsp)
movl $0x1, 0x2c(%rsp)
je 0x10c99a
cmpl %ebx, %r15d
jbe 0x10c856
movq 0x128(%rsp), %rax
movl %edi, (%rax)
movq 0x130(%rsp), %rax
movl %ecx, (%rax)
jmp 0x10c5fd
movl %r10d, %r12d
callq 0x131e9
movl %r12d, %r10d
movq 0x8(%rsp), %rsi
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq 0x18(%rsp), %r11
movl 0x4(%rsp), %r9d
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
jmp 0x10c8c5
movq %rdi, 0x50(%rsp)
movl %r10d, %r13d
callq 0x1320b
movl %r13d, %r10d
movq 0x50(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x18(%rsp), %r11
movl 0x4(%rsp), %r9d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x10c911
cmpl $0x0, 0x2c(%rsp)
movq 0x90(%rsp), %rsi
movq 0x100(%rsp), %rdi
movq 0x60(%rsp), %r8
jne 0x10ca4f
leaq 0x1(%r8), %rax
cmpq %rdi, %r8
movq %rax, %r8
jne 0x10c46c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq 0x130(%rsp), %rcx
movl %eax, (%rcx)
movq 0x128(%rsp), %rcx
movl %eax, (%rcx)
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq