LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/tovlp.cpp
// Function: is_pop_bub(unsigned int, asg_t*, ma_ug_t*, buf_t*, unsigned long, unsigned char*)
int is_pop_bub(uint32_t v, asg_t *g, ma_ug_t *ug, buf_t *b, uint64_t max_dist, uint8_t *bs_flag)
{
    bs_flag[v] = 4;
    asg_arc_t *av = NULL;
    uint32_t nv, i, n_arc;
    int occ = 0;
    nv = asg_arc_n(g, v);
    av = asg_arc_a(g, v);
    ///some node could be deleted
    if (nv < 2 || g->seq[v>>1].del || g->seq[v>>1].c == ALTER_LABLE) return occ;
    ///some edges could be deleted
    for (i = n_arc = 0; i < nv; ++i) // asg_bub_pop1() may delete some edges/arcs
        if (!av[i].del) ++n_arc;
    if (n_arc < 2) return occ;
    if(asg_bub_pop1_primary_trio(ug->g, NULL, v, max_dist, b, (uint32_t)-1, (uint32_t)-1, 0, NULL, NULL, NULL, 0, 0, NULL))
    {
        //beg is v, end is b.S.a[0]
        //note b.b include end, does not include beg
        bs_flag[v] = 0;
        occ = 1;
    }
    return occ;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rcx, %rax
movl %edi, %ecx
movl %edi, %r15d
movb $0x4, (%r9,%r15)
movq 0x28(%rsi), %rdi
movq (%rdi,%r15,8), %rdi
xorl %r14d, %r14d
testl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
je 0x191005
movq %r9, %rbx
movq 0x20(%rsi), %r9
movl %ecx, %r10d
shrl %r10d
cmpl $0x0, (%r9,%r10,8)
js 0x191005
cmpb $0x1, 0x4(%r9,%r10,8)
je 0x191005
movq 0x8(%rsi), %r9
movq %rdi, %r10
shrq $0x20, %r10
movl %edi, %esi
leaq (%r10,%r10,2), %rdi
leaq (%r9,%rdi,8), %r9
addq $0xc, %r9
xorl %edi, %edi
movl (%r9), %r10d
notl %r10d
shrl $0x1f, %r10d
addl %r10d, %edi
addq $0x18, %r9
decq %rsi
jne 0x190f93
xorl %r14d, %r14d
cmpl $0x2, %edi
jb 0x191005
movq 0x18(%rdx), %rdi
xorl %r14d, %r14d
movq %r14, 0x38(%rsp)
movl %r14d, 0x30(%rsp)
movl %r14d, 0x28(%rsp)
movq %r14, 0x20(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movl %r14d, 0x8(%rsp)
movl $0xffffffff, (%rsp)     # imm = 0xFFFFFFFF
xorl %esi, %esi
movl %ecx, %edx
movq %r8, %rcx
movq %rax, %r8
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0xbf39f
testq %rax, %rax
je 0x191005
movb $0x0, (%rbx,%r15)
movl $0x1, %r14d
movl %r14d, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/tovlp.cpp
// Function: unitig_iden_worker(void*, long, int)
static void unitig_iden_worker(void *_data, long eid, int tid)
{
    long long d;
    clean_mul_t *buf = (clean_mul_t*)_data;
    clean_t *b = &(buf->a[tid]);
    if(is_pop_unitig(eid, buf->g, buf->ug, &(b->tt), &(b->stack), b->vis, &(b->pq_p), &(b->pq_a), buf->fp, buf->fa, &d))
    {
        if(b->min_v == (uint32_t)-1 || (b->min_d > d) || 
        (b->min_d == d && buf->g->seq[b->min_v>>1].len > buf->g->seq[eid>>1].len) ||
        (b->min_d == d && buf->g->seq[b->min_v>>1].len == buf->g->seq[eid>>1].len && b->min_v > eid))
        {
            b->min_v = eid; b->min_d = d;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r15
movslq %edx, %rax
imulq $0x1a0, %rax, %rax      # imm = 0x1A0
movq (%rdi), %rcx
movq 0x30(%rdi), %rsi
leaq (%rcx,%rax), %r14
movq 0x38(%rdi), %rdx
leaq 0x20(%rcx,%rax), %r8
movq 0x20(%r8), %r9
leaq 0x48(%rcx,%rax), %r10
addq %rcx, %rax
addq $0xb0, %rax
movzbl 0x28(%rdi), %r11d
movzbl 0x29(%rdi), %r12d
subq $0x8, %rsp
leaq 0x10(%rsp), %r13
movl %ebx, %edi
movq %r14, %rcx
pushq %r13
pushq %r12
pushq %r11
pushq %rax
pushq %r10
callq 0x190aea
addq $0x30, %rsp
testl %eax, %eax
je 0x191551
movl 0x180(%r14), %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
je 0x19153e
movq 0x190(%r14), %rcx
movq 0x8(%rsp), %rdx
cmpq %rdx, %rcx
jle 0x19155f
movl %ebx, 0x180(%r14)
movq 0x8(%rsp), %rax
movq %rax, 0x190(%r14)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jne 0x191551
movq 0x30(%r15), %rsi
movq 0x20(%rsi), %rdi
movl %eax, %esi
shrl %esi
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movl (%rdi,%rsi,8), %r9d
andl %r8d, %r9d
movq %rbx, %rsi
andq $-0x2, %rsi
andl (%rdi,%rsi,4), %r8d
cmpl %r8d, %r9d
ja 0x19153e
cmpq %rdx, %rcx
jne 0x191551
cmpq %rbx, %rax
jle 0x191551
movq 0x30(%r15), %rcx
movq 0x20(%rcx), %rcx
shrl %eax
movl (%rcx,%rsi,4), %edx
xorl (%rcx,%rax,8), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
je 0x19153e
jmp 0x191551
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/tovlp.cpp
// Function: rs_sort_tb64(unsigned long*, unsigned long*, int, int)
KRADIX_SORT_INIT(tb64, uint64_t, generic_key, 8)

typedef struct { uint32_t n, m; pt128_t *a; } pt128_v;
typedef struct { uint32_t n, m; pt_mz1_t *a; } pt_mz1_v;

static inline int mzcmp(const pt_mz1_t *a, const pt_mz1_t *b)
{
	return (a->x > b->x) - (a->x < b->x);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %r14d
movl $0x1, %eax
movl %r14d, %ecx
shll %cl, %eax
leal -0x1(%rax), %edx
movq %rax, %rcx
shlq $0x4, %rcx
movq %rsp, %r15
subq %rcx, %r15
movq %r15, %rsp
cltq
shlq $0x4, %rax
leaq (%r15,%rax), %r12
xorl %ecx, %ecx
movq %rdi, 0x8(%r15,%rcx)
movq %rdi, (%r15,%rcx)
addq $0x10, %rcx
cmpq %rcx, %rax
jne 0x192544
movl %ebx, %ecx
movslq %edx, %rdx
cmpq %rsi, %rdi
je 0x19257f
movq %rdi, %r8
movq (%r8), %r9
shrq %cl, %r9
andq %rdx, %r9
shlq $0x4, %r9
addq $0x8, 0x8(%r15,%r9)
addq $0x8, %r8
cmpq %rsi, %r8
jne 0x192563
testl %r14d, %r14d
je 0x1925a6
movl $0x10, %esi
movq -0x8(%r15,%rsi), %r8
movq %r8, %r9
subq %rdi, %r9
addq %r9, 0x8(%r15,%rsi)
movq %r8, (%r15,%rsi)
addq $0x10, %rsi
cmpq %rsi, %rax
jne 0x192589
movq %r15, %rsi
movq (%rsi), %r10
cmpq 0x8(%rsi), %r10
je 0x192601
movq (%r10), %r8
movq %r8, %r9
shrq %cl, %r9
andq %rdx, %r9
shlq $0x4, %r9
addq %r15, %r9
cmpq %rsi, %r9
je 0x192607
movq %r8, %r10
movq (%r9), %r11
movq (%r11), %r8
leaq 0x8(%r11), %r13
movq %r13, (%r9)
movq %r10, (%r11)
movq %r8, %r9
shrq %cl, %r9
andq %rdx, %r9
shlq $0x4, %r9
addq %r15, %r9
cmpq %rsi, %r9
jne 0x1925ca
movq (%rsi), %r9
leaq 0x8(%r9), %r10
movq %r10, (%rsi)
movq %r8, (%r9)
jmp 0x19260e
addq $0x10, %rsi
jmp 0x19260e
addq $0x8, %r10
movq %r10, (%rsi)
cmpq %r12, %rsi
jne 0x1925a9
movq %rdi, (%r15)
testl %r14d, %r14d
je 0x192632
movl $0x10, %ecx
movq -0x8(%r15,%rcx), %rdx
movq %rdx, (%r15,%rcx)
addq $0x10, %rcx
cmpq %rcx, %rax
jne 0x192620
testl %ebx, %ebx
je 0x1926bb
xorl %eax, %eax
subl %r14d, %ebx
cmovlel %eax, %ebx
movq (%r15), %rdi
movq 0x8(%r15), %rsi
movq %rsi, %rax
subq %rdi, %rax
sarq $0x3, %rax
cmpq $0x41, %rax
jl 0x192665
movl %r14d, %edx
movl %ebx, %ecx
callq 0x192508
jmp 0x1926b2
cmpq $0x2, %rax
jl 0x1926b2
leaq 0x8(%rdi), %rdx
cmpq %rsi, %rdx
jae 0x1926b2
movq %rdi, %rax
movq %rax, %r8
movq 0x8(%rax), %rcx
movq %rdx, %rax
cmpq (%r8), %rcx
jae 0x1926a9
movq %rax, %rdx
cmpq %rdi, %rax
jbe 0x1926a6
movq %rax, %rdx
movq -0x8(%rdx), %r8
cmpq %r8, %rcx
jae 0x1926a6
movq %r8, (%rdx)
addq $-0x8, %rdx
cmpq %rdi, %rdx
ja 0x192691
movq %rcx, (%rdx)
leaq 0x8(%rax), %rdx
cmpq %rsi, %rdx
jb 0x192677
addq $0x10, %r15
cmpq %r12, %r15
jne 0x192642
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/tovlp.cpp
// Function: pt_collect_minimizers(ma_ug_t*, asg_t*, ma_sub_t*, ma_hit_t_alloc*, kvec_asg_arc_t_warp*, int, int)
pt_mz1_v *pt_collect_minimizers(ma_ug_t *ug, asg_t *read_g, ma_sub_t *coverage_cut, ma_hit_t_alloc* sources, 
kvec_asg_arc_t_warp* edge, int max_hang, int min_ovlp)
{
    uint32_t i;
    pt_mz1_v *mz = NULL; CALLOC(mz, 1);
    
    for (i = 0; i < ug->u.n; i++)
    {
        if(!ug->u.a[i].len) continue;
        pt_sketch(ug->u.a[i].s, ug->u.a[i].len, asm_opt.mz_win, asm_opt.k_mer_length, i, 0, mz);
    }

    radix_sort_mz(mz->a, mz->a + mz->n);
    return mz;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
movl $0x1, %edi
movl $0x10, %esi
callq 0x2120
movq %rax, %rbx
cmpq $0x0, (%r14)
je 0x193246
xorl %r15d, %r15d
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
leaq 0xf7550(%rip), %r12     # 0x28a758
movq 0x10(%r14), %rax
leaq (%r15,%r15,4), %rcx
movl (%rax,%rcx,8), %esi
andl %ebp, %esi
je 0x19323e
leaq (%rax,%rcx,8), %rax
movq 0x20(%rax), %rdi
movl 0x80(%r12), %ecx
movl 0x94(%r12), %edx
movq %rbx, (%rsp)
movl %r15d, %r8d
xorl %r9d, %r9d
callq 0x19272f
incl %r15d
cmpq %r15, (%r14)
ja 0x193208
movq 0x8(%rbx), %rdi
movl (%rbx), %eax
leaq (%rax,%rax,2), %rax
leaq (%rdi,%rax,8), %rsi
callq 0x192286
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/tovlp.cpp
// Function: pt_lis_64(int, unsigned long const*, int*, int*)
int32_t pt_lis_64(int32_t n, const uint64_t *a_idx, int32_t *b, int32_t *M)
{
	int32_t i, k, L = 0, *P = b;
	// MALLOC(M, n+1);
	for (i = 0; i < n; ++i) {
		int32_t lo = 1, hi = L, newL;
		while (lo <= hi) {
			int32_t mid = (lo + hi + 1) >> 1;
			if ((uint32_t)a_idx[M[mid]] < (uint32_t)a_idx[i]) lo = mid + 1;
			else hi = mid - 1;
		}
		newL = lo, P[i] = M[newL - 1], M[newL] = i;
		if (newL > L) L = newL;
	}
	k = M[L];
	memcpy(M, P, n * sizeof(int32_t));
	for (i = L - 1; i >= 0; --i) b[i] = k, k = M[k];
	// free(M);
	return L;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
testl %edi, %edi
jle 0x1936f7
movl %edi, %eax
xorl %ecx, %ecx
xorl %ebp, %ebp
testl %ebp, %ebp
jle 0x1936d4
movl (%rsi,%rcx,8), %r8d
movl $0x1, %edx
movl %ebp, %r9d
leal (%rdx,%r9), %r10d
incl %r10d
sarl %r10d
movslq %r10d, %r11
movslq (%rbx,%r11,4), %r11
cmpl %r8d, (%rsi,%r11,8)
jb 0x1936c7
decl %r10d
movl %r10d, %r9d
jmp 0x1936cd
incl %r10d
movl %r10d, %edx
cmpl %r9d, %edx
jle 0x1936a8
jmp 0x1936d9
movl $0x1, %edx
movslq %edx, %rdx
movl -0x4(%rbx,%rdx,4), %r8d
movl %r8d, (%r14,%rcx,4)
movl %ecx, (%rbx,%rdx,4)
cmpl %ebp, %edx
cmovgl %edx, %ebp
incq %rcx
cmpq %rax, %rcx
jne 0x193698
jmp 0x1936f9
xorl %ebp, %ebp
movslq %ebp, %r12
movl (%rbx,%r12,4), %r15d
movslq %edi, %rdx
shlq $0x2, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2160
testl %r12d, %r12d
jle 0x193731
movl %ebp, %eax
incq %rax
movl %r15d, -0x8(%r14,%rax,4)
movslq %r15d, %rcx
movl (%rbx,%rcx,4), %r15d
decq %rax
cmpq $0x1, %rax
jg 0x19371c
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/tovlp.cpp
// Function: debug_lis_64(unsigned long const*, int*, unsigned long)
uint32_t debug_lis_64(const uint64_t *a, int32_t *b, uint64_t n)
{
    uint32_t i;
    if(n <= 1) return 1;
    for (i = 0; i+1 < n; i++)
    {
        if(((a[b[i]]>>32) > (a[b[i+1]]>>32)) || (((uint32_t)a[b[i]]) > ((uint32_t)a[b[i+1]])))
        {
            i = (uint32_t)-1;
            break;
        }
    } 
    if(i == (uint32_t)-1)
    {
        fprintf(stderr, "\nERROR-chain\n");   
        for (i = 0; i < n; i++)
        {
            fprintf(stderr, "x-%lu, y-%lu\n", (a[b[i]]>>32), (uint64_t)((uint32_t)a[b[i]]));
        }
    }
    return 1;
}

// Assembly:
cmpq $0x2, %rdx
jb 0x19378e
movq %rdi, %rax
xorl %r9d, %r9d
leal 0x1(%r9), %ecx
cmpq %rdx, %rcx
jae 0x193786
movl %r9d, %edi
movslq (%rsi,%rdi,4), %rdi
movq (%rax,%rdi,8), %r8
movq %r8, %r9
shrq $0x20, %r9
movslq (%rsi,%rcx,4), %rdi
movq (%rax,%rdi,8), %r10
movq %r10, %r11
shrq $0x20, %r11
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
cmpl %r11d, %r9d
ja 0x193789
movl %ecx, %r9d
cmpl %r10d, %r8d
jbe 0x193748
jmp 0x193789
movl %r9d, %edi
cmpl $-0x1, %edi
je 0x193794
movl $0x1, %eax
retq
pushq %rax
movq %rsi, %rdi
movq %rax, %rsi
callq 0x24645
addq $0x8, %rsp
jmp 0x19378e
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/tovlp.cpp
// Function: update_mz_ovlp(unsigned int*, unsigned int*, long, unsigned int*, unsigned int*, long, unsigned int)
void update_mz_ovlp(uint32_t* n_x_beg, uint32_t* n_x_end, int64_t xLen, 
uint32_t* n_y_beg, uint32_t* n_y_end, int64_t yLen, uint32_t rev)
{
    int64_t x_beg = (*n_x_beg), x_end = (*n_x_end);
    int64_t y_beg = (*n_y_beg), y_end = (*n_y_end);
    if(x_beg <= y_beg)
    {
        y_beg = y_beg - x_beg;
        x_beg = 0;
    }
    else
    {
        x_beg = x_beg - y_beg;
        y_beg = 0;
    }

    long long x_right_length = xLen - x_end - 1;
    long long y_right_length = yLen - y_end - 1;


    if(x_right_length <= y_right_length)
    {
        x_end = xLen - 1;
        y_end = y_end + x_right_length;        
    }
    else
    {
        x_end = x_end + y_right_length;
        y_end = yLen - 1;
    }

    if(rev == 0)
    {
        (*n_y_beg) = y_beg;
        (*n_y_end) = y_end + 1;
    }
    else
    {
        (*n_y_beg) = yLen - y_end - 1;
        (*n_y_end) = yLen - y_beg - 1 + 1;
    }

    (*n_x_beg) = x_beg;
    (*n_x_end) = x_end + 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl (%rdi), %eax
movl (%rsi), %r10d
movl (%rcx), %ebx
movl (%r8), %r11d
movq %rbx, %r14
subq %rax, %r14
xorl %r12d, %r12d
cmpl %ebx, %eax
cmovbeq %r14, %r12
movq %r10, %r14
notq %r14
addq %rdx, %r14
leaq (%r14,%r11), %r13
notq %r11
addq %r9, %r11
leaq -0x1(%r9), %r15
cmpq %r11, %r14
cmovleq %r13, %r15
cmpl $0x0, 0x38(%rsp)
je 0x1937ff
notl %r15d
leal (%r9,%r15), %ebp
movl %ebp, (%rcx)
subq %r12, %r9
movq %r9, %r15
jmp 0x193805
movl %r12d, (%rcx)
incq %r15
xorl %ecx, %ecx
subl %ebx, %eax
cmovbl %ecx, %eax
cmpq %r11, %r14
leal 0x1(%r10,%r11), %ecx
movl %r15d, (%r8)
movl %eax, (%rdi)
cmovgl %ecx, %edx
movl %edx, (%rsi)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/tovlp.cpp
// Function: get_insert_pos(unsigned long*, long, long)
int64_t get_insert_pos(uint64_t *a, int64_t n, int64_t target)
{
    int64_t left, right, ans, mid;
    left = 0; right = n - 1; ans = n;
    while (left <= right) {
        mid = ((right - left) >> 1) + left;
        if (target <= (uint32_t)a[mid]) {
            ans = mid;
            right = mid - 1;
        } else {
            left = mid + 1;
        }
    }
    return ans;
}

// Assembly:
movq %rsi, %rax
testq %rsi, %rsi
jle 0x193864
leaq -0x1(%rax), %rsi
xorl %ecx, %ecx
movq %rsi, %r8
subq %rcx, %r8
sarq %r8
leaq (%r8,%rcx), %r9
movl (%rdi,%r9,8), %r10d
cmpq %rdx, %r10
jl 0x193859
leaq (%r8,%rcx), %rsi
decq %rsi
movq %r9, %rax
jmp 0x19385f
addq %r8, %rcx
incq %rcx
cmpq %rsi, %rcx
jle 0x193837
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/tovlp.cpp
// Function: get_mz_occ(mz_ds_t*, unsigned long, unsigned long, unsigned long)
uint32_t get_mz_occ(mz_ds_t *mz_idx, uint64_t uid, uint64_t s, uint64_t e)
{
    uint64_t *a = mz_idx->pos.a + (mz_idx->idx[uid]>>32), n = (uint32_t)(mz_idx->idx[uid]);
    if(n == 0) return 0;
    int64_t sid, eid;
    sid = get_insert_pos(a, n, s);
    eid = get_insert_pos(a, n, e);
    return eid + 1 - sid;
}

// Assembly:
movq (%rdi), %rax
movq (%rax,%rsi,8), %rsi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
andq %rsi, %rax
je 0x1938f3
pushq %rbx
shrq $0x1d, %rsi
andq $-0x8, %rsi
addq 0x18(%rdi), %rsi
leaq -0x1(%rax), %r9
xorl %r8d, %r8d
movq %rax, %rdi
movq %r9, %r10
subq %r8, %r10
sarq %r10
leaq (%r10,%r8), %r11
movl (%rsi,%r11,8), %ebx
cmpq %rdx, %rbx
jl 0x1938af
leaq (%r10,%r8), %r9
decq %r9
movq %r11, %rdi
jmp 0x1938b5
addq %r10, %r8
incq %r8
cmpq %r9, %r8
jle 0x19388d
leaq -0x1(%rax), %r8
xorl %edx, %edx
movq %r8, %r9
subq %rdx, %r9
sarq %r9
leaq (%r9,%rdx), %r10
movl (%rsi,%r10,8), %r11d
cmpq %rcx, %r11
jl 0x1938e2
leaq (%r9,%rdx), %r8
decq %r8
movq %r10, %rax
jmp 0x1938e8
addq %r9, %rdx
incq %rdx
cmpq %r8, %rdx
jle 0x1938c0
subl %edi, %eax
incl %eax
popq %rbx
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/tovlp.cpp
// Function: pt_pdist(ma_ug_t*, asg_t*, ma_sub_t*, ma_hit_t_alloc*, kvec_asg_arc_t_warp*, int, int, unsigned int)
kv_u_trans_t *pt_pdist(ma_ug_t *ug, asg_t *read_g, ma_sub_t *coverage_cut, ma_hit_t_alloc* sources, 
kvec_asg_arc_t_warp* edge, int max_hang, int min_ovlp, uint32_t min_chain_cnt)
{
    pt_mz1_v *mz = NULL;
    mz_ds_t mz_idx; memset(&mz_idx, 0, sizeof(mz_idx));
    pt128_v *an = NULL;
    kv_u_trans_t *ma = NULL; CALLOC(ma, 1);
    mz = pt_collect_minimizers(ug, read_g, coverage_cut, sources, edge, max_hang, min_ovlp);
    an = pt_collect_anchors(ug, mz, &mz_idx, asm_opt.polyploidy*10);
    kv_destroy(*mz); free(mz);

    ma = pt_cal_sim(an, &mz_idx, ug, min_chain_cnt, asm_opt.purge_simi_thres);
    kv_destroy(*an); free(an); 
    kv_destroy(mz_idx.pos); free(mz_idx.idx);
    
    kt_u_trans_t_idx(ma, ug->g->n_seq);
    kt_u_trans_t_simple_symm(ma, ug->g->n_seq, 1);
    clean_mz_ovlp(ma, ug);
    // print_u_trans(ma);
    // exit(1);
    return ma;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movl 0x78(%rsp), %ebp
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
callq 0x1931d2
movq %rax, %r15
leaq 0xf652d(%rip), %r13     # 0x28a758
movl 0x1bc(%r13), %eax
addl %eax, %eax
leal (%rax,%rax,4), %ecx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x193269
movq %rax, %r12
movq 0x8(%r15), %rdi
callq 0x2220
movq %r15, %rdi
callq 0x2220
xorps %xmm0, %xmm0
cvtss2sd 0x16c(%r13), %xmm0
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0x1938f6
movq %rax, %r15
movq 0x8(%r12), %rdi
callq 0x2220
movq %r12, %rdi
callq 0x2220
movq 0x18(%r14), %rdi
callq 0x2220
movq (%r14), %rdi
callq 0x2220
movq 0x18(%rbx), %rax
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movl 0x14(%rax), %esi
andl %ebp, %esi
movq %r15, %rdi
callq 0xc405a
movq 0x18(%rbx), %rax
andl 0x14(%rax), %ebp
movq %r15, %rdi
movl %ebp, %esi
movl $0x1, %edx
callq 0xcb60e
movq %r15, %rdi
movq %rbx, %rsi
callq 0x193e59
movq %r15, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: mg_gres_a_des(mg_gres_a*)
void mg_gres_a_des(mg_gres_a *p)
{
	uint64_t i = 0;
	for (i = 0; i < p->n; i++){
		free(p->a[i].lc); free(p->a[i].gc);
	}
	free(p->a);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, (%rdi)
je 0x1992ba
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movq 0x10(%rax,%r14), %rdi
callq 0x2220
movq 0x10(%rbx), %rax
movq 0x8(%rax,%r14), %rdi
callq 0x2220
incq %r15
addq $0x28, %r14
cmpq (%rbx), %r15
jb 0x199292
movq 0x10(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: flt_anchors(long, mg128_t*, int)
int64_t flt_anchors(int64_t n_a, mg128_t *a, int32_t r)
{
	int64_t i, j;
	for (i = 0; i < n_a; ++i) {
		for (j = i - 1; j >= 0; --j) {
			/**
			 * a is sorted by x
			 * a[].x: ref_id(31)rev(1)r_pos(32)
			 * a[].y: weight(8)query_id(8)flag(8)span(8)q_pos(32)
			 **/
			int32_t dq;
			int64_t dr = a[i].x - a[j].x;///a is sorted by x
			if (dr > r) break;///if two candidates coming from differnt unitigs, dr would be extremly large
			dq = (int32_t)a[i].y - (int32_t)a[j].y;
			if (dq > r || dq < 0) continue;
			a[j].y |= MG_SEED_KEPT;
			a[i].y |= MG_SEED_KEPT;
			break;
		}
	}
	for (i = n_a - 1; i >= 0; --i) {
		if (a[i].y & MG_SEED_KEPT) continue;
		for (j = i + 1; j < n_a; ++j) {
			int32_t dq;
			int64_t dr = a[j].x - a[i].x;
			if (dr > r) break;
			dq = (int32_t)a[j].y - (int32_t)a[i].y;
			if (dq > r || dq < 0) continue;
			a[j].y |= MG_SEED_KEPT;
			a[i].y |= MG_SEED_KEPT;
			break;
		}
	}
	for (i = j = 0; i < n_a; ++i)
		if (a[i].y & MG_SEED_KEPT)
			a[j++] = a[i];
	return j;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, -0x8(%rsp)
movabsq $0x80000000000, %r13    # imm = 0x80000000000
movslq %edx, %rax
testq %rdi, %rdi
jle 0x1996ce
movq -0x8(%rsp), %rcx
leaq 0x8(%rcx), %r8
movl $0x1, %r9d
xorl %r10d, %r10d
movq %r10, %r11
shlq $0x4, %r11
addq -0x8(%rsp), %r11
movq %r8, %rbx
movq %r9, %r14
decq %r14
jle 0x1996bf
movq (%r11), %r15
subq -0x18(%rbx), %r15
cmpq %rax, %r15
jg 0x1996bf
movl 0x8(%r11), %ebp
movq -0x10(%rbx), %r15
addq $-0x10, %rbx
subl %r15d, %ebp
sets %r12b
cmpl %edx, %ebp
setg %bpl
orb %r12b, %bpl
jne 0x199686
orq %r13, %r15
movq %r15, (%rbx)
orq %r13, 0x8(%r11)
incq %r10
incq %r9
addq $0x10, %r8
cmpq %rdi, %r10
jne 0x199674
testq %rdi, %rdi
jle 0x199776
movq %rdi, %r8
shlq $0x4, %r8
movq -0x8(%rsp), %rcx
addq %rcx, %r8
addq $0x8, %r8
xorl %r9d, %r9d
movq %rdi, %r10
movq %r10, %r11
decq %r10
movq %r10, %rbx
shlq $0x4, %rbx
movq %r13, %rsi
movq -0x8(%rsp), %rcx
testq %r13, 0x8(%rcx,%rbx)
setne %bpl
cmpq %rdi, %r11
setge %r14b
orb %bpl, %r14b
jne 0x199762
addq -0x8(%rsp), %rbx
movq (%rbx), %r15
movq %r8, %r14
movq %r9, %r12
movq -0x8(%r14), %r13
subq %r15, %r13
cmpq %rax, %r13
jg 0x199762
movq (%r14), %r13
movl 0x8(%rbx), %ebp
movl %r13d, %ecx
subl %ebp, %ecx
sets %bpl
cmpl %edx, %ecx
setg %cl
orb %bpl, %cl
je 0x199758
addq $0x10, %r14
decq %r12
jne 0x199728
jmp 0x199762
orq %rsi, %r13
movq %r13, (%r14)
orq %rsi, 0x8(%rbx)
incq %r9
addq $-0x10, %r8
cmpq $0x1, %r11
movq %rsi, %r13
jg 0x1996f0
testq %rdi, %rdi
jle 0x1997b1
movq -0x8(%rsp), %rax
leaq 0x8(%rax), %rdx
xorl %eax, %eax
testq %r13, (%rdx)
je 0x1997a6
leaq -0x8(%rdx), %rcx
leaq 0x1(%rax), %r8
shlq $0x4, %rax
movups (%rcx), %xmm0
movq -0x8(%rsp), %rcx
movups %xmm0, (%rcx,%rax)
movq %r8, %rax
addq $0x10, %rdx
decq %rdi
jne 0x199786
jmp 0x1997b3
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: extend_coordinates(mg_lchain_t*, long, long)
void extend_coordinates(mg_lchain_t *ri, int64_t qlen, int64_t rlen)
{
	int64_t qs, qe, rs, re, qtail, rtail;
	qs = ri->qs; qe = ri->qe - 1; rs = ri->rs; re = ri->re - 1;
	if(ri->v&1) {
		rs = rlen - ri->re; re = rlen - ri->rs - 1;
	}
	
	if(qs <= rs) {
        rs -= qs; qs = 0;
    } else {
    	qs -= rs; rs = 0;
    }

	qtail = qlen - qe - 1; rtail = rlen - re - 1;
    if(qtail <= rtail) {
        qe = qlen - 1; re += qtail;
    }
    else
    {
		re = rlen - 1; qe += rtail; 
    }

	ri->qs = qs; ri->qe = qe + 1; ri->rs = rs; ri->re = re + 1;
	if(ri->v&1) {
		ri->rs = rlen - re - 1; ri->re = rlen - rs;
	}
}

// Assembly:
pushq %r14
pushq %rbx
movslq 0x14(%rdi), %r8
movslq 0x18(%rdi), %rcx
movslq 0xc(%rdi), %r10
movslq 0x10(%rdi), %r11
movb 0x8(%rdi), %al
movq %rdx, %rbx
subq %r11, %rbx
decq %r11
movq %r10, %r9
notq %r9
addq %rdx, %r9
testb $0x1, %al
cmoveq %r10, %rbx
cmoveq %r11, %r9
movq %r9, %r10
notq %r10
addq %rdx, %r10
movl %r8d, %r11d
subl %ebx, %r11d
xorl %r14d, %r14d
subq %r8, %rbx
movl $0x0, %r8d
cmovgeq %rbx, %r8
cmovgel %r14d, %r11d
leal (%r10,%rcx), %ebx
movq %rsi, %r14
subq %rcx, %r14
addq %r14, %r9
leaq -0x1(%rdx), %rcx
cmpq %r10, %r14
cmovleq %r9, %rcx
cmovgl %ebx, %esi
leal 0x1(%rcx), %r9d
movl %r11d, 0x14(%rdi)
movl %esi, 0x18(%rdi)
movl %r8d, 0xc(%rdi)
movl %r9d, 0x10(%rdi)
testb $0x1, %al
je 0x19a3ac
notl %ecx
addl %edx, %ecx
movl %ecx, 0xc(%rdi)
subl %r8d, %edx
movl %edx, 0x10(%rdi)
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: mg_update_anchors(int, mg128_t*, int, int const*)
void mg_update_anchors(int32_t n_a, mg128_t *a, int32_t n, const int32_t *mini_pos)
{
	int32_t st, j, k;
	if (n_a <= 0) return;
	st = get_mini_idx(&a[0], n, mini_pos);
	assert(st >= 0);
	for (k = 0, j = st; j < n && k < n_a; ++j)
		if ((int32_t)a[k].y == mini_pos[j])
			a[k].x = (uint64_t)j << 32 | (a[k].x & 0xffffffffU), ++k;
	assert(k == n_a);
}

// Assembly:
pushq %rbx
testl %edi, %edi
jle 0x19a5f9
leal -0x1(%rdx), %r9d
movl 0x8(%rsi), %r8d
xorl %r10d, %r10d
cmpl %r9d, %r10d
jg 0x19a599
movslq %r9d, %r11
movslq %r10d, %rbx
addq %r11, %rbx
shrq %rbx
movl (%rcx,%rbx,4), %r11d
cmpl %r8d, %r11d
jge 0x19a582
leal 0x1(%rbx), %r10d
jmp 0x19a588
jle 0x19a58d
leal -0x1(%rbx), %r9d
movb $0x1, %r11b
jmp 0x19a592
xorl %r11d, %r11d
movl %ebx, %eax
testb %r11b, %r11b
jne 0x19a562
jmp 0x19a59e
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x19a5fb
xorl %r8d, %r8d
cmpl %edx, %eax
jge 0x19a5f4
movl %eax, %r9d
leaq (%rcx,%r9,4), %rcx
shlq $0x20, %r9
incl %eax
xorl %r8d, %r8d
movabsq $0x100000000, %r10      # imm = 0x100000000
movslq %r8d, %r11
shlq $0x4, %r11
movl (%rcx), %ebx
cmpl 0x8(%rsi,%r11), %ebx
jne 0x19a5e2
addq %rsi, %r11
movl (%r11), %ebx
addq %r9, %rbx
movq %rbx, (%r11)
incl %r8d
cmpl %edx, %eax
jge 0x19a5f4
addq %r10, %r9
addq $0x4, %rcx
incl %eax
cmpl %edi, %r8d
jl 0x19a5c3
cmpl %edi, %r8d
jne 0x19a61a
popq %rbx
retq
leaq 0x9942a(%rip), %rdi     # 0x233a2c
leaq 0x99382(%rip), %rsi     # 0x23398b
leaq 0x99424(%rip), %rcx     # 0x233a34
movl $0x3dc, %edx            # imm = 0x3DC
callq 0x2110
leaq 0x99458(%rip), %rdi     # 0x233a79
leaq 0x99363(%rip), %rsi     # 0x23398b
leaq 0x99405(%rip), %rcx     # 0x233a34
movl $0x3e0, %edx            # imm = 0x3E0
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: transfor_icoord(long, long, long, long, unsigned char, long, long, int*, int*, int*, int*)
void transfor_icoord(const int64_t iqs, const int64_t iqe, const int64_t irs, const int64_t ire, const uint8_t rev, 
const int64_t qlen, const int64_t rlen, int32_t *r_qs, int32_t *r_qe, int32_t *r_rs, int32_t *r_re)
{
    int64_t qs, qe, rs, re, qtail, rtail;
    qs = iqs; qe = iqe - 1; rs = irs; re = ire - 1;
    if(rev) {
        rs = rlen - ire; re = rlen - irs - 1;
    }
    
    if(qs <= rs) {
        rs -= qs; qs = 0;
    } else {
        qs -= rs; rs = 0;
    }

    qtail = qlen - qe - 1; rtail = rlen - re - 1;
    if(qtail <= rtail) {
        qe = qlen - 1; re += qtail;
    }
    else
    {
        re = rlen - 1; qe += rtail; 
    }

	if(r_qs) (*r_qs) = qs; if(r_qe) (*r_qe) = qe + 1;
	if(r_rs) (*r_rs) = rs; if(r_re) (*r_re) = re + 1;
    if(rev) {
        if(r_rs) (*r_rs) = rlen - re - 1; 
		if(r_re) (*r_re) = rlen - rs;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x28(%rsp), %rax
movq %rax, %r10
subq %rcx, %r10
decq %rcx
movq %rdx, %r14
notq %r14
addq %rax, %r14
testl %r8d, %r8d
cmoveq %rdx, %r10
cmoveq %rcx, %r14
xorl %ebx, %ebx
movq %r10, %rdx
subq %rdi, %rdx
movl $0x0, %ecx
cmovgeq %rdx, %rcx
movq 0x38(%rsp), %r11
movq %r9, %r15
subq %rsi, %r15
movq %r14, %r12
notq %r12
addq %rax, %r12
addq %r15, %r14
leaq -0x1(%rax), %rdx
addq %r12, %rsi
cmpq %r12, %r15
cmovleq %r14, %rdx
movq 0x30(%rsp), %r14
cmovleq %r9, %rsi
testq %r14, %r14
je 0x19bbf3
movl %edi, %r9d
subl %r10d, %r9d
cmpq %rdi, %r10
cmovll %r9d, %ebx
movl %ebx, (%r14)
movq 0x40(%rsp), %rdi
testq %r11, %r11
je 0x19bc00
movl %esi, (%r11)
movq 0x48(%rsp), %rsi
testq %rdi, %rdi
je 0x19bc0c
movl %ecx, (%rdi)
testq %rsi, %rsi
je 0x19bc18
leal 0x1(%rdx), %r9d
movl %r9d, (%rsi)
testb %r8b, %r8b
je 0x19bc31
testq %rdi, %rdi
je 0x19bc28
notl %edx
addl %eax, %edx
movl %edx, (%rdi)
testq %rsi, %rsi
je 0x19bc31
subl %ecx, %eax
movl %eax, (%rsi)
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: transfor_coord(mg_lchain_t*, long, long, int*, int*, int*, int*)
void transfor_coord(mg_lchain_t *ri, const int64_t qlen, const int64_t rlen, 
int32_t *r_qs, int32_t *r_qe, int32_t *r_rs, int32_t *r_re)
{
    int64_t qs, qe, rs, re, qtail, rtail;
    qs = ri->qs; qe = ri->qe - 1; rs = ri->rs; re = ri->re - 1;
    if(ri->v&1) {
        rs = rlen - ri->re; re = rlen - ri->rs - 1;
    }
    
    if(qs <= rs) {
        rs -= qs; qs = 0;
    } else {
        qs -= rs; rs = 0;
    }

    qtail = qlen - qe - 1; rtail = rlen - re - 1;
    if(qtail <= rtail) {
        qe = qlen - 1; re += qtail;
    }
    else
    {
        re = rlen - 1; qe += rtail; 
    }

	if(r_qs) (*r_qs) = qs; if(r_qe) (*r_qe) = qe + 1;
	if(r_rs) (*r_rs) = rs; if(r_re) (*r_re) = re + 1;
    if(ri->v&1) {
        if(r_rs) (*r_rs) = rlen - re - 1; 
		if(r_re) (*r_re) = rlen - rs;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq 0xc(%rdi), %rax
movslq 0x10(%rdi), %r10
movq %rdx, %r11
subq %r10, %r11
decq %r10
movq %rax, %r15
notq %r15
addq %rdx, %r15
testb $0x1, 0x8(%rdi)
cmoveq %rax, %r11
movslq 0x14(%rdi), %rbx
cmoveq %r10, %r15
movq %r15, %r12
notq %r12
addq %rdx, %r12
xorl %r14d, %r14d
movq %r11, %r10
subq %rbx, %r10
movl $0x0, %eax
cmovgeq %r10, %rax
movslq 0x18(%rdi), %r13
movq %rsi, %rbp
subq %r13, %rbp
addq %rbp, %r15
leaq -0x1(%rdx), %r10
cmpq %r12, %rbp
cmovleq %r15, %r10
leaq (%r13,%r12), %r15
cmovleq %rsi, %r15
testq %rcx, %rcx
je 0x19bcbd
movl %ebx, %esi
subl %r11d, %esi
cmpq %rbx, %r11
cmovll %esi, %r14d
movl %r14d, (%rcx)
testq %r8, %r8
je 0x19bcc5
movl %r15d, (%r8)
movq 0x38(%rsp), %rcx
testq %r9, %r9
je 0x19bcd2
movl %eax, (%r9)
testq %rcx, %rcx
je 0x19bcdd
leal 0x1(%r10), %esi
movl %esi, (%rcx)
testb $0x1, 0x8(%rdi)
je 0x19bcfb
testq %r9, %r9
je 0x19bcf2
notl %r10d
leal (%rdx,%r10), %esi
movl %esi, (%r9)
testq %rcx, %rcx
je 0x19bcfb
subl %eax, %edx
movl %edx, (%rcx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: get_nn_ov(unsigned int, unsigned int, asg_t const*)
int64_t get_nn_ov(const uint32_t v, const uint32_t w, const asg_t *g)
{
	uint32_t i;
	uint32_t nv = asg_arc_n(g, v);
    asg_arc_t *av = asg_arc_a(g, v), *p = NULL;
	for (i = 0; i < nv; i++) {
		if(av[i].del) continue;
		if(av[i].v == w) {
			// o -= av[i].ol;
			p = &(av[i]);
			break;
		}
	}
	return p?p->ol:0;
}

// Assembly:
movq 0x28(%rdx), %rax
movl %edi, %ecx
movq (%rax,%rcx,8), %rcx
testl %ecx, %ecx
je 0x19bd3d
movq %rcx, %rax
shrq $0x20, %rax
leaq (%rax,%rax,2), %rax
shlq $0x3, %rax
addq 0x8(%rdx), %rax
movl %ecx, %ecx
cmpl $0x0, 0xc(%rax)
js 0x19bd34
cmpl %esi, 0x8(%rax)
je 0x19bd3f
addq $0x18, %rax
decq %rcx
jne 0x19bd29
xorl %eax, %eax
testq %rax, %rax
je 0x19bd4d
movl 0xc(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: get_lchain_ovlp(mg_lchain_t*, mg_lchain_t*, asg_t const*, long, ma_ug_t const*)
int64_t get_lchain_ovlp(mg_lchain_t *lp, mg_lchain_t *la, const asg_t *g, const int64_t qlen, const ma_ug_t *ug)
{
	int64_t o = lp->qe - la->qs, oj;
	uint32_t v = la->v^1, w = lp->v^1, i;
	int32_t pqe, aqs;
	if(o <= 0) return 0;
	if(v == w) return o;
	transfor_coord(lp, qlen, ug->u.a[lp->v>>1].len, NULL, &pqe, NULL, NULL);
	transfor_coord(la, qlen, ug->u.a[la->v>>1].len, &aqs, NULL, NULL, NULL);
	uint32_t nv = asg_arc_n(g, v);
    asg_arc_t *av = asg_arc_a(g, v), *p = NULL;
	for (i = 0; i < nv; i++) {
		if(av[i].del) continue;
		if(av[i].v == w) {
			// o -= av[i].ol;
			p = &(av[i]);
			break;
		}
	}
	oj = o;
	if(p) oj = pqe - aqs - p->ol;
	if(o > oj) o = oj;
	if(o < 0) o = 0;
	return o;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movslq 0x18(%rdi), %rbx
movslq 0x14(%rsi), %rax
subq %rax, %rbx
testl %ebx, %ebx
jle 0x19be74
movq %rsi, %r12
movl 0x8(%rsi), %r14d
movl 0x8(%rdi), %r13d
cmpl %r13d, %r14d
je 0x19be76
movq %rcx, %r15
movq %r14, %rax
xorq $0x1, %rax
movq %rax, 0x18(%rsp)
movq 0x10(%r8), %rcx
movq %rcx, 0x10(%rsp)
movl %r13d, %eax
shrl %eax
leaq (%rax,%rax,4), %rax
movq %rdx, 0x20(%rsp)
movl (%rcx,%rax,8), %edx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andq %rax, %rdx
xorl %ebp, %ebp
movq %rbp, (%rsp)
leaq 0xc(%rsp), %r8
movq %r15, %rsi
xorl %ecx, %ecx
xorl %r9d, %r9d
callq 0x19bc39
shrl %r14d
leaq (%r14,%r14,4), %rax
movq 0x10(%rsp), %rcx
movl (%rcx,%rax,8), %edx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andq %rax, %rdx
movq %rbp, (%rsp)
leaq 0x8(%rsp), %rcx
movq %r12, %rdi
movq %r15, %rsi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x19bc39
movq 0x20(%rsp), %rdx
movq 0x28(%rdx), %rax
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rax
testl %eax, %eax
je 0x19be46
movq %rax, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rbp
shlq $0x3, %rbp
addq 0x8(%rdx), %rbp
movl %eax, %eax
cmpl $0x0, 0xc(%rbp)
js 0x19be3b
movl 0x8(%rbp), %ecx
xorl %r13d, %ecx
cmpl $0x1, %ecx
je 0x19be46
addq $0x18, %rbp
decq %rax
jne 0x19be2a
xorl %ebp, %ebp
movq %rbx, %rax
testq %rbp, %rbp
je 0x19be62
movl 0xc(%rsp), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl 0xc(%rbp), %ecx
addl 0x8(%rsp), %ecx
subl %ecx, %eax
cltq
cmpq %rbx, %rax
cmovlq %rax, %rbx
xorl %eax, %eax
testq %rbx, %rbx
cmovleq %rax, %rbx
jmp 0x19be76
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: get_lchain_gap(mg_lchain_t*, mg_lchain_t*, asg_t const*, long, ma_ug_t const*, int)
int64_t get_lchain_gap(mg_lchain_t *lp, mg_lchain_t *la, const asg_t *g, const int64_t qlen, const ma_ug_t *ug, int32_t double_ol)
{
	int64_t gg = la->qs - lp->qe, ggj;
	uint32_t v = la->v^1, w = lp->v^1, i;
	int32_t aqs, pqe;
	if(double_ol == 0 && gg >= 0) return gg;
	if(v == w) return gg;
	transfor_coord(la, qlen, ug->u.a[la->v>>1].len, &aqs, NULL, NULL, NULL);
	transfor_coord(lp, qlen, ug->u.a[lp->v>>1].len, NULL, &pqe, NULL, NULL);
	uint32_t nv = asg_arc_n(g, v);
    asg_arc_t *av = asg_arc_a(g, v), *p = NULL;;
	for (i = 0; i < nv; i++) {
		if(av[i].del) continue;
		if(av[i].v == w) {
			// gg += av[i].ol;
			p = &(av[i]);
			break;
		}
	}
	ggj = gg;
	if(p) ggj = aqs - pqe + p->ol + (double_ol?p->ol:0);
	// if(gg < ggj) gg = ggj;
	// return gg;
	return ggj;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r11
movq %rdx, %r10
movq %rdi, %r12
movl 0x8(%rsi), %eax
movl 0x14(%rsi), %ebp
subl 0x18(%rdi), %ebp
movl 0x8(%rdi), %ecx
testl %r9d, %r9d
sete %dl
testl %ebp, %ebp
setns %dil
andb %dl, %dil
cmpl %ecx, %eax
sete %dl
orb %dil, %dl
jne 0x19bfa9
movl %r9d, 0xc(%rsp)
movl %eax, %eax
movl %ecx, %r13d
movl %eax, %r14d
xorl $0x1, %r14d
movq 0x10(%r8), %r15
shrl %eax
leaq (%rax,%rax,4), %rax
movl (%r15,%rax,8), %edx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andq %rax, %rdx
xorl %ebx, %ebx
movq %rbx, (%rsp)
leaq 0x14(%rsp), %rcx
movq %rsi, %rdi
movq %r11, %rsi
xorl %r8d, %r8d
xorl %r9d, %r9d
movq %r10, 0x20(%rsp)
movq %r11, 0x18(%rsp)
callq 0x19bc39
movl %r13d, %eax
shrl %eax
leaq (%rax,%rax,4), %rax
movl (%r15,%rax,8), %edx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andq %rax, %rdx
movq %rbx, (%rsp)
leaq 0x10(%rsp), %r8
movq %r12, %rdi
movq 0x18(%rsp), %rsi
xorl %ecx, %ecx
xorl %r9d, %r9d
callq 0x19bc39
movq 0x20(%rsp), %rdx
movq 0x28(%rdx), %rax
movq (%rax,%r14,8), %rax
testl %eax, %eax
je 0x19bf87
movq %rax, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rbx
shlq $0x3, %rbx
addq 0x8(%rdx), %rbx
movl %eax, %eax
cmpl $0x0, 0xc(%rbx)
js 0x19bf7c
movl 0x8(%rbx), %ecx
xorl %r13d, %ecx
cmpl $0x1, %ecx
je 0x19bf87
addq $0x18, %rbx
decq %rax
jne 0x19bf6b
xorl %ebx, %ebx
testq %rbx, %rbx
je 0x19bfa9
movl 0x14(%rsp), %eax
subl 0x10(%rsp), %eax
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
andl 0xc(%rbx), %ebp
addl %ebp, %eax
movl 0xc(%rsp), %ecx
testl %ecx, %ecx
cmovel %ecx, %ebp
addl %eax, %ebp
movslq %ebp, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: max_ovlp(asg_t const*, unsigned int)
int64_t max_ovlp(const asg_t *g, uint32_t v)
{
	uint32_t i, nv = asg_arc_n(g, v), o = 0;
	asg_arc_t *av = asg_arc_a(g, v);
	for (i = 0; i < nv; i++) {
		if(av[i].del) continue;
		if(o < av[i].ol) o = av[i].ol;
	}
	return o;
}

// Assembly:
movq 0x28(%rdi), %rax
movl %esi, %ecx
movq (%rax,%rcx,8), %rcx
xorl %eax, %eax
testl %ecx, %ecx
je 0x19c00e
movq 0x8(%rdi), %rdx
movq %rcx, %rsi
shrq $0x20, %rsi
movl %ecx, %edi
leaq (%rsi,%rsi,2), %rcx
leaq (%rdx,%rcx,8), %rcx
addq $0xc, %rcx
shlq $0x3, %rdi
leaq (%rdi,%rdi,2), %rdx
xorl %esi, %esi
movl %eax, %edi
movl (%rcx,%rsi), %r8d
cmpl %r8d, %eax
movl %r8d, %eax
cmoval %edi, %eax
testl %r8d, %r8d
cmovsl %edi, %eax
addq $0x18, %rsi
cmpq %rsi, %rdx
jne 0x19bfee
movl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: max_ovlp_src(ug_opt_t const*, unsigned int)
int64_t max_ovlp_src(const ug_opt_t *uopt, uint32_t v)
{
	ma_hit_t_alloc* src = uopt->sources;
    int64_t min_ovlp = uopt->min_ovlp, max_hang = uopt->max_hang;
	uint32_t i, qn, tn, o = 0, x = v>>1; asg_arc_t e;

	for (i = 0; i < src[x].length; i++) {
        qn = Get_qn(src[x].buffer[i]); tn = Get_tn(src[x].buffer[i]);
        if(ma_hit2arc(&(src[x].buffer[i]), Get_READ_LENGTH(R_INF, qn), Get_READ_LENGTH(R_INF, tn), 
														max_hang, asm_opt.max_hang_rate, min_ovlp, &e) < 0) {
			continue;
		}
		if((e.ul>>32) != v) continue;
		if(o < e.ol) o = e.ol;
    }

	return o;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x8(%rdi), %rax
movl %esi, %ecx
shrl %ecx
leaq (%rcx,%rcx,2), %rcx
movl 0xc(%rax,%rcx,8), %r13d
xorl %ebx, %ebx
testq %r13, %r13
je 0x19c0c1
movl 0x44(%rdi), %ebp
movl 0x40(%rdi), %r14d
leaq (%rax,%rcx,8), %rax
movq (%rax), %r15
leaq 0xef1e2(%rip), %rax     # 0x28b230
movq 0x18(%rax), %r12
leaq 0xee6ff(%rip), %rax     # 0x28a758
movss 0x158(%rax), %xmm0
movss %xmm0, 0x4(%rsp)
movl %esi, %eax
movq %rax, 0x8(%rsp)
movl 0x4(%r15), %eax
movl 0xc(%r15), %ecx
movl (%r12,%rax,8), %esi
movl (%r12,%rcx,8), %edx
movq %r15, %rdi
movl %r14d, %ecx
movss 0x4(%rsp), %xmm0
movl %ebp, %r8d
leaq 0x10(%rsp), %r9
callq 0x19c0d3
testl %eax, %eax
js 0x19c0b6
movq 0x8(%rsp), %rax
cmpl %eax, 0x14(%rsp)
jne 0x19c0b6
movl 0x1c(%rsp), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %eax
cmpl %eax, %ebx
cmovbel %eax, %ebx
addq $0x28, %r15
decq %r13
jne 0x19c06e
movl %ebx, %ebx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: specific_ovlp(ma_ug_t const*, ug_opt_t const*, unsigned int, unsigned int)
int64_t specific_ovlp(const ma_ug_t *ug, const ug_opt_t *uopt, const uint32_t v, const uint32_t w)
{
	if(ug->u.a[v>>1].circ || ug->u.a[w>>1].circ) return 0;
	uint32_t rv, rw, i; int32_t r;
	const ma_hit_t_alloc *x = NULL;
	asg_arc_t t; memset(&t, 0, sizeof(t));
	if(v&1) rv = ug->u.a[v>>1].start^1;
	else rv = ug->u.a[v>>1].end^1;
	if(w&1) rw = ug->u.a[v>>1].end;
	else rw = ug->u.a[v>>1].start;
	x = &(uopt->sources[rv>>1]);
	for (i = 0; i < x->length; i++) {
		if(Get_tn(x->buffer[i]) == (rw>>1)) {
			r = ma_hit2arc(&(x->buffer[i]), uopt->coverage_cut[rv>>1].e - uopt->coverage_cut[rv>>1].s, 
			uopt->coverage_cut[rw>>1].e - uopt->coverage_cut[rw>>1].s, uopt->max_hang, asm_opt.max_hang_rate, uopt->min_ovlp, &t);
			if(r < 0) return 0;
			if((t.ul>>32)!=rv || t.v!=rw) return 0;
			return t.ol;
		}
	}
	return 0;
}

// Assembly:
movq 0x10(%rdi), %rax
movl %edx, %edi
shrl %edi
leaq (%rdi,%rdi,4), %rdi
cmpl $0x0, (%rax,%rdi,8)
js 0x19c2e4
movl %ecx, %r8d
shrl %r8d
leaq (%r8,%r8,4), %r8
cmpl $0x0, (%rax,%r8,8)
js 0x19c2e4
pushq %r14
pushq %rbx
subq $0x18, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
testb $0x1, %dl
leaq 0x4(%rax,%rdi,8), %rdx
leaq 0x8(%rax,%rdi,8), %rax
movq %rdx, %rdi
cmoveq %rax, %rdi
movl (%rdi), %ebx
testb $0x1, %cl
cmoveq %rdx, %rax
movq 0x8(%rsi), %rdi
movl %ebx, %ecx
shrl %ecx
leaq (%rcx,%rcx,2), %rcx
movl 0xc(%rdi,%rcx,8), %edx
testl %edx, %edx
je 0x19c34d
xorq $0x1, %rbx
movl (%rax), %r14d
leaq (%rdi,%rcx,8), %rax
movq (%rax), %rdi
movl %r14d, %r8d
shrl %r8d
xorl %eax, %eax
cmpl %r8d, 0xc(%rdi)
je 0x19c2e7
addq $0x28, %rdi
decl %edx
jne 0x19c2d4
jmp 0x19c34f
xorl %eax, %eax
retq
movq (%rsi), %r9
movl 0x4(%r9,%rcx,4), %eax
movl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
movl (%r9,%rcx,4), %ecx
andl %r10d, %ecx
subl %ecx, %eax
leaq (%r8,%r8,2), %rcx
movl 0x4(%r9,%rcx,4), %edx
andl (%r9,%rcx,4), %r10d
subl %r10d, %edx
movl 0x40(%rsi), %ecx
leaq 0xee440(%rip), %r8      # 0x28a758
movss 0x158(%r8), %xmm0
movl 0x44(%rsi), %r8d
movq %rsp, %r9
movl %eax, %esi
callq 0x19c0d3
testl %eax, %eax
js 0x19c34d
xorl %eax, %eax
cmpl %ebx, 0x4(%rsp)
jne 0x19c34f
cmpl %r14d, 0x8(%rsp)
jne 0x19c34f
movl 0xc(%rsp), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
jmp 0x19c34f
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: compress_lchain(mg_lchain_t*, int, int, ma_ug_t const*, mg128_t const*)
void compress_lchain(mg_lchain_t *lc, int32_t n_lc, int32_t qlen, const ma_ug_t *ug, const mg128_t *a)
{
	int32_t i, k, q_span;
	mg_lchain_t *ri = NULL;
	for (i = 0; i < n_lc; ++i) {
		ri = &lc[i];
		k = ri->off;
		ri->rs = (int32_t)a[k].x + 1 > q_span? (int32_t)a[k].x + 1 - q_span : 0; // for HPC k-mer
        ri->qs = (int32_t)a[k].y + 1 - (a[k].y>>32 & 0xff);
        ri->re = (int32_t)a[k + ri->cnt - 1].x + 1;
        ri->qe = (int32_t)a[k + ri->cnt - 1].y + 1;
	}
}

// Assembly:
testl %esi, %esi
jle 0x19c414
movl %esi, %eax
shlq $0x3, %rax
leaq (%rax,%rax,4), %rax
xorl %ecx, %ecx
movslq (%rdi,%rcx), %rdx
movl $0x0, 0xc(%rdi,%rcx)
movq %rdx, %rsi
shlq $0x4, %rsi
movq 0x8(%r8,%rsi), %rsi
movq %rsi, %r9
shrq $0x20, %r9
movzbl %r9b, %r9d
subl %r9d, %esi
incl %esi
movl %esi, 0x14(%rdi,%rcx)
movl 0x4(%rdi,%rcx), %esi
shlq $0x21, %rsi
sarq $0x21, %rsi
addq %rdx, %rsi
shlq $0x4, %rsi
movl -0x10(%r8,%rsi), %edx
incl %edx
movl %edx, 0x10(%rdi,%rcx)
movl -0x8(%r8,%rsi), %edx
incl %edx
movl %edx, 0x18(%rdi,%rcx)
addq $0x28, %rcx
cmpq %rcx, %rax
jne 0x19c3b6
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: print_gchain(gc_frag_t*, long const*, mg_lchain_t*, long, ma_ug_t const*, int)
void print_gchain(gc_frag_t *a, const int64_t *p, mg_lchain_t *lc, const int64_t nlc, const ma_ug_t *ug, int32_t qlen)
{
	int64_t k, i;
	gc_frag_t *ai = NULL;
    mg_lchain_t *li = NULL;
	for (k = 0; k < nlc; k++) {
		fprintf(stderr, "\n");
		for (i = k; i >= 0; i = p[i]) {
			ai = &a[i]; li = &lc[ai->i];
			fprintf(stderr, "*\tXXXXXX\tutg%.6d%c\t%c\tqs:%u\tqe:%u\tql:%d\tts:%u\tte:%u\ttl:%u\n", 
					(li->v>>1)+1, "lc"[ug->u.a[li->v>>1].circ], "+-"[li->v&1], li->qs, li->qe, qlen, li->rs, li->re, ug->u.a[li->v>>1].len);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, 0x8(%rsp)
testq %rcx, %rcx
jle 0x19c52b
movl %r9d, %r13d
movq %r8, %r14
movq %rdx, %r12
movq %rdi, %rbp
movq 0xedb9c(%rip), %rax     # 0x289fe0
xorl %r15d, %r15d
movq %rsi, 0x18(%rsp)
movq (%rax), %rsi
movl $0xa, %edi
callq 0x2270
movq %r15, 0x10(%rsp)
movslq 0x4(%rbp,%r15,8), %rax
leaq (%rax,%rax,4), %rax
movq 0xedb72(%rip), %rcx     # 0x289fe0
movq (%rcx), %rdi
movl 0x8(%r12,%rax,8), %esi
movl 0xc(%r12,%rax,8), %ecx
movq %rcx, 0x20(%rsp)
movl %esi, %ecx
shrl %ecx
leaq (%rcx,%rcx,4), %r8
movl %ecx, %edx
incl %edx
movq 0x10(%r14), %rcx
movl (%rcx,%r8,8), %r11d
movl %r11d, %ecx
shrl $0x1f, %ecx
leaq 0x8c18a(%rip), %r8      # 0x22862b
movsbl (%rcx,%r8), %ecx
andl $0x1, %esi
leaq 0x89d13(%rip), %r8      # 0x2261c3
movsbl (%rsi,%r8), %r8d
movl 0x14(%r12,%rax,8), %r9d
movq %r14, %rbx
movl 0x18(%r12,%rax,8), %r14d
movq %rbp, %r10
movq %r13, %rbp
movl 0x10(%r12,%rax,8), %r13d
andl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
subq $0x8, %rsp
leaq 0x97687(%rip), %rsi     # 0x233b66
xorl %eax, %eax
pushq %r11
pushq %r13
movq %rbp, %r13
movq %r10, %rbp
pushq 0x38(%rsp)
pushq %r13
pushq %r14
movq %rbx, %r14
movq 0x48(%rsp), %rbx
callq 0x22b0
addq $0x30, %rsp
movq (%rbx,%r15,8), %r15
testq %r15, %r15
jns 0x19c45e
movq 0x10(%rsp), %r15
incq %r15
cmpq 0x8(%rsp), %r15
movq 0xedabb(%rip), %rax     # 0x289fe0
jne 0x19c44c
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: mg_gchain_restore_order(void*, mg_gchains_t*)
void mg_gchain_restore_order(void *km, mg_gchains_t *gcs)
{
	int32_t i, n_a, n_lc;
	mg_llchain_t *lc;
	mg128_t *a;
	KMALLOC(km, lc, gcs->n_lc);
	KMALLOC(km, a, gcs->n_a);
	n_a = n_lc = 0;
	for (i = 0; i < gcs->n_gc; ++i) {
		mg_gchain_t *gc = &gcs->gc[i];
		assert(gc->cnt > 0);
		memcpy(&lc[n_lc], &gcs->lc[gc->off], gc->cnt * sizeof(mg_llchain_t));
		memcpy(&a[n_a], &gcs->a[gcs->lc[gc->off].off], gc->n_anchor * sizeof(mg128_t));
		n_lc += gc->cnt, n_a += gc->n_anchor;
	}
	memcpy(gcs->lc, lc, gcs->n_lc * sizeof(mg_llchain_t));
	memcpy(gcs->a, a, gcs->n_a * sizeof(mg128_t));
	kfree(km, lc); kfree(km, a);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movslq 0xc(%rsi), %rsi
shlq $0x4, %rsi
callq 0x1e36fd
movq %rax, 0x8(%rsp)
movslq 0x10(%r15), %rsi
shlq $0x4, %rsi
movq %rbx, 0x10(%rsp)
movq %rbx, %rdi
callq 0x1e36fd
movq %rax, (%rsp)
cmpl $0x0, 0x8(%r15)
jle 0x19d852
xorl %r13d, %r13d
movl $0x10, %ebp
xorl %ebx, %ebx
xorl %r14d, %r14d
movq 0x18(%r15), %r12
movslq -0x4(%r12,%rbp), %rdx
testq %rdx, %rdx
jle 0x19d8ac
movslq %r14d, %r14
movq %r14, %rdi
shlq $0x4, %rdi
addq 0x8(%rsp), %rdi
movslq -0x8(%r12,%rbp), %rsi
shlq $0x4, %rsi
addq 0x20(%r15), %rsi
shlq $0x4, %rdx
callq 0x2160
movslq %ebx, %rbx
movq %rbx, %rdi
shlq $0x4, %rdi
addq (%rsp), %rdi
movq 0x20(%r15), %rax
movslq -0x8(%r12,%rbp), %rcx
shlq $0x4, %rcx
movslq (%rax,%rcx), %rsi
shlq $0x4, %rsi
addq 0x28(%r15), %rsi
movslq (%r12,%rbp), %rdx
shlq $0x4, %rdx
callq 0x2160
addl -0x4(%r12,%rbp), %r14d
addl (%r12,%rbp), %ebx
incq %r13
movslq 0x8(%r15), %rax
addq $0x48, %rbp
cmpq %rax, %r13
jl 0x19d7ca
movq 0x20(%r15), %rdi
movslq 0xc(%r15), %rdx
shlq $0x4, %rdx
movq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x2160
movq 0x28(%r15), %rdi
movslq 0x10(%r15), %rdx
shlq $0x4, %rdx
movq (%rsp), %r15
movq %r15, %rsi
callq 0x2160
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1e3632
movq %rbx, %rdi
movq %r15, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1e3632
leaq 0x96476(%rip), %rdi     # 0x233d29
leaq 0x960d1(%rip), %rsi     # 0x23398b
leaq 0x96474(%rip), %rcx     # 0x233d35
movl $0x782, %edx            # imm = 0x782
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: mg_gchain_sort_by_score(void*, mg_gchains_t*)
void mg_gchain_sort_by_score(void *km, mg_gchains_t *gcs)
{
	mg128_t *z;
	mg_gchain_t *gc;
	int32_t i;
	KMALLOC(km, z, gcs->n_gc);
	KMALLOC(km, gc, gcs->n_gc);
	for (i = 0; i < gcs->n_gc; ++i)
		z[i].x = (uint64_t)gcs->gc[i].score << 32 | gcs->gc[i].hash, z[i].y = i;
	radix_sort_128x(z, z + gcs->n_gc);
	for (i = gcs->n_gc - 1; i >= 0; --i)
		gc[gcs->n_gc - 1 - i] = gcs->gc[z[i].y];
	memcpy(gcs->gc, gc, gcs->n_gc * sizeof(mg_gchain_t));
	kfree(km, z); kfree(km, gc);
	mg_gchain_restore_order(km, gcs); // this put gcs in the proper order
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x8(%rsi), %rsi
shlq $0x4, %rsi
callq 0x1e36fd
movq %rax, %r15
movslq 0x8(%rbx), %rax
shlq $0x3, %rax
leaq (%rax,%rax,8), %rsi
movq %r14, %rdi
callq 0x1e36fd
movq %rax, %r12
movslq 0x8(%rbx), %rsi
testq %rsi, %rsi
jle 0x19d93b
movq 0x18(%rbx), %rax
leaq 0x8(%r15), %rcx
addq $0x14, %rax
xorl %edx, %edx
movl (%rax), %edi
movl 0x24(%rax), %r8d
shlq $0x20, %rdi
orq %rdi, %r8
movq %r8, -0x8(%rcx)
movq %rdx, (%rcx)
incq %rdx
addq $0x10, %rcx
addq $0x48, %rax
cmpq %rdx, %rsi
jne 0x19d917
shlq $0x4, %rsi
addq %r15, %rsi
movq %r15, %rdi
callq 0x19712b
movslq 0x8(%rbx), %rcx
testq %rcx, %rcx
jle 0x19d99c
leaq 0x1(%rcx), %rax
movl %ecx, %edx
negl %edx
shlq $0x4, %rcx
leaq (%rcx,%r15), %r8
addq $-0x8, %r8
movq (%r8), %rcx
leaq (%rcx,%rcx,8), %rsi
shlq $0x3, %rsi
movl 0x8(%rbx), %ecx
addq 0x18(%rbx), %rsi
addl %edx, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,8), %rcx
leaq (%r12,%rcx,8), %rdi
movl $0x12, %ecx
rep  movsl (%rsi), %es:(%rdi)
decq %rax
incl %edx
addq $-0x10, %r8
cmpq $0x1, %rax
jg 0x19d967
movq 0x18(%rbx), %rdi
movslq 0x8(%rbx), %rax
shlq $0x3, %rax
leaq (%rax,%rax,8), %rdx
movq %r12, %rsi
callq 0x2160
movq %r14, %rdi
movq %r15, %rsi
callq 0x1e3632
movq %r14, %rdi
movq %r12, %rsi
callq 0x1e3632
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x19d773