// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: print_rough_inconsistent_sites(ma_utg_t*, unsigned int, unsigned int, asg_t*, All_reads*, ma_hit_t_alloc*, ma_sub_t*, kvec_asg_arc_t_warp*, UC_Read*, UC_Read*, int, int, unsigned int, unsigned int, kvec_t_u32_warp*, kvec_t_u32_warp*, char const*, int, _IO_FILE*, bed_in*)
void print_rough_inconsistent_sites(ma_utg_t* collection, uint32_t cur_i, uint32_t next_i, 
asg_t* read_g, All_reads *RNF, ma_hit_t_alloc* sources, ma_sub_t *coverage_cut, 
kvec_asg_arc_t_warp* edge, UC_Read* r_read, UC_Read* q_read, int max_hang, int min_ovlp,
uint32_t c_beg, uint32_t rate_thre, kvec_t_u32_warp* exact_count, kvec_t_u32_warp* total_count, 
const char* prefix, int uID, FILE* fp, bed_in* interval)
{
    uint32_t v, w, i, rate;
    int v_beg, v_end, v_sub_beg, v_sub_end, w_beg, w_end, w_sub_beg, w_sub_end, i_beg, i_end, j;
    asg_arc_t t;
    bed_interval* p = NULL;
    v = (uint64_t)(collection->a[cur_i])>>32;
    ///last element
    if(cur_i == collection->n-1 && next_i == collection->n)
    {
        if(!collection->circ)
        {
            next_i = (uint32_t)-1;
        }
        else
        {
            next_i = 0;
        }
    }


    if(next_i != ((uint32_t)-1))
    {
        w = (uint64_t)(collection->a[next_i])>>32;

        get_specific_edge(sources, coverage_cut, NULL, edge, read_g, max_hang, min_ovlp, v, w, &t);
        v_beg = 0; v_end = asg_arc_len(t) - 1; 
        if(v&1)
        {
            v_beg = Get_READ_LENGTH((*RNF), (v>>1)) - v_beg - 1;
            v_end = Get_READ_LENGTH((*RNF), (v>>1)) - v_end - 1;
            w = v_beg; v_beg = v_end; v_end = w;
        }
    }
    else
    {
        v_beg = 0; v_end = Get_READ_LENGTH((*RNF), (v>>1)) - 1;
    }

    kv_resize(uint32_t, exact_count->a, (uint32_t)(v_end - v_beg + 1)); 
    memset(exact_count->a.a, 0, (v_end-v_beg+1)*sizeof(uint32_t));
    kv_resize(uint32_t, total_count->a, (uint32_t)(v_end - v_beg + 1)); 
    memset(total_count->a.a, 0, (v_end-v_beg+1)*sizeof(uint32_t));
    exact_count->a.n = total_count->a.n = (v_end-v_beg+1);
    
    recover_UC_sub_Read(r_read, v_beg, v_end - v_beg + 1, 0, RNF, v>>1);
    ma_hit_t_alloc* x = &(sources[v>>1]);
    ma_hit_t *h = NULL;
    ///[v_beg, v_end] must be the end of read, which means v_beg = 0 or v_end = Get_READ_LENGTH((*RNF), (v>>1)) - 1

    for (i = 0; i < x->length; i++)
    {
        h = &(x->buffer[i]);
        if(inter_interval(v_beg, v_end, Get_qs((*h)), Get_qe((*h)) - 1, 
                                                &v_sub_beg, &v_sub_end) == 0)
        {
            continue;
        }

        if(h->el)
        {
            for (j = v_sub_beg; j <= v_sub_end; j++)
            {
                exact_count->a.a[j-v_beg]++;
                total_count->a.a[j-v_beg]++;
            }            
            continue;
        }

        w_beg = Get_ts((*h)); w_end = Get_te((*h)) - 1;
        if(h->rev)
        {
            w_beg = Get_READ_LENGTH((*RNF), Get_tn((*h))) - w_beg - 1;
            w_end = Get_READ_LENGTH((*RNF), Get_tn((*h))) - w_end - 1;
            w = w_beg; w_beg = w_end; w_end = w;
        }



        w_sub_beg = w_beg + (v_sub_beg - Get_qs((*h)));
        if(w_sub_beg >= (int)(Get_READ_LENGTH((*RNF), Get_tn((*h)))))
        {
            w_sub_beg = Get_READ_LENGTH((*RNF), Get_tn((*h))) - 1;
        }


        w_sub_end = w_end - ((int)(Get_qe((*h))) - 1 - v_sub_end);
        if(w_sub_end < 0) w_sub_end = 0;
        if(w_sub_beg > w_sub_end || (v_sub_end-v_sub_beg) != (w_sub_end-w_sub_beg))
        {
            for (j = v_sub_beg; j <= v_sub_end; j++)
            {
                total_count->a.a[j-v_beg]++;
            }  
            continue;
        } 

        recover_UC_sub_Read(q_read, w_sub_beg, w_sub_end-w_sub_beg +1, h->rev, RNF, Get_tn((*h)));
        if(if_exact_match(r_read->seq, r_read->length, q_read->seq, q_read->length, 
        v_sub_beg-v_beg, v_sub_end-v_beg, 0, q_read->length-1))
        {
            for (j = v_sub_beg; j <= v_sub_end; j++)
            {
                exact_count->a.a[j-v_beg]++;
                total_count->a.a[j-v_beg]++;
            }  
        }
        else
        {
            for (j = v_sub_beg; j <= v_sub_end; j++)
            {
                total_count->a.a[j-v_beg]++;
            } 
        }
    }
    
    i_beg = i_end = -1;
    v = (uint64_t)(collection->a[cur_i])>>32;
    uint32_t inexact = 0, total = 0; 
    for (i = 0; i < total_count->a.n; i++)
    {
        if(total_count->a.a[i] == 0)
        {
            rate = 100;
        }
        else
        {
            rate = ((total_count->a.a[i] - exact_count->a.a[i])*100)/total_count->a.a[i];
        }
         
        if(rate >= rate_thre)   ///inexact rate
        {
            ///start a new interval
            if(i_beg == -1 && i_end == -1)
            {
                i_beg = i_end = i;
            }
            else///extend current interval
            {
                i_end++;
            }
            total = total + total_count->a.a[i];
            inexact = inexact + (total_count->a.a[i] - exact_count->a.a[i]);
        }
        else///end an interval
        {
            if(i_beg != -1 && i_end != -1)
            {
                ///i_beg and i_end are the offsets in comparsion to v_beg
                v_sub_beg = i_beg + v_beg;
                v_sub_end = i_end + v_beg;
                if(v&1)
                {
                    i_beg = (v_end - v_beg + 1) - i_beg - 1;
                    i_end = (v_end - v_beg + 1) - i_end - 1;
                    w = i_beg; i_beg = i_end; i_end = w;
                }
                i_end++;
                rate = (total == 0)? 100 : (inexact*100)/total;

                if(prefix != NULL && fp != NULL)
                {
                    fprintf(fp,"%s%.6d%c\t%u\t%u\t%u\t", prefix, uID, "lc"[collection->circ], 
                    (uint32_t)(i_beg + c_beg), (uint32_t)(i_end + c_beg), rate);
                    fprintf(fp,"%.*s", (int)Get_NAME_LENGTH((*RNF), (v>>1)), Get_NAME((*RNF), (v>>1)));
                    for (j = 0; j < (int)x->length; j++)
                    {
                        h = &(x->buffer[j]);
                        if(inter_interval(v_sub_beg, v_sub_end, Get_qs((*h)), Get_qe((*h)) - 1, 
                                                                &w_sub_beg, &w_sub_end) == 0)
                        {
                            continue;
                        }
                        fprintf(fp,",%.*s", (int)Get_NAME_LENGTH((*RNF), Get_tn((*h))), Get_NAME((*RNF), Get_tn((*h))));
                    }
                    fprintf(fp,"\n");
                }
                else if(interval != NULL)
                {
                    kv_pushp(bed_interval, *interval, &p);
                    p->beg = (uint32_t)(i_beg + c_beg);
                    p->end = (uint32_t)(i_end + c_beg);
                }
                
            }

            i_beg = i_end = -1;
            inexact = total = 0;
        }
    }

    if(i_beg != -1 && i_end != -1)
    {
        ///i_beg and i_end are the offsets in comparsion to v_beg
        v_sub_beg = i_beg + v_beg;
        v_sub_end = i_end + v_beg;
        if(v&1)
        {
            i_beg = (v_end - v_beg + 1) - i_beg - 1;
            i_end = (v_end - v_beg + 1) - i_end - 1;
            w = i_beg; i_beg = i_end; i_end = w;
        }
        i_end++;
        rate = (total == 0)? 100 : (inexact*100)/total;

        if(prefix != NULL && fp != NULL)
        {
            fprintf(fp,"%s%.6d%c\t%u\t%u\t%u\t", prefix, uID, "lc"[collection->circ], 
            (uint32_t)(i_beg + c_beg), (uint32_t)(i_end + c_beg), rate);
            fprintf(fp,"%.*s", (int)Get_NAME_LENGTH((*RNF), (v>>1)), Get_NAME((*RNF), (v>>1)));
            for (j = 0; j < (int)x->length; j++)
            {
                h = &(x->buffer[j]);
                if(inter_interval(v_sub_beg, v_sub_end, Get_qs((*h)), Get_qe((*h)) - 1, 
                                                        &w_sub_beg, &w_sub_end) == 0)
                {
                    continue;
                }
                fprintf(fp,",%.*s", (int)Get_NAME_LENGTH((*RNF), Get_tn((*h))), Get_NAME((*RNF), Get_tn((*h))));
            }
            fprintf(fp,"\n");
        }
        else if(interval != NULL)
        {
            kv_pushp(bed_interval, *interval, &p);
            p->beg = (uint32_t)(i_beg + c_beg);
            p->end = (uint32_t)(i_end + c_beg);
        }
    }
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r9, %r11
movq %r8, 0x20(%rsp)
movq %rcx, %r8
movq %rdi, %rbp
movq 0x148(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x140(%rsp), %r12
movl 0x138(%rsp), %eax
movl %eax, 0x5c(%rsp)
movq 0x130(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x128(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x120(%rsp), %rax
movq %rax, 0x18(%rsp)
movl 0x118(%rsp), %eax
movl %eax, 0x2c(%rsp)
movl 0x10(%rdi), %eax
leal -0x1(%rax), %ecx
xorl %esi, %ecx
xorl %edx, %eax
orl %ecx, %eax
movl 0x110(%rsp), %eax
movl %eax, 0x28(%rsp)
movl 0x108(%rsp), %eax
movl %esi, %r10d
movl 0x100(%rsp), %r9d
movq 0xf8(%rsp), %rcx
movq %rcx, 0x60(%rsp)
movq 0xf0(%rsp), %rcx
movq %rcx, 0x48(%rsp)
movq 0xe8(%rsp), %rcx
movq 0xe0(%rsp), %rsi
movq 0x18(%rdi), %rdi
movq %r10, 0x88(%rsp)
movq (%rdi,%r10,8), %r13
movq %r11, 0x30(%rsp)
movq %r13, 0x10(%rsp)
jne 0xb5497
cmpl $0x0, (%rbp)
jns 0xb54e7
xorl %edx, %edx
jmp 0xb549c
cmpl $-0x1, %edx
je 0xb54e7
movq %r13, %rbx
shrq $0x20, %rbx
movl %edx, %edx
movl 0x4(%rdi,%rdx,8), %edx
leaq 0x90(%rsp), %r14
movq %r11, %rdi
pushq %r14
pushq %rdx
pushq %rbx
pushq %rax
callq 0xb4a8d
addq $0x20, %rsp
movq (%r14), %r15
xorl %ecx, %ecx
testb $0x1, %bl
je 0xb54fa
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
shrq $0x21, %r13
movq (%rax,%r13,8), %rax
movl %eax, %ecx
subl %r15d, %ecx
movq %rax, %r15
jmp 0xb54fa
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
shrq $0x21, %r13
movq (%rax,%r13,8), %r15
xorl %ecx, %ecx
movq 0x18(%rsp), %rdx
movl %ecx, 0xc(%rsp)
decl %r15d
movl %r15d, %eax
subl %ecx, %eax
movq %rax, 0x80(%rsp)
leal 0x1(%rax), %ebx
cmpq %rbx, 0x8(%rdx)
movq %rbp, 0x78(%rsp)
jae 0xb557b
leaq -0x1(%rbx), %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0x8(%rdx)
movq 0x10(%rdx), %rdi
leaq 0x4(,%rcx,4), %rsi
movq %rdx, %r14
callq 0x2370
movq %rax, %rdi
movq %rax, 0x10(%r14)
jmp 0xb557f
movq 0x10(%rdx), %rdi
movq %r12, 0x38(%rsp)
movslq %ebx, %rbp
leaq (,%rbp,4), %r14
xorl %esi, %esi
movq %r14, %rdx
callq 0x20e0
movq 0x50(%rsp), %rdx
cmpq %rbx, 0x8(%rdx)
jae 0xb55fd
decq %rbx
movq %rbx, %rax
shrq %rax
orq %rbx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x10, %rax
orq %rcx, %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rdx)
movq 0x10(%rdx), %rdi
leaq 0x4(,%rax,4), %rsi
movq %rdx, %rbx
callq 0x2370
movq %rax, %rdi
movq %rax, 0x10(%rbx)
jmp 0xb5604
movq 0x10(%rdx), %rdi
movq %rdx, %rbx
xorl %esi, %esi
movq %r14, %rdx
callq 0x20e0
movq %rbp, (%rbx)
movq 0x18(%rsp), %rax
movq %rbp, (%rax)
movl 0xc(%rsp), %r14d
movslq %r14d, %rsi
movq 0x10(%rsp), %r12
shrq $0x21, %r12
movq 0x48(%rsp), %rdi
movq %rsi, 0x10(%rsp)
movq %rbp, %rdx
xorl %ecx, %ecx
movq 0x20(%rsp), %r8
movq %r12, %r9
callq 0x33191
leaq (%r12,%r12,2), %rax
movq 0x30(%rsp), %rcx
leaq (%rcx,%rax,8), %r10
cmpl $0x0, 0xc(%r10)
movq %rbx, %r11
movq %r10, 0x30(%rsp)
je 0xb58bc
movq 0x10(%rsp), %rax
leaq (,%rax,4), %rax
negq %rax
movq %rax, 0x40(%rsp)
xorl %ebp, %ebp
movq (%r10), %rcx
leaq (,%rbp,4), %rdx
addq %rbp, %rdx
movq (%rcx,%rdx,8), %r12
cmpl %r12d, %r15d
jl 0xb5857
movl 0x8(%rcx,%rdx,8), %eax
leal -0x1(%rax), %r13d
cmpl %r13d, %r14d
jg 0xb5857
leaq (%rcx,%rdx,8), %rdi
cmpl %r12d, %r14d
movl %r12d, %ebx
cmovgl %r14d, %ebx
cmpl %r13d, %r15d
cmovll %r15d, %r13d
cmpb $0x0, 0x20(%rdi)
je 0xb5714
subl %ebx, %r13d
jl 0xb5857
movslq %r12d, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
cmovgq %rax, %rcx
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x40(%rsp), %rsi
addq %rsi, %rax
leaq (%rax,%rcx,4), %rax
movq 0x10(%r11), %rdx
addq %rsi, %rdx
leaq (%rdx,%rcx,4), %rcx
incl %r13d
xorl %edx, %edx
incl (%rax,%rdx,4)
incl (%rcx,%rdx,4)
incq %rdx
cmpl %edx, %r13d
jne 0xb5701
jmp 0xb5857
movl 0x10(%rdi), %esi
movl 0x14(%rdi), %edx
movq 0x18(%rdi), %rcx
movq 0x20(%rsp), %r8
movq 0x18(%r8), %r8
testl %ecx, %ecx
js 0xb5737
decl %edx
movl 0xc(%rdi), %r9d
movl (%r8,%r9,8), %edi
jmp 0xb574e
movl 0xc(%rdi), %r9d
movl (%r8,%r9,8), %edi
notl %esi
movl %esi, %r8d
addl %edi, %r8d
movl %edi, %esi
subl %edx, %esi
movl %r8d, %edx
movl %ebx, %r8d
subl %r12d, %r8d
addl %esi, %r8d
leal -0x1(%rdi), %esi
cmpl %edi, %r8d
cmovll %r8d, %esi
movl %r13d, %edi
subl %eax, %edi
leal (%rdi,%rdx), %eax
incl %eax
testl %eax, %eax
movl $0x0, %edx
cmovlel %edx, %eax
subl %esi, %eax
jl 0xb5826
movl %r13d, %edx
subl %ebx, %edx
cmpl %eax, %edx
jne 0xb5826
movslq %esi, %rsi
incl %edx
movslq %edx, %rdx
shrl $0x1f, %ecx
movq 0x60(%rsp), %r14
movq %r14, %rdi
movq 0x20(%rsp), %r8
callq 0x33191
movq 0x8(%r14), %rdx
movl 0xc(%rsp), %r14d
movl %ebx, %eax
subl %r14d, %eax
movslq %eax, %rdi
movl %r13d, %eax
subl %r14d, %eax
cltq
leaq -0x1(%rdx), %rcx
subq %rdi, %rax
cmpq %rax, %rcx
jne 0xb57e9
movq 0x60(%rsp), %rax
movq (%rax), %rsi
movq 0x48(%rsp), %rax
addq (%rax), %rdi
callq 0x21a0
testl %eax, %eax
je 0xb5869
subl %ebx, %r13d
movq 0x50(%rsp), %r11
movq 0x30(%rsp), %r10
jl 0xb5857
movslq %r12d, %rax
movq 0x10(%rsp), %rcx
cmpq %rax, %rcx
cmovgq %rcx, %rax
movq 0x10(%r11), %rcx
addq 0x40(%rsp), %rcx
leaq (%rcx,%rax,4), %rax
incl %r13d
xorl %ecx, %ecx
incl (%rax,%rcx,4)
incq %rcx
cmpl %ecx, %r13d
jne 0xb5819
jmp 0xb5857
subl %ebx, %r13d
jl 0xb5857
movslq %r12d, %rax
movq 0x10(%rsp), %rcx
cmpq %rax, %rcx
cmovgq %rcx, %rax
movq 0x10(%r11), %rcx
addq 0x40(%rsp), %rcx
leaq (%rcx,%rax,4), %rax
incl %r13d
xorl %ecx, %ecx
incl (%rax,%rcx,4)
incq %rcx
cmpl %ecx, %r13d
jne 0xb584c
incq %rbp
movl 0xc(%r10), %eax
cmpq %rax, %rbp
jb 0xb567d
jmp 0xb58bc
subl %ebx, %r13d
movq 0x50(%rsp), %r11
movq 0x30(%rsp), %r10
jl 0xb5857
movslq %r12d, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
cmovgq %rax, %rcx
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x40(%rsp), %rsi
addq %rsi, %rax
leaq (%rax,%rcx,4), %rax
movq 0x10(%r11), %rdx
addq %rsi, %rdx
leaq (%rdx,%rcx,4), %rcx
incl %r13d
xorl %edx, %edx
incl (%rax,%rdx,4)
incl (%rcx,%rdx,4)
incq %rdx
cmpl %edx, %r13d
jne 0xb58ac
jmp 0xb5857
cmpq $0x0, (%r11)
je 0xb5d49
movq 0x78(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x88(%rsp), %rcx
movl 0x4(%rax,%rcx,8), %ecx
cmpq $0x0, 0x68(%rsp)
setne %al
cmpq $0x0, 0x38(%rsp)
setne %dl
andb %al, %dl
movb %dl, 0x40(%rsp)
movl %ecx, 0x10(%rsp)
shrl %ecx
movq %rcx, 0x48(%rsp)
leal 0x1(%rcx), %eax
movq %rax, 0x60(%rsp)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %edi, %edi
xorl %ecx, %ecx
xorl %esi, %esi
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
xorl %r12d, %r12d
movq 0x18(%rsp), %r9
movl 0x2c(%rsp), %r10d
movq 0x10(%r11), %rax
movl (%rax,%rdi,4), %r8d
testl %r8d, %r8d
je 0xb5945
movq 0x10(%r9), %rax
movl %r8d, %edx
subl (%rax,%rdi,4), %edx
imull $0x64, %edx, %eax
xorl %edx, %edx
divl %r8d
jmp 0xb594a
movl $0x64, %eax
cmpl %r10d, %eax
jae 0xb5987
cmpl $-0x1, %r13d
je 0xb59af
cmpl $-0x1, %ebp
je 0xb59af
movq 0x80(%rsp), %r15
movl %r15d, %ebx
subl %r13d, %ebx
subl %ebp, %r15d
testb $0x1, 0x10(%rsp)
cmovel %r13d, %r15d
cmovel %ebp, %ebx
testl %ecx, %ecx
je 0xb59c3
imull $0x64, %esi, %eax
xorl %edx, %edx
divl %ecx
movl %eax, %r10d
jmp 0xb59c9
cmpl $-0x1, %r13d
sete %al
incl %ebp
sete %dl
testb %dl, %al
cmovnel %r12d, %r13d
cmovnel %r12d, %ebp
addl %r8d, %ecx
movq 0x10(%r9), %rax
addl %r8d, %esi
subl (%rax,%rdi,4), %esi
jmp 0xb5b70
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %esi, %esi
xorl %ecx, %ecx
jmp 0xb5b70
movl $0x64, %r10d
incl %ebx
cmpb $0x0, 0x40(%rsp)
je 0xb5af2
movq 0x78(%rsp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
leaq 0x17ed54(%rip), %rcx    # 0x23473b
movsbl (%rax,%rcx), %r8d
movl 0x28(%rsp), %eax
addl %eax, %r15d
addl %eax, %ebx
movq 0x38(%rsp), %r14
movq %r14, %rdi
leaq 0x1809bd(%rip), %rsi    # 0x2363c1
movq 0x68(%rsp), %rdx
movl 0x5c(%rsp), %ecx
movl %r15d, %r9d
xorl %eax, %eax
pushq %r10
pushq %rbx
callq 0x22b0
addq $0x10, %rsp
movq 0x20(%rsp), %rsi
movq 0x40(%rsi), %rax
movq 0x60(%rsp), %rcx
movl (%rax,%rcx,8), %edx
movq 0x48(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
subl %ecx, %edx
addq 0x8(%rsi), %rcx
movq %r14, %rdi
leaq 0x18098d(%rip), %rsi    # 0x2363d5
xorl %eax, %eax
callq 0x22b0
movq 0x30(%rsp), %rsi
movl 0xc(%rsi), %eax
testl %eax, %eax
movl 0xc(%rsp), %r14d
jle 0xb5ac8
addl %r14d, %r13d
addl %r14d, %ebp
movl $0xc, %ebx
xorl %r15d, %r15d
movq (%rsi), %rcx
cmpl -0xc(%rcx,%rbx), %ebp
jl 0xb5ab9
movl -0x4(%rcx,%rbx), %edx
decl %edx
cmpl %edx, %r13d
jg 0xb5ab9
movq 0x20(%rsp), %rsi
movq 0x40(%rsi), %rax
movl (%rcx,%rbx), %ecx
leal 0x1(%rcx), %edx
movl (%rax,%rdx,8), %edx
movq (%rax,%rcx,8), %rcx
subl %ecx, %edx
addq 0x8(%rsi), %rcx
movq 0x38(%rsp), %rdi
leaq 0x18092a(%rip), %rsi    # 0x2363d4
xorl %eax, %eax
callq 0x22b0
movq 0x30(%rsp), %rsi
movl 0xc(%rsi), %eax
incq %r15
movslq %eax, %rcx
addq $0x28, %rbx
cmpq %rcx, %r15
jl 0xb5a6e
movl $0xa, %edi
movq 0x38(%rsp), %rsi
callq 0x2270
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %esi, %esi
xorl %ecx, %ecx
movq 0x50(%rsp), %r11
movq 0x18(%rsp), %r9
jmp 0xb5b6b
movq 0x70(%rsp), %r14
testq %r14, %r14
je 0xb5b57
movq (%r14), %rcx
movq 0x10(%r14), %rax
cmpq 0x8(%r14), %rcx
jne 0xb5b3a
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r14)
shlq $0x4, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x18(%rsp), %r9
movq 0x50(%rsp), %r11
movq %rax, 0x10(%r14)
movq (%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%r14)
shlq $0x4, %rcx
movl 0x28(%rsp), %edx
addl %edx, %r15d
movq %r15, (%rax,%rcx)
addl %edx, %ebx
movq %rbx, 0x8(%rax,%rcx)
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %esi, %esi
xorl %ecx, %ecx
movl 0xc(%rsp), %r14d
movl 0x2c(%rsp), %r10d
incl %r12d
movq %r12, %rdi
cmpq %r12, (%r11)
ja 0xb5924
cmpl $-0x1, %r13d
je 0xb5d49
cmpl $-0x1, %ebp
je 0xb5d49
movq 0x80(%rsp), %rax
movl %eax, %ebx
subl %r13d, %ebx
subl %ebp, %eax
testb $0x1, 0x10(%rsp)
cmovel %r13d, %eax
movq %rax, %r12
cmovel %ebp, %ebx
testl %ecx, %ecx
je 0xb5bc0
imull $0x64, %esi, %eax
xorl %edx, %edx
divl %ecx
movl %eax, %r10d
jmp 0xb5bc6
movl $0x64, %r10d
movq 0x38(%rsp), %r15
movq 0x68(%rsp), %rdx
incl %ebx
testq %rdx, %rdx
sete %al
testq %r15, %r15
sete %cl
orb %al, %cl
jne 0xb5ce8
movq 0x78(%rsp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
leaq 0x17eb44(%rip), %rcx    # 0x23473b
movsbl (%rax,%rcx), %r8d
movl 0x28(%rsp), %eax
movq %r12, %r9
addl %eax, %r9d
addl %eax, %ebx
leaq 0x1807b2(%rip), %rsi    # 0x2363c1
movq %r15, %rdi
movl 0x5c(%rsp), %ecx
xorl %eax, %eax
pushq %r10
pushq %rbx
callq 0x22b0
addq $0x10, %rsp
movq 0x20(%rsp), %rsi
movq 0x40(%rsi), %rax
movq 0x48(%rsp), %rcx
movl 0x8(%rax,%rcx,8), %edx
movq (%rax,%rcx,8), %rcx
subl %ecx, %edx
addq 0x8(%rsi), %rcx
leaq 0x18078e(%rip), %rsi    # 0x2363d5
movq %r15, %rdi
xorl %eax, %eax
callq 0x22b0
movq 0x30(%rsp), %rsi
movl 0xc(%rsi), %eax
testl %eax, %eax
jle 0xb5cc8
addl %r14d, %r13d
addl %r14d, %ebp
movl $0xc, %ebx
leaq 0x180765(%rip), %r15    # 0x2363d4
xorl %r12d, %r12d
movq (%rsi), %rcx
cmpl -0xc(%rcx,%rbx), %ebp
jl 0xb5cb9
movl -0x4(%rcx,%rbx), %edx
decl %edx
cmpl %edx, %r13d
jg 0xb5cb9
movq 0x20(%rsp), %rsi
movq 0x40(%rsi), %rax
movl (%rcx,%rbx), %ecx
leal 0x1(%rcx), %edx
movl (%rax,%rdx,8), %edx
movq (%rax,%rcx,8), %rcx
subl %ecx, %edx
addq 0x8(%rsi), %rcx
movq 0x38(%rsp), %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x22b0
movq 0x30(%rsp), %rsi
movl 0xc(%rsi), %eax
incq %r12
movslq %eax, %rcx
addq $0x28, %rbx
cmpq %rcx, %r12
jl 0xb5c72
movl $0xa, %edi
movq 0x38(%rsp), %rsi
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2270
cmpq $0x0, 0x70(%rsp)
je 0xb5d49
movq 0x70(%rsp), %r14
movq (%r14), %rcx
cmpq 0x8(%r14), %rcx
jne 0xb5d28
leaq (%rcx,%rcx), %rax
testq %rcx, %rcx
movl $0x2, %esi
cmovneq %rax, %rsi
movq %rsi, 0x8(%r14)
movq 0x10(%r14), %rdi
shlq $0x4, %rsi
callq 0x2370
movq %rax, 0x10(%r14)
movq (%r14), %rcx
jmp 0xb5d2c
movq 0x10(%r14), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, (%r14)
shlq $0x4, %rcx
movl 0x28(%rsp), %edx
addl %edx, %r12d
movq %r12, (%rax,%rcx)
addl %edx, %ebx
movq %rbx, 0x8(%rax,%rcx)
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq