LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: determine_overlap_region(int, long long, long long, long long, long long, int*, int*, long long*, long long*)
int determine_overlap_region(int threshold, long long y_start, long long y_ID, long long Window_Len, /**All_reads* R_INF**/long long y_len,
int* r_extra_begin, int* r_extra_end, long long* r_y_start, long long* r_y_length)
{
    int extra_begin;
    int extra_end;
    long long currentIDLen;
    long long o_len;

    ///the length of y
    // currentIDLen = Get_READ_LENGTH((*R_INF), y_ID);
    currentIDLen = y_len;
    
    ///since Window_Len == x_len + (threshold << 1)
    if(y_start < 0 || currentIDLen <= y_start || 
    currentIDLen - y_start + 2 * threshold + THRESHOLD_MAX_SIZE < Window_Len)
    {
        return 0;
    }
    
    extra_begin = extra_end = 0;
    ///y maybe less than 0
    y_start = y_start - threshold;
    o_len = MIN(Window_Len, currentIDLen - y_start);
    extra_end = Window_Len - o_len;

    if (y_start < 0)
    {
        extra_begin = -y_start;
        y_start = 0;
        o_len = o_len - extra_begin;
    }

    (*r_extra_begin) = extra_begin;
    (*r_extra_end) = extra_end;
    (*r_y_start) = y_start;
    (*r_y_length) = o_len;

    return 1;
}

// Assembly:
testq %rsi, %rsi
sets %dl
cmpq %rsi, %r8
setle %r10b
xorl %eax, %eax
orb %dl, %r10b
jne 0x1b5ad
leal (%rdi,%rdi), %edx
movslq %edx, %rdx
subq %rsi, %rdx
addq %r8, %rdx
addq $0x1f, %rdx
cmpq %rcx, %rdx
jl 0x1b5ad
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rdx
movslq %edi, %rdi
subq %rdi, %rsi
subq %rsi, %r8
cmpq %rcx, %r8
cmovgeq %rcx, %r8
movq 0x8(%rsp), %rdi
subl %r8d, %ecx
movl %esi, %r10d
negl %r10d
xorl %r11d, %r11d
testq %rsi, %rsi
cmovgq %rsi, %r11
sarq $0x3f, %rsi
andl %r10d, %esi
subq %rsi, %r8
movl %esi, (%r9)
movl %ecx, (%rdi)
movq %r11, (%rdx)
movq %r8, (%rax)
pushq $0x1
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/./Hash_Table.h
// Function: y_start_offset(long long, Fake_Cigar*)
static inline long long y_start_offset(long long x_start, Fake_Cigar* o)
{
    if(x_start == get_fake_gap_pos(o, o->length - 1))
    {
        return get_fake_gap_shift(o, o->length - 1);
    }
    
    long long i;
    for (i = 0; i < (long long)o->length; i++)
    {
        if(x_start < get_fake_gap_pos(o, i))
        {
            break;
        }
    }

    if(i == 0 || i == (long long)o->length)
    {
        fprintf(stderr, "ERROR at %s:%d\n", __FILE__, __LINE__);
        exit(0);
    }

    ///note here return i - 1
    return get_fake_gap_shift(o, i - 1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movl 0x8(%rsi), %esi
decl %esi
movq %rbx, %rdi
callq 0x11a00
cltq
cmpq %r15, %rax
jne 0x1bee4
movl 0x8(%rbx), %r14d
jmp 0x1bf13
xorl %r14d, %r14d
movl 0x8(%rbx), %eax
cmpq %rax, %r14
jae 0x1bf06
movq %rbx, %rdi
movl %r14d, %esi
callq 0x11a00
cltq
cmpq %r15, %rax
jg 0x1bf06
incq %r14
jmp 0x1bee7
testq %r14, %r14
je 0x1bf29
movl 0x8(%rbx), %eax
cmpq %r14, %rax
je 0x1bf29
decl %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x11a0b
cltq
popq %rbx
popq %r14
popq %r15
retq
movq 0x2370b0(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0x1cb88c(%rip), %rsi    # 0x1e77c6
leaq 0x1cb895(%rip), %rdx    # 0x1e77d6
movl $0xb7, %ecx
xorl %eax, %eax
callq 0x22b0
xorl %edi, %edi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: init_waln(long, long, long, long, long*, long*, long*, long*)
int32_t init_waln(int64_t err, int64_t s, int64_t l, int64_t w_l, int64_t* aux_beg, int64_t* aux_end, int64_t* r_s, int64_t* r_l)
{
    (*aux_beg) = (*aux_end) = (*r_s) = (*r_l) = -1;
    ///since w_l == x_len + (err << 1)
    if((s < 0) || (s >= l) || ((l-s+(2*err)+THRESHOLD_MAX_SIZE) < w_l)) return 0;
    (*aux_beg) = (*aux_end) = 0;
    ///s might be less than 0
    (*r_s) = s - err; 
    (*r_l) = l-(*r_s); if((*r_l) > w_l) (*r_l) = w_l;
    (*aux_end) = w_l - (*r_l);

    if ((*r_s) < 0) {
        (*aux_beg) = -(*r_s); (*r_s) = 0; (*r_l) -= (*aux_beg);
    }
    return 1;
}

// Assembly:
pushq %rbp
pushq %rbx
movq 0x20(%rsp), %r10
orq $-0x1, (%r10)
movq 0x18(%rsp), %r11
orq $-0x1, (%r11)
orq $-0x1, (%r9)
orq $-0x1, (%r8)
testq %rsi, %rsi
sets %bl
cmpq %rdx, %rsi
setge %bpl
xorl %eax, %eax
orb %bl, %bpl
jne 0x1c864
leaq (%rdi,%rdi), %rbx
subq %rsi, %rbx
addq %rdx, %rbx
addq $0x1f, %rbx
cmpq %rcx, %rbx
jl 0x1c864
andq $0x0, (%r8)
subq %rdi, %rsi
movq %rsi, (%r11)
subq %rsi, %rdx
cmpq %rcx, %rdx
cmovgeq %rcx, %rdx
movq %rdx, (%r10)
subq %rdx, %rcx
movq %rcx, (%r9)
movq (%r11), %rcx
movl $0x1, %eax
testq %rcx, %rcx
jns 0x1c864
negq %rcx
movq %rcx, (%r8)
andq $0x0, (%r11)
movq (%r8), %rcx
subq %rcx, (%r10)
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: get_init_paras(All_reads*, ul_idx_t const*, overlap_region*, long, long, double, long, long*, long*, long*, long*)
uint32_t get_init_paras(All_reads* rref, const ul_idx_t *uref, overlap_region *z, int64_t x_s, int64_t x_e, double e_rate, int64_t block_s, 
                        int64_t *r_ys, int64_t *r_ex_beg, int64_t *r_ex_end, int64_t *r_err_thre)
{
    int e, ex_beg, ex_end; long long y_s, o_len, Window_Len;
    e = get_init_err_thres(x_e+1-x_s, e_rate, block_s, rref?THRESHOLD:THRESHOLD_MAX_SIZE);
    y_s = (x_s-z->x_pos_s) + z->y_pos_s; y_s += y_start_offset(x_s, &(z->f_cigar));
    Window_Len = (x_e+1-x_s) + (e<<1);

    if(!determine_overlap_region(e, y_s, z->y_id, Window_Len, (rref?(Get_READ_LENGTH((*rref), z->y_id)):(uref->ug->u.a[z->y_id].len)),
    &ex_beg, &ex_end, &y_s, &o_len)) {
        return 0;
    }
    (*r_ys) = y_s; (*r_ex_beg) = ex_beg; (*r_ex_end) = ex_end; (*r_err_thre) = e;
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r14
movq %rdx, %r13
movq %rsi, 0x18(%rsp)
movq %rdi, %r12
subq %rcx, %r14
incq %r14
xorl %ebx, %ebx
testq %rdi, %rdi
sete %al
cmpq %r9, %r14
jge 0x1ce13
cvtsi2sd %r14, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
cmpq $0x1f, %rax
pushq $0x1f
popq %rdx
cmovlq %rax, %rdx
testq %rax, %rax
pushq $0x1
popq %rbx
cmovneq %rdx, %rbx
cmpq $0x4, %r14
cmovlq %rdx, %rbx
jmp 0x1ce1c
movb %al, %bl
shll $0x4, %ebx
orq $0xf, %rbx
movl 0x4(%r13), %eax
movl 0x14(%r13), %ebp
movq %rcx, %r15
subq %rax, %r15
leaq 0x38(%r13), %rsi
movq %rcx, %rdi
callq 0x1bebf
addq %rbp, %rax
addq %r15, %rax
leal (%rbx,%rbx), %ecx
movslq %ecx, %rcx
addq %rcx, %r14
movq %rax, 0x10(%rsp)
movl 0x10(%r13), %ecx
testq %r12, %r12
je 0x1ce5e
movq 0x18(%r12), %rdx
movq (%rdx,%rcx,8), %r8
jmp 0x1ce79
movq 0x18(%rsp), %rdx
movq (%rdx), %rdx
movq 0x10(%rdx), %rdx
imulq $0x28, %rcx, %rcx
movl (%rdx,%rcx), %r8d
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
subq $0x8, %rsp
leaq 0x28(%rsp), %rdx
leaq 0x18(%rsp), %r10
leaq 0x10(%rsp), %r11
leaq 0x14(%rsp), %r9
movl %ebx, %edi
movq %rax, %rsi
movq %r14, %rcx
pushq %rdx
pushq %r10
pushq %r11
callq 0x1b53a
addq $0x20, %rsp
testl %eax, %eax
je 0x1cee2
movq 0x78(%rsp), %rax
movq 0x70(%rsp), %rcx
movq 0x68(%rsp), %rdx
movq 0x60(%rsp), %rsi
movq 0x10(%rsp), %rdi
movq %rdi, (%rsi)
movslq 0xc(%rsp), %rsi
movq %rsi, (%rdx)
movslq 0x8(%rsp), %rdx
movq %rdx, (%rcx)
movslq %ebx, %rcx
movq %rcx, (%rax)
pushq $0x1
popq %rax
jmp 0x1cee4
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: check_coverage_gap(unsigned long*, unsigned long, unsigned long, long)
int64_t check_coverage_gap(uint64_t *v_idx, uint64_t w_s, uint64_t w_e, int64_t block_s)
{
    int64_t wid = w_s/block_s, a_n = (uint32_t)(v_idx[wid]), k;
    uint64_t *a = v_idx + (v_idx[wid]>>32);
    for (k = 0; k < a_n; k++) {
        if(((a[k]>>32) == w_s) && (((uint32_t)(a[k])) == w_e)) return 1;
    }
    return 0;
}

// Assembly:
movq %rdx, %r8
xorl %r9d, %r9d
movq %rsi, %rax
xorl %edx, %edx
divq %rcx
movq (%rdi,%rax,8), %rax
movl %eax, %ecx
shrq $0x20, %rax
leaq (%rdi,%rax,8), %rdx
pushq $0x1
popq %rax
cmpq %r9, %rcx
je 0x1cf31
movq (%rdx,%r9,8), %rdi
movl %edi, %r10d
shrq $0x20, %rdi
xorq %rsi, %rdi
xorq %r8, %r10
incq %r9
orq %rdi, %r10
jne 0x1cf12
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: get_adjust_winid(overlap_region*, long, long)
int64_t get_adjust_winid(overlap_region *z, int64_t win_beg, int64_t win_len)
{   
    int64_t win_id, k;
    win_id = (win_beg-((z->x_pos_s/win_len)*win_len))/win_len;
    if((uint64_t)win_id < z->w_list.n && z->w_list.a[win_id].x_start == win_beg) return win_id;
    if(z->w_list.n == 0) return -1;
    // if(z->w_list.a[win_id].x_start <= win_beg) {
    //     fprintf(stderr, "z->w_list.n::%u, z->w_list.a[%ld].x_start::%d, win_beg::%ld\n", 
    //     (uint32_t)z->w_list.n, win_id, z->w_list.a[win_id].x_start, win_beg);
    // }
    if((uint64_t)win_id > z->w_list.n) win_id = z->w_list.n;
    // assert((z->w_list.a[win_id].x_start > win_beg);
    for (k = win_id - 1; k >= 0; k--) {
        // if(k < 0 || k >= (int64_t)z->w_list.n) fprintf(stderr, "win_id::%ld, k::%ld, z->w_list.n::%ld\n", win_id, k, (int64_t)z->w_list.n);
        if(z->w_list.a[k].x_start == win_beg) return k;
        if(z->w_list.a[k].x_start < win_beg) return -1;
    }
    return -1;
}

// Assembly:
movq %rdx, %rcx
movl 0x4(%rdi), %r8d
movq %r8, %rax
xorl %edx, %edx
idivq %rcx
leaq (%rdx,%rsi), %rax
subq %r8, %rax
cqto
idivq %rcx
movq 0x48(%rdi), %rcx
pushq $-0x1
popq %rdx
cmpq %rcx, %rax
jae 0x1e29b
movq 0x58(%rdi), %r8
movq %rax, %r9
shlq $0x5, %r9
movslq (%r8,%r9), %r8
cmpq %rsi, %r8
jne 0x1e2a0
retq
testq %rcx, %rcx
je 0x1e2d0
cmpq %rcx, %rax
cmovbq %rax, %rcx
movq %rcx, %rax
shlq $0x5, %rax
addq $-0x20, %rax
testq %rcx, %rcx
jle 0x1e2d0
movq 0x58(%rdi), %r8
movslq (%r8,%rax), %r8
cmpq %rsi, %r8
je 0x1e2d4
addq $-0x20, %rax
decq %rcx
cmpq %rsi, %r8
jge 0x1e2b2
movq %rdx, %rax
retq
decq %rcx
movq %rcx, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: print_graph(Graph*)
void print_graph(Graph* DAGCon)
{
    uint64_t i;
    for (i = 0; i < DAGCon->g_nodes.length; i++)
    {
        Node* currentStartNode = &(G_Node(*DAGCon, i));
        RSet iter_out;

        if(If_Node_Exist(*currentStartNode))
        {
            fprintf(stderr, "ID: %lu (%c) (w: %lu)\n", (unsigned long)(*currentStartNode).ID, (*currentStartNode).base, (unsigned long)(*currentStartNode).weight);
            clear_RSet(&iter_out);
            Edge* e;
            fprintf(stderr, "****Out-node: ");
            while(getOutputEdges(&iter_out, DAGCon, currentStartNode, &e))
            {
                //fprintf(stderr, "%d[%c], ", G_Node(*DAGCon, e->out_node).ID, G_Node(*DAGCon, e->out_node).base);
                fprintf(stderr, "%lu(w: %lu), ", (unsigned long)G_Node(*DAGCon, e->out_node).ID, (unsigned long)e->weight);
            }
            fprintf(stderr, "\n");


            // clear_RSet(&iter_out);
            // fprintf(stderr, "In-node: ");
            // while(getInputEdges(&iter_out, DAGCon, currentStartNode, &e))
            // {
            //     fprintf(stderr, "%d[%c], ", G_Node(*DAGCon, e->in_node).ID, G_Node(*DAGCon, e->in_node).base);
            // }
        }
    }

    fprintf(stderr, "*******\n");

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x23418b(%rip), %r15    # 0x252fe0
leaq 0x10(%rsp), %rbp
leaq 0x8(%rsp), %r14
xorl %r12d, %r12d
cmpq 0x60(%rbx), %r12
jae 0x1ef0f
movq 0x18(%rbx), %r13
movq %r12, %rax
shlq $0x7, %rax
movsbl 0x18(%r13,%rax), %ecx
cmpl $0x44, %ecx
jne 0x1ee87
incq %r12
jmp 0x1ee62
addq %rax, %r13
movq (%r15), %rdi
movq (%r13), %rdx
movq 0x8(%r13), %r8
leaq 0x1c4ad8(%rip), %rsi    # 0x1e3974
xorl %eax, %eax
callq 0x22b0
andq $0x0, 0x10(%rsp)
movq (%r15), %rcx
leaq 0x1c4ad8(%rip), %rdi    # 0x1e398b
pushq $0xe
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
movq %rbp, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x52a35
movq (%r15), %rsi
testl %eax, %eax
je 0x1ef02
movq 0x18(%rbx), %rax
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rdx
movq 0x10(%rcx), %rcx
shlq $0x7, %rdx
movq (%rax,%rdx), %rdx
movq %rsi, %rdi
leaq 0x1c4aa1(%rip), %rsi    # 0x1e399a
xorl %eax, %eax
callq 0x22b0
jmp 0x1eebe
pushq $0xa
popq %rdi
callq 0x2270
jmp 0x1ee82
movq (%r15), %rcx
leaq 0x1cb7cf(%rip), %rdi    # 0x1ea6e8
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: generate_best_seq_from_edges(Graph*)
long long generate_best_seq_from_edges(Graph* DAGCon)
{
    long long max_start = 0, max_end = 0, max_start_edge = 0, max_end_edge = 0;
    RSet iter;
    Edge* e = NULL;
    Node* newNode = NULL;
    long long max_count = 0;
    

    ///check the out-edges of start node
    ///must to be 0
    max_start = 0;
    newNode = &(G_Node(*DAGCon, DAGCon->s_start_nodeID));
    clear_RSet(&iter);
    while(getOutputEdges(&iter, DAGCon, newNode, &e))
    {
        if(e->weight > (uint64_t)max_start)
        {
            max_start = e->weight;
            max_start_edge = iter.index - 1;
        }
    }

    ///check the in-edges of end node
    ///must to be 0
    max_end = 0;
    newNode = &(G_Node(*DAGCon, DAGCon->s_end_nodeID));
    clear_RSet(&iter);
    while(getInputEdges(&iter, DAGCon, newNode, &e))
    {
        if(e->weight > (uint64_t)max_end)
        {
            max_end = e->weight;
            max_end_edge = iter.index - 1;
        }
    }

    if(max_start >= max_end)
    {
        max_count = max_start;
        generate_seq_from_path(DAGCon, 
        &G_Node(*DAGCon, Output_Edges(G_Node(*DAGCon, DAGCon->s_start_nodeID)).list[max_start_edge].out_node), 0);
    }
    else
    {
        max_count = max_end;
        generate_seq_from_path(DAGCon, 
        &G_Node(*DAGCon, Input_Edges(G_Node(*DAGCon, DAGCon->s_end_nodeID)).list[max_end_edge].in_node), 1);
    }

    return max_count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %r15
andq $0x0, (%r15)
movq 0xa8(%rdi), %r12
shlq $0x7, %r12
addq 0x18(%rdi), %r12
leaq 0x8(%rsp), %r14
andq $0x0, (%r14)
xorl %r13d, %r13d
xorl %ebp, %ebp
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x52a35
testl %eax, %eax
je 0x1f34c
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rsp), %rcx
decq %rcx
cmpq %r13, %rax
cmovaq %rax, %r13
cmovaq %rcx, %rbp
jmp 0x1f319
movq 0xb0(%rbx), %r15
shlq $0x7, %r15
addq 0x18(%rbx), %r15
leaq 0x8(%rsp), %rax
andq $0x0, (%rax)
xorl %r14d, %r14d
xorl %r12d, %r12d
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
leaq 0x10(%rsp), %rcx
callq 0x18a44
testl %eax, %eax
je 0x1f3a1
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rsp), %rcx
decq %rcx
cmpq %r14, %rax
cmovaq %rax, %r14
cmovaq %rcx, %r12
jmp 0x1f36a
movq 0x18(%rbx), %rsi
cmpq %r14, %r13
jge 0x1f3c6
movq 0xb0(%rbx), %rcx
shlq $0x7, %rcx
imulq $0x38, %r12, %rax
addq 0x60(%rsi,%rcx), %rax
pushq $0x1
popq %rdx
movq %r14, %r13
jmp 0x1f3e3
movq 0xa8(%rbx), %rax
shlq $0x7, %rax
movq 0x40(%rsi,%rax), %rax
imulq $0x38, %rbp, %rcx
addq %rcx, %rax
addq $0x8, %rax
xorl %edx, %edx
movq (%rax), %rax
shlq $0x7, %rax
addq %rax, %rsi
movq %rbx, %rdi
callq 0x52ac5
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: cmp_snp_stats(void const*, void const*)
int cmp_snp_stats(const void * a, const void * b)
{
    if ((*(SnpStats*)a).score != (*(SnpStats*)b).score)
    {
        return (*(SnpStats*)a).score < (*(SnpStats*)b).score ? 1 : -1; 
    }
    else
    {
        if ((*(SnpStats*)a).occ_2 != (*(SnpStats*)b).occ_2)
        {
            return (*(SnpStats*)a).occ_2 > (*(SnpStats*)b).occ_2 ? 1 : -1; 
        }
        else
        {
            return 0;
        }   
    }
}

// Assembly:
movl 0x1c(%rsi), %eax
cmpl %eax, 0x1c(%rdi)
jne 0x21d44
movl 0x10(%rdi), %ecx
movl 0x10(%rsi), %edx
xorl %eax, %eax
cmpl %edx, %ecx
je 0x21d43
xorl %eax, %eax
cmpl %ecx, %edx
adcl $-0x1, %eax
orl $0x1, %eax
retq
setl %al
movzbl %al, %eax
leal -0x1(,%rax,2), %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: calculate_distance_snp_vector(signed char*, signed char*, int)
int calculate_distance_snp_vector(int8_t *vector1, int8_t *vector2, int Len)
{
    int i;
    for (i = 0; i < Len; i++)
    {
        if(vector1[i] != vector2[i])
        {
            if ((vector1[i] == 0 || vector1[i] == 1) && (vector2[i] == 0 || vector2[i] == 1))
            {
                return 1;
            }
        }
    }
    
    return 0;
}

// Assembly:
xorl %eax, %eax
testl %edx, %edx
cmovlel %eax, %edx
pushq $0x1
popq %rcx
xorl %r8d, %r8d
cmpq %r8, %rdx
je 0x21ee7
movb (%rdi,%r8), %r9b
movb (%rsi,%r8), %r10b
cmpb %r10b, %r9b
sete %r11b
orb %r9b, %r10b
cmpb $0x2, %r10b
setae %r9b
incq %r8
orb %r11b, %r9b
jne 0x21ebe
movl %ecx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: print_core_snp(haplotype_evdience_alloc*)
void print_core_snp(haplotype_evdience_alloc* hap)
{
    uint64_t i, j;
    for (i = 0; i < hap->core_snp; i++)
    {
        fprintf(stderr, "core(i): %lu, site: %u, occ_0: %u, occ_1: %u, occ_2: %u, score: %d\n", 
    (unsigned long)i, 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,
    hap->snp_stat.a[i].score); 

        int vectorID = hap->snp_stat.a[i].id;
        int8_t* vector = Get_SNP_Vector((*hap), vectorID);

        for (j = 0; j < hap->overlap; j++)
        {
            if(vector[j] == 0)
            {
                fprintf(stderr, "type: %d, ID: %lu\n", vector[j], (unsigned long)j);
            }
        }


        for (j = 0; j < hap->overlap; j++)
        {
            if(vector[j] == 1)
            {
                fprintf(stderr, "type: %d, ID: %lu\n", vector[j], (unsigned long)j);
            }
        }


        for (j = 0; j < hap->overlap; j++)
        {
            if(vector[j] == 2)
            {
                fprintf(stderr, "type: %d, ID: %lu\n", vector[j], (unsigned long)j);
            }
        }
        
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x2310e3(%rip), %rbp    # 0x252fe0
leaq 0x1c1c23(%rip), %r15    # 0x1e3b27
xorl %r13d, %r13d
movl 0x1c4(%rbx), %eax
cmpq %rax, %r13
jae 0x2200e
movq (%rbp), %rdi
movq 0x218(%rbx), %rax
imulq $0x28, %r13, %r14
movl 0x20(%rax,%r14), %ecx
movl 0x8(%rax,%r14), %r8d
movl 0xc(%rax,%r14), %r9d
movl 0x10(%rax,%r14), %r10d
movl 0x1c(%rax,%r14), %r11d
leaq 0x1c1b9e(%rip), %rsi    # 0x1e3ae3
movq %r13, %rdx
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x22b0
popq %rcx
popq %rdx
movq 0x218(%rbx), %rcx
movl 0x1c8(%rbx), %eax
movl (%rcx,%r14), %r12d
imull %eax, %r12d
addq 0x1d0(%rbx), %r12
xorl %r14d, %r14d
movl %eax, %ecx
cmpq %rcx, %r14
jae 0x21fa2
cmpb $0x0, (%r12,%r14)
je 0x21f87
incq %r14
jmp 0x21f74
movq (%rbp), %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0x22b0
movl 0x1c8(%rbx), %eax
jmp 0x21f82
xorl %r14d, %r14d
movl %eax, %ecx
cmpq %rcx, %r14
jae 0x21fd4
cmpb $0x1, (%r12,%r14)
je 0x21fb8
incq %r14
jmp 0x21fa5
movq (%rbp), %rdi
movq %r15, %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x22b0
movl 0x1c8(%rbx), %eax
jmp 0x21fb3
xorl %r14d, %r14d
movl %eax, %ecx
cmpq %rcx, %r14
jae 0x22006
cmpb $0x2, (%r12,%r14)
je 0x21fea
incq %r14
jmp 0x21fd7
movq (%rbp), %rdi
movq %r15, %rsi
pushq $0x2
popq %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x22b0
movl 0x1c8(%rbx), %eax
jmp 0x21fe5
incq %r13
jmp 0x21f07
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: add_to_result_snp_vector(haplotype_evdience_alloc*, signed char*, int)
void add_to_result_snp_vector(haplotype_evdience_alloc* hap, int8_t *new_vector, int Len)
{
    int8_t *r_vector = Get_Result_SNP_Vector((*hap));
    int j;
    for (j = 0; j < Len; j++)
    {
        if(r_vector[j] == -1)
        {
            if(new_vector[j] == 0)
            {
                hap->result_stat.occ_0++;
                r_vector[j] = new_vector[j];
            }
            else if(new_vector[j] == 1)
            {
                hap->result_stat.occ_1++;
                r_vector[j] = new_vector[j];
            }
        }
        ///can debug here
    }

    hap->result_stat.overlap_num = hap->result_stat.occ_0 + hap->result_stat.occ_1;
}

// Assembly:
movq 0x1e0(%rdi), %rax
leaq 0x1f8(%rdi), %rcx
leaq 0x1f4(%rdi), %r8
xorl %r9d, %r9d
testl %edx, %edx
cmovlel %r9d, %edx
cmpq %r9, %rdx
je 0x2206d
cmpb $-0x1, (%rax,%r9)
jne 0x22068
movzbl (%rsi,%r9), %r10d
movq %r8, %r11
testl %r10d, %r10d
je 0x2205d
cmpl $0x1, %r10d
jne 0x22068
movq %rcx, %r11
incl (%r11)
movb (%rsi,%r9), %r10b
movb %r10b, (%rax,%r9)
incq %r9
jmp 0x2203b
movl 0x1f8(%rdi), %eax
addl 0x1f4(%rdi), %eax
movl %eax, 0x1f0(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: debug_add_to_result_snp_vector(haplotype_evdience_alloc*, signed char*, int)
int debug_add_to_result_snp_vector(haplotype_evdience_alloc* hap, int8_t *new_vector, int Len)
{
    int8_t *r_vector = Get_Result_SNP_Vector((*hap));
    int j;
    for (j = 0; j < Len; j++)
    {
        if(r_vector[j] == -1)
        {
            if(new_vector[j] == 0)
            {
                hap->result_stat.occ_0++;
                r_vector[j] = new_vector[j];
            }
            else if(new_vector[j] == 1)
            {
                hap->result_stat.occ_1++;
                r_vector[j] = new_vector[j];
            }
        }
        else ///can debug here
        {
            ///if((new_vector[j] != -1 && new_vector[j] != 2 && new_vector[j] != r_vector[j]))
            if((new_vector[j] == 0 || new_vector[j] == 1) && new_vector[j] != r_vector[j])
            {
                return j;
            }
        }
    }

    return -1;

}

// Assembly:
pushq %rbx
movq 0x1e0(%rdi), %rcx
leaq 0x1f8(%rdi), %r8
addq $0x1f4, %rdi            # imm = 0x1F4
xorl %r9d, %r9d
testl %edx, %edx
cmovlel %r9d, %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %r9, %rdx
je 0x220f1
movb (%rcx,%r9), %r11b
movzbl (%rsi,%r9), %r10d
cmpb $-0x1, %r11b
je 0x220cd
cmpb $0x2, %r10b
setae %bl
cmpb %r11b, %r10b
sete %r10b
orb %bl, %r10b
jne 0x220e9
jmp 0x220ee
movq %rdi, %r11
testl %r10d, %r10d
je 0x220de
movq %r8, %r11
cmpl $0x1, %r10d
jne 0x220e9
incl (%r11)
movb (%rsi,%r9), %r10b
movb %r10b, (%rcx,%r9)
incq %r9
jmp 0x220a4
movl %r9d, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: merge_snp_vectors_and_test(haplotype_evdience_alloc*, int)
int merge_snp_vectors_and_test(haplotype_evdience_alloc* hap, int diff_vector_ID)
{
    int8_t *r_vector = Get_Result_SNP_Vector((*hap));
    int vectorLen = Get_SNP_Vector_Length((*hap));
    memset(r_vector, -1, vectorLen);
    hap->result_stat.occ_0 = 0;
    hap->result_stat.occ_1 = 0;

    int8_t* vector;
    int vectorID;
    int i, j;

    for (i = 0; i < (int)hap->core_snp; i++)
    {
        if(i == diff_vector_ID)
        {
            continue;
        }

        vectorID = hap->snp_stat.a[i].id;
        vector = Get_SNP_Vector((*hap), vectorID);

        for (j = 0; j < vectorLen; j++)
        {
            if(r_vector[j] == -1)
            {
                if(vector[j] == 0)
                {
                    hap->result_stat.occ_0++;
                    r_vector[j] = vector[j];
                }
                else if(vector[j] == 1)
                {
                    hap->result_stat.occ_1++;
                    r_vector[j] = vector[j];
                }
            }
            else ///can debug here
            {
                ///has confilict
                if(vector[j] != -1 && vector[j] != 2 && vector[j] != r_vector[j])
                {
                    return 0;
                }
            }
        }
    }

    hap->result_stat.overlap_num = hap->result_stat.occ_0 + hap->result_stat.occ_1;

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq 0x1e0(%rdi), %r14
movslq 0x1c8(%rdi), %r15
movq %r14, %rdi
movl $0xff, %esi
movq %r15, %rdx
callq 0x20e0
andq $0x0, 0x1f4(%rbx)
leaq 0x1f4(%rbx), %rax
leaq 0x1f8(%rbx), %rcx
xorl %edx, %edx
testl %r15d, %r15d
movl $0x0, %esi
cmovgl %r15d, %esi
movl %ebp, %edi
movslq 0x1c4(%rbx), %r8
cmpq %r8, %rdx
jge 0x221c9
cmpq %rdi, %rdx
jne 0x22159
incq %rdx
jmp 0x22143
movq 0x218(%rbx), %r9
imulq $0x28, %rdx, %r10
movl 0x1c8(%rbx), %r8d
imull (%r9,%r10), %r8d
addq 0x1d0(%rbx), %r8
xorl %r9d, %r9d
cmpq %r9, %rsi
je 0x22154
movb (%r14,%r9), %r11b
movzbl (%r8,%r9), %r10d
cmpb $-0x1, %r11b
je 0x221a4
cmpl $0x2, %r10d
je 0x221c0
cmpl $0xff, %r10d
je 0x221c0
cmpb %r11b, %r10b
je 0x221c0
jmp 0x221c5
movq %rax, %r11
testl %r10d, %r10d
je 0x221b5
movq %rcx, %r11
cmpl $0x1, %r10d
jne 0x221c0
incl (%r11)
movb (%r8,%r9), %r10b
movb %r10b, (%r14,%r9)
incq %r9
jmp 0x2217a
xorl %eax, %eax
jmp 0x221de
movl 0x1f8(%rbx), %eax
addl 0x1f4(%rbx), %eax
movl %eax, 0x1f0(%rbx)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %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), %rsi
movslq %edx, %r15
movl %edi, (%rsi,%r15,4)
incl %r15d
movq 0x278(%rbx), %rax
movl (%rax,%r12,4), %eax
testl %eax, %eax
je 0x224ff
movl %edi, %r14d
imull 0x250(%rbx), %r14d
shlq $0x2, %r14
addq 0x280(%rbx), %r14
xorl %r13d, %r13d
cltq
cmpq %rax, %r13
jge 0x224f5
movl (%r14,%r13,4), %edi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x2247b
incq %r13
movq 0x278(%rbx), %rax
movl (%rax,%r12,4), %eax
jmp 0x224cf
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
addq $0x2b0, %rbx            # imm = 0x2B0
movq %rbx, %rdi
movl %r15d, %edx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x535eb
// File: /workspace/github_cpp_makefile_star2_O2/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 0x2272f
movl %edi, %r14d
imull 0x250(%rbx), %r14d
shlq $0x2, %r14
addq 0x280(%rbx), %r14
xorl %r13d, %r13d
cltq
cmpq %rax, %r13
jge 0x22725
movl (%r14,%r13,4), %edi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x226ab
incq %r13
movq 0x278(%rbx), %rax
movl (%rax,%r12,4), %eax
jmp 0x226ff
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 0x2251a
// File: /workspace/github_cpp_makefile_star2_O2/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 0x227d5
leaq (%rdx,%rsi), %rax
cvtsi2sd %rax, %xmm0
mulsd 0x1c0494(%rip), %xmm0   # 0x1e2c00
cvtsi2sd %rdx, %xmm1
ucomisd %xmm0, %xmm1
pushq $0x1
popq %rbx
jb 0x22785
cvtsi2sd %rsi, %xmm1
ucomisd %xmm0, %xmm1
jae 0x227d5
cmpq $0x5, %rdx
setge %al
cmpq $0x5, %rsi
setge %r9b
testb %al, %r9b
jne 0x227d5
cmpq $0x3, %rdx
setl %al
cmpq $0x3, %rsi
setl %dl
orb %al, %dl
cmpq $0x2, %r8
setl %al
orb %dl, %al
jne 0x227d3
leaq 0x4(%rsp), %rax
movq %rsp, %r14
movq %rcx, %rsi
movl %r8d, %edx
movq %rax, %rcx
movq %r14, %r8
callq 0x5378b
cmpl $0x0, (%r14)
jg 0x227d5
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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)
andl $0x0, 0x204(%rbx)
xorl %r12d, %r12d
testq %r14, %r14
cmovleq %r12, %r14
cmpq %r12, %r14
je 0x22895
movl (%r15,%r12,4), %eax
movq 0x218(%rbx), %rcx
imulq $0x28, %rax, %rax
movl 0x1c8(%rbx), %edx
movl (%rcx,%rax), %esi
imull %edx, %esi
addq 0x1d0(%rbx), %rsi
xorl %edi, %edi
cmpb $0x0, 0x24(%rcx,%rax)
sete %dil
incl 0x200(%rbx,%rdi,4)
movq %rbx, %rdi
callq 0x22080
incq %r12
cmpl $-0x1, %eax
je 0x22829
movq 0x230767(%rip), %rax    # 0x252fe0
movq (%rax), %rcx
leaq 0x1c12b7(%rip), %rdi    # 0x1e3b3a
pushq $0x1c
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
xorl %edi, %edi
callq 0x2250
movl 0x1f8(%rbx), %eax
addl 0x1f4(%rbx), %eax
movl %eax, 0x1f0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r14
pushq %rbx
xorl %eax, %eax
testq %rdx, %rdx
cmovleq %rax, %rdx
cmpq %rdx, %rax
je 0x22957
movl (%rsi,%rax,4), %r8d
movq 0x218(%rdi), %r9
imulq $0x28, %r8, %r8
addq %r9, %r8
addq $0x20, %r8
movl -0x20(%r8), %r9d
movl 0x1c8(%rdi), %r10d
imulq %r10, %r9
addq 0x1d0(%rdi), %r9
imulq $0xa8, %r10, %r10
xorl %r11d, %r11d
cmpq %r11, %r10
je 0x2294f
cmpb $0x1, (%r9)
movq (%rcx), %rbx
jne 0x2292c
cmpb $0x1, 0x2c(%rbx,%r11)
jne 0x2292c
movb $0x2, 0x2c(%rbx,%r11)
movl 0x8(%rbx,%r11), %r14d
subl 0x4(%rbx,%r11), %r14d
incl %r14d
subq %r14, 0x18(%rcx)
movl (%r8), %ebp
cmpl 0x4(%rbx,%r11), %ebp
jb 0x22943
cmpl 0x8(%rbx,%r11), %ebp
ja 0x22943
movb $0x1, 0x2e(%rbx,%r11)
addq $0xa8, %r11
incq %r9
jmp 0x228ff
incq %rax
jmp 0x228c0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
xorl %eax, %eax
testq %rsi, %rsi
cmovleq %rax, %rsi
movabsq $0x2c, %r10
cmpq %rax, %rsi
je 0x229a6
cmpb $0x1, (%rdi,%rax)
jne 0x2299a
movq (%rdx), %r11
cmpb $0x1, (%r11,%r10)
jne 0x2299a
movb $0x2, (%r11,%r10)
movl -0x24(%r11,%r10), %ebx
subl -0x28(%r11,%r10), %ebx
incl %ebx
subq %rbx, 0x18(%rdx)
incq %rax
addq $0xa8, %r10
jmp 0x22970
xorl %eax, %eax
testq %r8, %r8
cmovleq %rax, %r8
cmpq %r8, %rax
je 0x22a02
movl (%rcx,%rax,4), %edi
movl 0x1c8(%r9), %esi
imulq $0xa8, %rsi, %rsi
imulq $0x28, %rdi, %rdi
xorl %r10d, %r10d
cmpq %r10, %rsi
je 0x229fd
movq 0x218(%r9), %r11
movl 0x20(%r11,%rdi), %ebx
movq (%rdx), %r11
cmpl 0x4(%r11,%r10), %ebx
jb 0x229f4
cmpl 0x8(%r11,%r10), %ebx
ja 0x229f4
movb $0x1, 0x2e(%r11,%r10)
addq $0xa8, %r10
jmp 0x229cc
incq %rax
jmp 0x229af
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r13d, %r13d
xorl %ebp, %ebp
cmpq %rbp, 0x2b8(%r14)
jle 0x22ab4
movq 0x2c8(%r14), %rax
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 0x227df
movl 0x1f4(%r14), %esi
movl 0x1f8(%r14), %edx
movq %r14, %rdi
movq %r12, %rcx
movq %r15, %r8
callq 0x22743
testl %eax, %eax
je 0x22a9a
movq 0x1e0(%r14), %rdi
movl 0x1c8(%r14), %esi
movq %rbx, %rdx
movq %r12, %rcx
movq %r15, %r8
movq %r14, %r9
callq 0x2295c
pushq $0x1
popq %rax
jmp 0x22a9c
xorl %eax, %eax
movq 0x2c8(%r14), %rcx
movl %eax, 0x18(%rcx,%r13)
incq %rbp
addq $0x1c, %r13
jmp 0x22a1a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x22d47
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
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 %r14, %rdi
callq 0x21a0
testl %eax, %eax
je 0x22d4b
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
pushq $0x1
popq %rax
retq
movq 0x23028e(%rip), %r15    # 0x252fe0
movq (%r15), %rdi
movl 0x220(%rbx), %ecx
leaq 0x1c0df5(%rip), %rsi    # 0x1e3b57
movq %r14, %rdx
xorl %eax, %eax
callq 0x22b0
pushq $0x8
popq %r12
leaq 0x1c0df8(%rip), %r14    # 0x1e3b6f
xorl %r13d, %r13d
movslq 0x220(%rbx), %rax
cmpq %rax, %r13
jge 0x22d3e
movq (%r15), %rdi
movq 0x218(%rbx), %rax
movl 0x18(%rax,%r12), %edx
movl (%rax,%r12), %ecx
movl 0x4(%rax,%r12), %r8d
movl 0x8(%rax,%r12), %r9d
movq %r14, %rsi
xorl %eax, %eax
callq 0x22b0
incq %r13
addq $0x28, %r12
jmp 0x22d7a
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: prt_sub_read(char*, unsigned long, unsigned long, unsigned long)
void prt_sub_read(char *str, uint64_t str_l, uint64_t site, uint64_t win)
{
    uint64_t k, s, e;
    s = ((site >= win)?(site-win):(0)); 
    e = (((site+win+1) <= str_l)?(site+win+1):(str_l));
    fprintf(stderr, "[M::%s-site::%lu] [%lu, %lu)\n", __func__, site, s, e);

    for (k = s; k < site; k++) fprintf(stderr, "%c", str[k]);
    fprintf(stderr, "[%c]", str[k++]);
    for (; k < e; k++) fprintf(stderr, "%c", str[k]);

    fprintf(stderr, "\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
movq %rdx, %rax
subq %rcx, %rax
movl $0x0, %r15d
cmovaeq %rax, %r15
leaq (%rdx,%rcx), %rax
incq %rax
cmpq %rsi, %rax
cmovbq %rax, %rbx
movq 0x22f499(%rip), %r13    # 0x252fe0
movq (%r13), %rdi
leaq 0x1c00b9(%rip), %rsi    # 0x1e3c0b
leaq 0x1c00d0(%rip), %rdx    # 0x1e3c29
movq %r12, %rcx
movq %r15, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0x22b0
movq (%r13), %rsi
movsbl (%r14,%r15), %edx
cmpq %r12, %r15
jae 0x23b83
movl %edx, %edi
callq 0x2270
incq %r15
jmp 0x23b69
leaq 0x1c00ac(%rip), %rax    # 0x1e3c36
movq %rsi, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x22b0
incq %r15
movq (%r13), %rsi
cmpq %rbx, %r15
jae 0x23baf
movsbl (%r14,%r15), %edi
callq 0x2270
jmp 0x23b97
pushq $0xa
popq %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2270
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: dbg_prt_rphase_vec(SnpStats*, unsigned long, haplotype_evdience*)
void dbg_prt_rphase_vec(SnpStats *ai, uint64_t id, haplotype_evdience *za)
{
    haplotype_evdience *iz = NULL; int64_t in, ik; uint8_t fi;
    iz = za + ai->non_homopolymer_num; in = ai->homopolymer_num - ai->non_homopolymer_num;

    for (ik = 0; ik < in; ik++) {
        fi = 2;
        if(hh_tp(iz[ik]) == 0) {
            fi = 0;
        } else if(iz[ik].overlapSite == id){
            fi = 1;
        }
        fprintf(stderr, "oid::%u(f::%u)\n", iz[ik].overlapID, fi);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl 0x14(%rdi), %eax
movl 0x18(%rdi), %ecx
subl %ecx, %eax
imulq $0x18, %rax, %r15
imulq $0x18, %rcx, %rax
leaq (%rax,%rdx), %r12
addq $0xc, %r12
movq 0x22dec2(%rip), %r13    # 0x252fe0
leaq 0x1beccf(%rip), %r14    # 0x1e3df4
xorl %ebp, %ebp
cmpq %rbp, %r15
je 0x2515d
xorl %ecx, %ecx
testb $0x1, (%r12,%rbp)
je 0x25144
movl -0x4(%r12,%rbp), %eax
xorl %ecx, %ecx
cmpq %rbx, %rax
setne %cl
incl %ecx
movq (%r13), %rdi
movl -0x8(%r12,%rbp), %edx
movq %r14, %rsi
xorl %eax, %eax
callq 0x22b0
addq $0x18, %rbp
jmp 0x25127
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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), %eax
movl 0x14(%rdi), %r9d
subl %eax, %r9d
imulq $0x18, %r9, %r9
imulq $0x18, %rax, %rax
leaq (%rax,%rdx), %r10
addq $0x10, %r10
xorl %r11d, %r11d
movl %r8d, %eax
movl %ecx, %edx
cmpq %r11, %r9
je 0x25544
movzbl -0x4(%r10,%r11), %ebx
testb $0x2, %bl
je 0x2553e
testb $0x1, %bl
jne 0x2552d
subl (%r10,%r11), %edx
movl %edx, 0x8(%rdi)
jmp 0x2553e
movl -0x8(%r10,%r11), %ebx
cmpq %rsi, %rbx
jne 0x2553e
subl (%r10,%r11), %eax
movl %eax, 0xc(%rdi)
addq $0x18, %r11
jmp 0x2550f
cmpl $0x2, %edx
jae 0x25555
movabsq $0x1, %rax
jmp 0x25579
cmpl $0x2, %eax
jb 0x25549
movl %edx, %esi
leaq 0x22e1f5(%rip), %rdx    # 0x253758
cmpq %rsi, 0x218(%rdx)
jg 0x25549
movl %eax, %eax
cmpq %rax, 0x210(%rdx)
jg 0x25549
xorl %eax, %eax
movl %ecx, 0x8(%rdi)
movl %r8d, 0xc(%rdi)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/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), %r14
movl 0x14(%rdi), %r10d
movl 0x18(%rdi), %r11d
subl %r11d, %r10d
imulq $0x18, %r10, %r15
imulq $0x18, %r11, %r10
leaq (%r10,%rdx), %r12
addq $0xc, %r12
xorl %r13d, %r13d
xorl %edx, %edx
xorl %r10d, %r10d
xorl %r11d, %r11d
xorl %ebx, %ebx
cmpq %r13, %r15
je 0x2560f
movb (%r12,%r13), %bpl
testb $0x1, %bpl
jne 0x255e5
testb $0x8, %bpl
movq %r10, %rax
cmoveq %rdx, %rax
incq %rax
testb $0x8, %bpl
cmoveq %rax, %rdx
cmovneq %rax, %r10
jmp 0x25609
movl -0x4(%r12,%r13), %eax
cmpq %rsi, %rax
jne 0x25609
testb $0x8, %bpl
movq %rbx, %rax
cmoveq %r11, %rax
incq %rax
testb $0x8, %bpl
cmoveq %rax, %r11
cmovneq %rax, %rbx
addq $0x18, %r13
jmp 0x255ba
testq %r14, %r14
je 0x25626
movl 0x20(%rdi), %eax
cmpb $0x2, (%r14,%rax)
jb 0x25623
incq %r10
jmp 0x25626
incq %rdx
movq %rdx, (%rcx)
movq %r10, (%r8)
movq %r11, (%r9)
movq 0x38(%rsp), %rax
movq %rbx, (%rax)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq