LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: Preorder_Merge_Advance_Repeat(unsigned int, haplotype_evdience_alloc*, int)
void Preorder_Merge_Advance_Repeat(uint32_t snpID, haplotype_evdience_alloc* hap, int pathLen) 
{ 
    hap->dp.visit[snpID] = 1;
    hap->dp.buffer[pathLen] = snpID;
    pathLen++;

    if(hap->dp.backtrack_length[snpID] == 0)
    {
        insert_SNP_IDs_addition(&(hap->dp.SNP_IDs), hap->dp.buffer, pathLen);
        return;
    }
    else
    {
        uint32_t* column;
        int j;

        column = Get_DP_Backtrack_Column(hap->dp, snpID);
        for (j = 0; j < (int)hap->dp.backtrack_length[snpID]; j++)
        {
            Preorder_Merge_Advance_Repeat(column[j], hap, pathLen); 
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq 0x258(%rsi), %rax
movl %edi, %r13d
movb $0x1, (%rax,%r13)
movq 0x290(%rsi), %r14
movslq %edx, %r15
movl %edi, (%r14,%r15,4)
incl %r15d
movq 0x278(%rsi), %rax
movl (%rax,%r13,4), %eax
testl %eax, %eax
je 0x503e3
jle 0x504a9
movl %edi, %r12d
imull 0x250(%rbx), %r12d
shlq $0x2, %r12
addq 0x280(%rbx), %r12
xorl %r14d, %r14d
movl (%r12,%r14,4), %edi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x50360
incq %r14
movq 0x278(%rbx), %rax
movslq (%rax,%r13,4), %rax
cmpq %rax, %r14
jl 0x503bc
jmp 0x504a9
movl %edx, %ebp
movq 0x2b0(%rbx), %rax
movq 0x2b8(%rbx), %rdx
cmpq %rax, %rdx
jge 0x50401
movq 0x2c8(%rbx), %rax
jmp 0x5042a
leaq (%rax,%rax), %rcx
movq %rcx, 0x2b0(%rbx)
movq 0x2c8(%rbx), %rdi
imulq $0x38, %rax, %rsi
callq 0x2370
movq %rax, 0x2c8(%rbx)
movq 0x2b8(%rbx), %rdx
movq 0x2d8(%rbx), %rcx
leaq (%rdx,%rdx,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rdx, %rsi
movl %ecx, (%rax,%rsi)
movslq %r15d, %r15
addl %ecx, %ebp
movl %ebp, 0x4(%rax,%rsi)
leaq (%rcx,%r15), %rsi
cmpq 0x2d0(%rbx), %rsi
jle 0x50480
leaq (%rsi,%rsi), %rax
movq %rax, 0x2d0(%rbx)
movq 0x2e0(%rbx), %rdi
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x2e0(%rbx)
movq 0x2d8(%rbx), %rcx
jmp 0x50487
movq 0x2e0(%rbx), %rax
leaq (%rax,%rcx,4), %rdi
leaq (,%r15,4), %rdx
movq %r14, %rsi
callq 0x2160
incq 0x2b8(%rbx)
addq %r15, 0x2d8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: Preorder_Merge_Advance(unsigned int, haplotype_evdience_alloc*, int)
void Preorder_Merge_Advance(uint32_t snpID, haplotype_evdience_alloc* hap, int pathLen) 
{ 
    hap->dp.visit[snpID] = 1;
    hap->dp.buffer[pathLen] = snpID;
    pathLen++;

    if(hap->dp.backtrack_length[snpID] == 0)
    {
        generate_result_vector(hap, pathLen);
        return;
    }
    else
    {
        uint32_t* column;
        int j;

        column = Get_DP_Backtrack_Column(hap->dp, snpID);
        for (j = 0; j < (int)hap->dp.backtrack_length[snpID]; j++)
        {
            Preorder_Merge_Advance(column[j], hap, pathLen); 
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq 0x258(%rsi), %rax
movl %edi, %r12d
movb $0x1, (%rax,%r12)
movq 0x290(%rsi), %rax
movslq %edx, %r15
movl %edi, (%rax,%r15,4)
incl %r15d
movq 0x278(%rsi), %rax
movl (%rax,%r12,4), %eax
testl %eax, %eax
je 0x5076d
jle 0x50763
movl %edi, %r14d
imull 0x250(%rbx), %r14d
shlq $0x2, %r14
addq 0x280(%rbx), %r14
xorl %r13d, %r13d
movl (%r14,%r13,4), %edi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x506eb
incq %r13
movq 0x278(%rbx), %rax
movslq (%rax,%r12,4), %rax
cmpq %rax, %r13
jl 0x50741
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rbx, %rdi
movl %r15d, %esi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x504b8
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: if_snp_vector_useful(haplotype_evdience_alloc*, long long, long long, unsigned int*, long long)
int if_snp_vector_useful(haplotype_evdience_alloc* hap,
long long occ_0, long long occ_1, uint32_t* SNPs, long long SNPsLen)
{

    double occ_1_coverage_low = (occ_0 + occ_1) * 0.3;
    
    if(occ_1 == 0 || occ_0 == 0)
    {
        return 0;
    }

    ///Fix-attention
    if(occ_1 >= occ_1_coverage_low && occ_0 >= occ_1_coverage_low)
    {
        return 1;
    }
    else if(occ_1 >= 5 && occ_0 >= 5)
    {
        return 1;
    }
    else if(occ_1 >= 3 && occ_0 >= 3 && SNPsLen >= 2)
    {
        int nearsnp;
        int non_nearsnps;
        count_nearby_snps(hap, SNPs, SNPsLen, &nearsnp, &non_nearsnps);
        if(non_nearsnps > 0)
        {
            return 1;
        }
    }

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdx, %rdx
sete %al
testq %rsi, %rsi
sete %r9b
xorl %ebx, %ebx
orb %al, %r9b
jne 0x50818
leaq (%rdx,%rsi), %rax
cvtsi2sd %rax, %xmm0
mulsd 0x1e0476(%rip), %xmm0   # 0x230c20
cvtsi2sd %rdx, %xmm1
ucomisd %xmm0, %xmm1
movl $0x1, %ebx
jb 0x507c8
xorps %xmm1, %xmm1
cvtsi2sd %rsi, %xmm1
ucomisd %xmm0, %xmm1
jae 0x50818
cmpq $0x5, %rdx
setge %al
cmpq $0x5, %rsi
setge %r9b
testb %al, %r9b
jne 0x50818
cmpq $0x3, %rdx
setl %al
cmpq $0x3, %rsi
setl %dl
orb %al, %dl
cmpq $0x2, %r8
setl %al
orb %dl, %al
jne 0x50816
leaq 0x4(%rsp), %rax
movq %rsp, %r14
movq %rcx, %rsi
movl %r8d, %edx
movq %rax, %rcx
movq %r14, %r8
callq 0x86bf9
cmpl $0x0, (%r14)
jg 0x50818
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: merge_SNP_Vectors(haplotype_evdience_alloc*, unsigned int*, long long)
void merge_SNP_Vectors(haplotype_evdience_alloc* hap, uint32_t* SNPs, long long SNPLen)
{
    
    int8_t* vector = Get_Result_SNP_Vector((*hap));
    memset(vector, -1, Get_SNP_Vector_Length((*hap)));
    hap->result_stat.occ_0 = 0;
    hap->result_stat.occ_1 = 0;
    hap->result_stat.occ_2 = 0;
    hap->result_stat.score = SNPLen;
    hap->result_stat.homopolymer_num = 0;
    hap->result_stat.non_homopolymer_num = 0;

    long long snpID1;
    long long j = 0;
    int flag, vectorID;
    for (j = 0; j < SNPLen; j++)
    {
        snpID1 = SNPs[j];
        vectorID = hap->snp_stat.a[snpID1].id;
        vector = Get_SNP_Vector((*hap), vectorID);
        if(hap->snp_stat.a[snpID1].is_homopolymer)
        {
            hap->result_stat.homopolymer_num++;
        }
        else
        {
            hap->result_stat.non_homopolymer_num++;
        }

        if((flag = debug_add_to_result_snp_vector(hap, vector, Get_SNP_Vector_Length((*hap))))!= -1)
        {
            fprintf(stderr, "incompatible snp vector....\n");
            exit(0);
        }
    }
    hap->result_stat.overlap_num = hap->result_stat.occ_0 + hap->result_stat.occ_1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x1e0(%rdi), %rdi
movl 0x1c8(%rbx), %edx
movl $0xff, %esi
callq 0x20e0
movl %r14d, 0x208(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x1f4(%rbx)
movl $0x0, 0x204(%rbx)
testq %r14, %r14
jle 0x508c4
xorl %r12d, %r12d
movl (%r15,%r12,4), %eax
movq 0x218(%rbx), %rcx
leaq (%rax,%rax,4), %rax
movl 0x1c8(%rbx), %edx
movl (%rcx,%rax,8), %esi
imull %edx, %esi
addq 0x1d0(%rbx), %rsi
xorl %edi, %edi
cmpb $0x0, 0x24(%rcx,%rax,8)
sete %dil
incl 0x200(%rbx,%rdi,4)
movq %rbx, %rdi
callq 0x4ff29
cmpl $-0x1, %eax
jne 0x508d8
incq %r12
cmpq %r12, %r14
jne 0x5086d
movl 0x1f8(%rbx), %eax
addl 0x1f4(%rbx), %eax
jmp 0x508c6
xorl %eax, %eax
movl %eax, 0x1f0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x5b89
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: remove_reads(haplotype_evdience_alloc*, unsigned int*, long long, overlap_region_alloc*)
void remove_reads(haplotype_evdience_alloc* hap, uint32_t* SNPs, long long SNPsLen, overlap_region_alloc* overlap_list)
{
    long long i, j, snpID, vectorID, overlapLen;
    int8_t *vector;

    for (i = 0; i < SNPsLen; i++)
    {
        snpID = SNPs[i];
        vectorID = hap->snp_stat.a[snpID].id;
        vector = Get_SNP_Vector((*hap), vectorID);
        ///hap->snp_stat[snpID].site;

        for (j = 0; j < Get_SNP_Vector_Length((*hap)); j++)
        {
            
            if(vector[j] == 1 && overlap_list->list[j].is_match == 1)
            {
                //overlap_list->list[j].is_match = 0;
                overlap_list->list[j].is_match = 2;
                overlapLen = overlap_list->list[j].x_pos_e - overlap_list->list[j].x_pos_s + 1;
                ///overlap_list->mapped_overlaps--;
                overlap_list->mapped_overlaps_length -= overlapLen;
            }

            /****************************may have bugs********************************/
            if( hap->snp_stat.a[snpID].site >= overlap_list->list[j].x_pos_s
                &&
                hap->snp_stat.a[snpID].site <= overlap_list->list[j].x_pos_e)
              {
                  overlap_list->list[j].strong = 1;
              }
            /****************************may have bugs********************************/

        }
    }
}

// Assembly:
testq %rdx, %rdx
jle 0x50973
pushq %r15
pushq %r14
pushq %rbx
movq 0x218(%rdi), %rax
movq 0x1d0(%rdi), %r8
movl 0x1c8(%rdi), %edi
xorl %r9d, %r9d
testq %rdi, %rdi
je 0x50966
movl (%rsi,%r9,4), %r10d
leaq (%r10,%r10,4), %r11
movl (%rax,%r11,8), %r10d
imulq %rdi, %r10
addq %r8, %r10
movl 0x20(%rax,%r11,8), %r11d
movq (%rcx), %rbx
addq $0x4, %rbx
xorl %r14d, %r14d
cmpb $0x1, (%r10,%r14)
jne 0x50948
cmpb $0x1, 0x28(%rbx)
jne 0x50948
movb $0x2, 0x28(%rbx)
movl 0x4(%rbx), %r15d
subl (%rbx), %r15d
incl %r15d
subq %r15, 0x18(%rcx)
cmpl (%rbx), %r11d
jb 0x50957
cmpl 0x4(%rbx), %r11d
ja 0x50957
movb $0x1, 0x2a(%rbx)
incq %r14
addq $0xa8, %rbx
cmpq %r14, %rdi
jne 0x50929
incq %r9
cmpq %rdx, %r9
jne 0x50902
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: try_to_remove_reads(signed char*, long long, overlap_region_alloc*, unsigned int*, long long, haplotype_evdience_alloc*)
void try_to_remove_reads(int8_t* vector, long long vectorLen, overlap_region_alloc* overlap_list,
uint32_t* SNPs, long long SNPLen, haplotype_evdience_alloc* hap)
{
    long long i, overlapLen;
    long long removed_num = 0;

    for (i = 0; i < vectorLen; i++)
    {
        if(vector[i] == 1 && overlap_list->list[i].is_match == 1)
        {
            
            ///overlap_list->list[i].is_match = 0;
            overlap_list->list[i].is_match = 2;
            overlapLen = overlap_list->list[i].x_pos_e - overlap_list->list[i].x_pos_s + 1;
            ///overlap_list->mapped_overlaps--;
            overlap_list->mapped_overlaps_length -= overlapLen;
            removed_num++;
        }
    }


    long long snpID, j;
    for (i = 0; i < SNPLen; i++)
    {
        snpID = SNPs[i];
        ///check all overlaps
        for (j = 0; j < Get_SNP_Vector_Length((*hap)); j++)
        {
            /****************************may have bugs********************************/
            if( hap->snp_stat.a[snpID].site >= overlap_list->list[j].x_pos_s
                &&
                hap->snp_stat.a[snpID].site <= overlap_list->list[j].x_pos_e)
              {
                  overlap_list->list[j].strong = 1;
              }
            /****************************may have bugs********************************/
        }
    }
}

// Assembly:
pushq %rbx
testq %rsi, %rsi
jle 0x509b6
movl $0x2c, %eax
xorl %r10d, %r10d
cmpb $0x1, (%rdi,%r10)
jne 0x509a8
movq (%rdx), %r11
cmpb $0x1, (%r11,%rax)
jne 0x509a8
movb $0x2, (%r11,%rax)
movl -0x24(%r11,%rax), %ebx
subl -0x28(%r11,%rax), %ebx
incl %ebx
subq %rbx, 0x18(%rdx)
incq %r10
addq $0xa8, %rax
cmpq %r10, %rsi
jne 0x50982
testq %r8, %r8
jle 0x50a10
movl 0x1c8(%r9), %eax
imulq $0xa8, %rax, %rsi
xorl %edi, %edi
testl %eax, %eax
je 0x50a08
movl (%rcx,%rdi,4), %r10d
movq 0x218(%r9), %r11
leaq (%r10,%r10,4), %r10
movl 0x20(%r11,%r10,8), %r10d
movq (%rdx), %r11
xorl %ebx, %ebx
cmpl 0x4(%r11,%rbx), %r10d
jb 0x509fc
cmpl 0x8(%r11,%rbx), %r10d
ja 0x509fc
movb $0x1, 0x2e(%r11,%rbx)
addq $0xa8, %rbx
cmpq %rbx, %rsi
jne 0x509e8
incq %rdi
cmpq %r8, %rdi
jne 0x509cb
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: process_repeat_snps(haplotype_evdience_alloc*, overlap_region_alloc*)
void process_repeat_snps(haplotype_evdience_alloc* hap, overlap_region_alloc* overlap_list)
{
    int i;
    uint32_t* snp_ids;
    long long length;

    

    for (i = 0; i < hap->dp.SNP_IDs.IDs_length; i++)
    {
        snp_ids = hap->dp.SNP_IDs.buffer + hap->dp.SNP_IDs.IDs[i].beg;
        length = hap->dp.SNP_IDs.IDs[i].end -hap->dp.SNP_IDs.IDs[i].beg + 1;

        merge_SNP_Vectors(hap, snp_ids, length);

        if(if_snp_vector_useful(hap, hap->result_stat.occ_0, hap->result_stat.occ_1, 
        snp_ids, length))
        {
            try_to_remove_reads(Get_Result_SNP_Vector((*hap)), Get_SNP_Vector_Length((*hap)), 
            overlap_list, snp_ids, length, hap);

            hap->dp.SNP_IDs.IDs[i].is_remove = 1;
        }
        else
        {
            hap->dp.SNP_IDs.IDs[i].is_remove = 0;
        }
    }
}

// Assembly:
cmpq $0x0, 0x2b8(%rdi)
jle 0x50adc
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x2c8(%rdi), %rax
xorl %r13d, %r13d
xorl %ebp, %ebp
movl (%rax,%r13), %r12d
movl 0x4(%rax,%r13), %r15d
subl %r12d, %r15d
shlq $0x2, %r12
addq 0x2e0(%r14), %r12
incl %r15d
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x50822
movl 0x1f4(%r14), %esi
movl 0x1f8(%r14), %edx
movq %r14, %rdi
movq %r12, %rcx
movq %r15, %r8
callq 0x50781
movl $0x0, %ecx
testl %eax, %eax
je 0x50aae
movq 0x1e0(%r14), %rdi
movl 0x1c8(%r14), %esi
movq %rbx, %rdx
movq %r12, %rcx
movq %r15, %r8
movq %r14, %r9
callq 0x50974
movl $0x1, %ecx
movq 0x2c8(%r14), %rax
movl %ecx, 0x18(%rax,%r13)
incq %rbp
addq $0x1c, %r13
cmpq %rbp, 0x2b8(%r14)
jg 0x50a3d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: debug_print_snp_stat(char*, haplotype_evdience_alloc*, overlap_region_alloc*, All_reads*)
int debug_print_snp_stat(char* name, haplotype_evdience_alloc* hap, overlap_region_alloc* overlap_list, All_reads* R_INF)
{
    if(overlap_list->length > 0 &&
       memcmp(name, Get_NAME((*R_INF), overlap_list->list[0].x_id), 
       Get_NAME_LENGTH((*R_INF), overlap_list->list[0].x_id)) == 0)
    {
        fprintf(stderr, "\n%s, available_snp: %d\n", name, (int)hap->snp_stat.n);
        int i;
        for (i = 0; i < (int)hap->snp_stat.n; i++)
        {
            fprintf(stderr, "site: %d, occ_0: %d, occ_1: %d, occ_2: %d\n", 
            hap->snp_stat.a[i].site, hap->snp_stat.a[i].occ_0,
            hap->snp_stat.a[i].occ_1, hap->snp_stat.a[i].occ_2);
        }
    }

    return 1;  
}

// Assembly:
cmpq $0x0, 0x10(%rdx)
je 0x50e0b
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x40(%rcx), %rax
movq (%rdx), %rdx
movl (%rdx), %edx
movq (%rax,%rdx,8), %rdi
movq 0x8(%rcx), %rsi
addq %rdi, %rsi
leal 0x1(%rdx), %ecx
movq (%rax,%rcx,8), %rdx
subq %rdi, %rdx
movq %rbx, %rdi
callq 0x21a0
testl %eax, %eax
je 0x50e11
addq $0x8, %rsp
popq %rbx
popq %r14
movl $0x1, %eax
retq
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5bad
jmp 0x50e04
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: is_hpc_vec(SnpStats*, unsigned long, haplotype_evdience*)
int64_t is_hpc_vec(SnpStats *ai, uint64_t id, haplotype_evdience *za)
{
    haplotype_evdience *iz = NULL; int64_t in, ik, n0 = ai->occ_0, n1 = ai->occ_1, f = 0; 
    iz = za + ai->non_homopolymer_num; in = ai->homopolymer_num - ai->non_homopolymer_num;

    for (ik = 0; ik < in; ik++) {
        if(!hh_hp(iz[ik])) continue;
        if(hh_tp(iz[ik]) == 0) {
            ai->occ_0 -= iz[ik].cov;
        } else if(iz[ik].overlapSite == id){
            ai->occ_1 -= iz[ik].cov;
        }
    }
    if((ai->occ_0 < 2 || ai->occ_1 < 2) || (!(ai->occ_0 >= asm_opt.s_hap_cov && ai->occ_1 >= asm_opt.infor_cov))) f = 1;
    ai->occ_0 = n0; ai->occ_1 = n1;
    // if((sec_check) && (((n0)<=((n0+n1)*0.333333)) || ((n1)<=((n0+n1)*0.333333)))) f = 1;
    return f;
}

// Assembly:
pushq %rbx
movl 0x8(%rdi), %ecx
movl 0xc(%rdi), %r8d
movl 0x18(%rdi), %r11d
movl 0x14(%rdi), %r10d
movl %r8d, %eax
movl %ecx, %r9d
cmpl %r11d, %r10d
je 0x5384c
subl %r11d, %r10d
cmpl $0x1, %r10d
adcl $0x0, %r10d
shlq $0x3, %r10
leaq (%r10,%r10,2), %r10
leaq (%r11,%r11,2), %rax
leaq (%rdx,%rax,8), %rdx
addq $0x10, %rdx
xorl %r11d, %r11d
movl %ecx, %r9d
movl %r8d, %eax
movzbl -0x4(%rdx,%r11), %ebx
testb $0x2, %bl
je 0x53843
testb $0x1, %bl
jne 0x53832
subl (%rdx,%r11), %r9d
movl %r9d, 0x8(%rdi)
jmp 0x53843
movl -0x8(%rdx,%r11), %ebx
cmpq %rsi, %rbx
jne 0x53843
subl (%rdx,%r11), %eax
movl %eax, 0xc(%rdi)
addq $0x18, %r11
cmpq %r11, %r10
jne 0x53818
cmpl $0x2, %r9d
jae 0x53859
movl $0x1, %eax
jmp 0x5387e
cmpl $0x2, %eax
jb 0x53852
movl %r9d, %esi
leaq 0x241ef0(%rip), %rdx    # 0x295758
cmpq %rsi, 0x218(%rdx)
jg 0x53852
movl %eax, %eax
cmpq %rax, 0x210(%rdx)
jg 0x53852
xorl %eax, %eax
movl %ecx, 0x8(%rdi)
movl %r8d, 0xc(%rdi)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: get_hq_value(SnpStats*, unsigned long, haplotype_evdience*, long*, long*, long*, long*, unsigned char*)
void get_hq_value(SnpStats *ai, uint64_t id, haplotype_evdience *za, int64_t *lq0, int64_t *hq0, int64_t *lq1, int64_t *hq1, uint8_t *ref_a)
{
    haplotype_evdience *z; int64_t n, k, occ0[2], occ1[2]; uint8_t fi;
    z = za + ai->non_homopolymer_num; n = ai->homopolymer_num - ai->non_homopolymer_num;
    occ0[0] = occ0[1] = occ1[0] = occ1[1] = 0;
    for (k = 0; k < n; k++) {
        if((hh_tp(z[k]) == 1) && (z[k].overlapSite != id)) continue;
        fi = 0;
        if((hh_bq(z[k]) > 1)) fi = 1;

        if(hh_tp(z[k]) == 0) occ0[fi]++;
        else occ1[fi]++;
    }
    if(ref_a) {
        if(ref_a[ai->site] > 1) occ0[1]++;
        else occ0[0]++;
    }
    (*lq0) = occ0[0]; (*hq0) = occ0[1]; 
    (*lq1) = occ1[0]; (*hq1) = occ1[1]; 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x40(%rsp), %rax
movl 0x14(%rdi), %r11d
movl 0x18(%rdi), %r10d
cmpl %r10d, %r11d
jne 0x538b0
xorl %r11d, %r11d
xorl %ebx, %ebx
xorl %r10d, %r10d
xorl %edx, %edx
jmp 0x5392f
subl %r10d, %r11d
cmpl $0x1, %r11d
adcl $0x0, %r11d
shlq $0x3, %r11
leaq (%r11,%r11,2), %r14
leaq (%r10,%r10,2), %r10
leaq (%rdx,%r10,8), %r15
addq $0xc, %r15
xorl %r12d, %r12d
xorl %edx, %edx
xorl %r10d, %r10d
xorl %ebx, %ebx
xorl %r11d, %r11d
movb (%r15,%r12), %bpl
testb $0x1, %bpl
jne 0x53902
testb $0x8, %bpl
movq %rbx, %r13
cmoveq %r11, %r13
incq %r13
testb $0x8, %bpl
cmoveq %r13, %r11
cmovneq %r13, %rbx
jmp 0x53926
movl -0x4(%r15,%r12), %r13d
cmpq %rsi, %r13
jne 0x53926
testb $0x8, %bpl
movq %rdx, %r13
cmoveq %r10, %r13
incq %r13
testb $0x8, %bpl
cmoveq %r13, %r10
cmovneq %r13, %rdx
addq $0x18, %r12
cmpq %r12, %r14
jne 0x538dc
movq 0x38(%rsp), %rsi
testq %rax, %rax
je 0x5394a
movl 0x20(%rdi), %edi
cmpb $0x2, (%rax,%rdi)
jb 0x53947
incq %rbx
jmp 0x5394a
incq %r11
movq %r11, (%rcx)
movq %rbx, (%r8)
movq %r10, (%r9)
movq %rdx, (%rsi)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: debug_phasing_snp_site_status(haplotype_evdience_alloc*, haplotype_evdience*, unsigned long, overlap_region_alloc*)
void debug_phasing_snp_site_status(haplotype_evdience_alloc* h, haplotype_evdience* a, uint64_t a_n, overlap_region_alloc* olist)
{
    uint64_t i;
    for (i = 0; i < a_n; i++) {
        if(a[i].site == 76046) {
            fprintf(stderr, "[M::utg%.6dl::]x_site->%u, y_site->%u, type->%u, cov->%u, misBase->%c\n", 
            (int)olist->list[a[i].overlapID].y_id+1, a[i].site, 
            a[i].overlapSite, a[i].type, a[i].cov, a[i].misBase);
        }
    }
}

// Assembly:
testq %rdx, %rdx
je 0x578f4
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
cmpl $0x1290e, (%r15)        # imm = 0x1290E
je 0x578e2
addq $0x18, %r15
decq %r14
jne 0x578ce
jmp 0x578ef
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5d00
jmp 0x578d7
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: ovlp_occ(overlap_region_alloc*, unsigned char)
uint64_t ovlp_occ(overlap_region_alloc* overlap_list, uint8_t is_match)
{
    uint64_t occ = 0, k;
    for (k = 0; k < overlap_list->length; k++) {
        if(overlap_list->list[k].is_match == is_match) occ++;
    }
    return occ;
}

// Assembly:
movq 0x10(%rdi), %rcx
testq %rcx, %rcx
je 0x582c3
movq (%rdi), %rdx
addq $0x2c, %rdx
xorl %eax, %eax
xorl %edi, %edi
cmpb %sil, (%rdx)
sete %dil
addq %rdi, %rax
addq $0xa8, %rdx
decq %rcx
jne 0x582aa
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: clear_Correct_dumy(Correct_dumy*, overlap_region_alloc*, void*)
void clear_Correct_dumy(Correct_dumy* list, overlap_region_alloc* overlap_list, void *km)
{
    list->length = 0;
    list->lengthNT = 0;
    list->start_i = 0;

    if (list->size < overlap_list->length){
        list->size = overlap_list->length;
        if(!km) REALLOC(list->overlapID, list->size);
        else KREALLOC(km, list->overlapID, list->size);
    }

    list->last_boundary_length = 0;
    list->corrected_read_length = 0;
    list->corrected_base = 0;
    
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq $0x0, 0x48(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rdi)
movq 0x10(%rsi), %rax
cmpq %rax, 0x40(%rdi)
jae 0x585e2
movq %rax, 0x40(%rbx)
shlq $0x3, %rax
movq 0x28(%rbx), %rsi
testq %rdx, %rdx
je 0x585d0
movq %rdx, %rdi
movq %rax, %rdx
callq 0x1ee21d
jmp 0x585db
movq %rsi, %rdi
movq %rax, %rsi
callq 0x2370
movq %rax, 0x28(%rbx)
xorps %xmm0, %xmm0
movq $0x0, 0x20(%rbx)
movups %xmm0, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: print_ovlp_occ_stat(overlap_region_alloc*, unsigned int, unsigned char)
void print_ovlp_occ_stat(overlap_region_alloc* overlap_list, uint32_t xlen, uint8_t is_match)
{
    uint64_t k;
    for (k = 0; k < overlap_list->length; k++) {
        if(overlap_list->list[k].is_match != is_match) continue;
        fprintf(stderr, "[M::%s::xlen::%u] utg%.6dl(%c), is_match::%u, x::[%u, %u)\n", __func__, xlen,
            (int32_t)overlap_list->list[k].y_id + 1, 
            "+-"[overlap_list->list[k].y_pos_strand], overlap_list->list[k].is_match,
            overlap_list->list[k].x_pos_s, overlap_list->list[k].x_pos_e+1);
    }
}

// Assembly:
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x5869f
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movzbl %bl, %r13d
movl $0x4, %r15d
xorl %r12d, %r12d
movq (%r14), %rcx
cmpb %bl, 0x28(%rcx,%r15)
je 0x58637
incq %r12
addq $0xa8, %r15
cmpq %rax, %r12
jb 0x5861c
jmp 0x58691
movq 0x23c9a2(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
movl 0xc(%rcx,%r15), %r8d
incl %r8d
movl 0x18(%rcx,%r15), %eax
leaq 0x1d9c7e(%rip), %rdx    # 0x2322d3
movsbl (%rax,%rdx), %r9d
movl (%rcx,%r15), %r10d
movl 0x4(%rcx,%r15), %r11d
incl %r11d
subq $0x8, %rsp
leaq 0x1d9c13(%rip), %rsi    # 0x232284
leaq 0x1d9c47(%rip), %rdx    # 0x2322bf
movl %ebp, %ecx
xorl %eax, %eax
pushq %r11
pushq %r10
pushq %r13
callq 0x22b0
addq $0x20, %rsp
movq 0x10(%r14), %rax
jmp 0x58626
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: resize_Cigar_record_alloc(Cigar_record_alloc*, long long)
void resize_Cigar_record_alloc(Cigar_record_alloc* x, long long new_size)
{
    long long i;
    if(new_size > x->size)
    {
        x->buffer = (Cigar_record*)realloc(x->buffer, new_size*sizeof(Cigar_record));
        for (i = 0; i < x->size; i++)
        {
            clear_Cigar_record(&(x->buffer[i]));
        }
        for (; i < new_size; i++)
        {
            init_Cigar_record(&(x->buffer[i]));
            clear_Cigar_record(&(x->buffer[i]));
        }

        x->size = new_size;
    }
    else
    {
        for (i = 0; i < new_size; i++)
        {
            clear_Cigar_record(&(x->buffer[i]));
        }
    }

    x->length = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
cmpq %rsi, 0x8(%rdi)
jge 0x58a2c
movq 0x10(%rbx), %rdi
movq %r14, %rsi
shlq $0x6, %rsi
callq 0x2370
movq %rax, %rdi
movq %rax, 0x10(%rbx)
movq 0x8(%rbx), %r15
xorl %eax, %eax
testq %r15, %r15
jle 0x58a53
movq %rdi, %rcx
movq %r15, %rdx
movl %eax, 0x20(%rcx)
movq %rax, 0x18(%rcx)
movq %rax, 0x38(%rcx)
movl %eax, 0x4(%rcx)
movb $0x7f, (%rcx)
addq $0x40, %rcx
decq %rdx
jne 0x58a10
jmp 0x58a56
testq %r14, %r14
jle 0x58a97
movq 0x10(%rbx), %rax
xorl %ecx, %ecx
movl %ecx, 0x20(%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x38(%rax)
movl %ecx, 0x4(%rax)
movb $0x7f, (%rax)
addq $0x40, %rax
decq %r14
jne 0x58a37
jmp 0x58a97
xorl %r15d, %r15d
movq %r14, %r12
subq %r15, %r12
jle 0x58a93
shlq $0x6, %r15
xorl %r13d, %r13d
addq %r15, %rdi
callq 0x476d0
movq 0x10(%rbx), %rdi
movl %r13d, 0x20(%rdi,%r15)
movq %r13, 0x18(%rdi,%r15)
movq %r13, 0x38(%rdi,%r15)
movl %r13d, 0x4(%rdi,%r15)
movb $0x7f, (%rdi,%r15)
addq $0x40, %r15
decq %r12
jne 0x58a65
movq %r14, 0x8(%rbx)
movq $0x0, (%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: destory_Cigar_record_alloc(Cigar_record_alloc*)
void destory_Cigar_record_alloc(Cigar_record_alloc* x)
{
    long long i;
    for (i = 0; i < x->size; i++)
    {
        destory_Cigar_record(&(x->buffer[i]));
    }
    free(x->buffer);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
jle 0x58ae7
movl $0x28, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %r12
movq -0x20(%r12,%r14), %rdi
callq 0x2220
movq (%r12,%r14), %rdi
callq 0x2220
incq %r15
addq $0x40, %r14
cmpq 0x8(%rbx), %r15
jl 0x58ac3
movq 0x10(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: add_new_cell_to_cigar_record(Cigar_record*, unsigned int, unsigned int)
void add_new_cell_to_cigar_record(Cigar_record* dummy, uint32_t len, uint32_t type)
{
    uint32_t tmp;
    tmp = len;
    tmp = tmp << 2;
    tmp = tmp | type;

    dummy->length++;


    if(dummy->length > dummy->size)
    {
        dummy->size = dummy->size * 2;
        dummy->record = (uint32_t*)realloc(dummy->record, dummy->size*sizeof(uint32_t));
    }

    dummy->record[dummy->length - 1] = tmp;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movq 0x10(%rdi), %rsi
movq 0x18(%rdi), %rcx
incq %rcx
movq %rcx, 0x18(%rdi)
cmpq %rsi, %rcx
jbe 0x58b39
leaq (%rsi,%rsi), %rax
movq %rax, 0x10(%r14)
movq 0x8(%r14), %rdi
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x8(%r14)
movq 0x18(%r14), %rcx
jmp 0x58b3d
movq 0x8(%r14), %rax
shll $0x2, %ebp
orl %ebx, %ebp
movl %ebp, -0x4(%rax,%rcx,4)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: add_new_cell_to_cigar_record_with_different_base(Cigar_record*, unsigned int, unsigned int, char*)
void add_new_cell_to_cigar_record_with_different_base(Cigar_record* dummy, uint32_t len, uint32_t type, char* seq)
{
    uint32_t tmp;
    tmp = len;
    tmp = tmp << 2;
    tmp = tmp | type;
   

    dummy->length++;

    if(dummy->length > dummy->size)
    {
        dummy->size = dummy->size * 2;
        dummy->record = (uint32_t*)realloc(dummy->record, dummy->size*sizeof(uint32_t));
    }

    dummy->record[dummy->length - 1] = tmp;

    

    if (dummy->lost_base_length + len> dummy->lost_base_size)
    {
        dummy->lost_base_size = (dummy->lost_base_length + len) * 2;
        dummy->lost_base = (char*)realloc(dummy->lost_base, dummy->lost_base_size*sizeof(char));
    }

    uint32_t i = 0;
    for (i = 0; i < len; i++, dummy->lost_base_length++)
    {
        dummy->lost_base[dummy->lost_base_length] = seq[i];
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movl %esi, %r15d
movq %rdi, %r14
leal (,%r15,4), %ebp
orl %edx, %ebp
movq 0x10(%rdi), %rsi
movq 0x18(%rdi), %rcx
incq %rcx
movq %rcx, 0x18(%rdi)
cmpq %rsi, %rcx
jbe 0x58bb2
leaq (%rsi,%rsi), %rax
movq %rax, 0x10(%r14)
movq 0x8(%r14), %rdi
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x8(%r14)
movq 0x18(%r14), %rcx
jmp 0x58bb6
movq 0x8(%r14), %rax
movl %ebp, -0x4(%rax,%rcx,4)
movl %r15d, %r12d
movq 0x38(%r14), %rsi
addq %r12, %rsi
cmpq 0x30(%r14), %rsi
jbe 0x58bde
addq %rsi, %rsi
movq %rsi, 0x30(%r14)
movq 0x28(%r14), %rdi
callq 0x2370
movq %rax, 0x28(%r14)
testl %r15d, %r15d
je 0x58c06
movq 0x38(%r14), %rcx
xorl %eax, %eax
movb (%rbx,%rax), %dl
movq 0x28(%r14), %rsi
movb %dl, (%rsi,%rcx)
incq %rax
movq 0x38(%r14), %rcx
incq %rcx
movq %rcx, 0x38(%r14)
cmpq %rax, %r12
jne 0x58be9
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: add_existing_cell_to_cigar_record_with_different_base(Cigar_record*, unsigned int, unsigned int, char*)
void add_existing_cell_to_cigar_record_with_different_base(Cigar_record* dummy, uint32_t len, uint32_t type, char* seq)
{
    uint32_t tmp;

    tmp = dummy->record[dummy->length - 1] >> 2;
    tmp = tmp + len;
    tmp = tmp << 2;
    tmp = tmp | type;
    dummy->record[dummy->length - 1] = tmp;

    if (dummy->lost_base_length + len> dummy->lost_base_size)
    {
        dummy->lost_base_size = (dummy->lost_base_length + len) * 2;
        dummy->lost_base = (char*)realloc(dummy->lost_base, dummy->lost_base_size*sizeof(char));
    }

    uint32_t i = 0;
    for (i = 0; i < len; i++, dummy->lost_base_length++)
    {
        dummy->lost_base[dummy->lost_base_length] = seq[i];
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %esi, %r15d
movq %rdi, %r14
movq 0x8(%rdi), %rax
movq 0x18(%rdi), %rcx
leal (,%r15,4), %esi
addl -0x4(%rax,%rcx,4), %esi
andl $-0x4, %esi
orl %edx, %esi
movl %esi, -0x4(%rax,%rcx,4)
movl %r15d, %r12d
movq 0x38(%rdi), %rsi
addq %r12, %rsi
cmpq 0x30(%rdi), %rsi
jbe 0x58c61
addq %rsi, %rsi
movq %rsi, 0x30(%r14)
movq 0x28(%r14), %rdi
callq 0x2370
movq %rax, 0x28(%r14)
testl %r15d, %r15d
je 0x58c89
movq 0x38(%r14), %rcx
xorl %eax, %eax
movb (%rbx,%rax), %dl
movq 0x28(%r14), %rsi
movb %dl, (%rsi,%rcx)
incq %rax
movq 0x38(%r14), %rcx
incq %rcx
movq %rcx, 0x38(%r14)
cmpq %rax, %r12
jne 0x58c6c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: get_affine_gap_score(overlap_region*, UC_Read*, UC_Read*, unsigned char*, unsigned char*, unsigned long, unsigned long)
long long get_affine_gap_score(overlap_region* ovc, UC_Read* g_read, UC_Read* overlap_read, uint8_t* x_num,
uint8_t* y_num, uint64_t EstimateXOlen, uint64_t EstimateYOlen)
{
    char* x_string;
    char* y_string;
    uint64_t yStrand;
    long long minus_score_thres = (MAX(EstimateXOlen, EstimateYOlen)*HIGH_HET_ERROR_RATE*(MATCH_SCORE_KSW+(MAX(MISMATCH_SCORE_KSW,GAP_EXT_KSW))));
    long long total_score_thres = MAX(EstimateXOlen, EstimateYOlen)*MATCH_SCORE_KSW - minus_score_thres;

    yStrand = ovc->y_pos_strand;

    if(yStrand == 0)
    {
        recover_UC_Read(overlap_read, &R_INF, ovc->y_id);
    }
    else
    {
        recover_UC_Read_RC(overlap_read, &R_INF, ovc->y_id);
    }
    x_string = g_read->seq;
    y_string = overlap_read->seq;

    long long sum = 0;
    
    if(fill_chain_by_affine_gap(&(ovc->f_cigar), x_string, y_string, ovc, Get_READ_LENGTH(R_INF, ovc->x_id), 
    Get_READ_LENGTH(R_INF, ovc->y_id), NULL, seq_nt6_table, x_num, y_num, &minus_score_thres, &sum) == 0)
    {
        return 0;
    }

    if(sum >= total_score_thres) return 1;
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %rdx, %rax
movq 0x20(%rsp), %r14
cmpl $0x0, 0x1c(%rdi)
movl 0x10(%rdi), %edx
leaq 0x23d571(%rip), %rsi    # 0x296230
movq %rax, %rdi
je 0x58ccb
callq 0x334a6
jmp 0x58cd0
callq 0x333e0
cmpq %r14, %rbx
cmovaq %rbx, %r14
movq %r14, %xmm0
punpckldq 0x1d859c(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x1d85a4(%rip), %xmm0   # 0x231290
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x1d8908(%rip), %xmm1   # 0x231608
mulsd 0x1d88a0(%rip), %xmm1   # 0x2315a8
addq %r14, %r14
cvttsd2si %xmm1, %rax
subq %rax, %r14
xorl %eax, %eax
testq %r14, %r14
setle %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: iter_hpc(unsigned char*, long, long*, long, long*, long*, long)
int64_t iter_hpc(uint8_t *m, int64_t mn, int64_t *mo, int64_t rev, int64_t *so, int64_t *ho, int64_t sc)
{
    if(sc == 0) return 0;
    if(sc <= (*so)) return (*ho)-1;
    if(!rev) {
        while((*mo) < mn) {
            for (; (*mo) < mn && m[(*mo)] == 255; (*mo)++) {
                (*so) += m[(*mo)];
            }
            (*so) += m[(*mo)]; (*mo)++; (*ho)++;
            if(sc <= (*so)) return (*ho)-1;
        }        
    } else {
        while((*mo) < mn) {
            (*so) += m[mn-(*mo)-1]; (*mo)++; (*ho)++;
            for (; (*mo) < mn && m[mn-(*mo)-1] == 255; (*mo)++) {
                (*so) += m[mn-(*mo)-1];
            }
            if(sc <= (*so)) return (*ho)-1;
        }
    }

    return -1;
}

// Assembly:
movq 0x8(%rsp), %r10
testq %r10, %r10
je 0x58f86
movq (%r8), %r11
cmpq %r10, %r11
jge 0x58f2f
testq %rcx, %rcx
je 0x58f76
addq %rsi, %rdi
movq (%rdx), %rax
cmpq %rsi, %rax
jge 0x58f7e
notq %rax
movzbl (%rdi,%rax), %eax
addq %rax, %r11
movq %r11, (%r8)
incq (%rdx)
incq (%r9)
movq (%rdx), %rax
cmpq %rsi, %rax
jge 0x58f27
movq %rax, %rcx
notq %rcx
cmpb $-0x1, (%rdi,%rcx)
jne 0x58f27
addq $0xff, (%r8)
movq (%rdx), %rax
incq %rax
movq %rax, (%rdx)
jmp 0x58f04
movq (%r8), %r11
cmpq %r10, %r11
jl 0x58ee5
movq (%r9), %rax
decq %rax
retq
cmpb $-0x1, (%rdi,%rax)
movq (%r8), %rcx
jne 0x58f5a
addq $0xff, %rcx
movq %rcx, (%r8)
movq (%rdx), %rax
incq %rax
movq %rax, (%rdx)
cmpq %rsi, %rax
jl 0x58f36
movq (%r8), %rcx
movzbl (%rdi,%rax), %eax
addq %rcx, %rax
movq %rax, (%r8)
incq (%rdx)
movq (%r9), %rax
leaq 0x1(%rax), %rcx
movq %rcx, (%r9)
cmpq %r10, (%r8)
jge 0x58f88
movq (%rdx), %rax
cmpq %rsi, %rax
jl 0x58f36
movq $-0x1, %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: gen_hpc_str(char const*, unsigned int, UC_Read*, unsigned long*)
uint64_t gen_hpc_str(const char *in, uint32_t in_l, UC_Read *z, uint64_t *in_hl)
{
    uint64_t hl, k, l;
    if(in_hl) {
        hl = (*in_hl);
    } else {
        for (l = hl = 0, k = 1; k <= in_l; k++) {
            if((k == in_l) || (in[k] != in[l]) || (seq_nt4_table[(uint8_t)in[l]] >= 4)) {
                hl++; l = k;
            }
        }
    }
    resize_UC_Read(z, hl); z->length = 0;
    for (l = 0, k = 1; k <= in_l; k++) {
        if((k == in_l) || (in[k] != in[l]) || (seq_nt4_table[(uint8_t)in[l]] >= 4)) {
            z->seq[z->length++] = in[l]; l = k;
        }
    }
    return hl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movl %esi, %r12d
testq %rcx, %rcx
je 0x59640
movq (%rcx), %r15
jmp 0x5968f
testl %ebp, %ebp
je 0x5968c
movq %r12, %rax
negq %rax
movl $0x1, %ecx
xorl %esi, %esi
leaq 0x1e05c8(%rip), %rdx    # 0x239c20
xorl %r15d, %r15d
movq %rax, %rdi
addq %rcx, %rdi
je 0x59674
movzbl (%r14,%rcx), %edi
cmpb (%r14,%rsi), %dil
jne 0x59674
cmpb $0x4, (%rdx,%rdi)
jb 0x5967a
incq %r15
movq %rcx, %rsi
leaq (%rax,%rcx), %rdi
incq %rdi
incq %rcx
cmpq $0x1, %rdi
jne 0x5965b
jmp 0x5968f
xorl %r15d, %r15d
cmpq %r15, 0x10(%rbx)
jge 0x596a7
movq (%rbx), %rdi
movq %r15, %rsi
callq 0x2370
movq %rax, (%rbx)
movq %r15, 0x10(%rbx)
movq $0x0, 0x8(%rbx)
testl %ebp, %ebp
je 0x59711
negq %r12
movl $0x1, %eax
xorl %edx, %edx
leaq 0x1e055c(%rip), %rcx    # 0x239c20
movq %r12, %rsi
addq %rax, %rsi
je 0x596e7
movb (%r14,%rax), %dil
movb (%r14,%rdx), %sil
cmpb %sil, %dil
jne 0x596eb
movzbl %dil, %esi
cmpb $0x4, (%rcx,%rsi)
movl %edi, %esi
jae 0x596eb
jmp 0x59701
movb (%r14,%rdx), %sil
movq (%rbx), %rdx
movq 0x8(%rbx), %rdi
leaq 0x1(%rdi), %r8
movq %r8, 0x8(%rbx)
movb %sil, (%rdx,%rdi)
movq %rax, %rdx
leaq (%r12,%rax), %rsi
incq %rsi
incq %rax
cmpq $0x1, %rsi
jne 0x596c4
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: split_long_anchors(Candidates_list*, long, long)
void split_long_anchors(Candidates_list *ac, int64_t block, int64_t block_n)
{
    int64_t i, m, an = ac->length;
    if(block_n < 0) {
        for (i = block_n = 0; i < an; i++) {
            if(ac->list[i].cnt <= block) block_n++;
            else block_n += (ac->list[i].cnt/block) + (((ac->list[i].cnt%block) > 0)?1:0);
        }
    }
    if(block_n <= an) return;
    if(block_n > ac->size) {
        ac->size = block_n; REALLOC(ac->list, ac->size);
    }
    for (i = an-1, m = block_n-1; i >= 0; i--) {
        if(ac->list[i].cnt <= block) {
            ac->list[m--] = ac->list[i];
        } else {
            while (ac->list[i].cnt > 0) {
                ac->list[m] = ac->list[i];
                if(ac->list[i].cnt >= block) {
                    ac->list[m].cnt = block;
                    ac->list[i].cnt -= block;
                    ac->list[i].self_offset -= block;
                    ac->list[i].offset -= block;
                } else {
                    ac->list[i].cnt = 0; 
                }
                m--;
            }
        }
    }
    ac->length = block_n; assert(m == -1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %r12
testq %rdx, %rdx
jns 0x5d965
testq %r12, %r12
jle 0x5d962
movq (%rbx), %rcx
addq $0xc, %rcx
xorl %r15d, %r15d
movq %r12, %rsi
movl (%rcx), %eax
cmpq %r14, %rax
jle 0x5d954
xorl %edx, %edx
idivq %r14
addq %r15, %rax
cmpq $0x1, %rdx
sbbq $-0x1, %rax
movq %rax, %r15
jmp 0x5d957
incq %r15
addq $0x10, %rcx
decq %rsi
jne 0x5d938
jmp 0x5d965
xorl %r15d, %r15d
cmpq %r12, %r15
jle 0x5da49
cmpq 0x10(%rbx), %r15
jle 0x5d98a
movq %r15, 0x10(%rbx)
movq (%rbx), %rdi
movq %r15, %rsi
shlq $0x4, %rsi
callq 0x2370
movq %rax, (%rbx)
leaq -0x1(%r15), %rax
testq %r12, %r12
jle 0x5da3f
movd %r14d, %xmm0
pshufd $0x50, %xmm0, %xmm0     # xmm0 = xmm0[0,0,1,1]
movq %r12, %rcx
decq %r12
movq (%rbx), %rdx
movq %r12, %rsi
shlq $0x4, %rsi
leaq (%rdx,%rsi), %rdi
movl 0xc(%rdx,%rsi), %r8d
cmpq %r14, %r8
jle 0x5da15
testl %r8d, %r8d
je 0x5da35
movq %rax, %r8
shlq $0x4, %r8
movdqu (%rdi), %xmm1
movdqu %xmm1, (%rdx,%r8)
movq (%rbx), %rdx
leaq (%rdx,%rsi), %r9
addq $0xc, %r9
movl (%r9), %edi
cmpq %r14, %rdi
jl 0x5da2b
movl %r14d, 0xc(%rdx,%r8)
movl (%r9), %r10d
leaq (%rdx,%rsi), %rdi
movq 0x4(%rdx,%rsi), %xmm1
psubd %xmm0, %xmm1
movq %xmm1, 0x4(%rdx,%rsi)
decq %rax
addq $-0x10, %r8
subl %r14d, %r10d
movl %r10d, (%r9)
jne 0x5d9cb
jmp 0x5da35
leaq -0x1(%rax), %rsi
shlq $0x4, %rax
movdqu (%rdi), %xmm1
movdqu %xmm1, (%rdx,%rax)
movq %rsi, %rax
jmp 0x5da35
movl $0x0, (%r9)
decq %rax
cmpq $0x1, %rcx
jg 0x5d9a1
movq %r15, 0x8(%rbx)
cmpq $-0x1, %rax
jne 0x5da55
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1d4b3f(%rip), %rdi    # 0x23259b
leaq 0x1d3cf0(%rip), %rsi    # 0x231753
leaq 0x1d4b39(%rip), %rcx    # 0x2325a3
movl $0x3554, %edx           # imm = 0x3554
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: update_semi_coord(ul_idx_t const*, hpc_t*, All_reads*, overlap_region*, long, long, long, long*, long*, long*)
int64_t update_semi_coord(const ul_idx_t *uref, hpc_t *hpc_g, All_reads *rref, overlap_region *z, 
int64_t qs, int64_t qe, int64_t thre, int64_t *ts, int64_t *te, int64_t *aux_beg)
{
    int64_t ql = qe - qs, aln_l, t_tot_l, id = z->y_id, aux_end, tl; 
    (*ts) = (qs - z->x_pos_s) + z->y_pos_s;
    (*ts) += y_start_offset(qs, &(z->f_cigar));
    aln_l = ql + (thre<<1);
    if(hpc_g) t_tot_l = hpc_len(*hpc_g, id);
    else if(uref) t_tot_l = uref->ug->u.a[id].len;
    else t_tot_l = Get_READ_LENGTH((*rref), id);
    if(!init_waln(thre, (*ts), t_tot_l, aln_l, aux_beg, &aux_end, ts, &tl)) {
        (*ts) = (*te) = (*aux_beg) = -1;
        return 0;
    }
    (*te) = (*ts) + tl; 
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r12
movq %r8, %r13
movq %rcx, %rbx
movq %rdx, 0x8(%rsp)
movq %rsi, %r15
movq %rdi, 0x10(%rsp)
movq 0x68(%rsp), %rsi
movl 0x10(%rcx), %eax
movq %rax, (%rsp)
movl 0x4(%rcx), %eax
movl 0x14(%rcx), %ecx
movq %r8, %rdx
subq %rax, %rdx
addq %rdx, %rcx
movq %rcx, (%rsi)
leaq 0x38(%rbx), %rbp
movl 0x40(%rbx), %esi
decl %esi
movq %rbp, %rdi
callq 0x3d110
cltq
movl 0x40(%rbx), %r14d
cmpq %r13, %rax
je 0x6031f
testl %r14d, %r14d
je 0x603fe
xorl %r14d, %r14d
movq %rbp, %rdi
movl %r14d, %esi
callq 0x3d110
cltq
cmpq %r13, %rax
jg 0x6030a
incq %r14
movl 0x40(%rbx), %eax
cmpq %rax, %r14
jb 0x602eb
jmp 0x60316
testq %r14, %r14
je 0x603fe
movl 0x40(%rbx), %eax
cmpq %rax, %r14
je 0x603fe
movq 0x60(%rsp), %rbx
subq %r13, %r12
decl %r14d
movq %rbp, %rdi
movl %r14d, %esi
callq 0x3d11b
movslq %eax, %rsi
movq 0x68(%rsp), %r13
addq (%r13), %rsi
movq %rsi, (%r13)
leaq (%r12,%rbx,2), %rcx
testq %r15, %r15
je 0x6036a
movq (%r15), %rax
movq 0x10(%rax), %rax
movq (%rsp), %rdx
leaq (%rdx,%rdx,4), %rdx
movl (%rax,%rdx,8), %edx
shrl %edx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
jmp 0x6039f
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x6038e
movq (%rax), %rax
movq 0x10(%rax), %rax
movq (%rsp), %rdx
leaq (%rdx,%rdx,4), %rdx
movl (%rax,%rdx,8), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
jmp 0x6039f
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rsp), %rdx
movq (%rax,%rdx,8), %rdx
movq 0x78(%rsp), %r15
movq 0x70(%rsp), %r14
leaq 0x18(%rsp), %rax
leaq 0x20(%rsp), %r9
movq %rbx, %rdi
movq %r15, %r8
pushq %rax
pushq %r13
callq 0x48e1c
addq $0x10, %rsp
testl %eax, %eax
je 0x603dc
movq 0x18(%rsp), %rax
addq (%r13), %rax
movq %rax, (%r14)
movl $0x1, %eax
jmp 0x603ef
movq $-0x1, %rax
movq %rax, (%r15)
movq %rax, (%r14)
movq %rax, (%r13)
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5f47
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: update_semi_non_retrieve_coord(overlap_region*, long, long, long, long, long*, long*, long*)
int64_t update_semi_non_retrieve_coord(overlap_region *z, int64_t qs, int64_t qe, int64_t thre, int64_t t_tot_l, int64_t *ts, int64_t *te, int64_t *aux_beg)
{
    int64_t ql = qe - qs, aln_l, aux_end, tl; 
    (*ts) = (qs - z->x_pos_s) + z->y_pos_s;
    (*ts) += y_start_offset(qs, &(z->f_cigar));
    aln_l = ql + (thre<<1);
    
    if(!init_waln(thre, (*ts), t_tot_l, aln_l, aux_beg, &aux_end, ts, &tl)) {
        (*ts) = (*te) = (*aux_beg) = -1;
        return 0;
    }
    (*te) = (*ts) + tl; 
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %rbx
movq %r8, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r14
movl 0x4(%rdi), %eax
movl 0x14(%rdi), %ecx
movq %rsi, %rdx
subq %rax, %rdx
addq %rdx, %rcx
movq %rcx, (%r9)
leaq 0x38(%rdi), %rbp
movl 0x40(%rdi), %esi
decl %esi
movq %rbp, %rdi
callq 0x3d110
cltq
movl 0x40(%r14), %r15d
cmpq %r13, %rax
je 0x60497
testl %r15d, %r15d
je 0x6051d
xorl %r15d, %r15d
movq %rbp, %rdi
movl %r15d, %esi
callq 0x3d110
cltq
cmpq %r13, %rax
jg 0x60481
incq %r15
movl 0x40(%r14), %eax
cmpq %rax, %r15
jb 0x60461
jmp 0x6048e
testq %r15, %r15
je 0x6051d
movl 0x40(%r14), %eax
cmpq %rax, %r15
je 0x6051d
movq 0x68(%rsp), %r14
subq %r13, %r12
decl %r15d
movq %rbp, %rdi
movl %r15d, %esi
callq 0x3d11b
movslq %eax, %rsi
addq (%rbx), %rsi
movq %rsi, (%rbx)
movq 0x8(%rsp), %rdi
leaq (%r12,%rdi,2), %rcx
leaq 0x18(%rsp), %rax
leaq 0x20(%rsp), %r9
movq 0x10(%rsp), %rdx
movq %r14, %r8
pushq %rax
pushq %rbx
callq 0x48e1c
addq $0x10, %rsp
testl %eax, %eax
je 0x604f7
movq 0x18(%rsp), %rax
addq (%rbx), %rax
movq 0x60(%rsp), %rcx
movq %rax, (%rcx)
movl $0x1, %eax
jmp 0x6050e
movq $-0x1, %rax
movq %rax, (%r14)
movq 0x60(%rsp), %rcx
movq %rax, (%rcx)
movq %rax, (%rbx)
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5f73
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: adjust_ext_offset(long*, long*, long*, long*, long, long, long, long)
void adjust_ext_offset(int64_t *qs, int64_t *qe, int64_t *ts, int64_t *te, int64_t ql, int64_t tl, int64_t thre, int64_t mode)
{
    int64_t qoff, toff;
    if(mode == 1) {///forward extension
        qoff = ql - (*qs); toff = tl - (*ts);
        if(qoff <= toff) {
            (*qe) = ql; (*te) = (*ts) + qoff + thre;
        } else {
            (*te) = tl; (*qe) = (*qs) + toff + thre;
        }
    } else if(mode == 2) {///backward extension
        qoff = (*qe); toff = (*te);
        if(qoff <= toff) {
            (*qs) = 0; (*ts) = (*te) - qoff - thre;
        } else {
            (*ts) = 0; (*qs) = (*qe) - toff - thre;
        }
    }
    if((*qs) < 0) (*qs) = 0;
    if((*ts) < 0) (*ts) = 0;
    if((*qe) > ql) (*qe) = ql;
    if((*te) > tl) (*te) = tl;
}

// Assembly:
movq 0x10(%rsp), %r10
movq 0x8(%rsp), %rax
cmpq $0x2, %r10
je 0x60557
cmpq $0x1, %r10
jne 0x60598
movq %r8, %r10
subq (%rdi), %r10
movq %r9, %r11
subq (%rdx), %r11
cmpq %r11, %r10
jle 0x60577
movq %r9, (%rcx)
addq %rax, %r11
addq (%rdi), %r11
movq %r11, (%rsi)
jmp 0x60598
movq (%rsi), %r10
movq (%rcx), %r11
cmpq %r11, %r10
jle 0x60585
movq $0x0, (%rdx)
movq (%rsi), %r10
addq %rax, %r11
subq %r11, %r10
movq %r10, (%rdi)
jmp 0x6059b
movq %r8, (%rsi)
addq %rax, %r10
addq (%rdx), %r10
movq %r10, (%rcx)
jmp 0x60598
movq $0x0, (%rdi)
movq (%rcx), %r11
addq %rax, %r10
subq %r10, %r11
movq %r11, (%rdx)
movq (%rdi), %r10
testq %r10, %r10
jns 0x605a7
movq $0x0, (%rdi)
cmpq $0x0, (%rdx)
jns 0x605b4
movq $0x0, (%rdx)
cmpq %r8, (%rsi)
jle 0x605bc
movq %r8, (%rsi)
cmpq %r9, (%rcx)
jle 0x605c4
movq %r9, (%rcx)
retq