LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: chhylp123[P]hifiasm/Correct.cpp
// Function: get_init_err_thres(long, double, long, long)
inline int64_t get_init_err_thres(int64_t len, double e_rate, int64_t block_s, int64_t block_err)
{
    if(len >= block_s) return block_err;
    int64_t thres = len * e_rate;
    thres = Adjust_Threshold(thres, len);
    if(thres > THRESHOLD_MAX_SIZE) thres = THRESHOLD_MAX_SIZE;
    return thres;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x20(%rbp), %rax
jl 0x9e1e9
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x9e23d
cvtsi2sdq -0x10(%rbp), %xmm0
mulsd -0x18(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x9e216
cmpq $0x4, -0x10(%rbp)
jl 0x9e216
movl $0x1, %eax
movq %rax, -0x38(%rbp)
jmp 0x9e21e
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x1f, -0x30(%rbp)
jle 0x9e235
movq $0x1f, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: chhylp123[P]hifiasm/./Correct.h
// Function: get_win_id_by_e(overlap_region*, long, long, long*)
inline int64_t get_win_id_by_e(overlap_region *z, int64_t w_e, int64_t block_s, int64_t *w_s)
{
    int64_t n_s = ((z->x_pos_s/block_s)*block_s), wid = (w_e-n_s)/block_s;
    if(w_s) {
        (*w_s) = n_s + wid*block_s;        
        if((*w_s) < z->x_pos_s) (*w_s) = z->x_pos_s;
    }
    return wid;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
cqto
idivq -0x18(%rbp)
imulq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
subq -0x28(%rbp), %rax
cqto
idivq -0x18(%rbp)
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x9e2cf
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
imulq -0x18(%rbp), %rax
addq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %ecx
cmpq %rcx, %rax
jge 0x9e2cd
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0x9e2cf
movq -0x30(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: chhylp123[P]hifiasm/./Correct.h
// Function: get_win_id_by_s(overlap_region*, long, long, long*)
inline int64_t get_win_id_by_s(overlap_region *z, int64_t w_s, int64_t block_s, int64_t *w_e)
{
    int64_t n_s = ((z->x_pos_s/block_s)*block_s), wid = (w_s-n_s)/block_s;
    if(w_e) {
        (*w_e) = n_s + (wid+1)*block_s - 1;        
        if((*w_e) > z->x_pos_e) (*w_e) = z->x_pos_e;
    }
    return wid;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
cqto
idivq -0x18(%rbp)
imulq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
subq -0x28(%rbp), %rax
cqto
idivq -0x18(%rbp)
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x9e367
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
addq $0x1, %rax
imulq -0x18(%rbp), %rax
addq %rax, %rcx
subq $0x1, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x8(%rcx), %ecx
cmpq %rcx, %rax
jle 0x9e365
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0x9e367
movq -0x30(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: chhylp123[P]hifiasm/Correct.cpp
// Function: double_error_threshold(int, int)
inline int double_error_threshold(int pre_threshold, int x_len)
{

    pre_threshold = Adjust_Threshold(pre_threshold, x_len);
    int threshold = pre_threshold * 2;
    ///may have some bugs
    if(x_len >= 300 && threshold < THRESHOLD_MAX_SIZE)
    {
        threshold = THRESHOLD_MAX_SIZE;
    }
    
    if(threshold > THRESHOLD_MAX_SIZE)
    {
        threshold = THRESHOLD_MAX_SIZE;
    }

    return threshold;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0x9e390
cmpl $0x4, -0x8(%rbp)
jl 0x9e390
movl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x9e396
movl -0x4(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
shll %eax
movl %eax, -0xc(%rbp)
cmpl $0x12c, -0x8(%rbp)      # imm = 0x12C
jl 0x9e3ba
cmpl $0x1f, -0xc(%rbp)
jge 0x9e3ba
movl $0x1f, -0xc(%rbp)
cmpl $0x1f, -0xc(%rbp)
jle 0x9e3c7
movl $0x1f, -0xc(%rbp)
movl -0xc(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: chhylp123[P]hifiasm/Correct.cpp
// Function: double_ul_error_threshold(int, int)
inline int double_ul_error_threshold(int pre_threshold, int x_len)
{

    pre_threshold = Adjust_Threshold(pre_threshold, x_len);
    int threshold = THRESHOLD_UL_MAX * x_len;
    if(threshold < pre_threshold) threshold = pre_threshold;
    if(threshold > THRESHOLD_MAX_SIZE) threshold = THRESHOLD_MAX_SIZE;
    return threshold;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0x9f420
cmpl $0x4, -0x8(%rbp)
jl 0x9f420
movl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x9f426
movl -0x4(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x4(%rbp)
cvtsi2sdl -0x8(%rbp), %xmm1
movsd 0x2dfbd7(%rip), %xmm0   # 0x37f010
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x9f452
movl -0x4(%rbp), %eax
movl %eax, -0xc(%rbp)
cmpl $0x1f, -0xc(%rbp)
jle 0x9f45f
movl $0x1f, -0xc(%rbp)
movl -0xc(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: chhylp123[P]hifiasm/./Correct.h
// Function: init_Window_Pool(Window_Pool*, long long, long long, long long)
inline void init_Window_Pool(Window_Pool* dumy, long long read_length, long long window_length, long long tail_length)
{
    dumy->terminal = 0;
    dumy->read_length = read_length;
    dumy->window_length = window_length;
    dumy->tail_length = tail_length;

    dumy->window_start = 0;
    dumy->window_end = dumy->window_length - 1;
    if (dumy->window_end >= dumy->read_length)
    {
        dumy->window_end = dumy->read_length - 1;
    }

    dumy->window_num = (dumy->read_length + dumy->window_length - 1) / dumy->window_length;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, 0x30(%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
subq $0x1, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jl 0x9f4f6
movq -0x8(%rbp), %rax
movq (%rax), %rcx
subq $0x1, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
addq 0x8(%rcx), %rax
subq $0x1, %rax
movq -0x8(%rbp), %rcx
cqto
idivq 0x8(%rcx)
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
popq %rbp
retq
// File: chhylp123[P]hifiasm/./Correct.h
// Function: get_Window(Window_Pool*, long long*, long long*)
inline int get_Window(Window_Pool* dumy, long long* w_beg, long long* w_end)
{   
    (*w_beg) = dumy->window_start;
    (*w_end) = dumy->window_end;

    if(dumy->window_end == dumy->read_length - 1)
    {
        if(dumy->terminal == 1 || dumy->read_length == 0)
        {
            return 0;
        }
        else if(dumy->terminal == 0)
        {
            dumy->terminal = 1;
        }
    }


    dumy->window_start = dumy->window_start + dumy->window_length;
    dumy->window_end = dumy->window_end + dumy->window_length;
    if (dumy->window_end >= dumy->read_length)
    {
        dumy->window_end = dumy->read_length - 1;
    }
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jne 0x9f59c
movq -0x10(%rbp), %rax
cmpl $0x1, 0x30(%rax)
je 0x9f57a
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x9f583
movl $0x0, -0x4(%rbp)
jmp 0x9f5f7
movq -0x10(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x9f598
movq -0x10(%rbp), %rax
movl $0x1, 0x30(%rax)
jmp 0x9f59a
jmp 0x9f59c
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x10(%rbp), %rax
addq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x10(%rbp), %rax
addq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jl 0x9f5f0
movq -0x10(%rbp), %rax
movq (%rax), %rcx
subq $0x1, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: chhylp123[P]hifiasm/./POA.h
// Function: getOutputNodes(RSet*, Graph*, Node*, Node**)
inline int getOutputNodes(RSet* set, Graph* graph, Node* node, Node** get_Node)
{
    if(set->index >= (long long)Output_Edges(*node).length)
    {
        return 0;
    }

    ///skip all deleted edges
    while (
    set->index < (long long)Output_Edges(*node).length 
    && 
    !(If_Edge_Exist(Output_Edges(*node).list[set->index]))
    )
    {
        set->index++;
    }

    if(set->index < (long long)Output_Edges(*node).length && 
       If_Edge_Exist(Output_Edges(*node).list[set->index]))
    {
        (*get_Node) = &(G_Node((*graph), Output_Edges(*node).list[set->index].out_node));
        set->index++;
        return 1;
    }
    else
    {
        return 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jl 0x9f8e1
movl $0x0, -0x4(%rbp)
jmp 0x9f9a8
jmp 0x9f8e3
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x20(%rbp), %rdx
xorl %eax, %eax
cmpq 0x50(%rdx), %rcx
movb %al, -0x29(%rbp)
jge 0x9f919
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
imulq $0x38, (%rcx), %rcx
addq %rcx, %rax
cmpq $-0x1, 0x8(%rax)
setne %al
xorb $-0x1, %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x9f922
jmp 0x9f932
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x9f8e3
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jge 0x9f9a1
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
imulq $0x38, (%rcx), %rcx
addq %rcx, %rax
cmpq $-0x1, 0x8(%rax)
je 0x9f9a1
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rdx
imulq $0x38, (%rdx), %rdx
addq %rdx, %rax
movq 0x8(%rax), %rax
shlq $0x7, %rax
addq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x9f9a8
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: chhylp123[P]hifiasm/./POA.h
// Function: get_Edge_Weight(Graph*, Node*, Node*)
inline long long get_Edge_Weight(Graph* DAGCon, Node* inNode, Node* outNode)
{
    Edge* e_forward = NULL;
    Edge* e_backward = NULL;
    get_bi_Edge(DAGCon, inNode, outNode, &e_forward, &e_backward);
    return e_forward->weight;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x20(%rbp), %rcx
leaq -0x28(%rbp), %r8
callq 0x2c680
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: chhylp123[P]hifiasm/./POA.h
// Function: delete_Node_DAGCon(Graph*, Node*)
uint64_t inline delete_Node_DAGCon(Graph* g, Node* node)
{
    g->g_nodes.delete_length++;
    g->g_nodes.list[(*node).ID].base = 'D';
    g->g_nodes.list[(*node).ID].num_insertions = (uint64_t)-1;
    g->g_nodes.list[(*node).ID].weight = (uint64_t)-1;


    RSet iter;
    Edge* e;
    clear_RSet(&iter);
    while (getOutputEdges(&iter, g, node, &e))
    {
        remove_and_check_bi_direction_edge_from_edge(g, e);
    }

    clear_RSet(&iter);
    while (getInputEdges(&iter, g, node, &e))
    {
        remove_and_check_bi_direction_edge_from_edge(g, e);
    }


    
    clear_Edge_alloc(&(g->g_nodes.list[(*node).ID].insertion_edges));
    clear_Edge_alloc(&(g->g_nodes.list[(*node).ID].mismatch_edges));
    clear_Edge_alloc(&(g->g_nodes.list[(*node).ID].deletion_edges));

    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x68(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movb $0x44, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq $-0x1, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq $-0x1, 0x8(%rax)
leaq -0x18(%rbp), %rdi
callq 0x2cce0
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rcx
callq 0x9fc50
cmpl $0x0, %eax
je 0x9faa8
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x2bdd0
jmp 0x9fa7f
leaq -0x18(%rbp), %rdi
callq 0x2cce0
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rcx
callq 0x2cd00
cmpl $0x0, %eax
je 0x9fada
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x2bdd0
jmp 0x9fab1
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
shlq $0x7, %rax
addq %rax, %rdi
addq $0x60, %rdi
callq 0x2b930
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
shlq $0x7, %rax
addq %rax, %rdi
addq $0x20, %rdi
callq 0x2b930
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
shlq $0x7, %rax
addq %rax, %rdi
addq $0x40, %rdi
callq 0x2b930
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: chhylp123[P]hifiasm/./POA.h
// Function: getInputNodes(RSet*, Graph*, Node*, Node**)
inline int getInputNodes(RSet* set, Graph* graph, Node* node, Node** get_Node)
{
    if(set->index >= (long long)Input_Edges(*node).length)
    {
        return 0;
    }

    ///skip all deleted edges
    while (
        set->index < (long long)Input_Edges(*node).length
        &&
        !(If_Edge_Exist(Input_Edges(*node).list[set->index]))
    )
    {
        set->index++;
    }


    if(
        set->index < (long long)Input_Edges(*node).length 
        && 
        If_Edge_Exist(Input_Edges(*node).list[set->index])
    )
    {
        (*get_Node) = &(G_Node((*graph), Input_Edges(*node).list[set->index].in_node));
        set->index++;
        return 1;
    }
    else
    {
        return 0;
    }    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x70(%rcx), %rax
jl 0x9fb81
movl $0x0, -0x4(%rbp)
jmp 0x9fc47
jmp 0x9fb83
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x20(%rbp), %rdx
xorl %eax, %eax
cmpq 0x70(%rdx), %rcx
movb %al, -0x29(%rbp)
jge 0x9fbb9
movq -0x20(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x10(%rbp), %rcx
imulq $0x38, (%rcx), %rcx
addq %rcx, %rax
cmpq $-0x1, 0x8(%rax)
setne %al
xorb $-0x1, %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x9fbc2
jmp 0x9fbd2
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x9fb83
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x70(%rcx), %rax
jge 0x9fc40
movq -0x20(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x10(%rbp), %rcx
imulq $0x38, (%rcx), %rcx
addq %rcx, %rax
cmpq $-0x1, 0x8(%rax)
je 0x9fc40
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x20(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x10(%rbp), %rdx
imulq $0x38, (%rdx), %rdx
addq %rdx, %rax
movq (%rax), %rax
shlq $0x7, %rax
addq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x9fc47
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: chhylp123[P]hifiasm/./POA.h
// Function: getOutputEdges(RSet*, Graph*, Node*, Edge**)
inline int getOutputEdges(RSet* set, Graph* graph, Node* node, Edge** get_Edge)
{
    if(set->index >= (long long)Output_Edges(*node).length)
    {
        return 0;
    }

    ///skip all deleted edges
    while (
    set->index < (long long)Output_Edges(*node).length 
    && 
    !(If_Edge_Exist(Output_Edges(*node).list[set->index]))
    )
    {
        set->index++;
    }

    if(set->index < (long long)Output_Edges(*node).length && 
       If_Edge_Exist(Output_Edges(*node).list[set->index]))
    {
        (*get_Edge) = &(Output_Edges(*node).list[set->index]);
        set->index++;
        return 1;
    }
    else
    {
        return 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jl 0x9fc81
movl $0x0, -0x4(%rbp)
jmp 0x9fd35
jmp 0x9fc83
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x20(%rbp), %rdx
xorl %eax, %eax
cmpq 0x50(%rdx), %rcx
movb %al, -0x29(%rbp)
jge 0x9fcb9
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
imulq $0x38, (%rcx), %rcx
addq %rcx, %rax
cmpq $-0x1, 0x8(%rax)
setne %al
xorb $-0x1, %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x9fcc2
jmp 0x9fcd2
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x9fc83
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jge 0x9fd2e
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
imulq $0x38, (%rcx), %rcx
addq %rcx, %rax
cmpq $-0x1, 0x8(%rax)
je 0x9fd2e
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rcx
movq -0x10(%rbp), %rax
imulq $0x38, (%rax), %rax
addq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x9fd35
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: chhylp123[P]hifiasm/./POA.h
// Function: Pop_Node(Graph*, Node**)
inline int Pop_Node(Graph* DAGCon, Node** node)
{
    long long nodeID = 0;
    int return_flag = pop_from_Queue(&(DAGCon->node_q), &nodeID);

    (*node) = &(G_Node(*DAGCon, nodeID));
    return return_flag;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
leaq -0x18(%rbp), %rsi
callq 0xc3460
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x18(%rbp), %rax
shlq $0x7, %rax
addq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl -0x1c(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: chhylp123[P]hifiasm/./POA.h
// Function: extract_path(Graph*, int, int, char*)
inline void extract_path(Graph* backbone, int debug_node_in_backbone, int path_i, char* pre)
{
    int step = G_Node(*backbone, debug_node_in_backbone).insertion_edges.list[path_i].length;
    int string_i = 0, preNode = 0, j = 0;
    if(step != 0)
    {
        string_i = 0;
        preNode = G_Node(*backbone, debug_node_in_backbone).insertion_edges.list[path_i].out_node;
    
        for (j = 0; j < step; j++)
        {
            pre[string_i++] = G_Node(*backbone, preNode).base;
            preNode = G_Node(*backbone, preNode).insertion_edges.list[0].out_node;
        }
    }

    pre[string_i] = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x60(%rax), %rax
movslq -0x10(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movl %eax, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0xa034f
movl $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x60(%rax), %rax
movslq -0x10(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl %eax, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0xa034d
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movb 0x18(%rax), %dl
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x60(%rax), %rax
movq 0x8(%rax), %rax
movl %eax, -0x24(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xa02f1
jmp 0xa034f
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb $0x0, (%rax,%rcx)
popq %rbp
retq
nopl (%rax)
// File: chhylp123[P]hifiasm/Correct.cpp
// Function: add_base_to_correct_read_directly(Correct_dumy*, char)
inline void add_base_to_correct_read_directly(Correct_dumy* dumy, char base)
{
  
    if (dumy->corrected_read_length + 2 > dumy->corrected_read_size)
    {
        dumy->corrected_read_size = dumy->corrected_read_size * 2;
        dumy->corrected_read = (char*)realloc(dumy->corrected_read, dumy->corrected_read_size);
    }
    
    dumy->corrected_read[dumy->corrected_read_length] = base;
    dumy->corrected_read_length++;
    dumy->corrected_read[dumy->corrected_read_length] = '\0';

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x2, %rax
movq -0x8(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jle 0xa0899
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
shlq %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movb -0x9(%rbp), %dl
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movb $0x0, (%rax,%rcx)
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: chhylp123[P]hifiasm/Correct.cpp
// Function: add_segment_to_correct_read(Correct_dumy*, char*, long long)
inline void add_segment_to_correct_read(Correct_dumy* dumy, char* segment, long long segment_length)
{

    if (dumy->corrected_read_length + segment_length + 2 > dumy->corrected_read_size)
    {
        dumy->corrected_read_size = dumy->corrected_read_length + segment_length + 2;
        dumy->corrected_read = (char*)realloc(dumy->corrected_read, dumy->corrected_read_size);
    }

    memcpy(dumy->corrected_read + dumy->corrected_read_length, segment, segment_length);
    dumy->corrected_read_length += segment_length;
    dumy->corrected_read[dumy->corrected_read_length] = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
addq -0x18(%rbp), %rax
addq $0x2, %rax
movq -0x8(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jle 0xa0bc4
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
addq -0x18(%rbp), %rcx
addq $0x2, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
addq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x2180
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movb $0x0, (%rax,%rcx)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: chhylp123[P]hifiasm/./Correct.h
// Function: addHaplotypeEvdience(haplotype_evdience_alloc*, haplotype_evdience*, void*)
inline void addHaplotypeEvdience(haplotype_evdience_alloc* h, haplotype_evdience* ev, void *km)
{
    if(h->length + 1 > h->size){
        h->size = h->length + 1;
        kroundup32(h->size);
        if(!km) REALLOC(h->list, h->size);
        else KREALLOC(km, h->list, h->size);
        // h->list = (haplotype_evdience*)realloc(h->list, sizeof(haplotype_evdience)*h->size);
    }

    h->list[h->length] = (*ev);
    h->length++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
addl $0x1, %eax
movq -0x8(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jbe 0xa0f9a
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x14(%rax)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %ecx
shrl %ecx
movq -0x8(%rbp), %rax
orl 0x14(%rax), %ecx
movl %ecx, 0x14(%rax)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %ecx
shrl $0x2, %ecx
movq -0x8(%rbp), %rax
orl 0x14(%rax), %ecx
movl %ecx, 0x14(%rax)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %ecx
shrl $0x4, %ecx
movq -0x8(%rbp), %rax
orl 0x14(%rax), %ecx
movl %ecx, 0x14(%rax)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %ecx
shrl $0x8, %ecx
movq -0x8(%rbp), %rax
orl 0x14(%rax), %ecx
movl %ecx, 0x14(%rax)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %ecx
shrl $0x10, %ecx
movq -0x8(%rbp), %rax
orl 0x14(%rax), %ecx
movl %ecx, 0x14(%rax)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x14(%rax)
cmpq $0x0, -0x18(%rbp)
jne 0xa0f73
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
imulq $0x18, %rax, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
jmp 0xa0f98
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
imulq $0x18, %rax, %rdx
callq 0x30e740
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
jmp 0xa0f9a
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rdx
movl 0x10(%rdx), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: chhylp123[P]hifiasm/./Correct.h
// Function: filter_one_snp(int, int, int)
inline int filter_one_snp(int occ_0, int occ_1, int total)
{
    

    double available;

    if(occ_0 <= occ_1)
    {
        available = occ_0;
    }
    else
    {
        available = occ_1;
    }
    double threshold = 0.35;
    available = available/((double)(total));

    

    if(available < threshold || occ_0 < MIN_COVERAGE_THRESHOLD + 1 || total < 10)
    ///if(available < threshold || total < 10)
    {
        return 0;
    }
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl -0x8(%rbp), %eax
cmpl -0xc(%rbp), %eax
jg 0xa14c1
cvtsi2sdl -0x8(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
jmp 0xa14cb
cvtsi2sdl -0xc(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
movsd 0x2e0d85(%rip), %xmm0   # 0x382258
movsd %xmm0, -0x20(%rbp)
movsd -0x18(%rbp), %xmm0
cvtsi2sdl -0x10(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm1
movsd -0x20(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xa1507
cmpl $0x4, -0x8(%rbp)
jl 0xa1507
cmpl $0xa, -0x10(%rbp)
jge 0xa1510
movl $0x0, -0x4(%rbp)
jmp 0xa1517
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: chhylp123[P]hifiasm/./Correct.h
// Function: insert_SNP_IDs_addition(Snp_ID_Vector_Alloc*, unsigned int*, int)
inline void insert_SNP_IDs_addition(Snp_ID_Vector_Alloc* SNP_IDs, uint32_t* IDs_vec, int IDs_vec_length)
{
    if(SNP_IDs->IDs_length + 1 > SNP_IDs->IDs_size)
    {
        SNP_IDs->IDs_size = SNP_IDs->IDs_size * 2;
        SNP_IDs->IDs = (Snp_ID_Vector*)realloc(SNP_IDs->IDs, SNP_IDs->IDs_size * sizeof(Snp_ID_Vector));
    }
    SNP_IDs->IDs[SNP_IDs->IDs_length].beg = SNP_IDs->buffer_length;
    SNP_IDs->IDs[SNP_IDs->IDs_length].end = SNP_IDs->buffer_length + IDs_vec_length - 1;


    if(SNP_IDs->buffer_length + IDs_vec_length > SNP_IDs->buffer_size)
    {
        SNP_IDs->buffer_size = (SNP_IDs->buffer_length + IDs_vec_length) * 2;
        SNP_IDs->buffer = (uint32_t*)realloc(SNP_IDs->buffer, SNP_IDs->buffer_size * sizeof(uint32_t));
    }
    memcpy(SNP_IDs->buffer + SNP_IDs->buffer_length, IDs_vec, IDs_vec_length*sizeof(uint32_t));


    SNP_IDs->IDs_length++;
    SNP_IDs->buffer_length += IDs_vec_length;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x1, %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jle 0xa1579
movq -0x8(%rbp), %rax
movq (%rax), %rcx
shlq %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x8(%rbp), %rax
imulq $0x1c, (%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdx
imulq $0x1c, 0x8(%rdx), %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x14(%rbp), %rcx
addq %rcx, %rax
subq $0x1, %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdx
imulq $0x1c, 0x8(%rdx), %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x14(%rbp), %rcx
addq %rcx, %rax
movq -0x8(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jle 0xa161c
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rcx
movslq -0x14(%rbp), %rax
addq %rax, %rcx
shlq %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rdx
shlq $0x2, %rdx
callq 0x2180
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movslq -0x14(%rbp), %rcx
movq -0x8(%rbp), %rax
addq 0x28(%rax), %rcx
movq %rcx, 0x28(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: chhylp123[P]hifiasm/./Correct.h
// Function: filter_one_snp_advance_nearby(haplotype_evdience_alloc*, int, int, int, long long, long long, unsigned int*, int)
inline int filter_one_snp_advance_nearby(haplotype_evdience_alloc* hap, int occ_0, int occ_1, int total,
long long homopolymer_num, long long non_homopolymer_num,
uint32_t* SNPs, int SNPsLen)
{
    

    double available;

    if(occ_0 <= occ_1)
    {
        available = occ_0;
    }
    else
    {
        available = occ_1;
    }
    int min = available;

    double threshold1 = 0.35;
    double threshold2 = 0.24;
    available = available/((double)(total));
    


    ///if((non_homopolymer_num > 0 && min >= 5) || (min >= 6))
    if(min >= 5)
    {
        if(available < threshold2 || total < 10)
        {
            return 0;
        }
    }
    else if(available < threshold1 || occ_0 < MIN_COVERAGE_THRESHOLD + 1 || total < 10)
    {
        return 0;
    }
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x18(%rbp), %eax
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jg 0xa16a4
cvtsi2sdl -0x14(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
jmp 0xa16ae
cvtsi2sdl -0x18(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
cvttsd2si -0x38(%rbp), %eax
movl %eax, -0x3c(%rbp)
movsd 0x2e0b9a(%rip), %xmm0   # 0x382258
movsd %xmm0, -0x48(%rbp)
movsd 0x2e0b95(%rip), %xmm0   # 0x382260
movsd %xmm0, -0x50(%rbp)
movsd -0x38(%rbp), %xmm0
cvtsi2sdl -0x1c(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
cmpl $0x5, -0x3c(%rbp)
jl 0xa170a
movsd -0x38(%rbp), %xmm1
movsd -0x50(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xa16ff
cmpl $0xa, -0x1c(%rbp)
jge 0xa1708
movl $0x0, -0x4(%rbp)
jmp 0xa1738
jmp 0xa1731
movsd -0x38(%rbp), %xmm1
movsd -0x48(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0xa1726
cmpl $0x4, -0x14(%rbp)
jl 0xa1726
cmpl $0xa, -0x1c(%rbp)
jge 0xa172f
movl $0x0, -0x4(%rbp)
jmp 0xa1738
jmp 0xa1731
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: chhylp123[P]hifiasm/./Correct.h
// Function: calculate_score(int, int)
inline int calculate_score(int new_occ_0, int new_occ_1)
{
    if(new_occ_0 + new_occ_1 == 0)
    {
        return -1;
    }

    if(filter_snp(new_occ_0, new_occ_1, new_occ_0 + new_occ_1) == 0)
    {
        return -1;
    }

    double consensus = new_occ_0 + new_occ_1 - abs(new_occ_0 - new_occ_1);

    consensus = consensus /((double)(new_occ_0 + new_occ_1));

    ///50% vs 50%
    if(new_occ_0 == new_occ_1)
    {
        consensus = consensus + 0.25;
    }
    else if(consensus >= 0.8)
    {
        consensus = consensus + 0.2;
    }
    else if(consensus >= 0.6)
    {
        consensus = consensus + 0.15;
    }
    else if(consensus >= 0.4)
    {
        consensus = consensus + 0.1;
    }
    else if(consensus >= 0.2)
    {
        consensus = consensus + 0.05;
    }
    

    consensus= consensus*((double)(new_occ_0 + new_occ_1));

    return consensus;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0x8(%rbp), %eax
addl -0xc(%rbp), %eax
cmpl $0x0, %eax
jne 0xa1765
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa189e
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
movl -0x8(%rbp), %edx
addl -0xc(%rbp), %edx
callq 0xc3500
cmpl $0x0, %eax
jne 0xa1787
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa189e
movl -0x8(%rbp), %eax
addl -0xc(%rbp), %eax
movl -0x8(%rbp), %ecx
subl -0xc(%rbp), %ecx
movl %ecx, %edx
negl %edx
cmovnsl %edx, %ecx
subl %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movl -0x8(%rbp), %eax
addl -0xc(%rbp), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movl -0x8(%rbp), %eax
cmpl -0xc(%rbp), %eax
jne 0xa17dc
movsd 0x2e0a83(%rip), %xmm0   # 0x382250
addsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
jmp 0xa187e
movsd -0x18(%rbp), %xmm0
movsd 0x2e0a47(%rip), %xmm1   # 0x382230
ucomisd %xmm1, %xmm0
jb 0xa1803
movsd 0x2dd819(%rip), %xmm0   # 0x37f010
addsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
jmp 0xa187c
movsd -0x18(%rbp), %xmm0
movsd 0x2e0a00(%rip), %xmm1   # 0x382210
ucomisd %xmm1, %xmm0
jb 0xa182a
movsd 0x2e0a2a(%rip), %xmm0   # 0x382248
addsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
jmp 0xa187a
movsd -0x18(%rbp), %xmm0
movsd 0x2e0a01(%rip), %xmm1   # 0x382238
ucomisd %xmm1, %xmm0
jb 0xa1851
movsd 0x2dd7d3(%rip), %xmm0   # 0x37f018
addsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
jmp 0xa1878
movsd -0x18(%rbp), %xmm0
movsd 0x2dd7b2(%rip), %xmm1   # 0x37f010
ucomisd %xmm1, %xmm0
jb 0xa1876
movsd 0x2e09d4(%rip), %xmm0   # 0x382240
addsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
jmp 0xa1878
jmp 0xa187a
jmp 0xa187c
jmp 0xa187e
movsd -0x18(%rbp), %xmm0
movl -0x8(%rbp), %eax
addl -0xc(%rbp), %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
cvttsd2si -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: chhylp123[P]hifiasm/./Correct.h
// Function: init_DP_matrix(DP_matrix*, unsigned int)
inline void init_DP_matrix(DP_matrix* dp, uint32_t snp_num)
{

    if(snp_num > dp->snp_size)
    {
        dp->snp_size = snp_num;
        dp->max = (uint32_t*)realloc(dp->max, dp->snp_size * sizeof(uint32_t));
        dp->max_for_sort = (uint64_t*)realloc(dp->max_for_sort, dp->snp_size * sizeof(uint64_t));
        dp->visit = (uint8_t*)realloc(dp->visit, dp->snp_size * sizeof(uint8_t));
        dp->buffer = (uint32_t*)realloc(dp->buffer, dp->snp_size * sizeof(uint32_t));
        dp->max_buffer = (uint32_t*)realloc(dp->max_buffer, dp->snp_size * sizeof(uint32_t));


        
        dp->backtrack_length = (uint32_t*)realloc(dp->backtrack_length, dp->snp_size * sizeof(uint32_t));

        dp->backtrack_size = snp_num*snp_num;
        dp->backtrack = (uint32_t*)realloc(dp->backtrack, dp->backtrack_size * sizeof(uint32_t));
    }

    dp->snp_num = snp_num;

    clear_SNP_IDs(&(dp->SNP_IDs));


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jbe 0xa1d9a
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, %esi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, %esi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, %esi
shlq $0x0, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, %esi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, %esi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, %esi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movl -0xc(%rbp), %ecx
imull -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, %esi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x30(%rax)
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
callq 0xc3580
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: chhylp123[P]hifiasm/Correct.cpp
// Function: check_informative_site(haplotype_evdience_alloc*, SnpStats*)
inline int check_informative_site(haplotype_evdience_alloc* hap, SnpStats* snp)
{
    long long vectorID = snp->id;
    int8_t *vector = Get_SNP_Vector((*hap), vectorID);
    snp->occ_0 = 0;
    snp->occ_1 = 0;
    snp->occ_2 = 0;
    long long i;
    for (i = 0; i < Get_SNP_Vector_Length((*hap)); i++)
    {
        if(vector[i] == 0)
        {
            snp->occ_0++;
        }
        else if(vector[i] == 1)
        {
            snp->occ_1++;
        }
        else if(vector[i] == 2)
        {
            snp->occ_2++;
        }
    }

    if(snp->occ_0 >= 2 || snp->occ_1 >= 2)
    {
        return 1;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x1d0(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x1c8(%rcx), %ecx
imulq -0x20(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x10(%rax)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x1c8(%rcx), %ecx
cmpq %rcx, %rax
jge 0xa1ea8
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0xa1e53
movq -0x18(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0xa1e95
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x1, %eax
jne 0xa1e73
movq -0x18(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
jmp 0xa1e93
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2, %eax
jne 0xa1e91
movq -0x18(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
jmp 0xa1e93
jmp 0xa1e95
jmp 0xa1e97
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0xa1e20
movq -0x18(%rbp), %rax
cmpl $0x2, 0x8(%rax)
jae 0xa1ebc
movq -0x18(%rbp), %rax
cmpl $0x2, 0xc(%rax)
jb 0xa1ec5
movl $0x1, -0x4(%rbp)
jmp 0xa1ecc
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: chhylp123[P]hifiasm/./Levenshtein_distance.h
// Function: pop_trace(asg16_v*, unsigned int, unsigned short*, unsigned int*)
inline uint32_t pop_trace(asg16_v *res, uint32_t i, uint16_t *c, uint32_t *len)
{
	(*c) = (res->a[i]>>14); (*len) = (res->a[i]&(0x3fff));
	for (i++; (i < res->n) && ((*c) == (res->a[i]>>14)); i++) {
		(*len) += (res->a[i]&(0x3fff));
	}
	return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xc(%rbp), %ecx
movzwl (%rax,%rcx,2), %eax
sarl $0xe, %eax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, (%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xc(%rbp), %ecx
movzwl (%rax,%rcx,2), %ecx
andl $0x3fff, %ecx           # imm = 0x3FFF
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %ecx
movq -0x8(%rbp), %rdx
xorl %eax, %eax
cmpq (%rdx), %rcx
movb %al, -0x21(%rbp)
jae 0xa1f67
movq -0x18(%rbp), %rax
movzwl (%rax), %eax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0xc(%rbp), %edx
movzwl (%rcx,%rdx,2), %ecx
sarl $0xe, %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0xa1f70
jmp 0xa1f98
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xc(%rbp), %ecx
movzwl (%rax,%rcx,2), %ecx
andl $0x3fff, %ecx           # imm = 0x3FFF
movq -0x20(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xa1f33
movl -0xc(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: chhylp123[P]hifiasm/./Correct.h
// Function: ResizeInitHaplotypeEvdience(haplotype_evdience_alloc*)
inline void ResizeInitHaplotypeEvdience(haplotype_evdience_alloc* h)
{
    // h->snp = 0;
    h->nn_snp = 0;
    h->snp_stat.n = 0;
    h->length = 0;
    h->sub_list_start = 0;
    h->sub_list_length = 0;
    /****************************may have bugs********************************/
    memset(h->flag, 0, WINDOW_MAX_SIZE * sizeof(uint8_t));
    /****************************may have bugs********************************/
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, 0x230(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x220(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x8(%rbp), %rdi
addq $0x18, %rdi
xorl %esi, %esi
movl $0x1ac, %edx            # imm = 0x1AC
callq 0x2100
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: chhylp123[P]hifiasm/Correct.cpp
// Function: simi_pass(long, long, unsigned int, double, double*)
uint32_t inline simi_pass(int64_t ol, int64_t aln_ol, uint32_t second_ck, double o_rate, double *e_rate)
{
    if(aln_ol == 0 || ol == 0) return 0;
    if((!second_ck) && (!e_rate)) {
        // if((ol*OVERLAP_THRESHOLD_FILTER) <= aln_ol) return 1;
        if((ol*o_rate) <= aln_ol) return 1;
    } else if(e_rate) {
        if((ol*((double)(((double)1.0)-(*e_rate)))) <= aln_ol) return 1;
    } else if(second_ck) {
        if(((ol*MIN_UL_ALIN_RATE) <= aln_ol) && (aln_ol >= MIN_UL_ALIN_LEN)) return 1;
    }

    // if(rref) {
    //     if((ol*OVERLAP_THRESHOLD_FILTER) <= aln_ol) return 1;
    // } else if(uref) {
    //     if(e_rate) {
    //         if((ol*((double)(((double)1.0)-(*e_rate)))) <= aln_ol) return 1;
    //     } else {
    //         if(((ol*MIN_UL_ALIN_RATE) <= aln_ol) && (aln_ol >= MIN_UL_ALIN_LEN)) return 1;
    //     }
    // }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movsd %xmm0, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xa7126
cmpq $0x0, -0x10(%rbp)
jne 0xa7132
movl $0x0, -0x4(%rbp)
jmp 0xa71dd
cmpl $0x0, -0x1c(%rbp)
jne 0xa7161
cmpq $0x0, -0x30(%rbp)
jne 0xa7161
cvtsi2sdq -0x10(%rbp), %xmm1
mulsd -0x28(%rbp), %xmm1
cvtsi2sdq -0x18(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xa715f
movl $0x1, -0x4(%rbp)
jmp 0xa71dd
jmp 0xa71d6
cmpq $0x0, -0x30(%rbp)
je 0xa7199
cvtsi2sdq -0x10(%rbp), %xmm1
movq -0x30(%rbp), %rax
movsd 0x2dae86(%rip), %xmm0   # 0x382000
subsd (%rax), %xmm0
mulsd %xmm0, %xmm1
cvtsi2sdq -0x18(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xa7197
movl $0x1, -0x4(%rbp)
jmp 0xa71dd
jmp 0xa71d4
cmpl $0x0, -0x1c(%rbp)
je 0xa71d2
cvtsi2sdq -0x10(%rbp), %xmm1
movsd 0x2db0c3(%rip), %xmm0   # 0x382270
mulsd %xmm0, %xmm1
cvtsi2sdq -0x18(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xa71d0
cmpq $0x1c2, -0x18(%rbp)     # imm = 0x1C2
jl 0xa71d0
movl $0x1, -0x4(%rbp)
jmp 0xa71dd
jmp 0xa71d2
jmp 0xa71d4
jmp 0xa71d6
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)