// File: /workspace/github_cpp_makefile_star2_O1/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 $0x98, %rsp
movq %r9, %r15
movq %rcx, %r11
movq 0x18(%rdi), %rax
movl %esi, %r9d
movq %rdi, 0x50(%rsp)
movl 0x10(%rdi), %ecx
leal -0x1(%rcx), %edi
xorl %esi, %edi
xorl %edx, %ecx
orl %edi, %ecx
jne 0xb43bf
movq 0x50(%rsp), %rcx
movl (%rcx), %edx
notl %edx
sarl $0x1f, %edx
movq %r9, 0x60(%rsp)
movq (%rax,%r9,8), %r13
movq 0x138(%rsp), %rcx
movq %rcx, 0x68(%rsp)
movq 0x130(%rsp), %r12
movl 0x128(%rsp), %ecx
movl %ecx, 0x44(%rsp)
movq 0x120(%rsp), %rcx
movq %rcx, 0x70(%rsp)
movq 0x118(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movq 0x110(%rsp), %rsi
movl 0x108(%rsp), %ecx
movl %ecx, 0x1c(%rsp)
movl 0x100(%rsp), %ecx
movl %ecx, 0x18(%rsp)
movq 0xe8(%rsp), %rcx
movq %rcx, 0x48(%rsp)
movq 0xe0(%rsp), %rcx
movq %rcx, 0x58(%rsp)
cmpl $-0x1, %edx
movq %r8, 0x28(%rsp)
movq %rsi, 0x10(%rsp)
movq %r15, 0x8(%rsp)
je 0xb44c7
movq %r13, %rbx
shrq $0x20, %rbx
movl 0xf8(%rsp), %r10d
movl 0xf0(%rsp), %r9d
movq 0xd8(%rsp), %rcx
movq 0xd0(%rsp), %rsi
movl %edx, %edx
movl 0x4(%rax,%rdx,8), %eax
leaq 0x80(%rsp), %r14
movq %r15, %rdi
movq %r11, %r8
pushq %r14
pushq %rax
pushq %rbx
pushq %r10
callq 0xb3953
addq $0x20, %rsp
movq (%r14), %r15
xorl %r14d, %r14d
testb $0x1, %bl
je 0xb44c0
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rax
movq %r13, %rcx
shrq $0x21, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %r14d
subl %r15d, %r14d
movq %rax, %r15
movq 0x10(%rsp), %rsi
jmp 0xb44d9
movq 0x18(%r8), %rax
movq %r13, %rcx
shrq $0x21, %rcx
movq (%rax,%rcx,8), %r15
xorl %r14d, %r14d
movq %r12, 0x30(%rsp)
decl %r15d
movl %r15d, %eax
subl %r14d, %eax
movq %rax, 0x38(%rsp)
leal 0x1(%rax), %ebx
cmpq %rbx, 0x8(%rsi)
jae 0xb454c
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(%rsi)
movq 0x10(%rsi), %rdi
leaq 0x4(,%rcx,4), %rsi
callq 0x2370
movq 0x10(%rsp), %rsi
movq %rax, 0x10(%rsi)
movq 0x10(%rsi), %rdi
movslq %ebx, %r12
leaq (,%r12,4), %rbp
xorl %esi, %esi
movq %rbp, %rdx
callq 0x20e0
movq 0x20(%rsp), %rdx
cmpq %rbx, 0x8(%rdx)
jae 0xb45c6
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
callq 0x2370
movq 0x20(%rsp), %rdx
movq %rax, 0x10(%rdx)
movq 0x10(%rdx), %rdi
movq $0x0, 0x78(%rsp)
xorl %esi, %esi
movq %rbp, %rdx
callq 0x20e0
movq 0x20(%rsp), %rax
movq %r12, (%rax)
movq 0x10(%rsp), %rax
movq %r12, (%rax)
movl %r14d, 0x4(%rsp)
movslq %r14d, %rsi
shrq $0x21, %r13
movq 0x58(%rsp), %rdi
movq %rsi, %r14
movq %r12, %rdx
xorl %ecx, %ecx
movq 0x28(%rsp), %rbx
movq %rbx, %r8
movq %r13, %r9
callq 0x33a96
movq 0x20(%rsp), %r11
leaq (,%r13,2), %rax
addq %r13, %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,8), %rbp
cmpl $0x0, 0xc(%rbp)
je 0xb4863
shlq $0x2, %r14
negq %r14
movq %r14, 0x8(%rsp)
xorl %r14d, %r14d
movq (%rbp), %rcx
leaq (%r14,%r14,4), %rsi
movl (%rcx,%rsi,8), %edx
movl 0x8(%rcx,%rsi,8), %eax
leal -0x1(%rax), %r8d
cmpl %r8d, 0x4(%rsp)
setg %r9b
cmpl %edx, %r15d
setl %dil
orb %r9b, %dil
jne 0xb4689
movl 0x4(%rsp), %r9d
cmpl %edx, %r9d
movl %edx, %r12d
cmovgl %r9d, %r12d
cmpl %r8d, %r15d
cmovll %r15d, %r8d
movl %r8d, %r13d
testb %dil, %dil
jne 0xb480a
leaq (%rcx,%rsi,8), %rdi
cmpb $0x0, 0x20(%rdi)
je 0xb46e1
movl %r13d, %eax
subl %r12d, %eax
jl 0xb480a
movslq %r12d, %rdx
movq 0x10(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x8(%rsp), %rdi
addq %rdi, %rcx
leaq (%rcx,%rdx,4), %rcx
movq 0x10(%r11), %rsi
addq %rdi, %rsi
leaq (%rsi,%rdx,4), %rdx
incl %eax
xorl %esi, %esi
incl (%rcx,%rsi,4)
incl (%rdx,%rsi,4)
incq %rsi
cmpl %esi, %eax
jne 0xb46cf
jmp 0xb480a
movl 0x10(%rdi), %r8d
movl 0x14(%rdi), %esi
movq 0x18(%rdi), %rcx
testl %ecx, %ecx
js 0xb46f4
decl %esi
jmp 0xb470f
movq 0x18(%rbx), %r9
movl 0xc(%rdi), %r10d
movl (%r9,%r10,8), %r9d
notl %r8d
addl %r9d, %r8d
subl %esi, %r9d
movl %r8d, %esi
movl %r9d, %r8d
movl %r12d, %r10d
subl %edx, %r10d
addl %r8d, %r10d
movq 0x18(%rbx), %rdx
movl 0xc(%rdi), %r9d
movl (%rdx,%r9,8), %edi
leal -0x1(%rdi), %edx
cmpl %edi, %r10d
cmovll %r10d, %edx
movl %r13d, %edi
subl %eax, %edi
leal (%rdi,%rsi), %eax
incl %eax
testl %eax, %eax
movl $0x0, %esi
cmovlel %esi, %eax
subl %edx, %eax
jl 0xb47e4
movl %r13d, %esi
subl %r12d, %esi
cmpl %eax, %esi
jne 0xb47e4
movslq %edx, %rsi
incl %eax
movslq %eax, %rdx
shrl $0x1f, %ecx
movq %rbx, %r8
movq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0x33a96
movq 0x8(%rbx), %rax
movl %r12d, %ecx
movl 0x4(%rsp), %edx
subl %edx, %ecx
movslq %ecx, %rdi
movl %r13d, %ecx
subl %edx, %ecx
movslq %ecx, %rdx
decq %rax
subq %rdi, %rdx
cmpq %rdx, %rax
jne 0xb47b2
movq 0x48(%rsp), %rax
movq (%rax), %rsi
incq %rdx
movq 0x58(%rsp), %rax
addq (%rax), %rdi
callq 0x21a0
testl %eax, %eax
je 0xb481b
movl %r13d, %eax
subl %r12d, %eax
movq 0x20(%rsp), %r11
movq 0x28(%rsp), %rbx
jl 0xb480a
movslq %r12d, %rcx
movq 0x10(%r11), %rdx
addq 0x8(%rsp), %rdx
leaq (%rdx,%rcx,4), %rcx
incl %eax
xorl %edx, %edx
incl (%rcx,%rdx,4)
incq %rdx
cmpl %edx, %eax
jne 0xb47d8
jmp 0xb480a
movl %r13d, %eax
subl %r12d, %eax
jl 0xb480a
movslq %r12d, %rcx
movq 0x10(%r11), %rdx
addq 0x8(%rsp), %rdx
leaq (%rdx,%rcx,4), %rcx
incl %eax
xorl %edx, %edx
incl (%rcx,%rdx,4)
incq %rdx
cmpl %edx, %eax
jne 0xb4800
incq %r14
movl 0xc(%rbp), %eax
cmpq %rax, %r14
jb 0xb4648
jmp 0xb4863
movl %r13d, %eax
subl %r12d, %eax
movq 0x20(%rsp), %r11
movq 0x28(%rsp), %rbx
jl 0xb480a
movslq %r12d, %rdx
movq 0x10(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x8(%rsp), %rdi
addq %rdi, %rcx
leaq (%rcx,%rdx,4), %rcx
movq 0x10(%r11), %rsi
addq %rdi, %rsi
leaq (%rsi,%rdx,4), %rdx
incl %eax
xorl %esi, %esi
incl (%rcx,%rsi,4)
incl (%rdx,%rsi,4)
incq %rsi
cmpl %esi, %eax
jne 0xb4854
jmp 0xb480a
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x60(%rsp), %rcx
movl 0x4(%rax,%rcx,8), %esi
cmpq $0x0, (%r11)
je 0xb4b2e
cmpq $0x0, 0x70(%rsp)
setne %al
cmpq $0x0, 0x30(%rsp)
setne %cl
andb %al, %cl
movb %cl, 0x58(%rsp)
movq %rsi, 0x8(%rsp)
shrl %esi
movq %rsi, 0x48(%rsp)
leal 0x1(%rsi), %eax
movq %rax, 0x60(%rsp)
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
xorl %edi, %edi
xorl %ecx, %ecx
xorl %esi, %esi
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
xorl %r14d, %r14d
movq 0x10(%rsp), %r9
movl 0x1c(%rsp), %r10d
movq 0x10(%r11), %rax
movl (%rax,%rdi,4), %r8d
testl %r8d, %r8d
je 0xb48eb
movq 0x10(%r9), %rax
movl %r8d, %edx
subl (%rax,%rdi,4), %edx
imull $0x64, %edx, %eax
xorl %edx, %edx
divl %r8d
jmp 0xb48f0
movl $0x64, %eax
cmpl %r10d, %eax
jae 0xb492c
cmpl $-0x1, %r13d
je 0xb4955
cmpl $-0x1, %r12d
je 0xb4955
movq 0x38(%rsp), %r15
movl %r15d, %ebx
subl %r13d, %ebx
subl %r12d, %r15d
testb $0x1, 0x8(%rsp)
cmovel %r13d, %r15d
cmovel %r12d, %ebx
testl %ecx, %ecx
je 0xb496a
imull $0x64, %esi, %eax
xorl %edx, %edx
divl %ecx
movl %eax, %r10d
jmp 0xb4970
cmpl $-0x1, %r13d
sete %al
incl %r12d
sete %dl
testb %dl, %al
cmovnel %r14d, %r13d
cmovnel %r14d, %r12d
addl %r8d, %ecx
movq 0x10(%r9), %rax
addl %r8d, %esi
subl (%rax,%rdi,4), %esi
jmp 0xb4b10
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
xorl %esi, %esi
xorl %ecx, %ecx
jmp 0xb4b10
movl $0x64, %r10d
incl %ebx
cmpb $0x0, 0x58(%rsp)
je 0xb4a8d
movq 0x50(%rsp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
leaq 0x173c9d(%rip), %rcx    # 0x22862b
movsbl (%rax,%rcx), %r8d
movl 0x18(%rsp), %eax
addl %eax, %r15d
addl %eax, %ebx
movq 0x30(%rsp), %rdi
leaq 0x175829(%rip), %rsi    # 0x22a1d1
movq 0x70(%rsp), %rdx
movl 0x44(%rsp), %ecx
movl %r15d, %r9d
xorl %eax, %eax
pushq %r10
pushq %rbx
callq 0x22b0
addq $0x10, %rsp
movq 0x28(%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 0x30(%rsp), %rdi
leaq 0x1757f7(%rip), %rsi    # 0x22a1e5
xorl %eax, %eax
callq 0x22b0
cmpl $0x0, 0xc(%rbp)
jle 0xb4a62
movl 0x4(%rsp), %eax
addl %eax, %r13d
addl %eax, %r12d
movl $0xc, %ebx
xorl %r15d, %r15d
movq (%rbp), %rax
cmpl -0xc(%rax,%rbx), %r12d
jl 0xb4a52
movl -0x4(%rax,%rbx), %ecx
decl %ecx
cmpl %ecx, %r13d
jg 0xb4a52
movq 0x28(%rsp), %rsi
movq 0x40(%rsi), %rcx
movl (%rax,%rbx), %eax
leal 0x1(%rax), %edx
movl (%rcx,%rdx,8), %edx
movq (%rcx,%rax,8), %rcx
subl %ecx, %edx
addq 0x8(%rsi), %rcx
movq 0x30(%rsp), %rdi
leaq 0x175799(%rip), %rsi    # 0x22a1e4
xorl %eax, %eax
callq 0x22b0
incq %r15
movslq 0xc(%rbp), %rax
addq $0x28, %rbx
cmpq %rax, %r15
jl 0xb4a0d
movl $0xa, %edi
movq 0x30(%rsp), %rsi
callq 0x2270
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
xorl %esi, %esi
xorl %ecx, %ecx
movq 0x20(%rsp), %r11
movq 0x10(%rsp), %r9
jmp 0xb4b0b
movq 0x68(%rsp), %r12
testq %r12, %r12
je 0xb4afb
movq 0x8(%r12), %rax
cmpq %rax, (%r12)
jne 0xb4ad4
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%r12)
movq 0x10(%r12), %rdi
shlq $0x4, %rsi
callq 0x2370
movq 0x10(%rsp), %r9
movq 0x20(%rsp), %r11
movq %rax, 0x10(%r12)
movq (%r12), %rax
movq 0x10(%r12), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%r12)
shlq $0x4, %rax
movl 0x18(%rsp), %edx
addl %edx, %r15d
movq %r15, (%rcx,%rax)
addl %edx, %ebx
movq %rbx, 0x8(%rcx,%rax)
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
xorl %esi, %esi
xorl %ecx, %ecx
movl 0x1c(%rsp), %r10d
incl %r14d
movq %r14, %rdi
cmpq %r14, (%r11)
ja 0xb48ca
imull $0x64, %esi, %eax
movq %rax, 0x78(%rsp)
movq 0x8(%rsp), %rsi
jmp 0xb4b3c
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
xorl %ecx, %ecx
cmpl $-0x1, %r13d
je 0xb4d0e
cmpl $-0x1, %r12d
je 0xb4d0e
movq 0x38(%rsp), %rax
movl %eax, %r14d
subl %r13d, %r14d
subl %r12d, %eax
testb $0x1, %sil
cmovel %r13d, %eax
movq %rax, 0x38(%rsp)
cmovel %r12d, %r14d
testl %ecx, %ecx
movq 0x70(%rsp), %rdi
je 0xb4b86
movq 0x78(%rsp), %rax
xorl %edx, %edx
divl %ecx
movl %eax, %r10d
jmp 0xb4b8c
movl $0x64, %r10d
incl %r14d
testq %rdi, %rdi
sete %al
movq 0x30(%rsp), %r15
testq %r15, %r15
sete %cl
orb %al, %cl
jne 0xb4caa
movq 0x50(%rsp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
leaq 0x173a72(%rip), %rcx    # 0x22862b
movsbl (%rax,%rcx), %r8d
movl 0x18(%rsp), %eax
movq 0x38(%rsp), %r9
addl %eax, %r9d
addl %eax, %r14d
movq %rsi, %rbx
leaq 0x1755fa(%rip), %rsi    # 0x22a1d1
movq %rdi, %rdx
movq %r15, %rdi
movl 0x44(%rsp), %ecx
xorl %eax, %eax
pushq %r10
pushq %r14
callq 0x22b0
addq $0x10, %rsp
movq 0x28(%rsp), %rsi
movq 0x40(%rsi), %rax
shrl %ebx
movl 0x8(%rax,%rbx,8), %edx
movq (%rax,%rbx,8), %rcx
subl %ecx, %edx
addq 0x8(%rsi), %rcx
leaq 0x1755d5(%rip), %rsi    # 0x22a1e5
movq %r15, %rdi
xorl %eax, %eax
callq 0x22b0
cmpl $0x0, 0xc(%rbp)
jle 0xb4c8a
movl 0x4(%rsp), %eax
addl %eax, %r13d
addl %eax, %r12d
movl $0xc, %ebx
leaq 0x1755ae(%rip), %r15    # 0x22a1e4
xorl %r14d, %r14d
movq (%rbp), %rax
cmpl -0xc(%rax,%rbx), %r12d
jl 0xb4c7a
movl -0x4(%rax,%rbx), %ecx
decl %ecx
cmpl %ecx, %r13d
jg 0xb4c7a
movq 0x28(%rsp), %rsi
movq 0x40(%rsi), %rcx
movl (%rax,%rbx), %eax
leal 0x1(%rax), %edx
movl (%rcx,%rdx,8), %edx
movq (%rcx,%rax,8), %rcx
subl %ecx, %edx
addq 0x8(%rsi), %rcx
movq 0x30(%rsp), %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x22b0
incq %r14
movslq 0xc(%rbp), %rax
addq $0x28, %rbx
cmpq %rax, %r14
jl 0xb4c39
movl $0xa, %edi
movq 0x30(%rsp), %rsi
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2270
cmpq $0x0, 0x68(%rsp)
je 0xb4d0e
movq 0x68(%rsp), %rbx
movq 0x8(%rbx), %rax
cmpq %rax, (%rbx)
jne 0xb4ce5
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %esi
cmovneq %rcx, %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
shlq $0x4, %rsi
callq 0x2370
movq %rax, 0x10(%rbx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rbx)
shlq $0x4, %rax
movl 0x18(%rsp), %edx
movq 0x38(%rsp), %rsi
addl %edx, %esi
movq %rsi, (%rcx,%rax)
addl %edx, %r14d
movq %r14, 0x8(%rcx,%rax)
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq