LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/gfa-bbl.c
// Function: gfa_scbuf_init
gfa_scbuf_t *gfa_scbuf_init(const gfa_t *g)
{
	uint32_t v, n_vtx = gfa_n_vtx(g);
	gfa_scbuf_t *b;
	GFA_CALLOC(b, 1);
	GFA_CALLOC(b->a, n_vtx);
	for (v = 0; v < n_vtx; ++v)
		b->a[v].index = b->a[v].start = (uint32_t)-1;
	return b;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x4(%rdi), %ebx
addl %ebx, %ebx
movl $0x1, %edi
movl $0x40, %esi
callq 0x21e0
movq %rax, %r14
movl $0x10, %esi
movq %rbx, %rdi
callq 0x21e0
movq %rax, 0x8(%r14)
testl %ebx, %ebx
je 0xa8b1
shlq $0x4, %rbx
xorl %ecx, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %edx, 0xc(%rax,%rcx)
movl %edx, (%rax,%rcx)
addq $0x10, %rcx
cmpq %rcx, %rbx
jne 0xa8a1
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/gfa-bbl.c
// Function: gfa_scc_all
void gfa_scc_all(const gfa_t *g)
{
	uint32_t v, n_vtx = gfa_n_vtx(g);
	gfa_scbuf_t *b;
	b = gfa_scbuf_init(g);
	for (v = 0; v < n_vtx; ++v)
		if (b->a[v].index == (uint32_t)-1 && b->a[v^1].index == (uint32_t)-1) {
			gfa_sub_t *sub;
			sub = gfa_scc1(0, g, b, v);
			gfa_sub_print(stderr, g, sub);
			gfa_sub_destroy(sub);
		}
	gfa_scbuf_destroy(b);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x4(%rdi), %ebp
addl %ebp, %ebp
callq 0xa866
movq %rax, %r14
testl %ebp, %ebp
je 0xaf5b
movl %ebp, %r13d
xorl %r15d, %r15d
movq 0x270f1(%rip), %rbp     # 0x31ff8
movq 0x8(%r14), %rax
movq %r15, %rcx
shlq $0x4, %rcx
cmpl $-0x1, (%rax,%rcx)
jne 0xaf53
movl %r15d, %ecx
xorq $0x1, %rcx
shlq $0x4, %rcx
cmpl $-0x1, (%rax,%rcx)
jne 0xaf53
xorl %edi, %edi
movq %rbx, %rsi
movq %r14, %rdx
movl %r15d, %ecx
callq 0xa8e4
movq %rax, %r12
movq (%rbp), %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0xa75e
movq %r12, %rdi
callq 0xaf71
incq %r15
cmpq %r13, %r15
jne 0xaf07
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa8bc
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/gfa-bbl.c
// Function: gfa_sub_destroy
void gfa_sub_destroy(gfa_sub_t *sub)
{
	void *km;
	if (sub == 0) return;
	km = sub->km;
	kfree(km, sub->v); kfree(km, sub->a); kfree(km, sub);
}

// Assembly:
testq %rdi, %rdi
je 0xafab
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rsi
movq 0x20(%rdi), %r14
movq %r14, %rdi
callq 0x301f
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0x301f
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x301f
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/gfa-bbl.c
// Function: bb_write_seq
static void bb_write_seq(const gfa_t *g, int32_t n, const uint32_t *v, int32_t l_seq, char *seq)
{
	int32_t k, l;
	for (k = n - 1, l = 0; k >= 0; --k) {
		const gfa_seg_t *s = &g->seg[v[k]>>1];
		if (v[k]&1) {
			int32_t p;
			for (p = s->len - 1; p >= 0; --p)
				seq[l++] = gfa_comp_table[(uint8_t)s->seq[p]];
		} else {
			memcpy(&seq[l], s->seq, s->len);
			l += s->len;
		}
	}
	assert(l == l_seq);
	seq[l] = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x8(%rsp)
movl %ecx, 0x14(%rsp)
testl %esi, %esi
jle 0xb886
movq %rdx, %r14
movq %rdi, %r15
movl %esi, %r13d
xorl %r12d, %r12d
leaq 0x269eb(%rip), %rbp     # 0x32200
movl -0x4(%r14,%r13,4), %eax
movl %eax, %ebx
shrl %ebx
shlq $0x6, %rbx
addq 0x10(%r15), %rbx
testb $0x1, %al
jne 0xb843
movslq %r12d, %rdi
addq 0x8(%rsp), %rdi
movq 0x20(%rbx), %rsi
movslq (%rbx), %rdx
callq 0x2230
addl (%rbx), %r12d
jmp 0xb877
movslq (%rbx), %rdx
testq %rdx, %rdx
jle 0xb877
movslq %r12d, %rax
addq 0x8(%rsp), %rax
movq %rdx, %rcx
incq %rcx
addl %edx, %r12d
movq 0x20(%rbx), %rdx
movzbl -0x2(%rdx,%rcx), %edx
movb (%rbp,%rdx), %dl
movb %dl, (%rax)
incq %rax
decq %rcx
cmpq $0x1, %rcx
ja 0xb85c
leaq -0x1(%r13), %rax
cmpq $0x1, %r13
movq %rax, %r13
jg 0xb815
jmp 0xb889
xorl %r12d, %r12d
movl 0x14(%rsp), %eax
cmpl %eax, %r12d
jne 0xb8ac
cltq
movq 0x8(%rsp), %rcx
movb $0x0, (%rcx,%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1cefd(%rip), %rdi     # 0x287b0
leaq 0x1cdf3(%rip), %rsi     # 0x286ad
leaq 0x1cefa(%rip), %rcx     # 0x287bb
movl $0xda, %edx
callq 0x2160
nop
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/gfa-ed.c
// Function: gfa_edseq_init
gfa_edseq_t *gfa_edseq_init(const gfa_t *g)
{
	uint32_t i, n_vtx = gfa_n_vtx(g);
	gfa_edseq_t *es;
	GFA_MALLOC(es, n_vtx);
	for (i = 0; i < g->n_seg; ++i) {
		const gfa_seg_t *s = &g->seg[i];
		char *t;
		int32_t j;
		GFA_MALLOC(t, s->len + 1);
		for (j = 0; j < s->len; ++j)
			t[s->len - j - 1] = gfa_comp_table[(uint8_t)s->seq[j]];
		t[s->len] = 0;
		es[i<<1].seq = (char*)s->seq;
		es[i<<1|1].seq = t;
		es[i<<1].len = es[i<<1|1].len = s->len;
	}
	return es;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movl 0x4(%rdi), %r15d
leal (%r15,%r15), %edi
shlq $0x4, %rdi
callq 0x2280
movq %rax, %rbx
movq %r15, (%rsp)
testq %r15, %r15
je 0xb989
movq 0x10(%r14), %r14
xorl %r15d, %r15d
leaq 0x268e5(%rip), %r13     # 0x32200
movq %r15, %r12
shlq $0x6, %r12
movslq (%r14,%r12), %rbp
leaq 0x1(%rbp), %rdi
callq 0x2280
movq 0x20(%r14,%r12), %rcx
testq %rbp, %rbp
jle 0xb958
leal -0x1(%rbp), %edx
xorl %esi, %esi
movzbl (%rcx,%rsi), %edi
movb (%r13,%rdi), %dil
movslq %edx, %rdx
movb %dil, (%rax,%rdx)
incq %rsi
decl %edx
cmpq %rbp, %rsi
jb 0xb93e
movb $0x0, (%rax,%rbp)
leal (%r15,%r15), %edx
shlq $0x4, %rdx
movq %rcx, (%rbx,%rdx)
leal 0x1(,%r15,2), %ecx
shlq $0x4, %rcx
movq %rax, (%rbx,%rcx)
movl %ebp, 0x8(%rbx,%rcx)
movl %ebp, 0x8(%rbx,%rdx)
incq %r15
cmpq (%rsp), %r15
jne 0xb91b
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/gfa-ed.c
// Function: gfa_edseq_destroy
void gfa_edseq_destroy(int32_t n_seg, gfa_edseq_t *es)
{
	int32_t i;
	for (i = 0; i < n_seg; ++i)
		free((char*)es[i<<1|1].seq);
	free(es);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
testl %edi, %edi
jle 0xb9cc
movl %edi, %r14d
addq %r14, %r14
xorl %r15d, %r15d
leal 0x1(%r15), %eax
cltq
shlq $0x4, %rax
movq (%rbx,%rax), %rdi
callq 0x2040
addq $0x2, %r15
cmpq %r15, %r14
jne 0xb9b0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/gfa-ed.c
// Function: rs_sort_gwf_intv
static int gwf_intv_is_sorted(int32_t n_a, const gwf_intv_t *a)
{
	int32_t i;
	for (i = 1; i < n_a; ++i)
		if (a[i-1].vd0 > a[i].vd0) break;
	return (i == n_a);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movl %ecx, %ebx
movl %edx, %ebp
movl $0x1, %edx
movl %ebp, %ecx
shll %cl, %edx
cmpl $0x8, %ebp
jg 0xbbc9
movslq %edx, %r14
decl %edx
shlq $0x4, %r14
leaq (%rsp,%r14), %rax
xorl %ecx, %ecx
movq %rdi, 0x8(%rsp,%rcx)
movq %rdi, (%rsp,%rcx)
addq $0x10, %rcx
cmpq %rcx, %r14
jne 0xba69
movl %ebx, %ecx
movslq %edx, %rdx
cmpq %rsi, %rdi
je 0xbaa4
movq %rdi, %r8
movq (%r8), %r9
shrq %cl, %r9
andq %rdx, %r9
shlq $0x4, %r9
addq $0x10, 0x8(%rsp,%r9)
addq $0x10, %r8
cmpq %rsi, %r8
jne 0xba88
testl %ebp, %ebp
je 0xbaca
movl $0x10, %esi
movq -0x8(%rsp,%rsi), %r8
movq %r8, %r9
subq %rdi, %r9
addq %r9, 0x8(%rsp,%rsi)
movq %r8, (%rsp,%rsi)
addq $0x10, %rsi
cmpq %rsi, %r14
jne 0xbaad
movq %rsp, %rsi
movq (%rsi), %r9
cmpq 0x8(%rsi), %r9
je 0xbb3d
movq (%r9), %r8
movq %r8, %r10
shrq %cl, %r10
andq %rdx, %r10
shlq $0x4, %r10
addq %rsp, %r10
cmpq %rsi, %r10
je 0xbb43
movq 0x8(%r9), %r9
movq %r8, %r11
movq %r9, %r15
movq (%r10), %r12
movq (%r12), %r8
movq 0x8(%r12), %r9
leaq 0x10(%r12), %r13
movq %r13, (%r10)
movq %r11, (%r12)
movq %r15, 0x8(%r12)
movq %r8, %r10
shrq %cl, %r10
andq %rdx, %r10
shlq $0x4, %r10
addq %rsp, %r10
cmpq %rsi, %r10
jne 0xbaf2
movq (%rsi), %r10
leaq 0x10(%r10), %r11
movq %r11, (%rsi)
movq %r8, (%r10)
movq %r9, 0x8(%r10)
jmp 0xbb4a
addq $0x10, %rsi
jmp 0xbb4a
addq $0x10, %r9
movq %r9, (%rsi)
cmpq %rax, %rsi
jne 0xbacd
movq %rdi, (%rsp)
testl %ebp, %ebp
je 0xbb72
movl $0x10, %eax
movq -0x8(%rsp,%rax), %rcx
movq %rcx, (%rsp,%rax)
addq $0x10, %rax
cmpq %rax, %r14
jne 0xbb60
testl %ebx, %ebx
je 0xbbb7
xorl %r15d, %r15d
subl %ebp, %ebx
cmovlel %r15d, %ebx
movq (%rsp,%r15), %rdi
movq 0x8(%rsp,%r15), %rsi
movq %rsi, %rax
subq %rdi, %rax
sarq $0x4, %rax
cmpq $0x41, %rax
jl 0xbba3
movl %ebp, %edx
movl %ebx, %ecx
callq 0xba33
jmp 0xbbae
cmpq $0x2, %rax
jl 0xbbae
callq 0xb9d9
addq $0x10, %r15
cmpq %r15, %r14
jne 0xbb7f
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1c54c(%rip), %rdi     # 0x2811c
leaq 0x1cc49(%rip), %rsi     # 0x28820
leaq 0x1cc4b(%rip), %rcx     # 0x28829
movl $0x49, %edx
callq 0x2160
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/gfa-ed.c
// Function: gfa_ed_init
void *gfa_ed_init(void *km, const gfa_edopt_t *opt, const gfa_t *g, const gfa_edseq_t *es, int32_t ql, const char *q, uint32_t v0, int32_t off0)
{
	gfa_edbuf_t *z;
	KCALLOC(km, z, 1);
	z->buf.km = km;
	z->opt = opt;
	z->g = g, z->es = es;
	z->ql = ql, z->q = q;
	z->buf.ha = gwf_set64_init2(km);
	z->buf.ht = gwf_map64_init2(km);
	kv_resize(gwf_trace_t, km, z->buf.t, 16);
	KCALLOC(km, z->a, 1);
	z->a[0].vd = gwf_gen_vd(v0, -off0), z->a[0].k = off0 - 1, z->a[0].xo = 0;
	if (z->opt->traceback) z->a[0].t = gwf_trace_push(km, &z->buf.t, -1, -1, z->buf.ht);
	z->n_a = 1;
	return z;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movl %r8d, 0xc(%rsp)
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r14
movl 0x58(%rsp), %ebp
movl $0x1, %esi
movl $0xd0, %edx
callq 0x2f84
movq %rax, %rbx
movq %r14, 0x28(%rax)
movq %r15, 0x10(%rax)
movq %r13, (%rax)
movq %r12, 0x8(%rax)
movl 0xc(%rsp), %eax
movl %eax, 0x18(%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rbx)
movl $0x1, %esi
movl $0x20, %edx
movq %r14, %rdi
callq 0x2f84
movq %r14, 0x18(%rax)
movq %rax, 0x30(%rbx)
movl $0x1, %esi
movl $0x20, %edx
movq %r14, %rdi
callq 0x2f84
movq %r14, 0x18(%rax)
movq %rax, 0x38(%rbx)
cmpq $0xf, 0xa8(%rbx)
ja 0xbf2c
movq $0x10, 0xa8(%rbx)
movq 0xb0(%rbx), %rsi
movl $0x80, %edx
movq %r14, %rdi
callq 0x31ed
movq %rax, 0xb0(%rbx)
movl $0x1, %esi
movl $0x18, %edx
movq %r14, %rdi
callq 0x2f84
movq %rax, 0xc0(%rbx)
movl 0x50(%rsp), %ecx
movq %rcx, %rdx
shlq $0x20, %rdx
movl $0x40000000, %ecx       # imm = 0x40000000
subl %ebp, %ecx
movslq %ecx, %rcx
orq %rdx, %rcx
movq %rcx, (%rax)
decl %ebp
movl %ebp, 0x8(%rax)
movl $0x0, 0x10(%rax)
movq 0x10(%rbx), %rax
cmpl $0x0, (%rax)
je 0xbf9f
movq %rbx, %rsi
addq $0xa0, %rsi
movq 0x38(%rbx), %r8
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0xbfbb
movq 0xc0(%rbx), %rcx
movl %eax, 0x14(%rcx)
movl $0x1, 0xbc(%rbx)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/gfa-ed.c
// Function: gfa_ed_destroy
void gfa_ed_destroy(void *z_)
{
	gfa_edbuf_t *z = (gfa_edbuf_t*)z_;
	void *km = z->buf.km;
	kfree(km, z->a);
	gwf_set64_destroy(z->buf.ha);
	gwf_map64_destroy(z->buf.ht);
	kfree(km, z->buf.ooo.a);
	kfree(km, z->buf.intv.a);
	kfree(km, z->buf.tmp.a);
	kfree(km, z->buf.swap.a);
	kfree(km, z->buf.t.a);
	kfree(km, z);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %r14
movq 0xc0(%rdi), %rsi
movq %r14, %rdi
callq 0x301f
movq 0x30(%rbx), %r15
testq %r15, %r15
je 0xe65f
movq 0x10(%r15), %rsi
movq 0x18(%r15), %r12
movq %r12, %rdi
callq 0x301f
movq 0x8(%r15), %rsi
movq %r12, %rdi
callq 0x301f
movq %r12, %rdi
movq %r15, %rsi
callq 0x301f
movq 0x38(%rbx), %r15
testq %r15, %r15
je 0xe68f
movq 0x10(%r15), %rsi
movq 0x18(%r15), %r12
movq %r12, %rdi
callq 0x301f
movq 0x8(%r15), %rsi
movq %r12, %rdi
callq 0x301f
movq %r12, %rdi
movq %r15, %rsi
callq 0x301f
movq 0x98(%rbx), %rsi
movq %r14, %rdi
callq 0x301f
movq 0x50(%rbx), %rsi
movq %r14, %rdi
callq 0x301f
movq 0x68(%rbx), %rsi
movq %r14, %rdi
callq 0x301f
movq 0x80(%rbx), %rsi
movq %r14, %rdi
callq 0x301f
movq 0xb0(%rbx), %rsi
movq %r14, %rdi
callq 0x301f
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x301f
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/gfa-ed.c
// Function: gfa_edit_dist
int32_t gfa_edit_dist(void *km, const gfa_edopt_t *opt, const gfa_t *g, const gfa_edseq_t *es, int32_t ql, const char *q, uint32_t v0, int32_t off0, gfa_edrst_t *rst)
{
	void *z;
	z = gfa_ed_init(km, opt, g, es, ql, q, v0, off0);
	gfa_ed_step(z, (uint32_t)-1, -1, -1, rst);
	gfa_ed_destroy(z);
	return rst->s;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x30(%rsp), %rbx
movl 0x20(%rsp), %eax
movl 0x28(%rsp), %r10d
pushq %r10
pushq %rax
callq 0xbe6f
addq $0x10, %rsp
movq %rax, %r14
movq %rax, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rbx, %r8
callq 0xc3ae
movq %r14, %rdi
callq 0xe611
movl (%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/bseq.c
// Function: mg_bseq_open
mg_bseq_file_t *mg_bseq_open(const char *fn)
{
	mg_bseq_file_t *fp;
	gzFile f;
	f = fn && strcmp(fn, "-")? gzopen(fn, "r") : gzdopen(0, "r");
	if (f == 0) return 0;
	fp = (mg_bseq_file_t*)calloc(1, sizeof(mg_bseq_file_t));
	fp->fp = f;
	fp->ks = kseq_init(fp->fp);
	return fp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xf466
cmpb $0x2d, (%rdi)
jne 0xf458
cmpb $0x0, 0x1(%rdi)
je 0xf466
leaq 0x1b0b6(%rip), %rsi     # 0x2a515
callq 0x22e0
jmp 0xf474
leaq 0x1b0a8(%rip), %rsi     # 0x2a515
xorl %edi, %edi
callq 0x20f0
movq %rax, %rbx
testq %rax, %rax
je 0xf4d9
movl $0x1, %edi
movl $0x38, %esi
callq 0x21e0
movq %rax, %r14
movq %rbx, (%rax)
movl $0x1, %edi
movl $0x50, %esi
callq 0x21e0
movq %rax, %r15
movl $0x1, %edi
movl $0x20, %esi
callq 0x21e0
movq %rax, %r12
movq %rbx, 0x10(%rax)
movl $0x40000, 0x8(%rax)     # imm = 0x40000
movl $0x10000, %edi          # imm = 0x10000
callq 0x2280
movq %rax, 0x18(%r12)
movq %r12, 0x48(%r15)
movq %r15, 0x8(%r14)
jmp 0xf4dc
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/bseq.c
// Function: kseq2bseq
static inline void kseq2bseq(kseq_t *ks, mg_bseq1_t *s, int with_qual, int with_comment)
{
	int i;
	if (ks->name.l == 0)
		fprintf(stderr, "[WARNING]\033[1;31m empty sequence name in the input.\033[0m\n");
	s->name = kstrdup(&ks->name);
	s->seq = kstrdup(&ks->seq);
	for (i = 0; i < (int)ks->seq.l; ++i) // convert U to T
		if (s->seq[i] == 'u' || s->seq[i] == 'U')
			--s->seq[i];
	s->qual = with_qual && ks->qual.l? kstrdup(&ks->qual) : 0;
	s->comment = with_comment && ks->comment.l? kstrdup(&ks->comment) : 0;
	s->l_seq = ks->seq.l;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, 0x4(%rsp)
movl %edx, (%rsp)
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdi), %r12d
testl %r12d, %r12d
je 0xfcdf
movq 0x8(%r14), %r13
incl %r12d
movq %r12, %rdi
callq 0x2280
movq %rax, %rbp
movq %rax, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x2230
movq %rbp, 0x8(%rbx)
movl 0x20(%r14), %r15d
movq 0x28(%r14), %r12
leal 0x1(%r15), %r13d
movq %r13, %rdi
callq 0x2280
movq %rax, %rbp
movq %rax, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2230
movq %rbp, 0x10(%rbx)
testl %r15d, %r15d
jle 0xfc5d
xorl %eax, %eax
movq 0x10(%rbx), %rcx
movzbl (%rcx,%rax), %edx
movl %edx, %esi
orl $0x20, %esi
cmpl $0x75, %esi
jne 0xfc51
decb %dl
movb %dl, (%rcx,%rax)
incq %rax
movslq 0x20(%r14), %r15
cmpq %r15, %rax
jl 0xfc3a
cmpl $0x0, (%rsp)
je 0xfc8e
movl 0x30(%r14), %r12d
testl %r12d, %r12d
je 0xfc8e
movq 0x38(%r14), %r13
incl %r12d
movq %r12, %rdi
callq 0x2280
movq %rax, %rbp
movq %rax, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x2230
jmp 0xfc90
xorl %ebp, %ebp
movq %rbp, 0x18(%rbx)
cmpl $0x0, 0x4(%rsp)
je 0xfcc6
movl 0x10(%r14), %r13d
testl %r13d, %r13d
je 0xfcc6
movq 0x18(%r14), %r12
incl %r13d
movq %r13, %rdi
callq 0x2280
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2230
jmp 0xfcc9
xorl %r14d, %r14d
movq %r14, 0x20(%rbx)
movl %r15d, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x22312(%rip), %rax     # 0x31ff8
movq (%rax), %rcx
leaq 0x18dcf(%rip), %rdi     # 0x28abf
movl $0x37, %esi
movl $0x1, %edx
callq 0x2340
movl (%r14), %r12d
jmp 0xfbe6
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/bseq.c
// Function: mg_bseq_read_frag
mg_bseq1_t *mg_bseq_read_frag(int n_fp, mg_bseq_file_t **fp, int64_t chunk_size, int with_qual, int with_comment, int *n_)
{
	int i;
	int64_t size = 0;
	kvec_t(mg_bseq1_t) a = {0,0,0};
	*n_ = 0;
	if (n_fp < 1) return 0;
	while (1) {
		int n_read = 0;
		for (i = 0; i < n_fp; ++i)
			if (kseq_read(fp[i]->ks) >= 0)
				++n_read;
		if (n_read < n_fp) {
			if (n_read > 0)
				fprintf(stderr, "[W::%s]\033[1;31m query files have different number of records; extra records skipped.\033[0m\n", __func__);
			break; // some file reaches the end
		}
		if (a.m == 0) kv_resize(mg_bseq1_t, 0, a, 256);
		for (i = 0; i < n_fp; ++i) {
			mg_bseq1_t *s;
			kv_pushp(mg_bseq1_t, 0, a, &s);
			kseq2bseq(fp[i]->ks, s, with_qual, with_comment);
			size += s->l_seq;
		}
		if (size >= chunk_size) break;
	}
	*n_ = a.n;
	return a.a;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r8d, 0x3c(%rsp)
movl %ecx, 0x38(%rsp)
movq %rdx, 0x40(%rsp)
movl $0x0, (%r9)
testl %edi, %edi
jle 0xfe5a
movq %rsi, 0x28(%rsp)
movq %r9, 0x18(%rsp)
movl %edi, 0x34(%rsp)
movl %edi, %r15d
xorl %ebp, %ebp
xorl %eax, %eax
xorl %ebx, %ebx
movq $0x0, 0x8(%rsp)
movq %r15, 0x20(%rsp)
movq %rax, 0x10(%rsp)
xorl %r13d, %r13d
xorl %r12d, %r12d
movq 0x28(%rsp), %r14
movq (%r14,%r13,8), %rax
movq 0x8(%rax), %rdi
callq 0xf890
notl %eax
shrl $0x1f, %eax
addl %eax, %r12d
incq %r13
cmpq %r13, %r15
jne 0xfd67
cmpl 0x34(%rsp), %r12d
jl 0xfe65
testq %rbx, %rbx
jne 0xfdaf
movl $0x2800, %edx           # imm = 0x2800
xorl %edi, %edi
movq 0x8(%rsp), %rsi
callq 0x31ed
movq %rax, 0x8(%rsp)
movl $0x100, %ebx            # imm = 0x100
movq 0x20(%rsp), %r15
movq 0x10(%rsp), %rax
leaq (,%rax,8), %rax
leaq (%rax,%rax,4), %r13
xorl %r12d, %r12d
movq 0x10(%rsp), %rax
addq %r12, %rax
cmpq %rbx, %rax
jne 0xfe0a
leaq (%rbx,%rbx), %r15
testq %rbx, %rbx
movl $0x2, %eax
cmoveq %rax, %r15
leaq (,%r15,8), %rax
leaq (%rax,%rax,4), %rdx
xorl %edi, %edi
movq 0x8(%rsp), %rsi
callq 0x31ed
movq %rax, 0x8(%rsp)
movq %r15, %rbx
movq 0x20(%rsp), %r15
movq 0x28(%rsp), %rax
movq 0x8(%rsp), %r14
leaq (%r14,%r13), %rsi
movq (%rax,%r12,8), %rax
movq 0x8(%rax), %rdi
movl 0x38(%rsp), %edx
movl 0x3c(%rsp), %ecx
callq 0xfbc2
movslq (%r14,%r13), %rax
addq %rax, %rbp
incq %r12
addq $0x28, %r13
cmpq %r12, %r15
jne 0xfdc8
movq 0x10(%rsp), %rax
addq %r12, %rax
cmpq 0x40(%rsp), %rbp
jl 0xfd57
addq %r12, 0x10(%rsp)
jmp 0xfe6a
movq $0x0, 0x8(%rsp)
jmp 0xfe76
testl %r12d, %r12d
jne 0xfe8a
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
movl %ecx, (%rax)
movq 0x8(%rsp), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2601
jmp 0xfe6a
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/options.c
// Function: mg_opt_update
void mg_opt_update(const mg_idx_t *gi, mg_mapopt_t *mo, mg_ggopt_t *go)
{
	float f[2];
	int32_t q[2];
	f[0] = 0.1f, f[1] = mo->occ_max1_frac;
	mg_idx_cal_quantile(gi, 2, f, q);
	if (q[0] > mo->lc_max_occ) mo->lc_max_occ = q[0];
	if (mo->lc_max_occ > mo->occ_max1_cap) mo->lc_max_occ = mo->occ_max1_cap;
	if (q[1] > mo->occ_max1) mo->occ_max1 = q[1];
	if (mo->occ_max1 > mo->occ_max1_cap) mo->occ_max1 = mo->occ_max1_cap;
	if (mo->bw_long < mo->bw) mo->bw_long = mo->bw;
	if (mg_verbose >= 3)
		fprintf(stderr, "[M::%s::%.3f*%.2f] occ_max1=%d; lc_max_occ=%d\n", __func__,
				realtime() - mg_realtime0, cputime() / (realtime() - mg_realtime0), mo->occ_max1, mo->lc_max_occ);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
leaq 0x10(%rsp), %rdx
movl $0x3dcccccd, (%rdx)     # imm = 0x3DCCCCCD
movss 0x24(%rsi), %xmm0
movss %xmm0, 0x4(%rdx)
leaq 0x8(%rsp), %r14
movl $0x2, %esi
movq %r14, %rcx
callq 0x1547c
movl (%r14), %eax
leaq 0x7c(%rbx), %rsi
movl 0x7c(%rbx), %ecx
cmpl %ecx, %eax
jle 0x1050e
movl %eax, (%rsi)
movl %eax, %ecx
movl 0x20(%rbx), %eax
cmpl %eax, %ecx
jle 0x10517
movl %eax, (%rsi)
movl 0xc(%rsp), %edx
leaq 0x1c(%rbx), %rdi
movl 0x1c(%rbx), %ecx
cmpl %ecx, %edx
cmovgl %edx, %ecx
setle %dl
cmpl %eax, %ecx
setle %r8b
testb %r8b, %dl
jne 0x1053c
cmpl %eax, %ecx
cmovll %ecx, %eax
movl %eax, (%rdi)
movl 0x28(%rbx), %eax
cmpl %eax, 0x2c(%rbx)
jge 0x10547
movl %eax, 0x2c(%rbx)
leaq 0x21eb2(%rip), %rax     # 0x32400
cmpl $0x3, (%rax)
jge 0x1055b
addq $0x18, %rsp
popq %rbx
popq %r14
retq
callq 0x263c
jmp 0x10553
nop
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/shortk.c
// Function: mg_sub_print_path
void mg_sub_print_path(FILE *fp, const gfa_t *g, int32_t n, mg_pathv_t *path)
{
	int32_t i;
	for (i = 0; i < n; ++i) {
		mg_pathv_t *p = &path[i];
		fprintf(fp, "[%d]\t%d\t%s\t%d\t%d\n", i, p->v, g->seg[p->v>>1].name, p->d, p->pre);
	}
}

// Assembly:
testl %edx, %edx
jle 0x11ee1
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl %edx, %ebp
addq $0x8, %rbx
leaq 0x16e7e(%rip), %r12     # 0x28d15
xorl %r13d, %r13d
movq 0x10(%r14), %rax
movl -0x8(%rbx), %ecx
movl -0x4(%rbx), %r9d
movl %ecx, %edx
shrl %edx
shlq $0x6, %rdx
movq 0x18(%rax,%rdx), %r8
movl (%rbx), %eax
movl %eax, (%rsp)
movq %r15, %rdi
movq %r12, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x2210
incq %r13
addq $0xc, %rbx
cmpq %r13, %rbp
jne 0x11e9a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/miniwfa.c
// Function: mwf_opt_init
void mwf_opt_init(mwf_opt_t *opt)
{
	memset(opt, 0, sizeof(*opt));
	opt->x  = 4; // corresponding SW score: m=1, x=3, o1=4, e1=3/2, o2=15, e2=1/2
	opt->o1 = 4, opt->e1 = 2;
	opt->o2 = 15, opt->e2 = 1;
	opt->kmer = 13, opt->max_occ = 2, opt->min_len = 30;
}

// Assembly:
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movups %xmm0, 0x20(%rdi)
movq $0x0, 0x30(%rdi)
movaps 0x168bb(%rip), %xmm0    # 0x28d30
movups %xmm0, 0x4(%rdi)
movl $0x1, 0x14(%rdi)
movabsq $0xd00000002, %rax      # imm = 0xD00000002
movq %rax, 0x28(%rdi)
movl $0x1e, 0x30(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/miniwfa.c
// Function: wf_stripe_init
static wf_stripe_t *wf_stripe_init(void *km, int32_t max_pen)
{
	int32_t i;
	wf_stripe_t *wf;
	wf = Kcalloc(km, wf_stripe_t, 1);
	wf->max_pen = max_pen;
	wf->n = max_pen + 1;
	wf->a = Kcalloc(km, wf_slice_t, wf->n);
	wf->lo = wf->hi = 0;
	for (i = 0; i < wf->n; ++i) {
		wf_slice_t *f;
		wf_stripe_add(km, wf, 0, 0);
		f = &wf->a[wf->top];
		f->H[0] = f->E1[0] = f->E2[0] = f->F1[0] = f->F2[0] = WF_NEG_INF;
	}
	wf->s = 0;
	wf->a[wf->top].H[0] = -1;
	return wf;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %r14
movl $0x1, %esi
movl $0x20, %edx
callq 0x2f84
movq %rax, %rbx
movl %ebp, 0xc(%rax)
incl %ebp
movl %ebp, 0x8(%rax)
movslq %ebp, %rsi
movl $0x38, %edx
movq %r14, %rdi
callq 0x2f84
movq %rax, 0x18(%rbx)
movq $0x0, 0x10(%rbx)
cmpl $0x0, 0x8(%rbx)
jle 0x131ab
xorl %ebp, %ebp
movl $0xc0000000, %r15d      # imm = 0xC0000000
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x12496
movq 0x18(%rbx), %rax
movslq 0x4(%rbx), %rcx
imulq $0x38, %rcx, %rcx
movq 0x30(%rax,%rcx), %rdx
movl %r15d, (%rdx)
movq 0x28(%rax,%rcx), %rdx
movl %r15d, (%rdx)
movq 0x20(%rax,%rcx), %rdx
movl %r15d, (%rdx)
movq 0x18(%rax,%rcx), %rdx
movl %r15d, (%rdx)
movq 0x10(%rax,%rcx), %rcx
movl %r15d, (%rcx)
incl %ebp
cmpl 0x8(%rbx), %ebp
jl 0x13161
movl $0x0, (%rbx)
movslq 0x4(%rbx), %rcx
imulq $0x38, %rcx, %rcx
movq 0x10(%rax,%rcx), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/miniwfa.c
// Function: wf_stripe_destroy
static void wf_stripe_destroy(void *km, wf_stripe_t *wf)
{
	int32_t i;
	for (i = 0; i < wf->n; ++i)
		kfree(km, wf->a[i].mem);
	kfree(km, wf->a);
	kfree(km, wf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x8(%rdi)
jle 0x13505
movl $0x8, %r14d
xorl %r15d, %r15d
movq 0x18(%rbx), %rax
movq (%rax,%r14), %rsi
xorl %edi, %edi
callq 0x301f
incq %r15
movslq 0x8(%rbx), %rax
addq $0x38, %r14
cmpq %rax, %r15
jl 0x134e6
movq 0x18(%rbx), %rsi
xorl %edi, %edi
callq 0x301f
xorl %edi, %edi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x301f
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/miniwfa.c
// Function: wf_cigar_push1
static void wf_cigar_push1(void *km, wf_cigar_t *c, int32_t op, int32_t len)
{
	if (c->n && op == (c->cigar[c->n-1]&0xf)) {
		c->cigar[c->n-1] += len<<4;
	} else {
		if (c->n == c->m) {
			c->m = c->m + (c->m>>1) + 4;
			c->cigar = Krealloc(km, uint32_t, c->cigar, c->m);
		}
		c->cigar[c->n++] = len<<4 | op;
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, %r14
movslq 0x4(%rsi), %rcx
testq %rcx, %rcx
je 0x14de3
movq 0x8(%r14), %rax
movl -0x4(%rax,%rcx,4), %edx
movl %edx, %esi
andl $0xf, %esi
cmpl %ebp, %esi
jne 0x14de3
shll $0x4, %ebx
addl %ebx, %edx
movl %edx, -0x4(%rax,%rcx,4)
jmp 0x14e24
cmpl (%r14), %ecx
jne 0x14e0e
movl %ecx, %eax
sarl %eax
addl %ecx, %eax
addl $0x4, %eax
movl %eax, (%r14)
movq 0x8(%r14), %rsi
movslq %eax, %rdx
shlq $0x2, %rdx
callq 0x31ed
movq %rax, 0x8(%r14)
movl 0x4(%r14), %ecx
jmp 0x14e12
movq 0x8(%r14), %rax
shll $0x4, %ebx
orl %ebp, %ebx
leal 0x1(%rcx), %edx
movl %edx, 0x4(%r14)
movslq %ecx, %rcx
movl %ebx, (%rax,%rcx,4)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/miniwfa.c
// Function: mwf_wfa_auto
void mwf_wfa_auto(void *km, const mwf_opt_t *opt0, int32_t tl, const char *ts, int32_t ql, const char *qs, mwf_rst_t *r)
{
	mwf_opt_t opt = *opt0;
	opt.step = 0, opt.max_iter = 100000000;
	mwf_wfa_exact(km, &opt, tl, ts, ql, qs, r);
	if (r->s < 0) {
		if (opt.flag & MWF_F_CIGAR) opt.step = 5000;
		opt.max_iter = -1;
		mwf_wfa_chain(km, &opt, tl, ts, ql, qs, r);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, %rbx
movl %r8d, %ebp
movq %rcx, %r14
movl %edx, %r15d
movq %rdi, %r12
movq 0x80(%rsp), %r13
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movups 0x20(%rsi), %xmm2
leaq 0x10(%rsp), %rax
movaps %xmm1, 0x10(%rax)
movaps %xmm2, 0x20(%rax)
movq 0x30(%rsi), %rcx
movq %rcx, 0x30(%rax)
movaps %xmm0, (%rax)
movl $0x0, 0x18(%rax)
movq $0x5f5e100, 0x20(%rax)  # imm = 0x5F5E100
movq %r13, (%rsp)
movq %rax, %rsi
movq %r14, %rcx
callq 0x1351f
cmpl $0x0, (%r13)
jns 0x14eca
testb $0x1, 0x10(%rsp)
je 0x14ea5
movl $0x1388, 0x28(%rsp)     # imm = 0x1388
leaq 0x10(%rsp), %rsi
movq $-0x1, 0x20(%rsi)
movq %r13, (%rsp)
movq %r12, %rdi
movl %r15d, %edx
movq %r14, %rcx
movl %ebp, %r8d
movq %rbx, %r9
callq 0x142bd
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/miniwfa.c
// Function: wf_next_prep
static void wf_next_prep(void *km, const mwf_opt_t *opt, wf_stripe_t *wf, int32_t lo, int32_t hi,
						 int32_t **H, int32_t **E1, int32_t **F1, int32_t **E2, int32_t **F2,
						 const int32_t **pHx, const int32_t **pHo1, const int32_t **pHo2,
						 const int32_t **pE1, const int32_t **pF1, const int32_t **pE2, const int32_t **pF2)
{
	const wf_slice_t *fx, *fo1, *fo2, *fe1, *fe2;
	wf_slice_t *ft;
	wf_stripe_add(km, wf, lo, hi);
	ft  = &wf->a[wf->top];
	fx  = wf_stripe_get(wf, opt->x);
	fo1 = wf_stripe_get(wf, opt->o1 + opt->e1);
	fo2 = wf_stripe_get(wf, opt->o2 + opt->e2);
	fe1 = wf_stripe_get(wf, opt->e1);
	fe2 = wf_stripe_get(wf, opt->e2);
	*pHx = fx->H, *pHo1 = fo1->H, *pHo2 = fo2->H, *pE1 = fe1->E1, *pE2 = fe2->E2, *pF1 = fe1->F1, *pF2 = fe2->F2;
	*H = ft->H, *E1 = ft->E1, *E2 = ft->E2, *F1 = ft->F1, *F2 = ft->F2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, (%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdx, %rsi
movl %ecx, %edx
movl %r8d, %ecx
callq 0x12496
movslq 0x4(%r14), %rax
movl 0x4(%r15), %edx
movl %eax, %ecx
subl %edx, %ecx
jns 0x14f0d
addl 0x8(%r14), %ecx
movl 0xc(%r15), %edi
movl 0x8(%r15), %esi
addl %edi, %esi
movl %eax, %edx
subl %esi, %edx
jns 0x14f21
addl 0x8(%r14), %edx
movl 0x14(%r15), %r12d
movl 0x10(%r15), %r8d
addl %r12d, %r8d
movl %eax, %esi
subl %r8d, %esi
jns 0x14f37
addl 0x8(%r14), %esi
movl %eax, %r8d
subl %edi, %r8d
jns 0x14f43
addl 0x8(%r14), %r8d
movq 0x88(%rsp), %rbp
movq 0x80(%rsp), %r15
movq 0x78(%rsp), %rdi
movq 0x70(%rsp), %r9
movq 0x68(%rsp), %r11
movq 0x60(%rsp), %rbx
movq 0x40(%rsp), %r13
movl %eax, %r10d
subl %r12d, %r10d
movq 0x18(%r14), %r12
jns 0x14f7c
addl 0x8(%r14), %r10d
movslq %ecx, %rcx
imulq $0x38, %rcx, %rcx
movq 0x10(%r12,%rcx), %rcx
movq %rcx, (%rbx)
movslq %edx, %rcx
imulq $0x38, %rcx, %rcx
movq 0x10(%r12,%rcx), %rcx
movq %rcx, (%r11)
movslq %esi, %rcx
imulq $0x38, %rcx, %rcx
movq 0x10(%r12,%rcx), %rcx
movq %rcx, (%r9)
movslq %r8d, %rcx
imulq $0x38, %rcx, %rcx
movq 0x18(%r12,%rcx), %rdx
movq %rdx, (%rdi)
movslq %r10d, %rdx
imulq $0x38, %rdx, %rdx
movq 0x20(%r12,%rdx), %rsi
movq %rsi, (%rbp)
movq 0x28(%r12,%rcx), %rcx
movq %rcx, (%r15)
movq 0x30(%r12,%rdx), %rcx
movq 0x90(%rsp), %rdx
movq %rcx, (%rdx)
imulq $0x38, %rax, %rax
movq 0x10(%r12,%rax), %rcx
movq (%rsp), %rdx
movq %rcx, (%rdx)
movq 0x18(%r12,%rax), %rcx
movq %rcx, (%r13)
movq 0x20(%r12,%rax), %rcx
movq 0x50(%rsp), %rdx
movq %rcx, (%rdx)
movq 0x28(%r12,%rax), %rcx
movq 0x48(%rsp), %rdx
movq %rcx, (%rdx)
movq 0x30(%r12,%rax), %rax
movq 0x58(%rsp), %rcx
movq %rax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/miniwfa.c
// Function: mg_fc_kmer
static int32_t mg_fc_kmer(int32_t len, const char *seq, int32_t rid, int32_t k, uint64_t *a)
{
	int32_t i, l, n;
	uint64_t x, mask = (1ULL<<k*2) - 1;
	for (i = l = 0, x = 0, n = 0; i < len; ++i) {
		int32_t c = seq_nt4_table[(uint8_t)seq[i]];
		if (c < 4) {
			x = (x << 2 | c) & mask;
			if (++l >= k) a[n++] = (x<<1|rid) << 32 | i;
		} else l = 0, x = 0;
	}
	return n;
}

// Assembly:
movl %ecx, %r9d
leal (%r9,%r9), %ecx
movq $-0x1, %r10
shlq %cl, %r10
testl %edi, %edi
jle 0x15267
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
notq %r10
shlq $0x20, %rdx
movl %edi, %ecx
xorl %edi, %edi
leaq 0x1d0eb(%rip), %r11     # 0x32300
xorl %ebx, %ebx
xorl %r14d, %r14d
xorl %eax, %eax
movzbl (%rsi,%rdi), %r15d
movzbl (%r11,%r15), %r15d
cmpq $0x3, %r15
ja 0x15252
leaq (%r15,%r14,4), %r14
andq %r10, %r14
incl %ebx
cmpl %r9d, %ebx
jl 0x15257
movq %r14, %r15
shlq $0x21, %r15
orq %rdx, %r15
addq %rdi, %r15
movslq %eax, %r12
incl %eax
movq %r15, (%r8,%r12,8)
jmp 0x15257
xorl %r14d, %r14d
xorl %ebx, %ebx
incq %rdi
cmpq %rdi, %rcx
jne 0x1521c
popq %rbx
popq %r12
popq %r14
popq %r15
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/index.c
// Function: mg_idx_destroy
void mg_idx_destroy(mg_idx_t *gi)
{
	uint32_t i;
	if (gi == 0) return;
	if (gi->B) {
		for (i = 0; i < 1U<<gi->b; ++i) {
			free(gi->B[i].p);
			free(gi->B[i].a.a);
			mg_hidx_destroy((idxhash_t*)gi->B[i].h);
		}
		free(gi->B);
	}
	gfa_edseq_destroy(gi->n_seg, gi->es);
	free(gi);
}

// Assembly:
testq %rdi, %rdi
je 0x15387
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x28(%rdi)
je 0x15368
movl $0x1, %r12d
leal -0x1(%r12), %eax
movq 0x28(%rbx), %rcx
shlq $0x4, %rax
leaq (%rax,%rax,2), %r14
movq 0x20(%rcx,%r14), %rdi
callq 0x2040
movq 0x28(%rbx), %rax
movq 0x10(%rax,%r14), %rdi
callq 0x2040
movq 0x28(%rbx), %rax
movq 0x28(%rax,%r14), %r14
testq %r14, %r14
je 0x15350
movq 0x10(%r14), %rsi
movq 0x18(%r14), %r15
movq %r15, %rdi
callq 0x301f
movq 0x8(%r14), %rsi
movq %r15, %rdi
callq 0x301f
movq %r15, %rdi
movq %r14, %rsi
callq 0x301f
movb 0x10(%rbx), %cl
movl %r12d, %eax
shrl %cl, %eax
incl %r12d
testl %eax, %eax
je 0x152f2
movq 0x28(%rbx), %rdi
callq 0x2040
movl 0x20(%rbx), %edi
movq 0x8(%rbx), %rsi
callq 0xb99b
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2040
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/index.c
// Function: mg_idx_hget
const uint64_t *mg_idx_hget(const void *h_, const uint64_t *q, int suflen, uint64_t minier, int *n)
{
	khint_t k;
	const idxhash_t *h = (const idxhash_t*)h_;
	*n = 0;
	if (h == 0) return 0;
	k = mg_hidx_get(h, minier>>suflen<<1);
	if (k == kh_end(h)) return 0;
	if (kh_key(h, k)&1) { // special casing when there is only one k-mer
		*n = 1;
		return &kh_val(h, k);
	} else {
		*n = (uint32_t)kh_val(h, k);
		return &q[kh_val(h, k)>>32];
	}
}

// Assembly:
movl $0x0, (%r8)
testq %rdi, %rdi
je 0x15405
movq %rcx, %rax
movl %edx, %ecx
shrq %cl, %rax
movq 0x10(%rdi), %rdx
testq %rdx, %rdx
je 0x15405
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movb (%rdi), %cl
movl $0x1, %r9d
shll %cl, %r9d
leaq (%rax,%rax), %r10
imull $0x9e3779b9, %eax, %r11d # imm = 0x9E3779B9
negb %cl
shrl %cl, %r11d
leal -0x1(%r9), %ecx
movq 0x8(%rdi), %rdi
xorl %eax, %eax
movl %r11d, %ebx
movl %ebx, %r14d
shrl $0x5, %r14d
movl (%rdi,%r14,4), %ebp
btl %ebx, %ebp
jae 0x1543f
movl %ebx, %r14d
movq %r14, %r15
shlq $0x4, %r15
movq (%rdx,%r15), %r15
xorq %r10, %r15
cmpq $0x2, %r15
jb 0x15408
incl %ebx
andl %ecx, %ebx
cmpl %r11d, %ebx
jne 0x153d3
jmp 0x1543f
xorl %eax, %eax
retq
cmpl %r9d, %ebx
jne 0x15411
xorl %eax, %eax
jmp 0x1543f
shlq $0x4, %r14
testb $0x1, (%rdx,%r14)
jne 0x15430
addq %r14, %rdx
movq 0x8(%rdx), %rax
movl %eax, (%r8)
shrq $0x20, %rax
leaq (%rsi,%rax,8), %rax
jmp 0x1543f
movl $0x1, (%r8)
leaq (%rdx,%r14), %rax
addq $0x8, %rax
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/index.c
// Function: mg_idx_cal_quantile
void mg_idx_cal_quantile(const mg_idx_t *gi, int32_t m, float f[], int32_t q[])
{
	int32_t i;
	uint64_t n = 0;
	khint_t *a, k;
	for (i = 0; i < 1<<gi->b; ++i)
		if (gi->B[i].h) n += kh_size((idxhash_t*)gi->B[i].h);
	a = (uint32_t*)malloc(n * 4);
	for (i = 0, n = 0; i < 1<<gi->b; ++i) {
		idxhash_t *h = (idxhash_t*)gi->B[i].h;
		if (h == 0) continue;
		for (k = 0; k < kh_end(h); ++k) {
			if (!kh_exist(h, k)) continue;
			a[n++] = kh_key(h, k)&1? 1 : (uint32_t)kh_val(h, k);
		}
	}
	for (i = 0; i < m; ++i)
		q[i] = ks_ksmall_uint32_t(n, a, (size_t)((1.0 - (double)f[i]) * n));
	free(a);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, (%rsp)
movl 0x10(%rdi), %r13d
movl $0x1, %edx
movl $0x1, %ebp
movl %r13d, %ecx
shll %cl, %ebp
cmpl $0x1f, %r13d
jne 0x154bb
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x2280
movq %rax, %r15
jmp 0x15502
movq %rdi, %r12
movq 0x28(%rdi), %rax
cmpl $0x2, %ebp
cmovgel %ebp, %edx
shlq $0x4, %rdx
leaq (%rdx,%rdx,2), %rcx
xorl %edx, %edx
xorl %edi, %edi
movq 0x28(%rax,%rdx), %rsi
testq %rsi, %rsi
je 0x154e4
movl 0x4(%rsi), %esi
addq %rsi, %rdi
addq $0x30, %rdx
cmpq %rdx, %rcx
jne 0x154d4
shlq $0x2, %rdi
callq 0x2280
movq %rax, %r15
cmpl $0x1f, %r13d
jne 0x1550a
xorl %r12d, %r12d
movl (%rsp), %ebp
jmp 0x15595
movq 0x28(%r12), %rax
cmpl $0x2, %ebp
movl $0x1, %edx
cmovgel %ebp, %edx
xorl %esi, %esi
xorl %r12d, %r12d
movl (%rsp), %ebp
leaq (%rsi,%rsi,2), %rcx
shlq $0x4, %rcx
movq 0x28(%rax,%rcx), %rdi
testq %rdi, %rdi
je 0x1558d
movq 0x10(%rdi), %r8
leaq 0x8(%r8), %r9
xorl %r10d, %r10d
testq %r8, %r8
je 0x15551
movb (%rdi), %cl
movl $0x1, %r11d
shlq %cl, %r11
jmp 0x15554
xorl %r11d, %r11d
cmpq %r11, %r10
jae 0x1558d
movq 0x8(%rdi), %rcx
movq %r10, %r11
shrq $0x5, %r11
movl (%rcx,%r11,4), %ecx
btl %r10d, %ecx
jae 0x15584
movl $0x1, %ecx
testb $0x1, -0x8(%r9)
jne 0x1557d
movl (%r9), %ecx
movl %ecx, (%r15,%r12,4)
incq %r12
incq %r10
addq $0x10, %r9
jmp 0x1553f
incq %rsi
cmpq %rdx, %rsi
jne 0x15522
testl %ebp, %ebp
jle 0x15613
movq %r12, %xmm0
punpckldq 0x13b4a(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x13b52(%rip), %xmm0    # 0x29100
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, (%rsp)
movl %ebp, %r13d
xorl %ebp, %ebp
xorps %xmm0, %xmm0
cvtss2sd (%r14,%rbp,4), %xmm0
movsd 0x13b3b(%rip), %xmm1    # 0x29110
subsd %xmm0, %xmm1
mulsd (%rsp), %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x13b26(%rip), %xmm1    # 0x29118
cvttsd2si %xmm1, %rdx
andq %rcx, %rdx
orq %rax, %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0xf368
movl %eax, (%rbx,%rbp,4)
incq %rbp
cmpq %rbp, %r13
jne 0x155c4
movq %r15, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/index.c
// Function: mg_gfa_overlap
int mg_gfa_overlap(const gfa_t *g)
{
	int64_t i;
	for (i = 0; i < g->n_arc; ++i) // non-zero overlap
		if (g->arc[i].ov != 0 || g->arc[i].ow != 0)
			return 1;
	return 0;
}

// Assembly:
movq 0x40(%rdi), %rcx
testq %rcx, %rcx
je 0x15a47
movq 0x48(%rdi), %rdx
addq $0x14, %rdx
movl $0x1, %eax
cmpl $0x0, -0x4(%rdx)
jne 0x15a49
cmpl $0x0, (%rdx)
jne 0x15a49
addq $0x20, %rdx
decq %rcx
jne 0x15a33
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/index.c
// Function: mg_index_core
mg_idx_t *mg_index_core(gfa_t *g, int k, int w, int b, int n_threads)
{
	mg_idx_t *gi;
	mg128_v a = {0,0,0};
	int i;

	if (mg_gfa_overlap(g)) {
		if (mg_verbose >= 1)
			fprintf(stderr, "[E::%s] minigraph doesn't work with graphs containing overlapping segments\n", __func__);
		return 0;
	}
	gi = mg_idx_init(k, w, b);
	gi->g = g;

	for (i = 0; i < g->n_seg; ++i) {
		gfa_seg_t *s = &g->seg[i];
		a.n = 0;
		mg_sketch(0, s->seq, s->len, w, k, i, &a); // TODO: this can be parallelized
		mg_idx_add(gi, a.n, a.a);
	}
	free(a.a);
	kt_for(n_threads, worker_post, gi, 1<<gi->b);
	return gi;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r8d, %ebx
movl %edx, 0x18(%rsp)
movl %esi, 0x14(%rsp)
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x40(%rdi), %rax
testq %rax, %rax
je 0x15aa4
movq 0x48(%r14), %rdx
addq $0x14, %rdx
cmpl $0x0, -0x4(%rdx)
jne 0x15bc0
cmpl $0x0, (%rdx)
jne 0x15bc0
addq $0x20, %rdx
decq %rax
jne 0x15a88
movl 0x14(%rsp), %edi
movl 0x18(%rsp), %esi
movl %ecx, %edx
callq 0x1526c
movq %rax, %r12
movq %r14, (%rax)
cmpl $0x0, 0x4(%r14)
je 0x15bd1
movl %ebx, 0x1c(%rsp)
xorl %r13d, %r13d
movq %r14, 0x40(%rsp)
movq 0x10(%r14), %rax
movq %r13, %rcx
shlq $0x6, %rcx
movq $0x0, 0x20(%rsp)
movq 0x20(%rax,%rcx), %rsi
movl (%rax,%rcx), %edx
leaq 0x20(%rsp), %rax
movq %rax, (%rsp)
xorl %edi, %edi
movl 0x18(%rsp), %ecx
movl 0x14(%rsp), %r8d
movl %r13d, %r9d
callq 0xe8ac
movq 0x20(%rsp), %rbp
testl %ebp, %ebp
jle 0x15ba0
movb 0x10(%r12), %cl
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
shll %cl, %r14d
movq 0x30(%rsp), %r15
notl %r14d
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movq 0x28(%r12), %rax
movl 0x1(%r15), %ecx
andl %r14d, %ecx
leaq (%rcx,%rcx,2), %rdx
shlq $0x4, %rdx
leaq (%rax,%rdx), %rbx
movq (%rax,%rdx), %rcx
cmpq 0x8(%rax,%rdx), %rcx
jne 0x15b80
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %eax
cmoveq %rax, %rdx
movq %rdx, 0x8(%rbx)
movq 0x10(%rbx), %rsi
shlq $0x4, %rdx
xorl %edi, %edi
callq 0x31ed
movq %rax, 0x10(%rbx)
movq (%rbx), %rcx
jmp 0x15b84
movq 0x10(%rbx), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
shlq $0x4, %rcx
movups (%r15), %xmm0
movups %xmm0, (%rax,%rcx)
addq $0x10, %r15
decq %rbp
jne 0x15b31
incq %r13
movq 0x40(%rsp), %r14
movl 0x4(%r14), %eax
cmpq %rax, %r13
jb 0x15ad0
movq 0x30(%rsp), %rdi
movl 0x1c(%rsp), %ebx
jmp 0x15bd3
leaq 0x1c839(%rip), %rax     # 0x32400
cmpl $0x0, (%rax)
jg 0x15c0a
xorl %r12d, %r12d
jmp 0x15bf8
xorl %edi, %edi
callq 0x2040
movb 0x10(%r12), %cl
movl $0x1, %eax
shll %cl, %eax
movslq %eax, %rcx
leaq 0x23(%rip), %rsi        # 0x15c11
movl %ebx, %edi
movq %r12, %rdx
callq 0x33a0
movq %r12, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x26bf
jmp 0x15bcc
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/index.c
// Function: worker_post
static void worker_post(void *g, long i, int tid)
{
	mg_idx_t *gi = (mg_idx_t*)g;
	mg_idx_bucket_t *b = &gi->B[i];
	if (b->a.n == 0) return;
	b->h = (idxhash_t*)mg_idx_a2h(0, b->a.n, b->a.a, gi->b, &b->p, &b->n);
	kfree(0, b->a.a);
	b->a.n = b->a.m = 0, b->a.a = 0;
}

// Assembly:
pushq %rbx
movq 0x28(%rdi), %rbx
leaq (%rsi,%rsi,2), %rax
shlq $0x4, %rax
movq (%rbx,%rax), %rsi
testq %rsi, %rsi
je 0x15c5d
addq %rax, %rbx
movq 0x10(%rbx), %rdx
movl 0x10(%rdi), %ecx
leaq 0x20(%rbx), %r8
leaq 0x18(%rbx), %r9
xorl %edi, %edi
callq 0x15664
movq %rax, 0x28(%rbx)
movq 0x10(%rbx), %rsi
xorl %edi, %edi
callq 0x301f
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/index.c
// Function: mg_index
mg_idx_t *mg_index(gfa_t *g, const mg_idxopt_t *io, int n_threads, mg_mapopt_t *mo)
{
	int32_t i, j;
	mg_idx_t *gi;
	for (i = 0; i < g->n_seg; ++i) { // uppercase
		gfa_seg_t *s = &g->seg[i];
		for (j = 0; j < s->len; ++j)
			if (s->seq[j] >= 'a' && s->seq[j] <= 'z')
				s->seq[j] -= 32;
	}
	gi = mg_index_core(g, io->k, io->w, io->bucket_bits, n_threads);
	if (gi == 0) return 0;
	gi->es = gfa_edseq_init(gi->g);
	gi->n_seg = g->n_seg;
	if (mg_verbose >= 3)
		fprintf(stderr, "[M::%s::%.3f*%.2f] indexed the graph\n", __func__,
				realtime() - mg_realtime0, cputime() / (realtime() - mg_realtime0));
	if (mo) mg_opt_update(gi, mo, 0);
	return gi;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movl %edx, %r8d
movq %rdi, %r14
movl 0x4(%rdi), %edi
testl %edi, %edi
je 0x15cc3
xorl %eax, %eax
movq 0x10(%r14), %rcx
movq %rax, %r9
shlq $0x6, %r9
movl (%rcx,%r9), %edx
testl %edx, %edx
jle 0x15cb9
addq %r9, %rcx
xorl %edi, %edi
movq 0x20(%rcx), %r9
movb (%r9,%rdi), %r10b
leal -0x61(%r10), %r11d
cmpb $0x19, %r11b
ja 0x15caa
addb $-0x20, %r10b
movb %r10b, (%r9,%rdi)
movl (%rcx), %edx
incq %rdi
movslq %edx, %r9
cmpq %r9, %rdi
jl 0x15c8e
movl 0x4(%r14), %edi
incq %rax
movl %edi, %ecx
cmpq %rcx, %rax
jb 0x15c76
movl (%rsi), %edx
movl 0x4(%rsi), %eax
movl 0x8(%rsi), %ecx
movq %r14, %rdi
movl %eax, %esi
callq 0x15a4a
movq %rax, %r15
testq %rax, %rax
je 0x15d0f
movq (%r15), %rdi
callq 0xb8e2
movq %rax, 0x8(%r15)
movl 0x4(%r14), %eax
movl %eax, 0x20(%r15)
leaq 0x1c708(%rip), %rax     # 0x32400
cmpl $0x3, (%rax)
jge 0x15d18
testq %rbx, %rbx
je 0x15d0f
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x104cb
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
callq 0x26de
jmp 0x15cfd
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/lchain.c
// Function: mg_chain_bk_end
static int64_t mg_chain_bk_end(int32_t max_drop, const mg128_t *z, const int32_t *f, const int64_t *p, int32_t *t, int64_t k)
{
	int64_t i = z[k].y, end_i = -1, max_i = i;
	int32_t max_s = 0;
	if (i < 0 || t[i] != 0) return i;
	do {
		int32_t s;
		t[i] = 2;
		end_i = i = p[i];
		s = i < 0? z[k].x : (int32_t)z[k].x - f[i];
		if (s > max_s) max_s = s, max_i = i;
		else if (max_s - s > max_drop) break;
	} while (i >= 0 && t[i] == 0);
	for (i = z[k].y; i >= 0 && i != end_i; i = p[i]) // reset modified t[]
		t[i] = 0;
	return max_i;
}

// Assembly:
shlq $0x4, %r9
movq 0x8(%rsi,%r9), %rax
testq %rax, %rax
js 0x16282
cmpl $0x0, (%r8,%rax,4)
je 0x16283
retq
pushq %rbp
pushq %r14
pushq %rbx
addq %r9, %rsi
movl (%rsi), %r10d
xorl %r11d, %r11d
movq %rax, %r9
movq %rax, %rsi
movl $0x2, (%r8,%r9,4)
movq (%rcx,%r9,8), %r9
movl %r10d, %ebx
testq %r9, %r9
js 0x162b1
movl %r10d, %ebx
subl (%rdx,%r9,4), %ebx
movl %r11d, %r14d
subl %ebx, %r14d
cmovlq %r9, %rsi
setl %bpl
cmpl %edi, %r14d
setle %r14b
testq %r9, %r9
js 0x162f1
orb %r14b, %bpl
je 0x162f1
cmpl %r11d, %ebx
cmovgl %ebx, %r11d
cmpl $0x0, (%r8,%r9,4)
je 0x16296
jmp 0x162f1
movl $0x0, (%r8,%rax,4)
movq (%rcx,%rax,8), %rax
testq %rax, %rax
js 0x162f6
cmpq %r9, %rax
jne 0x162e0
movq %rsi, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/lchain.c
// Function: mg_update_anchors
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 0x1893c
testl %edx, %edx
jle 0x188c5
movl 0x8(%rsi), %r8d
leal -0x1(%rdx), %r10d
xorl %r9d, %r9d
movslq %r9d, %r11
movslq %r10d, %rax
addq %r11, %rax
shrq %rax
cmpl %r8d, (%rcx,%rax,4)
jge 0x188ba
leal 0x1(%rax), %r9d
jmp 0x188c0
jle 0x188e4
leal -0x1(%rax), %r10d
cmpl %r10d, %r9d
jle 0x188a2
leaq 0x10b67(%rip), %rdi     # 0x29433
leaq 0x1098d(%rip), %rsi     # 0x29260
leaq 0x10b61(%rip), %rcx     # 0x2943b
movl $0x1b4, %edx            # imm = 0x1B4
callq 0x2160
testl %eax, %eax
js 0x188c5
xorl %r8d, %r8d
cmpl %edx, %eax
jge 0x18937
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, %r9
shlq $0x20, %r9
xorl %r8d, %r8d
movabsq $0x100000000, %r10      # imm = 0x100000000
movslq %r8d, %r11
shlq $0x4, %r11
movl (%rcx,%rax,4), %ebx
cmpl 0x8(%rsi,%r11), %ebx
jne 0x18928
addq %rsi, %r11
movl (%r11), %ebx
addq %r9, %rbx
movq %rbx, (%r11)
incl %r8d
incq %rax
cmpl %edx, %eax
jge 0x18937
addq %r10, %r9
cmpl %edi, %r8d
jl 0x18908
cmpl %edi, %r8d
jne 0x1893e
popq %rbx
retq
leaq 0x10b3b(%rip), %rdi     # 0x29480
leaq 0x10914(%rip), %rsi     # 0x29260
leaq 0x10ae8(%rip), %rcx     # 0x2943b
movl $0x1b8, %edx            # imm = 0x1B8
callq 0x2160
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/gchain1.c
// Function: rs_insertsort_gc
static int32_t find_max(int32_t n, const gc_frag_t *gf, int32_t x)
{
	int32_t s = 0, e = n;
	if (n == 0) return -1;
	if (gf[n-1].srt < x) return n - 1;
	if (gf[0].srt >= x) return -1;
	while (e > s) { // TODO: finish this block
		int32_t m = s + (e - s) / 2;
		if (gf[m].srt >= x) e = m;
		else s = m + 1;
	}
	assert(s == e);
	return s;
}

// Assembly:
leaq 0x8(%rdi), %rcx
cmpq %rsi, %rcx
jae 0x189b5
movq %rdi, %rdx
movq %rcx, %rax
movl 0x8(%rdx), %ecx
cmpl (%rdx), %ecx
jae 0x189a9
movl 0xc(%rdx), %edx
movq %rax, %r8
cmpq %rdi, %rax
jbe 0x189a2
movq %rax, %r9
cmpl -0x8(%r9), %ecx
jae 0x1899f
leaq -0x8(%r9), %r8
movq -0x8(%r9), %r10
movq %r10, (%r9)
movq %r8, %r9
cmpq %rdi, %r8
ja 0x18984
jmp 0x189a2
movq %r9, %r8
movl %ecx, (%r8)
movl %edx, 0x4(%r8)
leaq 0x8(%rax), %rcx
movq %rax, %rdx
cmpq %rsi, %rcx
jb 0x1896c
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/gchain1.c
// Function: mg_gchain_free
void mg_gchain_free(mg_gchains_t *gs)
{
	void *km;
	int32_t i;
	if (gs == 0) return;
	km = gs->km;
	for (i = 0; i < gs->n_gc; ++i) {
		if (gs->gc[i].p) kfree(km, gs->gc[i].p);
		if (gs->gc[i].ds.ds) kfree(km, gs->gc[i].ds.ds);
		if (gs->gc[i].ds.off) kfree(km, gs->gc[i].ds.off);
	}
	kfree(km, gs->gc); kfree(km, gs->a); kfree(km, gs->lc);
	kfree(km, gs);
}

// Assembly:
testq %rdi, %rdi
je 0x1ad3f
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
cmpl $0x0, 0x8(%rdi)
jle 0x1ad05
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x18(%rbx), %rax
movq 0x48(%rax,%r15), %rsi
testq %rsi, %rsi
je 0x1accd
movq %r14, %rdi
callq 0x301f
movq 0x18(%rbx), %rax
movq 0x60(%rax,%r15), %rsi
testq %rsi, %rsi
je 0x1ace3
movq %r14, %rdi
callq 0x301f
movq 0x18(%rbx), %rax
movq 0x58(%rax,%r15), %rsi
testq %rsi, %rsi
je 0x1acf5
movq %r14, %rdi
callq 0x301f
incq %r12
movslq 0x8(%rbx), %rax
addq $0x68, %r15
cmpq %rax, %r12
jl 0x1acb3
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0x301f
movq 0x28(%rbx), %rsi
movq %r14, %rdi
callq 0x301f
movq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0x301f
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x301f
retq