LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Hash_Table.cpp
// Function: append_window_list(overlap_region*, unsigned long, unsigned long, int, int, int, int, int, int, int, void*)
void append_window_list(overlap_region* region, uint64_t x_start, uint64_t x_end, int y_start, int y_end, int error,
                        int extra_begin, int extra_end, int error_threshold, int blockLen, void *km)
{
    window_list *p = NULL;
    kv_pushp(window_list, region->w_list, &p);

    p->x_start = x_start;
    p->x_end = x_end;
    p->y_start = y_start;
    p->y_end = y_end;
    p->error = error;
    p->extra_begin = extra_begin;
    p->extra_end = extra_end;
    p->error_threshold = error_threshold;
    p->cidx = p->clen = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebx
movl %r8d, %ebp
movl %ecx, %r14d
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
movl 0x50(%rsp), %esi
movl 0x48(%rsp), %edi
movl 0x40(%rsp), %r8d
movq 0x48(%r13), %rcx
cmpq 0x50(%r13), %rcx
jne 0x13ba5
leaq (%rcx,%rcx), %rax
testq %rcx, %rcx
pushq $0x2
popq %rsi
cmovneq %rax, %rsi
movq %rsi, 0x50(%r13)
movq 0x58(%r13), %rdi
shlq $0x5, %rsi
callq 0x2370
movl 0x40(%rsp), %r8d
movl 0x48(%rsp), %edi
movl 0x50(%rsp), %esi
movq %rax, 0x58(%r13)
movq 0x48(%r13), %rcx
jmp 0x13ba9
movq 0x58(%r13), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, 0x48(%r13)
shlq $0x5, %rcx
movl %r12d, (%rax,%rcx)
movl %r15d, 0x4(%rax,%rcx)
movl %r14d, 0x8(%rax,%rcx)
movl %ebp, 0xc(%rax,%rcx)
movw %bx, 0x14(%rax,%rcx)
movw %r8w, 0x10(%rax,%rcx)
movw %di, 0x12(%rax,%rcx)
movw %si, 0x16(%rax,%rcx)
andq $0x0, 0x18(%rax,%rcx)
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/Hash_Table.cpp
// Function: test_single_list(Candidates_list*, k_mer_pos*, unsigned long, unsigned long, unsigned long)
void test_single_list(Candidates_list* candidates, k_mer_pos* n_list, uint64_t n_lengh, uint64_t end_pos, uint64_t strand)
{
    uint64_t i;
    long long j = 0;
    for (i = 0; i < n_lengh; i++)
    {
        
        for (; j < candidates->length; j++)
        {
            if (
                n_list[i].offset == (uint64_t)candidates->list[j].offset
                &&
                n_list[i].readID == candidates->list[j].readID
                &&
                end_pos == (uint64_t)candidates->list[j].self_offset
                &&
                strand == candidates->list[j].strand
            )
            {
                break;
            }   
        }

        if (j == candidates->length)
        {
            fprintf(stderr, "ERROR 4\n");
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r9
movq %rsi, %r12
movq %rdi, %r13
xorl %ebp, %ebp
xorl %r15d, %r15d
movq %rdx, (%rsp)
cmpq %r9, %rbp
je 0x13ca6
movq 0x8(%r13), %rax
cmpq %rax, %r15
movq %rax, %rcx
cmovgq %r15, %rcx
movq %r15, %rdx
shlq $0x4, %rdx
orq $0x8, %rdx
cmpq %r15, %rcx
je 0x13c77
movl (%r12,%rbp,8), %esi
movq (%r13), %rdi
cmpl -0x4(%rdi,%rdx), %esi
jne 0x13c6e
movl -0x8(%rdi,%rdx), %esi
movl 0x4(%r12,%rbp,8), %r8d
xorl %esi, %r8d
testl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
jne 0x13c6e
movl (%rdi,%rdx), %edi
cmpq %r14, %rdi
jne 0x13c6e
shrl $0x1f, %esi
cmpq %rbx, %rsi
je 0x13c7a
incq %r15
addq $0x10, %rdx
jmp 0x13c36
movq %rcx, %r15
cmpq %rax, %r15
je 0x13c84
incq %rbp
jmp 0x13c14
movq 0x23f355(%rip), %rax    # 0x252fe0
movq (%rax), %rcx
leaq 0x1cf7d3(%rip), %rdi    # 0x1e3468
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
movq (%rsp), %r9
jmp 0x13c7f
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/Hash_Table.cpp
// Function: destory_Candidates_list_buf(void*, Candidates_list*, int)
void destory_Candidates_list_buf(void *km, Candidates_list* l, int is_z)
{
    kfree(km, l->list);
    kfree(km, l->chainDP.score);
    kfree(km, l->chainDP.pre);
    kfree(km, l->chainDP.indels);
    kfree(km, l->chainDP.self_length);
    kfree(km, l->chainDP.occ);
    kfree(km, l->chainDP.tmp);
    if(is_z) memset(l, 0, sizeof(*l));
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rsi
callq 0x1a38cf
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0x1a38cf
movq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0x1a38cf
movq 0x28(%rbx), %rsi
movq %r14, %rdi
callq 0x1a38cf
movq 0x30(%rbx), %rsi
movq %r14, %rdi
callq 0x1a38cf
movq 0x38(%rbx), %rsi
movq %r14, %rdi
callq 0x1a38cf
movq 0x40(%rbx), %rsi
movq %r14, %rdi
callq 0x1a38cf
testl %ebp, %ebp
je 0x13dc3
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rbx)
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
andq $0x0, 0x50(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Hash_Table.cpp
// Function: push_ovlp_chain_qgen(overlap_region*, unsigned int, long, long, long, k_mer_hit*, k_mer_hit*)
void push_ovlp_chain_qgen(overlap_region* o, uint32_t xid, int64_t xl, int64_t yl, int64_t sc, 
k_mer_hit *beg, k_mer_hit *end)
{
    int64_t xr, yr; 
    o->x_id = xid; o->y_id = beg->readID;
    o->x_pos_strand = 0; o->y_pos_strand = beg->strand;
    o->x_pos_s = beg->self_offset; o->y_pos_s = beg->offset;
    o->x_pos_e = end->self_offset; o->y_pos_e = end->offset;

    if(o->x_pos_s <= o->y_pos_s) {
        o->y_pos_s -= o->x_pos_s; o->x_pos_s = 0;
    } else {
        o->x_pos_s -= o->y_pos_s; o->y_pos_s = 0;
    }

    xr = xl-o->x_pos_e-1; yr = yl-o->y_pos_e-1;
    if(xr <= yr) {
        o->x_pos_e = xl-1; o->y_pos_e += xr;        
    } else {
        o->y_pos_e = yl-1; o->x_pos_e += yr; 
    }

    o->shared_seed = sc;
    o->align_length = 0;
    o->is_match = 0;
    o->non_homopolymer_errors = 0;
    o->strong = 0;
    o->overlapLen = 0;
}

// Assembly:
pushq %rbx
movl %esi, (%rdi)
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl (%r9), %eax
movl %eax, 0x10(%rdi)
andl $0x0, 0xc(%rdi)
movq 0x10(%rsp), %r10
movl (%r9), %eax
shrl $0x1f, %eax
movl %eax, 0x1c(%rdi)
movl 0x4(%r9), %r11d
movl 0x8(%r9), %r9d
xorl %eax, %eax
movl %r9d, %ebx
subl %r11d, %ebx
cmovbl %eax, %ebx
movl 0x4(%r10), %esi
subl %r9d, %r11d
cmovbl %eax, %r11d
movl 0x8(%r10), %r9d
movl %ebx, 0x4(%rdi)
movl %r11d, 0x14(%rdi)
movq %rsi, %r10
notq %r10
addq %rcx, %r10
leal (%r10,%r9), %r11d
notq %r9
addq %rdx, %r9
decl %ecx
decl %edx
addl %r9d, %esi
cmpq %r10, %r9
cmovgl %ecx, %esi
cmovgl %r11d, %edx
movl %esi, 0x18(%rdi)
movl %edx, 0x8(%rdi)
movl %r8d, 0x24(%rdi)
andl $0x0, 0x28(%rdi)
movb %al, 0x2c(%rdi)
andl $0x0, 0x30(%rdi)
movb %al, 0x2e(%rdi)
andl $0x0, 0x20(%rdi)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Hash_Table.cpp
// Function: filter_non_ovlp_xchains(overlap_region*, long, long*)
int64_t filter_non_ovlp_xchains(overlap_region *a, int64_t a_n, int64_t *n_v)
{
    int64_t k, i, n_mchain, omx, opx, ovx, os, oe; overlap_region *m, *p, t;
    for (k = n_mchain = (*n_v) = 0; k < a_n; k++) {
		m = &(a[k]); 
        omx = m->x_pos_e + 1 - m->x_pos_s;
		for (i = 0; i < n_mchain; i++) {
			p = &(a[i]);
            opx = p->x_pos_e + 1 - p->x_pos_s;

            os = ((m->x_pos_s>=p->x_pos_s)? m->x_pos_s:p->x_pos_s);
            oe = ((m->x_pos_e<=p->x_pos_e)? m->x_pos_e:p->x_pos_e) + 1;
			ovx = oe>os?oe-os:0;
            if((ovx > omx*0.1) || (ovx > opx*0.1)) break;
		}
		if(i < n_mchain) continue;

        if (n_mchain != k) {
            t = a[k]; a[k] = a[n_mchain]; a[n_mchain] = t;
        }
        (*n_v) += a[n_mchain].align_length;
		n_mchain++;
	}
	return n_mchain;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
andq $0x0, (%rdx)
xorl %eax, %eax
testq %rsi, %rsi
cmovleq %rax, %r14
leaq 0x8(%rdi), %rcx
movq %rcx, 0x8(%rsp)
movsd 0x1cdd97(%rip), %xmm3   # 0x1e2bf0
xorl %r13d, %r13d
xorl %ebx, %ebx
movq %r14, (%rsp)
cmpq %r14, %rbx
je 0x14f78
imulq $0xa8, %rbx, %rsi
movl 0x4(%r15,%rsi), %ecx
movl 0x8(%r15,%rsi), %edx
movl %edx, %edi
subl %ecx, %edi
incl %edi
cvtsi2sd %rdi, %xmm0
leaq (%r15,%rsi), %rbp
mulsd %xmm3, %xmm0
testq %r13, %r13
movl $0x0, %esi
cmovgq %r13, %rsi
incq %rsi
movq 0x8(%rsp), %rdi
decq %rsi
je 0x14f01
movl -0x4(%rdi), %r8d
cmpl %r8d, %ecx
movl %r8d, %r10d
cmoval %ecx, %r10d
movl (%rdi), %r9d
cmpl %r9d, %edx
movl %r9d, %r11d
cmovbl %edx, %r11d
incl %r11d
cmpl %r10d, %r11d
ja 0x14ed1
xorpd %xmm1, %xmm1
jmp 0x14ed9
subq %r10, %r11
cvtsi2sd %r11, %xmm1
ucomisd %xmm0, %xmm1
ja 0x14f70
subl %r8d, %r9d
incl %r9d
cvtsi2sd %r9, %xmm2
addq $0xa8, %rdi
mulsd %xmm3, %xmm2
ucomisd %xmm2, %xmm1
jbe 0x14ea3
jmp 0x14f70
cmpq %rbx, %r13
je 0x14f5a
movl $0xa8, %edx
leaq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x2160
movq %r12, %r14
imulq $0xa8, %r13, %r12
addq %r15, %r12
movl $0xa8, %edx
movq %rbp, %rdi
movq %r12, %rsi
callq 0x2160
movl $0xa8, %edx
movq %r12, %rdi
movq %r14, %r12
movq (%rsp), %r14
leaq 0x10(%rsp), %rsi
callq 0x2160
movsd 0x1cdc9a(%rip), %xmm3   # 0x1e2bf0
movq (%r12), %rax
imulq $0xa8, %r13, %rcx
movl 0x28(%r15,%rcx), %ecx
addq %rcx, %rax
movq %rax, (%r12)
incq %r13
incq %rbx
jmp 0x14e62
movq %r13, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Hash_Table.cpp
// Function: lchain_dp_trace(k_mer_hit*, long, long, double, long)
uint64_t lchain_dp_trace(k_mer_hit* a, int64_t a_n, int64_t max_lgap, double sgap_rate, int64_t sgap)
{
    // fprintf(stderr, "[M::%s::] a_n::%ld\n", __func__, a_n);
    if(a_n <= 0) return 0;
    int64_t i, st, occ = 0; 

    for (i = 1, st = 0; i <= a_n; ++i) {
        // fprintf(stderr, "[M::%s::i->%ld] q::%u, t::%u, cnt::%u, readID::%u\n", __func__, 
        // i-1, a[i-1].self_offset, a[i-1].offset, a[i-1].cnt, a[i-1].readID);
        if((i == a_n) || (is_alnw(a[i]))) {///[st, i)
            if(i > st) {
                occ += filter_bad_seed_dp((st>0)?&(a[st-1]):NULL, (i<a_n)?&(a[i]):NULL, a, a_n, max_lgap, sgap_rate, sgap);
            }
            st = i+1;
        }
    }

    if(occ) {
        for (i = occ = 0; i < a_n; ++i) {
            if(a[i].self_offset == ((uint32_t)-1)) continue;
            a[occ++] = a[i];
        }
        a_n = occ;
    }
    return a_n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rsi, %rsi
jle 0x17d06
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x10(%rdi), %rdx
leaq 0x1(%rsi), %rbp
pushq $0x1
popq %r13
xorl %r10d, %r10d
xorl %eax, %eax
xorl %edi, %edi
movq %r13, %rsi
shlq $0x4, %rsi
addq %r14, %rsi
cmpq %r13, %rbp
je 0x17cce
cmpq %r13, %rbx
je 0x17c6c
movl (%rsi), %ecx
notl %ecx
testl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
je 0x17c6c
incq %r13
addq $0x10, %rsi
jmp 0x17c4d
cmpq %rax, %r13
jle 0x17cc3
movq %rdi, 0x8(%rsp)
movq %rax, %rdi
shlq $0x4, %rdi
addq %rdx, %rdi
testq %rax, %rax
cmovleq %r10, %rdi
cmpq %rbx, %r13
cmovgeq %r10, %rsi
movq %rdx, 0x10(%rsp)
movq %r14, %rdx
movq %rbx, %rcx
movq %r15, %r8
movsd %xmm0, (%rsp)
movsd (%rsp), %xmm0
movq %r12, %r9
callq 0x17a6e
movq 0x8(%rsp), %rdi
xorl %r10d, %r10d
movq 0x10(%rsp), %rdx
movsd (%rsp), %xmm0
addq %rax, %rdi
incq %r13
movq %r13, %rax
jmp 0x17c43
testq %rdi, %rdi
je 0x17d08
leaq 0x8(%r14), %rax
xorl %ecx, %ecx
subq $0x1, %rbx
jb 0x17d01
cmpl $-0x1, (%rax)
je 0x17cfb
leaq -0x8(%rax), %rdx
leaq 0x1(%rcx), %rsi
shlq $0x4, %rcx
movups (%rdx), %xmm0
movups %xmm0, (%r14,%rcx)
movq %rsi, %rcx
addq $0x10, %rax
jmp 0x17cd9
movq %rcx, %rbx
jmp 0x17d08
xorl %ebx, %ebx
movq %rbx, %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/Hash_Table.cpp
// Function: comput_sc_ch(k_mer_hit const*, k_mer_hit const*, double, double, double, long, long)
inline int32_t comput_sc_ch(const k_mer_hit *ai, const k_mer_hit *aj, double bw_rate, double chn_pen_gap, double chn_pen_skip, int64_t sl, int64_t ol)
{
    ///ai is the suffix of aj
    int32_t dq, dr, dd, dg, q_span, sc; 
    dq = (int64_t)(ai->self_offset) - (int64_t)(aj->self_offset);
    if(dq <= 0) return INT32_MIN;
    dr = (int64_t)(ai->offset) - (int64_t)(aj->offset);
    if(dr <= 0) return INT32_MIN;
    dd = dr > dq? dr - dq : dq - dr;//gap
    if((dd > 16) && (dd > cal_bw(ai, aj, bw_rate, sl, ol))) return INT32_MIN;
    dg = dr < dq? dr : dq;//len
    q_span = ai->cnt&(0xffu); 
    sc = q_span < dg? q_span : dg;
    sc = normal_w(sc, ((int32_t)(ai->cnt>>8)));
    if (dd || (dg > q_span && dg > 0)) {
        double lin_pen, a_pen;
        lin_pen = (chn_pen_gap*(double)dd);
        a_pen = ((double)(sc))*((((double)dd)/((double)dg))/bw_rate);
        if(lin_pen > a_pen) lin_pen = a_pen;
        lin_pen += (chn_pen_skip*(double)dg);
        sc -= (int32_t)lin_pen;
    }
    return sc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl 0x8(%rdi), %ebp
subl 0x8(%rsi), %ebp
movl $0x80000000, %ebx       # imm = 0x80000000
testl %ebp, %ebp
jle 0x17df6
movq %rdi, %r14
movl 0x4(%rdi), %r12d
subl 0x4(%rsi), %r12d
testl %r12d, %r12d
jle 0x17df6
movl %ebp, %eax
subl %r12d, %eax
negl %eax
movl %ebp, %r15d
subl %r12d, %r15d
cmovbl %eax, %r15d
cmpl $0x11, %r15d
jl 0x17d95
movq %r14, %rdi
movsd %xmm2, 0x18(%rsp)
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
callq 0x17e05
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
cmpl %eax, %r15d
jg 0x17df6
cmpl %ebp, %r12d
cmovbl %r12d, %ebp
movl 0xc(%r14), %edx
movzbl %dl, %ecx
cmpl %ebp, %ecx
movl %ebp, %eax
cmovbl %ecx, %eax
shrl $0x8, %edx
cmpl %edx, %eax
jae 0x17db6
pushq $0x1
popq %rbx
jmp 0x17dbe
movzbl %al, %eax
divb %dl
movzbl %al, %ebx
testl %r15d, %r15d
jne 0x17dc7
cmpl %ebp, %ecx
jae 0x17df6
cvtsi2sd %r15d, %xmm5
cvtsi2sd %ebx, %xmm4
mulsd %xmm5, %xmm1
cvtsi2sd %ebp, %xmm3
divsd %xmm3, %xmm5
divsd %xmm0, %xmm5
mulsd %xmm4, %xmm5
minsd %xmm1, %xmm5
mulsd %xmm3, %xmm2
addsd %xmm5, %xmm2
cvttsd2si %xmm2, %eax
subl %eax, %ebx
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Hash_Table.cpp
// Function: cal_bw(k_mer_hit const*, k_mer_hit const*, double, long, long)
inline int32_t cal_bw(const k_mer_hit *ai, const k_mer_hit *aj, double bw_rate, int64_t sf_l, int64_t ot_l)
{
    ///ai is the suffix of aj
    int64_t sf_s = aj->self_offset, sf_e = ai->self_offset + 1;
    int64_t ot_s = aj->offset, ot_e = ai->offset + 1;
    int64_t sf_r = sf_l - sf_e, ot_r = ot_l - ot_e;
    if(sf_s <= ot_s) sf_s = 0;
    else sf_s -= ot_s;

    if(sf_r <= ot_r) sf_e = sf_l;
    else sf_e += ot_r;

    return (sf_e - sf_s)*bw_rate;
}

// Assembly:
movl 0x4(%rsi), %eax
movl 0x8(%rsi), %esi
movl 0x4(%rdi), %r8d
movl 0x8(%rdi), %edi
incl %edi
incl %r8d
movq %rdx, %r9
subq %rdi, %r9
subq %r8, %rcx
movq %rax, %r8
subq %rsi, %r8
xorl %r10d, %r10d
cmpl %eax, %esi
cmovaq %r8, %r10
addq %rcx, %rdi
cmpq %rcx, %r9
cmovleq %rdx, %rdi
addq %r10, %rdi
cvtsi2sd %rdi, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Hash_Table.cpp
// Function: hit_long_gap(k_mer_hit*, k_mer_hit*, long, double, long)
inline int64_t hit_long_gap(k_mer_hit *a, k_mer_hit *b, int64_t max_lgap, double small_bw_rate, int64_t min_small_bw)
{
    int64_t dq, dr, dd, dm;
    dq = b->self_offset-a->self_offset;
    dr = b->offset-a->offset;
	dd = dq>=dr? ((dq)-(dr)): ((dr)-(dq));
    if(max_lgap>=0) {
        if(dd <= max_lgap) return 1;
        return 0;
    } else {
        dm = dq>=dr?dr:dq;
        if((dd > (dm*small_bw_rate)) && (dd > min_small_bw)) return 0;
        return 1;
    }
}

// Assembly:
movl 0x4(%rsi), %eax
movl 0x8(%rsi), %r8d
subl 0x8(%rdi), %r8d
subl 0x4(%rdi), %eax
movq %r8, %rdi
subq %rax, %rdi
movq %rax, %rsi
subq %r8, %rsi
cmpl %eax, %r8d
cmovaeq %rdi, %rsi
testq %rdx, %rdx
js 0x18003
cmpq %rdx, %rsi
setle %al
jmp 0x18027
cmpl %eax, %r8d
cmovbl %r8d, %eax
cvtsi2sd %rsi, %xmm1
cvtsi2sd %rax, %xmm2
mulsd %xmm0, %xmm2
ucomisd %xmm2, %xmm1
setbe %dl
cmpq %rcx, %rsi
setle %al
orb %dl, %al
movzbl %al, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/POA.cpp
// Function: append_Edge_alloc(Edge_alloc*, unsigned long, unsigned long, unsigned long, unsigned long)
void append_Edge_alloc(Edge_alloc* list,  uint64_t in_node, uint64_t out_node, uint64_t weight, uint64_t length)
{
	if (list->length + 1 > list->size) {
		uint64_t old_size = list->size;
		list->size = list->size + INCREASE_EDGE_SIZE;
		list->list = (Edge*)realloc(list->list, sizeof(Edge)*list->size);
		memset(&list->list[old_size], 0, (list->size - old_size) * sizeof(Edge));
	}

	list->list[list->length].in_node = in_node;
	list->list[list->length].out_node = out_node;
	list->list[list->length].weight = weight;
	list->list[list->length].length = length;
	list->list[list->length].num_insertions = 0;
	list->list[list->length].self_edge_ID = list->length;

	list->length++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r14
movq 0x10(%rdi), %rax
leaq 0x1(%rax), %rsi
movq (%rdi), %rbp
movq 0x8(%rdi), %r15
cmpq %r15, %rsi
jbe 0x180ea
leaq 0x5(%r15), %rax
movq %rax, 0x8(%r14)
imulq $0x38, %r15, %rbx
leaq 0x118(%rbx), %rsi
movq %rbp, %rdi
movq %r8, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
callq 0x2370
movq %rax, %rbp
movq %rax, (%r14)
addq %rax, %rbx
movq 0x8(%r14), %rax
subq %r15, %rax
imulq $0x38, %rax, %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x20e0
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %r8
movq 0x10(%r14), %rax
leaq 0x1(%rax), %rsi
imulq $0x38, %rax, %rdx
movq %r13, (%rbp,%rdx)
movq %r12, 0x8(%rbp,%rdx)
movq %rcx, 0x10(%rbp,%rdx)
movq %r8, 0x20(%rbp,%rdx)
andq $0x0, 0x18(%rbp,%rdx)
movq %rax, 0x28(%rbp,%rdx)
movq %rsi, 0x10(%r14)
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/POA.cpp
// Function: add_and_check_bi_direction_edge(Graph*, Node*, Node*, unsigned long, unsigned long)
int add_and_check_bi_direction_edge(Graph* graph, Node* in_node, Node* out_node, uint64_t weight, uint64_t flag)
{
    Edge* e_forward;
    Edge* e_backward;

    //if there are no edge from in_node to out_node
    if(!get_bi_Edge(graph, in_node, out_node, &e_forward, &e_backward))
    {
        append_Edge_alloc(&(Output_Edges((*in_node))), (*in_node).ID, (*out_node).ID, weight, flag);
        append_Edge_alloc(&(Input_Edges((*out_node))), (*in_node).ID, (*out_node).ID, weight, flag);

        Output_Edges((*in_node)).list[Output_Edges((*in_node)).length - 1].reverse_edge_ID 
        = Input_Edges((*out_node)).length - 1;

        Input_Edges((*out_node)).list[Input_Edges((*out_node)).length - 1].reverse_edge_ID
        = Output_Edges((*in_node)).length - 1;

        return 1;
    }
    else//if there is an edge from in_node to out_node, do nothing
    {
        return 0;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x10(%rsp), %rcx
leaq 0x8(%rsp), %r8
callq 0x1871a
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
jne 0x181a6
leaq 0x40(%r14), %rdi
movq (%r14), %rsi
movq (%rbx), %rdx
movq %r12, %rcx
movq %r15, %r8
callq 0x1806a
leaq 0x60(%rbx), %rdi
movq (%r14), %rsi
movq (%rbx), %rdx
movq %r12, %rcx
movq %r15, %r8
callq 0x1806a
movq 0x70(%rbx), %rax
leaq -0x1(%rax), %rcx
movq 0x40(%r14), %rdx
movq 0x50(%r14), %rsi
imulq $0x38, %rsi, %rdi
movq %rcx, -0x8(%rdx,%rdi)
decq %rsi
movq 0x60(%rbx), %rcx
imulq $0x38, %rax, %rax
movq %rsi, -0x8(%rcx,%rax)
pushq $0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/POA.cpp
// Function: add_bi_direction_edge(Graph*, Node*, Node*, unsigned long, unsigned long)
void add_bi_direction_edge(Graph* graph, Node* in_node, Node* out_node, uint64_t weight, uint64_t flag)
{

    append_Edge_alloc(&(Output_Edges((*in_node))), (*in_node).ID, (*out_node).ID, weight, flag);
    append_Edge_alloc(&(Input_Edges((*out_node))), (*in_node).ID, (*out_node).ID, weight, flag);

    Output_Edges((*in_node)).list[Output_Edges((*in_node)).length - 1].reverse_edge_ID 
    = Input_Edges((*out_node)).length - 1;

    Input_Edges((*out_node)).list[Input_Edges((*out_node)).length - 1].reverse_edge_ID
    = Output_Edges((*in_node)).length - 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r12
leaq 0x40(%rsi), %rdi
movq (%rsi), %rsi
movq (%rdx), %rdx
callq 0x1806a
leaq 0x60(%rbx), %rdi
movq (%r12), %rsi
movq (%rbx), %rdx
movq %r15, %rcx
movq %r14, %r8
callq 0x1806a
movq 0x70(%rbx), %rax
leaq -0x1(%rax), %rcx
movq 0x40(%r12), %rdx
movq 0x50(%r12), %rsi
imulq $0x38, %rsi, %rdi
movq %rcx, -0x8(%rdx,%rdi)
decq %rsi
movq 0x60(%rbx), %rcx
imulq $0x38, %rax, %rax
movq %rsi, -0x8(%rcx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/POA.cpp
// Function: remove_and_check_bi_direction_edge_from_edge(Graph*, Edge*)
int remove_and_check_bi_direction_edge_from_edge(Graph* graph, Edge* e)
{
    Edge* e_forward;
    Edge* e_backward;

    if(If_Edge_Exist(*e))
    {
        get_bi_direction_edges(graph, e, &e_forward, &e_backward);
        Output_Edges(G_Node(*graph, e_forward->in_node)).delete_length++;
        Input_Edges(G_Node(*graph, e_forward->out_node)).delete_length++;

        e_forward->in_node = (uint64_t)-1;
        e_forward->out_node = (uint64_t)-1;
        e_forward->weight = (uint64_t)-1;
        e_forward->length = (uint64_t)-1;
        e_forward->num_insertions = (uint64_t)-1;
        e_forward->self_edge_ID = (uint64_t)-1;
        e_forward->reverse_edge_ID = (uint64_t)-1;


        e_backward->in_node = (uint64_t)-1;
        e_backward->out_node = (uint64_t)-1;
        e_backward->weight = (uint64_t)-1;
        e_backward->length = (uint64_t)-1;
        e_backward->num_insertions = (uint64_t)-1;
        e_backward->self_edge_ID = (uint64_t)-1;
        e_backward->reverse_edge_ID = (uint64_t)-1;

        return 1;
    }
    else
    {
        return 0;
    }
}

// Assembly:
cmpq $-0x1, 0x8(%rsi)
je 0x1830e
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movq %rsp, %r15
movq %r14, %rdx
movq %r15, %rcx
callq 0x187aa
movq 0x18(%rbx), %rax
movq (%r14), %rcx
movq (%rcx), %rdx
shlq $0x7, %rdx
incq 0x58(%rax,%rdx)
movq 0x8(%rcx), %rdx
shlq $0x7, %rdx
incq 0x78(%rax,%rdx)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x20(%rcx)
movdqu %xmm0, 0x10(%rcx)
movdqu %xmm0, (%rcx)
orq $-0x1, 0x30(%rcx)
movq (%r15), %rax
movdqu %xmm0, 0x20(%rax)
movdqu %xmm0, 0x10(%rax)
movdqu %xmm0, (%rax)
orq $-0x1, 0x30(%rax)
pushq $0x1
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/POA.cpp
// Function: destory_Node_alloc(Node_alloc*)
void destory_Node_alloc(Node_alloc* list)
{
	uint64_t i;
	for (i = 0; i < list->size; i++) {
		destory_Edge_alloc(&list->list[i].deletion_edges);
		destory_Edge_alloc(&list->list[i].insertion_edges);
		destory_Edge_alloc(&list->list[i].mismatch_edges);
	}
	free(list->list);
	free(list->sort.list);
	free(list->sort.visit);
	free(list->sort.iterative_buffer);
	free(list->sort.iterative_buffer_visit);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x60
popq %r14
xorl %r15d, %r15d
movq (%rbx), %rdi
cmpq 0x40(%rbx), %r15
jae 0x18390
addq %r14, %rdi
addq $-0x20, %rdi
callq 0x1805c
movq (%rbx), %rdi
addq %r14, %rdi
callq 0x1805c
movq (%rbx), %rax
leaq (%rax,%r14), %rdi
addq $-0x40, %rdi
callq 0x1805c
incq %r15
subq $-0x80, %r14
jmp 0x18357
callq 0x2220
movq 0x8(%rbx), %rdi
callq 0x2220
movq 0x10(%rbx), %rdi
callq 0x2220
movq 0x28(%rbx), %rdi
callq 0x2220
movq 0x30(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/POA.cpp
// Function: clear_Node_alloc(Node_alloc*)
void clear_Node_alloc(Node_alloc* list)
{
	uint64_t i =0;
	for (i = 0; i < list->length; i++) { // TODO: is this list->size or list->length? The original version is list->length.
		clear_Edge_alloc(&list->list[i].insertion_edges);
		clear_Edge_alloc(&list->list[i].mismatch_edges);
		clear_Edge_alloc(&list->list[i].deletion_edges);
	}
	list->length = 0;
	list->delete_length = 0;
}

// Assembly:
leaq 0x48(%rdi), %rax
xorl %ecx, %ecx
xorps %xmm0, %xmm0
xorl %edx, %edx
cmpq (%rax), %rdx
jae 0x183ef
movq (%rdi), %rsi
movups %xmm0, 0x70(%rsi,%rcx)
movq (%rdi), %rsi
movups %xmm0, 0x30(%rsi,%rcx)
movq (%rdi), %rsi
movups %xmm0, 0x50(%rsi,%rcx)
incq %rdx
subq $-0x80, %rcx
jmp 0x183c9
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/POA.cpp
// Function: append_Node_alloc(Node_alloc*, char)
uint64_t append_Node_alloc(Node_alloc* list, char base)
{
	if (list->length + 1 > list->size) {
		uint64_t old_size = list->size;
		list->size = list->size * 2;
		list->list = (Node*)realloc(list->list, sizeof(Node) * list->size);
		memset(&list->list[old_size], 0, (list->size - old_size) * sizeof(Node));
	}

	list->list[list->length].ID = list->length;
	list->list[list->length].base = base;
	list->list[list->length].weight = 1;
	list->list[list->length].num_insertions = 0;
	init_Edge_alloc(&list->list[list->length].deletion_edges);
	init_Edge_alloc(&list->list[list->length].insertion_edges);
	init_Edge_alloc(&list->list[list->length].mismatch_edges);

	list->length++;

	return list->length - 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq 0x48(%rdi), %rax
leaq 0x1(%rax), %rcx
movq (%rdi), %r14
movq 0x40(%rdi), %r15
cmpq %r15, %rcx
jbe 0x18453
leaq (%r15,%r15), %rax
movq %rax, 0x40(%rbx)
movq %r15, %rsi
shlq $0x8, %rsi
movq %r14, %rdi
callq 0x2370
movq %rax, %r14
movq %rax, (%rbx)
movq %r15, %rdi
shlq $0x7, %rdi
addq %rax, %rdi
movq 0x40(%rbx), %rdx
subq %r15, %rdx
shlq $0x7, %rdx
xorl %esi, %esi
callq 0x20e0
movq 0x48(%rbx), %rax
movq %rax, %rcx
shlq $0x7, %rcx
leaq (%r14,%rcx), %rdi
addq $0x40, %rdi
movq %rax, -0x40(%rdi)
movb %bpl, -0x28(%rdi)
movq $0x1, -0x38(%rdi)
andq $0x0, -0x30(%rdi)
callq 0x1802c
movq (%rbx), %rax
movq 0x48(%rbx), %rcx
shlq $0x7, %rcx
leaq (%rax,%rcx), %rdi
addq $0x60, %rdi
callq 0x1802c
movq (%rbx), %rax
movq 0x48(%rbx), %rcx
shlq $0x7, %rcx
leaq (%rax,%rcx), %rdi
addq $0x20, %rdi
callq 0x1802c
movq 0x48(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x48(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/POA.cpp
// Function: init_Graph(Graph*)
void init_Graph(Graph* g)
{
    init_Node_alloc(&g->g_nodes);
    g->g_n_edges = 0;
    g->g_n_nodes = 0;
    g->g_next_nodeID = 0;
    g->s_end_nodeID = 0;
    g->s_start_nodeID = 0;
    g->seq = NULL;
    g->seqID = (uint64_t)-1;

    init_Queue(&(g->node_q));
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x18, %rdi
callq 0x18311
andq $0x0, 0x98(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
movups %xmm0, 0xa8(%rbx)
orq $-0x1, 0xa0(%rbx)
addq $0x70, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0x18818
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/POA.cpp
// Function: clear_Graph(Graph*)
void clear_Graph(Graph* g)
{
    clear_Node_alloc(&g->g_nodes);

    g->g_n_edges = 0;
    g->g_n_nodes = 0;
    g->g_next_nodeID = 0;
    g->s_end_nodeID = 0;
    g->s_start_nodeID = 0;
    g->seq = NULL;
    g->seqID = (uint64_t)-1;

    clear_Queue(&(g->node_q));
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x18, %rdi
callq 0x183be
andq $0x0, 0x98(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
movups %xmm0, 0xa8(%rbx)
orq $-0x1, 0xa0(%rbx)
movups %xmm0, 0x70(%rbx)
andq $0x0, 0x80(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/POA.cpp
// Function: addUnmatchedSeqToGraph(Graph*, char*, long long, long long*, long long*)
void addUnmatchedSeqToGraph(Graph* g, char* g_read_seq, long long g_read_length, long long* startID, long long* endID)
{
    long long firstID, lastID, nodeID, i;
    firstID = -1;
    lastID = -1;

    if(g_read_length == 0)
        return;

    ///start node
    nodeID  = add_Node_Graph(g, 'S');
    firstID = nodeID;
    lastID = nodeID;


    for (i = 0; i < g_read_length; i++)
    {
        nodeID = add_Node_Graph(g, g_read_seq[i]);
        
        if (firstID == -1)
        {
            firstID = nodeID;
        }
        if (lastID != -1)
        {
            ///the legnth of match edge is 0, while the length of musmatch is 1
            append_Edge_alloc(&(g->g_nodes.list[lastID].mismatch_edges), lastID, nodeID, 1, 0);
        }

        lastID = nodeID; 
    }

    *startID = firstID;
    *endID = lastID;

    g->s_start_nodeID = firstID;
    g->s_end_nodeID = lastID;
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, 0x20(%rsp)
testq %rdx, %rdx
je 0x1861a
movq %rdx, %r12
movq %rcx, 0x8(%rsp)
movq %r8, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0x18(%rdi), %rbp
pushq $0x53
popq %rsi
movq %rbp, %rdi
callq 0x183f6
movq %rax, %r15
xorl %r13d, %r13d
testq %r12, %r12
cmovleq %r13, %r12
movq %rax, %r14
cmpq %r13, %r12
je 0x185f7
movq 0x20(%rsp), %rax
movsbl (%rax,%r13), %esi
movq %rbp, %rdi
callq 0x183f6
movq %rax, %rbx
cmpq $-0x1, %r15
cmoveq %rax, %r15
cmpq $-0x1, %r14
je 0x185ef
movq (%rbp), %rax
movq %r14, %rcx
shlq $0x7, %rcx
leaq (%rax,%rcx), %rdi
addq $0x20, %rdi
movq %r14, %rsi
movq %rbx, %rdx
pushq $0x1
popq %rcx
xorl %r8d, %r8d
callq 0x1806a
incq %r13
movq %rbx, %r14
jmp 0x185a3
movq 0x8(%rsp), %rax
movq %r15, (%rax)
movq 0x18(%rsp), %rax
movq %r14, (%rax)
movq 0x10(%rsp), %rax
movq %r15, 0xa8(%rax)
movq %r14, 0xb0(%rax)
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/./POA.h
// Function: get_bi_direction_edges(Graph*, Edge*, Edge**, Edge**)
inline void get_bi_direction_edges(Graph* DAGCon, Edge* edge, Edge** e_forward, Edge** e_backward)
{
    long long in_node = edge->in_node;
    long long out_node = edge->out_node;

    if(
    edge->self_edge_ID < Output_Edges(G_Node(*DAGCon, in_node)).length
    &&
    (long long)Output_Edges(G_Node(*DAGCon, in_node)).list[edge->self_edge_ID].in_node == in_node
    &&
    (long long)Output_Edges(G_Node(*DAGCon, in_node)).list[edge->self_edge_ID].out_node == out_node
    )
    {
        (*e_forward) = &(Output_Edges(G_Node(*DAGCon, in_node)).list[edge->self_edge_ID]);
        (*e_backward) = &(Input_Edges(G_Node(*DAGCon, out_node)).list[edge->reverse_edge_ID]);
    }
    else
    {
        (*e_forward) = &(Output_Edges(G_Node(*DAGCon, in_node)).list[edge->reverse_edge_ID]);
        (*e_backward) = &(Input_Edges(G_Node(*DAGCon, out_node)).list[edge->self_edge_ID]);
    }
}

// Assembly:
pushq %rbx
movq (%rsi), %r10
movq 0x8(%rsi), %rax
movq 0x28(%rsi), %r8
movq 0x18(%rdi), %r11
movq %r10, %rbx
shlq $0x7, %rbx
movq 0x40(%r11,%rbx), %r9
cmpq 0x50(%r11,%rbx), %r8
jae 0x187f7
imulq $0x38, %r8, %r11
cmpq %r10, (%r9,%r11)
jne 0x187f7
addq %r9, %r11
cmpq %rax, 0x8(%r11)
jne 0x187f7
movq %r11, (%rdx)
movq 0x18(%rdi), %rdi
shlq $0x7, %rax
imulq $0x38, 0x30(%rsi), %rdx
addq 0x60(%rdi,%rax), %rdx
jmp 0x18813
imulq $0x38, 0x30(%rsi), %rsi
addq %rsi, %r9
movq %r9, (%rdx)
movq 0x18(%rdi), %rsi
shlq $0x7, %rax
imulq $0x38, %r8, %rdx
addq 0x60(%rsi,%rax), %rdx
movq %rdx, (%rcx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/./POA.h
// Function: add_mismatchEdge_weight(Graph*, unsigned long, char, int)
inline void add_mismatchEdge_weight(Graph* g, uint64_t in_node, char base, int last_operation)
{
    long long i = 0;
    long long nodeID;
    Edge_alloc* edge = &(g->g_nodes.list[in_node].mismatch_edges);

    for (i = 0; i < (long long)edge->length; i++)
    {
        nodeID = edge->list[i].out_node;
        if(g->g_nodes.list[nodeID].base == base)
        {
            edge->list[i].weight++;
            ///if last operation is insertion
            if (last_operation == 2)
            {
                edge->list[i].num_insertions++;
            }
            
            break;
        }
    }

    ///there are no such edge
    if (i == (long long)edge->length)
    {
        nodeID  = add_Node_Graph(g, base);
        
        ///the length of match edge is 0, while the length of mismatch edge is 1
        append_Edge_alloc(edge, in_node, nodeID, 1, 1);
        ///if last operation is insertion
        if (last_operation == 2)
        {
            edge->list[edge->length - 1].num_insertions++;
        }

        ///add the mismatch_edges of new node to the backbone
        append_Edge_alloc(&(g->g_nodes.list[nodeID].mismatch_edges), nodeID, in_node + 1, 1, 0);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rsi
addq $0x18, %r14
movq %rbx, %rax
shlq $0x7, %rax
leaq (%rsi,%rax), %r15
addq $0x20, %r15
movq 0x10(%r15), %rax
xorl %ecx, %ecx
testq %rax, %rax
movl $0x0, %r8d
cmovgq %rax, %r8
pushq $0x18
popq %rdi
cmpq %rcx, %r8
je 0x188a6
movq (%r15), %r9
movq -0x10(%r9,%rdi), %r10
shlq $0x7, %r10
cmpb %dl, 0x18(%rsi,%r10)
je 0x188ab
incq %rcx
addq $0x38, %rdi
jmp 0x18885
movq %r8, %rcx
jmp 0x188b9
incq -0x8(%r9,%rdi)
cmpl $0x2, %ebp
jne 0x188b9
incq (%r9,%rdi)
cmpq %rax, %rcx
jne 0x18920
movsbl %dl, %esi
movq %r14, %rdi
callq 0x183f6
movq %rax, %r12
pushq $0x1
popq %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movq %rcx, %r8
callq 0x1806a
cmpl $0x2, %ebp
jne 0x188f2
imulq $0x38, 0x10(%r15), %rax
movq (%r15), %rcx
incq -0x20(%rcx,%rax)
movq (%r14), %rax
movq %r12, %rcx
shlq $0x7, %rcx
leaq (%rax,%rcx), %rdi
addq $0x20, %rdi
incq %rbx
pushq $0x1
popq %rcx
movq %r12, %rsi
movq %rbx, %rdx
xorl %r8d, %r8d
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1806a
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/./POA.h
// Function: add_insertionEdge_weight(Graph*, long long, char*, long long)
inline void add_insertionEdge_weight(Graph* g, long long alignNodeID, char* insert, long long insert_length)
{
    
    long long nodeID;
    long long edgeID;
    Edge_alloc* edge = &(g->g_nodes.list[alignNodeID].insertion_edges);

    if (insert_length == 1)
    {
        edgeID = getEdge(g, edge, 1, insert[0]);
        if (edgeID != -1)
        {
            edge->list[edgeID].weight++;
        }
        else ///there is no such edge
        {
            nodeID  = add_Node_Graph(g, insert[0]);
            append_Edge_alloc(edge, alignNodeID, nodeID, 1, 1);
            ///add the new node to alignNodeID by insertion_edges
            //should link to the initial node, instead of the next node of the initial node
            ///append_Edge_alloc(&(g->g_nodes.list[nodeID].insertion_edges), nodeID, alignNodeID + 1, 1, 0);
            append_Edge_alloc(&(g->g_nodes.list[nodeID].insertion_edges), nodeID, alignNodeID, 1, 0);
        }
    }
    else
    {
        ///edgeID = get_insertion_Edges(g, edge, insert_length, insert);
        edgeID = get_insertion_Edges_new(g, alignNodeID, insert_length, insert);
        if (edgeID != -1)
        {
            ///just one outdegree
            edge->list[edgeID].weight++;
        }
        else
        {
            create_insertion_Edges(g, alignNodeID, insert_length, insert);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r13
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rax
movq %rsi, %rcx
shlq $0x7, %rcx
leaq (%rax,%rcx), %r15
addq $0x60, %r15
cmpq $0x1, %r13
jne 0x189c7
movsbl (%r12), %ecx
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x18a83
cmpl $-0x1, %eax
jne 0x189dc
addq $0x18, %r14
movsbl (%r12), %esi
movq %r14, %rdi
callq 0x183f6
movq %rax, %r12
pushq $0x1
popq %r13
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movq %r13, %rcx
movq %r13, %r8
callq 0x1806a
movq (%r14), %rax
movq %r12, %rcx
shlq $0x7, %rcx
leaq (%rax,%rcx), %rdi
addq $0x60, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x1806a
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
movq %r12, %rcx
callq 0x18ad1
cmpl $-0x1, %eax
je 0x189f4
cltq
movq (%r15), %rcx
imulq $0x38, %rax, %rax
incq 0x10(%rcx,%rax)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r12, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x18b60
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/./POA.h
// Function: getEdge(Graph*, Edge_alloc*, unsigned long, char)
inline int getEdge(Graph* g, Edge_alloc* edge, uint64_t edge_length, char base)
{
    long long i = 0;
    long long nodeID;

    for (i = 0; i < (long long)edge->length; i++)
    {
        if (edge->list[i].length == edge_length)
        {
            nodeID = edge->list[i].out_node;
            if(g->g_nodes.list[nodeID].base == base)
            {
                return i;
            }
        }
    }
    
    return -1;
}

// Assembly:
pushq %rbx
movq 0x10(%rsi), %r9
xorl %r8d, %r8d
testq %r9, %r9
cmovleq %r8, %r9
movabsq $0x20, %r10
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %r8, %r9
je 0x18acf
movq (%rsi), %r11
cmpq %rdx, (%r11,%r10)
jne 0x18ac3
movq -0x18(%r11,%r10), %r11
movq 0x18(%rdi), %rbx
shlq $0x7, %r11
cmpb %cl, 0x18(%rbx,%r11)
je 0x18acc
incq %r8
addq $0x38, %r10
jmp 0x18aa1
movl %r8d, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/./POA.h
// Function: get_insertion_Edges_new(Graph*, int, unsigned long, char*)
inline int get_insertion_Edges_new(Graph* backbone, int debug_node_in_backbone, uint64_t edge_length, char* bases)
{
    int path_i, j, step, preNode;

    for (path_i = 0; path_i < (long long)G_Node(*backbone, debug_node_in_backbone).insertion_edges.length; path_i++)
    {
        step = G_Node(*backbone, debug_node_in_backbone).insertion_edges.list[path_i].length;


        if(step != (long long)edge_length)
        {
            continue;
        }


        if(step != 0)
        {
            preNode = G_Node(*backbone, debug_node_in_backbone).insertion_edges.list[path_i].out_node;

            for (j = 0; j < step; j++)
            {
                if(G_Node(*backbone, preNode).base != bases[j])
                {
                    break;
                }

                preNode = G_Node(*backbone, preNode).insertion_edges.list[0].out_node;
            }

            if(j == step)
            {
                return path_i;
            }
        }
    }


    return -1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq 0x18(%rdi), %rdi
movslq %esi, %rax
shlq $0x7, %rax
leaq (%rdi,%rax), %r8
addq $0x60, %r8
movq 0x10(%r8), %r9
xorl %esi, %esi
testq %r9, %r9
cmovleq %rsi, %r9
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %r9, %rsi
je 0x18b5b
movq (%r8), %r11
imulq $0x38, %rsi, %rbx
movq 0x20(%r11,%rbx), %r10
testl %r10d, %r10d
je 0x18b54
movslq %r10d, %r14
cmpq %rdx, %r14
jne 0x18b54
addq %rbx, %r11
testl %r10d, %r10d
movl $0x0, %ebx
cmovgl %r10d, %ebx
xorl %r14d, %r14d
cmpq %r14, %rbx
je 0x18b4f
movslq 0x8(%r11), %r11
shlq $0x7, %r11
movb 0x18(%rdi,%r11), %bpl
cmpb (%rcx,%r14), %bpl
jne 0x18b4c
movq 0x60(%rdi,%r11), %r11
incq %r14
jmp 0x18b2a
movl %r14d, %ebx
cmpl %r10d, %ebx
je 0x18b59
incq %rsi
jmp 0x18afa
movl %esi, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/./POA.h
// Function: create_insertion_Edges(Graph*, long long, unsigned long, char*)
inline int create_insertion_Edges(Graph* g, long long alignNodeID, uint64_t edge_length, char* bases)
{
    long long i = 0;
    long long nodeID;
    ///should link back to the intial node
    ///long long backboneID = alignNodeID + 1;
    long long backboneID = alignNodeID;


    if (edge_length < 1)
    {
        return -1;
    }


    nodeID  = add_Node_Graph(g, bases[0]);
    ///add the new node to alignNodeID by insertion_edges
    append_Edge_alloc(&(g->g_nodes.list[alignNodeID].insertion_edges), alignNodeID, nodeID, 1, edge_length);

    alignNodeID = nodeID;

    for (i = 1; i < (long long)edge_length; i++)
    {
        nodeID  = add_Node_Graph(g, bases[i]);
        ///add the new node to alignNodeID by insertion_edges
        append_Edge_alloc(&(g->g_nodes.list[alignNodeID].insertion_edges), alignNodeID, nodeID, 1, edge_length - i);
        alignNodeID = nodeID;        
    }

    append_Edge_alloc(&(g->g_nodes.list[alignNodeID].insertion_edges), alignNodeID, backboneID, 1, 0);

    return 1;
}

// Assembly:
testq %rdx, %rdx
je 0x18c4c
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq %rcx, 0x10(%rsp)
movsbl (%rcx), %esi
leaq 0x18(%rdi), %r12
movq %r12, %rdi
callq 0x183f6
movq %rax, %rbp
movq 0x18(%rbx), %rax
movq %r14, %rcx
shlq $0x7, %rcx
leaq (%rax,%rcx), %rdi
addq $0x60, %rdi
pushq $0x1
popq %r13
movq %r14, 0x8(%rsp)
movq %r14, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq %r15, %r8
callq 0x1806a
leaq -0x1(%r15), %rbx
movq %r13, %r14
cmpq %r15, %r14
jge 0x18c14
movq 0x10(%rsp), %rax
movsbl (%rax,%r14), %esi
movq %r12, %rdi
callq 0x183f6
movq %rax, %r13
movq (%r12), %rax
movq %rbp, %rcx
shlq $0x7, %rcx
leaq (%rax,%rcx), %rdi
addq $0x60, %rdi
movq %rbp, %rsi
movq %r13, %rdx
pushq $0x1
popq %rcx
movq %rbx, %r8
callq 0x1806a
incq %r14
decq %rbx
movq %r13, %rbp
jmp 0x18bcb
movq (%r12), %rax
movq %rbp, %rcx
shlq $0x7, %rcx
leaq (%rax,%rcx), %rdi
addq $0x60, %rdi
pushq $0x1
popq %rcx
movq %rbp, %rsi
movq 0x8(%rsp), %rdx
xorl %r8d, %r8d
callq 0x1806a
pushq $0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/./POA.h
// Function: add_single_deletionEdge_weight(Graph*, long long, long long, unsigned long)
inline void add_single_deletionEdge_weight(Graph* g, long long alignNodeID, long long nextNodeID, uint64_t edge_length)
{
    long long i = 0;
    long long nodeID;
    Edge_alloc* edge = &(g->g_nodes.list[alignNodeID].deletion_edges);

    for (i = 0; i < (long long)edge->length; i++)
    {
        nodeID = edge->list[i].out_node;
        if(nodeID == nextNodeID)
        {
            edge->list[i].weight++;
            break;
        }
    }

    ///there are no such edge
    if (i == (long long)edge->length)
    {
        append_Edge_alloc(edge, alignNodeID, nextNodeID, 1, edge_length);
    }
}

// Assembly:
movq %rcx, %r8
movq 0x18(%rdi), %rax
movq %rsi, %rcx
shlq $0x7, %rcx
leaq (%rax,%rcx), %rdi
addq $0x40, %rdi
movq 0x10(%rdi), %rax
xorl %ecx, %ecx
testq %rax, %rax
movl $0x0, %r9d
cmovgq %rax, %r9
pushq $0x10
popq %r10
cmpq %rcx, %r9
je 0x18c95
movq (%rdi), %r11
cmpq %rdx, -0x8(%r11,%r10)
je 0x18c9a
incq %rcx
addq $0x38, %r10
jmp 0x18c7d
movq %r9, %rcx
jmp 0x18c9e
incq (%r11,%r10)
cmpq %rax, %rcx
jne 0x18cab
pushq $0x1
popq %rcx
jmp 0x1806a
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: clear_Round2_alignment(Round2_alignment*)
void clear_Correct_dumy_pure(Correct_dumy* list)
{
    list->length = 0;
    list->lengthNT = 0;
    list->start_i = 0;
    list->last_boundary_length = 0;
    list->corrected_read_length = 0;
    list->corrected_base = 0;
}

// Assembly:
andq $0x0, 0x48(%rdi)
andq $0x0, 0x20(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movaps %xmm0, 0x30(%rdi)
andl $0x0, 0x8da0(%rdi)
andq $0x0, 0x8d98(%rdi)
andq $0x0, 0x8db8(%rdi)
andl $0x0, 0x8d84(%rdi)
movb $0x7f, %al
movb %al, 0x8d80(%rdi)
andl $0x0, 0x8de0(%rdi)
andq $0x0, 0x8dd8(%rdi)
movups %xmm0, 0x8df8(%rdi)
andl $0x0, 0x8dc4(%rdi)
movb %al, 0x8dc0(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: init_Round2_alignment(Round2_alignment*)
void init_Round2_alignment(Round2_alignment* h)
{
    init_Correct_dumy(&(h->dumy));
    init_Cigar_record(&(h->cigar));
    init_Cigar_record(&(h->tmp_cigar));
    h->obtained_cigar_length = 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x1b29e
leaq 0x8d80(%rbx), %rdi
callq 0x1b2ea
leaq 0x8dc0(%rbx), %rdi
callq 0x1b2ea
andq $0x0, 0x8e00(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: init_Correct_dumy(Correct_dumy*)
void init_Correct_dumy(Correct_dumy* list)
{
    list->size = 0;
    list->length = 0;
    list->lengthNT = 0;
    list->start_i = 0;
    list->overlapID = NULL;
    int i;
    for (i = 0; i < 256; i++)
	{
		list->Peq_SSE[i] = _mm_setzero_si128();
	}


    list->corrected_read_size = 1000;
    list->corrected_read_length = 0;
    list->corrected_read = (char*)malloc(sizeof(char)*list->corrected_read_size);
    list->corrected_base = 0;

}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rdi)
movups %xmm0, 0x28(%rdi)
andq $0x0, 0x48(%rdi)
movl $0x7d80, %eax           # imm = 0x7D80
cmpq $0x8d80, %rax           # imm = 0x8D80
je 0x1b2c9
movaps %xmm0, (%rbx,%rax)
addq $0x10, %rax
jmp 0x1b2b7
movq $0x3e8, 0x18(%rbx)      # imm = 0x3E8
andq $0x0, 0x8(%rbx)
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x2280
movq %rax, (%rbx)
andq $0x0, 0x20(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: init_Cigar_record(Cigar_record*)
void init_Cigar_record(Cigar_record* dummy)
{
    dummy->length = 0;
    dummy->size = 100;
    dummy->record = (uint32_t*)malloc(sizeof(uint32_t)*dummy->size);


    dummy->lost_base_length = 0;
    dummy->lost_base_size = 100;
    dummy->lost_base = (char*)malloc(sizeof(char)*dummy->lost_base_size);



    dummy->current_operation_length = 0;
    dummy->current_operation = 127;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
andq $0x0, 0x18(%rdi)
pushq $0x64
popq %r14
movq %r14, 0x10(%rdi)
movl $0x190, %edi            # imm = 0x190
callq 0x2280
movq %rax, 0x8(%rbx)
andq $0x0, 0x38(%rbx)
movq %r14, 0x30(%rbx)
movq %r14, %rdi
callq 0x2280
movq %rax, 0x28(%rbx)
andl $0x0, 0x4(%rbx)
movb $0x7f, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: init_Round2_alignment_buf(Round2_alignment*, void*)
void init_Round2_alignment_buf(Round2_alignment* h, void *km)
{
    init_Correct_dumy_buf(&(h->dumy), km);
    init_Cigar_record_buf(&(h->cigar), km);
    init_Cigar_record_buf(&(h->tmp_cigar), km);
    h->obtained_cigar_length = 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x1b38c
xorps %xmm0, %xmm0
movups %xmm0, 0x8d80(%rbx)
movups %xmm0, 0x8db0(%rbx)
movups %xmm0, 0x8da0(%rbx)
movups %xmm0, 0x8d90(%rbx)
movb $0x7f, %al
movb %al, 0x8d80(%rbx)
movups %xmm0, 0x8dc0(%rbx)
movups %xmm0, 0x8dd0(%rbx)
movups %xmm0, 0x8de0(%rbx)
movups %xmm0, 0x8df0(%rbx)
movb %al, 0x8dc0(%rbx)
andq $0x0, 0x8e00(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: init_Correct_dumy_buf(Correct_dumy*, void*)
void init_Correct_dumy_buf(Correct_dumy* list, void *km)
{
    memset(list, 0, sizeof(Correct_dumy));
    int i;
    for (i = 0; i < 256; i++){
		list->Peq_SSE[i] = _mm_setzero_si128();
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movl $0x8d80, %edx           # imm = 0x8D80
xorl %esi, %esi
callq 0x20e0
xorps %xmm0, %xmm0
cmpq $0x1000, %r14           # imm = 0x1000
je 0x1b3bd
movaps %xmm0, 0x7d80(%rbx,%r14)
addq $0x10, %r14
jmp 0x1b3a5
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: print_string(char*, int)
void print_string(char* s, int l)
{
    int i;
    for (i = 0; i < l; i++)
    {
        fprintf(stderr, "%c", s[i]);
    }

    fprintf(stderr, "\n");
    
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %r15d, %r15d
testl %esi, %esi
cmovlel %r15d, %ebx
movq 0x237b96(%rip), %r12    # 0x252fe0
movq (%r12), %rsi
cmpq %r15, %rbx
je 0x1b462
movsbl (%r14,%r15), %edi
callq 0x2270
incq %r15
jmp 0x1b44a
pushq $0xa
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2270