LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/map.c
// Function: ks_heapdown_heap
static inline int skip_seed(int flag, uint64_t r, const mm_seed_t *q, const char *qname, int qlen, const mm_idx_t *mi, int *is_self)
{
	*is_self = 0;
	if (qname && (flag & (MM_F_NO_DIAG|MM_F_NO_DUAL))) {
		const mm_idx_seq_t *s = &mi->seq[r>>32];
		int cmp;
		cmp = strcmp(qname, s->name);
		if ((flag&MM_F_NO_DIAG) && cmp == 0 && (int)s->len == qlen) {
			if ((uint32_t)r>>1 == (q->q_pos>>1)) return 1; // avoid the diagnonal anchors
			if ((r&1) == (q->q_pos&1)) *is_self = 1; // this flag is used to avoid spurious extension on self chain
		}
		if ((flag&MM_F_NO_DUAL) && cmp > 0) // all-vs-all mode: map once
			return 1;
	}
	if (flag & (MM_F_FOR_ONLY|MM_F_REV_ONLY)) {
		if ((r&1) == (q->q_pos&1)) { // forward strand
			if (flag & MM_F_REV_ONLY) return 1;
		} else {
			if (flag & MM_F_FOR_ONLY) return 1;
		}
	}
	return 0;
}

// Assembly:
movq %rdi, %rax
shlq $0x4, %rax
movdqu (%rdx,%rax), %xmm0
leaq 0x1(,%rdi,2), %r8
cmpq %rsi, %r8
jae 0xada3
leaq (%rdi,%rdi), %r9
leaq -0x2(%rsi), %rax
movq %xmm0, %rcx
cmpq %rax, %r9
jne 0xad4f
movq %r8, %r10
jmp 0xad71
movq %r8, %r10
shlq $0x4, %r10
movq (%rdx,%r10), %r10
addq $0x2, %r9
movq %r9, %r11
shlq $0x4, %r11
cmpq (%rdx,%r11), %r10
ja 0xad6e
movq %r8, %r9
movq %r9, %r10
movq %r10, %r8
shlq $0x4, %r8
cmpq %rcx, (%rdx,%r8)
ja 0xada3
addq %rdx, %r8
shlq $0x4, %rdi
movups (%r8), %xmm1
movups %xmm1, (%rdx,%rdi)
leaq (%r10,%r10), %r9
leaq 0x1(,%r10,2), %r8
movq %r10, %rdi
cmpq %rsi, %r8
jb 0xad45
jmp 0xada6
movq %rdi, %r10
shlq $0x4, %r10
movdqu %xmm0, (%rdx,%r10)
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/map.c
// Function: align_regs
static mm_reg1_t *align_regs(const mm_mapopt_t *opt, const mm_idx_t *mi, void *km, int qlen, const char *seq, int *n_regs, mm_reg1_t *regs, mm128_t *a)
{
	if (!(opt->flag & MM_F_CIGAR)) return regs;
	regs = mm_align_skeleton(km, opt, mi, qlen, seq, n_regs, regs, a); // this calls mm_filter_regs()
	if (!(opt->flag & MM_F_ALL_CHAINS)) { // don't choose primary mapping(s)
		mm_set_parent(km, opt->mask_level, opt->mask_len, *n_regs, regs, opt->a * 2 + opt->b, opt->flag&MM_F_HARD_MLEVEL, opt->alt_drop);
		mm_select_sub(km, opt->pri_ratio, mi->k*2, opt->best_n, 0, opt->max_gap * 0.8, n_regs, regs);
		mm_set_sam_pri(*n_regs, regs);
	}
	return regs;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x30(%rsp), %rbx
testb $0x4, (%rdi)
je 0xc9d1
movq %r9, %r14
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r12
movq %rdx, %rdi
movq %r12, %rsi
movq %r13, %rdx
pushq 0x38(%rsp)
pushq %rbx
callq 0x174f4
addq $0x10, %rsp
movq %rax, %rbx
movq (%r12), %r9
btl $0x17, %r9d
jb 0xc9d1
movss 0x50(%r12), %xmm0
movl 0x54(%r12), %esi
movl (%r14), %edx
movl 0x64(%r12), %r8d
addl %r8d, %r8d
addl 0x68(%r12), %r8d
andl $0x20000000, %r9d       # imm = 0x20000000
movss 0x60(%r12), %xmm1
movq %r15, %rdi
movq %rbx, %rcx
callq 0x1bfdc
movss 0x58(%r12), %xmm0
movl 0x8(%r13), %esi
addl %esi, %esi
movl 0x5c(%r12), %edx
xorps %xmm1, %xmm1
cvtsi2sdl 0x1c(%r12), %xmm1
mulsd 0x20dd5(%rip), %xmm1    # 0x2d780
cvttsd2si %xmm1, %r8d
subq $0x8, %rsp
movq %r15, %rdi
xorl %ecx, %ecx
movq %r14, %r9
pushq %rbx
callq 0x1c811
addq $0x10, %rsp
movl (%r14), %edi
movq %rbx, %rsi
callq 0x1c6d6
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/map.c
// Function: mm_map_frag
void mm_map_frag(const mm_idx_t *mi, int n_segs, const int *qlens, const char **seqs, int *n_regs, mm_reg1_t **regs, mm_tbuf_t *b, const mm_mapopt_t *opt, const char *qname)
{
	if ((opt->flag & MM_F_WEAK_PAIRING) && n_segs == 2 && opt->pe_ori >= 0 && (opt->flag&MM_F_CIGAR)) {
		int i;
		for (i = 0; i < n_segs; ++i)
			mm_map_frag_core(mi, 1, &qlens[i], &seqs[i], &n_regs[i], &regs[i], b, opt, qname);
		mm_pair(b->km, opt->max_gap_ref, opt->pe_bonus, opt->a * 2 + opt->b, opt->a, qlens, n_regs, regs);
	} else {
		mm_map_frag_core(mi, n_segs, qlens, seqs, n_regs, regs, b, opt, qname);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r14
movq %r8, %rbx
movq %rcx, %r12
movq %rdx, %r15
movq %rdi, %r13
movq 0x58(%rsp), %rbp
movq (%rbp), %rax
btq $0x26, %rax
setae %cl
cmpl $0x2, %esi
setne %dl
orb %cl, %dl
jne 0xcace
testb $0x4, %al
je 0xcace
cmpl $0x0, 0xb8(%rbp)
js 0xcace
movq 0x60(%rsp), %r10
movq %r10, 0x10(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
subq $0x8, %rsp
movq %r13, %rdi
movl $0x1, %esi
movq %r15, %rdx
movq %r12, %rcx
movq %rbx, %r8
movq %r14, %r9
pushq %r10
pushq %rbp
pushq %rax
callq 0xaf2a
addq $0x20, %rsp
leaq 0x4(%r15), %rdx
addq $0x8, %r12
leaq 0x4(%rbx), %r8
leaq 0x8(%r14), %r9
subq $0x8, %rsp
movq %r13, %rdi
movl $0x1, %esi
movq %r12, %rcx
pushq 0x18(%rsp)
pushq %rbp
movq 0x20(%rsp), %r12
pushq %r12
callq 0xaf2a
addq $0x20, %rsp
movq (%r12), %rdi
movl 0xbc(%rbp), %edx
movl 0x20(%rbp), %esi
movl 0x64(%rbp), %r8d
leal (%r8,%r8), %ecx
addl 0x68(%rbp), %ecx
movq %r15, %r9
pushq %r14
pushq %rbx
callq 0x1130e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
movq %r15, %rdx
movq %r12, %rcx
movq %rbx, %r8
movq %r14, %r9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xaf2a
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/map.c
// Function: mm_map_file_frag
int mm_map_file_frag(const mm_idx_t *idx, int n_segs, const char **fn, const mm_mapopt_t *opt, int n_threads)
{
	int i, pl_threads;
	pipeline_t pl;
	if (n_segs < 1) return -1;
	memset(&pl, 0, sizeof(pipeline_t));
	pl.n_fp = n_segs;
	pl.fp = open_bseqs(pl.n_fp, fn);
	if (pl.fp == 0) return -1;
	pl.opt = opt, pl.mi = idx;
	pl.n_threads = n_threads > 1? n_threads : 1;
	pl.mini_batch_size = opt->mini_batch_size;
	if (opt->split_prefix)
		pl.fp_split = mm_split_init(opt->split_prefix, idx);
	pl_threads = n_threads == 1? 1 : (opt->flag&MM_F_2_IO_THREADS)? 3 : 2;
	kt_pipeline(pl_threads, worker_pipeline, &pl, 3);

	free(pl.str.s);
	if (pl.fp_split) fclose(pl.fp_split);
	for (i = 0; i < pl.n_fp; ++i)
		mm_bseq_close(pl.fp[i]);
	free(pl.fp);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testl %esi, %esi
jle 0xcc60
movl %r8d, %ebp
movq %rcx, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x60(%rsp)
movl %esi, 0x8(%rsp)
movl %esi, %edi
movq %rdx, %rsi
callq 0xcc6e
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0xcc60
movq %rbx, 0x18(%rsp)
movq %r14, 0x28(%rsp)
cmpl $0x2, %ebp
movl $0x1, %r15d
movl $0x1, %eax
cmovgel %ebp, %eax
movl %eax, 0x4(%rsp)
movq 0xe8(%rbx), %rax
movq %rax, 0x10(%rsp)
movq 0x100(%rbx), %rdi
testq %rdi, %rdi
je 0xcbe8
movq %r14, %rsi
callq 0x11cec
movq %rax, 0x58(%rsp)
cmpl $0x1, %ebp
je 0xcbfe
movb 0x1(%rbx), %al
andb $-0x80, %al
cmpb $0x1, %al
movl $0x3, %r15d
sbbl $0x0, %r15d
leaq 0xf4(%rip), %rsi        # 0xccf9
movq %rsp, %rbx
movl %r15d, %edi
movq %rbx, %rdx
movl $0x3, %ecx
callq 0x12278
movq 0x40(%rbx), %rdi
callq 0x2040
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0xcc2f
callq 0x2120
cmpl $0x0, 0x8(%rsp)
jle 0xcc53
xorl %ebx, %ebx
movq 0x20(%rsp), %rax
movq (%rax,%rbx,8), %rdi
callq 0x13060
incq %rbx
movslq 0x8(%rsp), %rax
cmpq %rax, %rbx
jl 0xcc38
movq 0x20(%rsp), %rdi
callq 0x2040
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/map.c
// Function: open_bseqs
static mm_bseq_file_t **open_bseqs(int n, const char **fn)
{
	mm_bseq_file_t **fp;
	int i, j;
	fp = (mm_bseq_file_t**)calloc(n, sizeof(mm_bseq_file_t*));
	for (i = 0; i < n; ++i) {
		if ((fp[i] = mm_bseq_open(fn[i])) == 0) {
			if (mm_verbose >= 1)
				fprintf(stderr, "ERROR: failed to open file '%s': %s\n", fn[i], strerror(errno));
			for (j = 0; j < i; ++j)
				mm_bseq_close(fp[j]);
			free(fp);
			return 0;
		}
	}
	return fp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movl %edi, %ebp
movl %edi, %r12d
movl $0x8, %esi
movq %r12, %rdi
callq 0x2230
movq %rax, %rbx
testl %ebp, %ebp
jle 0xcce0
xorl %r14d, %r14d
movq (%r15,%r14,8), %rdi
callq 0x12ff7
movq %rax, (%rbx,%r14,8)
testq %rax, %rax
je 0xccb1
incq %r14
cmpq %r14, %r12
jne 0xcc95
jmp 0xcce0
leaq 0x29a48(%rip), %rax     # 0x36700
cmpl $0x0, (%rax)
jg 0xccec
testq %r14, %r14
je 0xccd6
xorl %r15d, %r15d
movq (%rbx,%r15,8), %rdi
callq 0x13060
incq %r15
cmpq %r15, %r14
jne 0xccc5
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movq %r14, %rsi
callq 0x2f83
jmp 0xccbd
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/format.c
// Function: sam_write_sq
static void sam_write_sq(kstring_t *s, char *seq, int l, int rev, int comp)
{
	extern unsigned char seq_comp_table[256];
	if (rev) {
		int i;
		str_enlarge(s, l);
		for (i = 0; i < l; ++i) {
			int c = seq[l - 1 - i];
			s->s[s->l + i] = c < 128 && comp? seq_comp_table[c] : c;
		}
		s->l += l;
	} else str_copy(s, seq, seq + l);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r12d
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8(%rdi), %rax
testl %ecx, %ecx
je 0x10ac9
movl %r8d, %ebp
movq (%rbx), %rcx
movslq %r12d, %r14
leaq (%rcx,%r14), %rdx
incq %rdx
cmpq %rax, %rdx
jbe 0x10a86
addq %r14, %rcx
movq %rcx, %rax
shrq %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x2320
movq %rax, 0x10(%rbx)
testl %r12d, %r12d
jle 0x10b3a
movl %r12d, %eax
leaq (%r14,%r15), %rcx
decq %rcx
xorl %edx, %edx
leaq 0x25c6e(%rip), %rsi     # 0x36710
movb (%rcx), %dil
testl %ebp, %ebp
je 0x10ab1
movsbq %dil, %rdi
movb (%rsi,%rdi), %dil
movq 0x10(%rbx), %r8
addq (%rbx), %r8
movb %dil, (%rdx,%r8)
incq %rdx
decq %rcx
cmpq %rdx, %rax
jne 0x10aa2
jmp 0x10b3a
movslq %r12d, %r14
movq (%rbx), %rdi
leaq (%rdi,%r14), %rcx
incq %rcx
cmpq %rax, %rcx
jbe 0x10b28
addq %r14, %rdi
movq %rdi, %rax
shrq %rax
orq %rdi, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x2320
movq %rax, 0x10(%rbx)
movq (%rbx), %rdi
jmp 0x10b2c
movq 0x10(%rbx), %rax
addq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x22a0
addq %r14, (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/format.c
// Function: write_indel_ds
static void write_indel_ds(kstring_t *str, int64_t len, const uint8_t *seq, int64_t ll, int64_t lr) // write an indel to ds; adapted from minigraph
{
	int64_t i;
	if (ll + lr >= len) {
		mm_sprintf_lite(str, "[");
		for (i = 0; i < len; ++i)
			mm_sprintf_lite(str, "%c", "acgtn"[seq[i]]);
		mm_sprintf_lite(str, "]");
	} else {
		int64_t k = 0;
		if (ll > 0) {
			mm_sprintf_lite(str, "[");
			for (i = 0; i < ll; ++i)
				mm_sprintf_lite(str, "%c", "acgtn"[seq[k+i]]);
			mm_sprintf_lite(str, "]");
			k += ll;
		}
		for (i = 0; i < len - lr - ll; ++i)
			mm_sprintf_lite(str, "%c", "acgtn"[seq[k+i]]);
		k += len - lr - ll;
		if (lr > 0) {
			mm_sprintf_lite(str, "[");
			for (i = 0; i < lr; ++i)
				mm_sprintf_lite(str, "%c", "acgtn"[seq[k+i]]);
			mm_sprintf_lite(str, "]");
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rdi, %rbx
leaq (%r8,%rcx), %rax
movq %rsi, %r12
subq %rax, %r12
jle 0x10c65
movq %rcx, %rbp
testq %rcx, %rcx
movq %r8, 0x10(%rsp)
jle 0x10cb6
movq %r12, 0x8(%rsp)
leaq 0x1d216(%rip), %rsi     # 0x2de25
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe575
leaq 0x1d1e9(%rip), %r15     # 0x2de09
leaq 0x1ce6e(%rip), %r13     # 0x2da95
xorl %r12d, %r12d
movzbl (%r14,%r12), %eax
movsbl (%rax,%r15), %edx
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0xe575
incq %r12
cmpq %r12, %rbp
jne 0x10c2a
movq %rbp, (%rsp)
leaq 0x1d1d3(%rip), %rsi     # 0x2de27
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe575
movq 0x8(%rsp), %r12
jmp 0x10cbe
movq %rsi, %r13
leaq 0x1d1b6(%rip), %rsi     # 0x2de25
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe575
testq %r13, %r13
jle 0x10d4b
leaq 0x1d180(%rip), %r12     # 0x2de09
leaq 0x1ce05(%rip), %r15     # 0x2da95
xorl %ebp, %ebp
movzbl (%r14,%rbp), %eax
movsbl (%rax,%r12), %edx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0xe575
incq %rbp
cmpq %rbp, %r13
jne 0x10c92
jmp 0x10d4b
movq $0x0, (%rsp)
testq %r12, %r12
jle 0x10cf9
movq (%rsp), %rax
leaq (%r14,%rax), %r15
leaq 0x1cdc3(%rip), %r13     # 0x2da95
xorl %ebp, %ebp
movzbl (%r15,%rbp), %eax
leaq 0x1d129(%rip), %rdx     # 0x2de09
movsbl (%rax,%rdx), %edx
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0xe575
incq %rbp
cmpq %rbp, %r12
jne 0x10cd4
movq 0x10(%rsp), %rbp
testq %rbp, %rbp
jle 0x10d6a
leaq 0x1d11b(%rip), %rsi     # 0x2de25
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe575
addq (%rsp), %r14
addq %r12, %r14
leaq 0x1d0e7(%rip), %r15     # 0x2de09
leaq 0x1cd6c(%rip), %r12     # 0x2da95
xorl %r13d, %r13d
movzbl (%r14,%r13), %eax
movsbl (%rax,%r15), %edx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0xe575
incq %r13
cmpq %r13, %rbp
jne 0x10d2c
leaq 0x1d0d5(%rip), %rsi     # 0x2de27
movq %rbx, %rdi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe575
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/pe.c
// Function: mm_set_pe_thru
void mm_set_pe_thru(const int *qlens, int *n_regs, mm_reg1_t **regs)
{
	int s, i, n_pri[2], pri[2];
	n_pri[0] = n_pri[1] = 0;
	pri[0] = pri[1] = -1;
	for (s = 0; s < 2; ++s)
		for (i = 0; i < n_regs[s]; ++i)
			if (regs[s][i].id == regs[s][i].parent)
				++n_pri[s], pri[s] = i;
	if (n_pri[0] == 1 && n_pri[1] == 1) {
		mm_reg1_t *p = &regs[0][pri[0]];
		mm_reg1_t *q = &regs[1][pri[1]];
		if (p->rid == q->rid && p->rev == q->rev && abs(p->rs - q->rs) < 3 && abs(p->re - q->re) < 3
			&& ((p->qs == 0 && qlens[1] - q->qe == 0) || (q->qs == 0 && qlens[0] - p->qe == 0)))
		{
			p->pe_thru = q->pe_thru = 1;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
xorl %r11d, %r11d
leaq -0x8(%rsp), %rax
movl %r11d, (%rax)
leaq -0x4(%rsp), %r8
movl %r11d, (%r8)
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
leaq -0x10(%rsp), %rcx
movl %r9d, (%rcx)
leaq -0xc(%rsp), %r10
movl %r9d, (%r10)
movb $0x1, %r9b
movslq (%rsi,%r11,4), %rbx
testq %rbx, %rbx
jle 0x10fcb
movq (%rdx,%r11,8), %r11
addq $0x20, %r11
xorl %r14d, %r14d
movl -0x20(%r11), %ebp
cmpl (%r11), %ebp
jne 0x10fbf
incl (%r8)
movl %r14d, (%r10)
incq %r14
addq $0x50, %r11
cmpq %r14, %rbx
jne 0x10fb0
movl $0x1, %r11d
movq %rcx, %r10
movq %rax, %r8
testb $0x1, %r9b
movl $0x0, %r9d
jne 0x10f9c
cmpl $0x1, -0x4(%rsp)
jne 0x1108e
cmpl $0x1, -0x8(%rsp)
jne 0x1108e
movslq -0xc(%rsp), %rax
leaq (%rax,%rax,4), %rsi
shlq $0x4, %rsi
movq (%rdx), %rax
movq 0x8(%rdx), %rcx
movslq -0x10(%rsp), %rdx
leaq (%rdx,%rdx,4), %rdx
shlq $0x4, %rdx
movl 0x8(%rax,%rsi), %r8d
cmpl 0x8(%rcx,%rdx), %r8d
jne 0x1108e
addq %rsi, %rax
addq %rdx, %rcx
movl 0x3c(%rcx), %edx
movl 0x3c(%rax), %esi
xorl %edx, %esi
btl $0xa, %esi
jb 0x1108e
movl 0x18(%rax), %esi
subl 0x18(%rcx), %esi
movl %esi, %r8d
negl %r8d
cmovsl %esi, %r8d
cmpl $0x2, %r8d
ja 0x1108e
movl 0x1c(%rax), %esi
subl 0x1c(%rcx), %esi
movl %esi, %r8d
negl %r8d
cmovsl %esi, %r8d
cmpl $0x2, %r8d
ja 0x1108e
cmpl $0x0, 0x10(%rax)
jne 0x11074
movl 0x4(%rdi), %esi
cmpl 0x14(%rcx), %esi
je 0x11081
cmpl $0x0, 0x10(%rcx)
jne 0x1108e
movl (%rdi), %esi
cmpl 0x14(%rax), %esi
jne 0x1108e
orl $0x4000, %edx           # imm = 0x4000
movl %edx, 0x3c(%rcx)
orb $0x40, 0x3d(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/splitidx.c
// Function: mm_split_init
FILE *mm_split_init(const char *prefix, const mm_idx_t *mi)
{
	char *fn;
	FILE *fp;
	uint32_t i, k = mi->k;
	fn = (char*)calloc(strlen(prefix) + 10, 1);
	sprintf(fn, "%s.%.4d.tmp", prefix, mi->index);
	if ((fp = fopen(fn, "wb")) == NULL) {
		if (mm_verbose >= 1)
			fprintf(stderr, "[ERROR]\033[1;31m failed to write to temporary file '%s'\033[0m: %s\n", fn, strerror(errno));
		exit(1);
	}
	mm_err_fwrite(&k, 4, 1, fp);
	mm_err_fwrite(&mi->n_seq, 4, 1, fp);
	for (i = 0; i < mi->n_seq; ++i) {
		uint32_t l;
		l = strlen(mi->seq[i].name);
		mm_err_fwrite(&l, 1, 4, fp);
		mm_err_fwrite(mi->seq[i].name, 1, l, fp);
		mm_err_fwrite(&mi->seq[i].len, 4, 1, fp);
	}
	free(fn);
	return fp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
movl 0x8(%rsi), %eax
movl %eax, 0x4(%rsp)
callq 0x2130
leaq 0xa(%rax), %rdi
movl $0x1, %esi
callq 0x2230
movq %rax, %r14
movl 0x14(%rbx), %ecx
leaq 0x1c2d7(%rip), %rsi     # 0x2dffb
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x23d0
leaq 0x19675(%rip), %rsi     # 0x2b3ad
movq %r14, %rdi
callq 0x2390
testq %rax, %rax
je 0x11e0b
movq %rax, %r15
leaq 0x4(%rsp), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x5816
leaq 0x10(%rbx), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rcx
callq 0x5816
cmpl $0x0, 0x10(%rbx)
je 0x11df1
movl $0x10, %r13d
xorl %ebp, %ebp
movq %rsp, %r12
movq 0x20(%rbx), %rax
movq -0x10(%rax,%r13), %rdi
callq 0x2130
movl %eax, (%rsp)
movl $0x1, %esi
movl $0x4, %edx
movq %r12, %rdi
movq %r15, %rcx
callq 0x5816
movq 0x20(%rbx), %rax
movq -0x10(%rax,%r13), %rdi
movl (%rsp), %edx
movl $0x1, %esi
movq %r15, %rcx
callq 0x5816
movq 0x20(%rbx), %rdi
addq %r13, %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rcx
callq 0x5816
incq %rbp
movl 0x10(%rbx), %eax
addq $0x18, %r13
cmpq %rax, %rbp
jb 0x11d8a
movq %r14, %rdi
callq 0x2040
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x248ee(%rip), %rax     # 0x36700
cmpl $0x0, (%rax)
jle 0x11e1f
movq %r14, %rdi
callq 0x30bf
movl $0x1, %edi
callq 0x23e0
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/splitidx.c
// Function: mm_split_rm_tmp
void mm_split_rm_tmp(const char *prefix, int n_splits)
{
	int i;
	char *fn;
	fn = CALLOC(char, strlen(prefix) + 10);
	for (i = 0; i < n_splits; ++i) {
		sprintf(fn, "%s.%.4d.tmp", prefix, i);
		remove(fn);
	}
	free(fn);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
callq 0x2130
leaq 0xa(%rax), %rdi
movl $0x1, %esi
callq 0x2230
movq %rax, %r15
testl %ebx, %ebx
jle 0x1209f
leaq 0x1bf7e(%rip), %r12     # 0x2dffb
xorl %ebp, %ebp
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x23d0
movq %r15, %rdi
callq 0x2070
incl %ebp
cmpl %ebp, %ebx
jne 0x1207f
movq %r15, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2040
nop
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/bseq.c
// Function: mm_bseq_open
mm_bseq_file_t *mm_bseq_open(const char *fn)
{
	mm_bseq_file_t *fp;
	gzFile f;
	f = fn && strcmp(fn, "-")? gzopen(fn, "r") : gzdopen(0, "r");
	if (f == 0) return 0;
	fp = (mm_bseq_file_t*)calloc(1, sizeof(mm_bseq_file_t));
	fp->fp = f;
	fp->ks = kseq_init(fp->fp);
	return fp;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x13019
cmpb $0x2d, (%rdi)
jne 0x1300b
cmpb $0x0, 0x1(%rdi)
je 0x13019
leaq 0x19c69(%rip), %rsi     # 0x2cc7b
callq 0x2350
jmp 0x13027
leaq 0x19c5b(%rip), %rsi     # 0x2cc7b
xorl %edi, %edi
callq 0x20f0
movq %rax, %rbx
testq %rax, %rax
je 0x13052
movl $0x1, %edi
movl $0x38, %esi
callq 0x2230
movq %rax, %r14
movq %rbx, (%rax)
movq %rbx, %rdi
callq 0x12c14
movq %rax, 0x8(%r14)
jmp 0x13055
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/bseq.c
// Function: mm_bseq_read_frag2
mm_bseq1_t *mm_bseq_read_frag2(int n_fp, mm_bseq_file_t **fp, int64_t chunk_size, int with_qual, int with_comment, int *n_)
{
	int i;
	int64_t size = 0;
	kvec_t(mm_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(mm_bseq1_t, 0, a, 256);
		for (i = 0; i < n_fp; ++i) {
			mm_bseq1_t *s;
			kv_pushp(mm_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 0x136bc
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 0x12ca6
notl %eax
shrl $0x1f, %eax
addl %eax, %r12d
incq %r13
cmpq %r13, %r15
jne 0x135c9
cmpl 0x34(%rsp), %r12d
jl 0x136c7
testq %rbx, %rbx
jne 0x13611
movl $0x2800, %edx           # imm = 0x2800
xorl %edi, %edi
movq 0x8(%rsp), %rsi
callq 0x12755
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 0x1366c
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 0x12755
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 0x13407
movslq (%r14,%r13), %rax
addq %rax, %rbp
incq %r12
addq $0x28, %r13
cmpq %r12, %r15
jne 0x1362a
movq 0x10(%rsp), %rax
addq %r12, %rax
cmpq 0x40(%rsp), %rbp
jl 0x135b9
addq %r12, 0x10(%rsp)
jmp 0x136cc
movq $0x0, 0x8(%rsp)
jmp 0x136d8
testl %r12d, %r12d
jne 0x136ec
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 0x3228
jmp 0x136cc
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/sdust.c
// Function: sdust_buf_init
sdust_buf_t *sdust_buf_init(void *km)
{
	sdust_buf_t *buf;
	buf = (sdust_buf_t*)kcalloc(km, 1, sizeof(sdust_buf_t));
	buf->km = km;
	buf->w = kdq_init(int, buf->km);
	kdq_resize(int, buf->w, 8);
	return buf;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x1, %esi
movl $0x40, %edx
callq 0x124ec
movq %rax, %r14
movq %rbx, 0x38(%rax)
movl $0x1, %esi
movl $0x28, %edx
movq %rbx, %rdi
callq 0x124ec
movq %rax, %r15
movabsq $0x3ffffffffffffff, %rax # imm = 0x3FFFFFFFFFFFFFF
andq (%r15), %rax
btsq $0x3b, %rax
movq %rax, (%r15)
movq $0x3, 0x10(%r15)
movl $0x10, %esi
movq %rbx, %rdi
callq 0x1264d
movq %rax, 0x18(%r15)
movq %rbx, 0x20(%r15)
movq %r15, (%r14)
movq %r15, %rdi
movl $0x8, %esi
callq 0x14102
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/sdust.c
// Function: sdust
uint64_t *sdust(void *km, const uint8_t *seq, int l_seq, int T, int W, int *n)
{
	uint64_t *ret;
	sdust_buf_t *buf;
	buf = sdust_buf_init(km);
	ret = (uint64_t*)sdust_core(seq, l_seq, T, W, n, buf);
	buf->res.a = 0;
	sdust_buf_destroy(buf);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movl %r8d, %ebp
movl %ecx, %r14d
movl %edx, %r15d
movq %rsi, %r12
callq 0x14084
movq %rax, %r13
movq %r12, %rdi
movl %r15d, %esi
movl %r14d, %edx
movl %ebp, %ecx
movq %rbx, %r8
movq %rax, %r9
callq 0x142a2
movq %rax, %rbx
movq $0x0, 0x30(%r13)
movq %r13, %rdi
callq 0x14247
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/align.c
// Function: mm_enlarge_cigar
void mm_enlarge_cigar(mm_reg1_t *r, uint32_t n_cigar) // TODO: this calls the libc realloc()
{
	if (n_cigar == 0) return;
	if (r->p == 0) {
		uint32_t capacity = n_cigar + sizeof(mm_extra_t)/4;
		kroundup32(capacity);
		r->p = (mm_extra_t*)calloc(capacity, 4);
		r->p->capacity = capacity;
	} else if (r->p->n_cigar + n_cigar + sizeof(mm_extra_t)/4 > r->p->capacity) {
		r->p->capacity = r->p->n_cigar + n_cigar + sizeof(mm_extra_t)/4;
		kroundup32(r->p->capacity);
		r->p = (mm_extra_t*)realloc(r->p, r->p->capacity * 4);
	}
}

// Assembly:
testl %esi, %esi
je 0x17203
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x48(%rdi), %rdi
testq %rdi, %rdi
je 0x171bd
addl 0x18(%rdi), %esi
addq $0x7, %rsi
movl (%rdi), %eax
cmpq %rax, %rsi
jbe 0x171fc
decl %esi
movl %esi, %eax
shrl %eax
orl %esi, %eax
movl %eax, %ecx
shrl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x4, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x8, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x10, %eax
orl %ecx, %eax
leal 0x1(%rax), %ecx
movl %ecx, (%rdi)
leal 0x4(,%rax,4), %esi
callq 0x2320
movq %rax, 0x48(%rbx)
jmp 0x171fc
addl $0x6, %esi
movl %esi, %eax
shrl %eax
orl %esi, %eax
movl %eax, %ecx
shrl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x4, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x8, %ecx
orl %eax, %ecx
movl %ecx, %r14d
shrl $0x10, %r14d
orl %ecx, %r14d
incl %r14d
movl $0x4, %esi
movq %r14, %rdi
callq 0x2230
movq %rax, 0x48(%rbx)
movl %r14d, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/align.c
// Function: mm_event_identity
double mm_event_identity(const mm_reg1_t *r)
{
	int32_t n_gap, n_gapo;
	if (r->p == 0) return -1.0f;
	mm_count_gaps(r, &n_gap, &n_gapo);
	return (double)r->mlen / (r->blen + r->p->n_ambi - n_gap + n_gapo);
}

// Assembly:
movq 0x48(%rdi), %rax
testq %rax, %rax
je 0x1724d
movl 0x18(%rax), %edx
testq %rdx, %rdx
je 0x17256
xorl %esi, %esi
xorl %r9d, %r9d
xorl %ecx, %ecx
xorl %r8d, %r8d
movl 0x1c(%rax,%r9,4), %r10d
movl %r10d, %r11d
andl $0xf, %r11d
decl %r11d
shrl $0x4, %r10d
cmpl $0x2, %r11d
cmovael %esi, %r10d
adcl $0x0, %ecx
addl %r10d, %r8d
incq %r9
cmpq %r9, %rdx
jne 0x1721f
subl %r8d, %ecx
jmp 0x17258
movsd 0x17343(%rip), %xmm0    # 0x2e598
retq
xorl %ecx, %ecx
cvtsi2sdl 0x2c(%rdi), %xmm0
movl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
andl 0x14(%rax), %edx
addl 0x30(%rdi), %ecx
addl %edx, %ecx
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/align.c
// Function: ksw_gen_ts_mat
static void ksw_gen_simple_mat(int m, int8_t *mat, int8_t a, int8_t b, int8_t sc_ambi)
{
	int i, j;
	a = a < 0? -a : a;
	b = b > 0? -b : b;
	sc_ambi = sc_ambi > 0? -sc_ambi : sc_ambi;
	for (i = 0; i < m - 1; ++i) {
		for (j = 0; j < m - 1; ++j)
			mat[i * m + j] = i == j? a : b;
		mat[i * m + m - 1] = sc_ambi;
	}
	for (j = 0; j < m; ++j)
		mat[(m - 1) * m + j] = sc_ambi;
}

// Assembly:
movl %esi, %eax
sarb $0x7, %al
xorb %al, %sil
subb %al, %sil
movl %edx, %r9d
sarb $0x7, %r9b
movl %edx, %eax
xorb %r9b, %al
subb %al, %r9b
movl %r8d, %eax
sarb $0x7, %al
xorb %al, %r8b
subb %r8b, %al
leaq 0x4(%rdi), %r8
movzbl %sil, %esi
movd %esi, %xmm0
punpcklbw %xmm0, %xmm0    # xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
movzbl %r9b, %esi
movd %esi, %xmm1
punpcklbw %xmm1, %xmm1    # xmm1 = xmm1[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pshuflw $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0,4,5,6,7]
xorl %esi, %esi
movdqa 0x13ca5(%rip), %xmm2    # 0x2e5d0
movdqa 0x13cad(%rip), %xmm3    # 0x2e5e0
movq %rsi, %xmm4
pshufd $0x44, %xmm4, %xmm4     # xmm4 = xmm4[0,1,0,1]
movdqa %xmm4, %xmm5
pcmpeqd %xmm2, %xmm5
pshufd $0xb1, %xmm5, %xmm6     # xmm6 = xmm5[1,0,3,2]
pand %xmm5, %xmm6
pcmpeqd %xmm3, %xmm4
pshufd $0xb1, %xmm4, %xmm5     # xmm5 = xmm4[1,0,3,2]
pand %xmm4, %xmm5
packssdw %xmm6, %xmm5
packssdw %xmm5, %xmm5
packsswb %xmm5, %xmm5
movdqa %xmm0, %xmm4
pand %xmm5, %xmm4
pandn %xmm1, %xmm5
por %xmm4, %xmm5
movd %xmm5, -0x4(%r8)
movb %al, (%r8)
incq %rsi
addq $0x5, %r8
cmpq $0x4, %rsi
jne 0x1a933
movzbl %al, %eax
imull $0x1010101, %eax, %eax  # imm = 0x1010101
movl %eax, 0x14(%rdi)
movb %al, 0x18(%rdi)
testb %cl, %cl
sete %al
cmpb %dl, %cl
sete %dl
orb %al, %dl
jne 0x1a9bf
movl %ecx, %eax
sarb $0x7, %al
xorb %al, %cl
subb %cl, %al
movb %al, 0x2(%rdi)
movb %al, 0x8(%rdi)
movb %al, 0xa(%rdi)
movb %al, 0x10(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/align.c
// Function: mm_append_cigar
static void mm_append_cigar(mm_reg1_t *r, uint32_t n_cigar, const uint32_t *cigar)
{
	mm_extra_t *p;
	if (n_cigar == 0) return;
	mm_enlarge_cigar(r, n_cigar);
	p = r->p;
	if (p->n_cigar > 0 && (p->cigar[p->n_cigar-1]&0xf) == (cigar[0]&0xf)) { // same CIGAR op at the boundary
		p->cigar[p->n_cigar-1] += cigar[0]>>4<<4;
		if (n_cigar > 1) memcpy(p->cigar + p->n_cigar, cigar + 1, (n_cigar - 1) * 4);
		p->n_cigar += n_cigar - 1;
	} else {
		memcpy(p->cigar + p->n_cigar, cigar, n_cigar * 4);
		p->n_cigar += n_cigar;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movl %esi, %ebx
movq %rdi, %r15
callq 0x1715c
movq 0x48(%r15), %r15
movl 0x18(%r15), %eax
testq %rax, %rax
je 0x1ad6a
leal -0x1(%rax), %ecx
movl 0x1c(%r15,%rcx,4), %edx
movl (%r14), %esi
movl %esi, %edi
xorl %edx, %edi
testb $0xf, %dil
je 0x1ad87
leaq (%r15,%rax,4), %rdi
addq $0x1c, %rdi
leal (,%rbx,4), %edx
movq %r14, %rsi
callq 0x22a0
addl 0x18(%r15), %ebx
jmp 0x1adb7
leaq 0x1c(%r15), %rdi
andl $-0x10, %esi
addl %edx, %esi
movl %esi, (%rdi,%rcx,4)
cmpl $0x2, %ebx
jb 0x1adb3
leaq (%rdi,%rax,4), %rdi
addq $0x4, %r14
leal -0x4(,%rbx,4), %edx
movq %r14, %rsi
callq 0x22a0
movl 0x18(%r15), %eax
addl %eax, %ebx
decl %ebx
movl %ebx, 0x18(%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/align.c
// Function: mm_seed_ext_score
static int mm_seed_ext_score(void *km, const mm_mapopt_t *opt, const mm_idx_t *mi, const int8_t mat[25], int qlen, uint8_t *qseq0[2], const mm128_t *a)
{
	uint8_t *qseq, *tseq;
	int q_span = a->y>>32&0xff, qs, qe, rs, re, rid, score, q_off, t_off, ext_len = opt->anchor_ext_len;
	void *qp;
	rid = a->x<<1>>33;
	re = (uint32_t)a->x + 1, rs = re - q_span;
	qe = (uint32_t)a->y + 1, qs = qe - q_span;
	rs = rs - ext_len > 0? rs - ext_len : 0;
	qs = qs - ext_len > 0? qs - ext_len : 0;
	re = re + ext_len < (int32_t)mi->seq[rid].len? re + ext_len : mi->seq[rid].len;
	qe = qe + ext_len < qlen? qe + ext_len : qlen;
	tseq = (uint8_t*)kmalloc(km, re - rs);
	if (opt->flag & MM_F_QSTRAND) {
		qseq = qseq0[0] + qs;
		mm_idx_getseq2(mi, a->x>>63, rid, rs, re, tseq);
	} else {
		qseq = qseq0[a->x>>63] + qs;
		mm_idx_getseq(mi, rid, rs, re, tseq);
	}
	qp = ksw_ll_qinit(km, 2, qe - qs, qseq, 5, mat);
	score = ksw_ll_i16(qp, re - rs, tseq, opt->q, opt->e, &q_off, &t_off);
	kfree(km, tseq);
	kfree(km, qp);
	return score;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, 0x10(%rsp)
movl %r8d, 0xc(%rsp)
movq %rcx, 0x30(%rsp)
movq %rsi, %r14
movq 0x80(%rsp), %rcx
movq 0x8(%rcx), %rsi
movq %rsi, %rax
shrq $0x20, %rax
movzbl %al, %eax
movl 0xa4(%r14), %r15d
movq (%rcx), %rcx
leal 0x1(%rcx), %r13d
movq %rcx, %rbx
shrq $0x20, %rbx
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
incl %esi
addl %r15d, %eax
subl %eax, %r13d
xorl %r8d, %r8d
testl %r13d, %r13d
cmovlel %r8d, %r13d
addl %r15d, %ecx
incl %ecx
movq %rsi, 0x28(%rsp)
movl %esi, %r12d
subl %eax, %r12d
testl %r12d, %r12d
cmovlel %r8d, %r12d
movq %rdx, 0x18(%rsp)
movq 0x20(%rdx), %rax
leaq (%rbx,%rbx,2), %rdx
movl 0x10(%rax,%rdx,8), %ebp
cmpl %ebp, %ecx
cmovll %ecx, %ebp
movl %ebp, %eax
subl %r13d, %eax
movl %eax, 0x8(%rsp)
movslq %eax, %rsi
movq %rdi, 0x20(%rsp)
callq 0x1264d
movq %rax, %r9
movq %r14, 0x38(%rsp)
testb $0x1, 0x4(%r14)
jne 0x1b958
movq 0x80(%rsp), %rax
movq (%rax), %rax
shrq $0x3f, %rax
movl %r12d, %r14d
movq 0x10(%rsp), %rcx
addq (%rcx,%rax,8), %r14
movq 0x18(%rsp), %rdi
movl %ebx, %esi
movl %r13d, %edx
movl %ebp, %ecx
movq %r9, %r13
movq %r9, %r8
callq 0x71d0
jmp 0x1b987
movl %r12d, %r14d
movq 0x10(%rsp), %rax
addq (%rax), %r14
movq 0x80(%rsp), %rax
movq (%rax), %rsi
shrq $0x3f, %rsi
movq 0x18(%rsp), %rdi
movl %ebx, %edx
movl %r13d, %ecx
movl %ebp, %r8d
movq %r9, %r13
callq 0x72e4
addl 0x28(%rsp), %r15d
movl 0xc(%rsp), %eax
cmpl %eax, %r15d
cmovgel %eax, %r15d
subl %r12d, %r15d
movq 0x20(%rsp), %r12
movq %r12, %rdi
movl $0x2, %esi
movl %r15d, %edx
movq %r14, %rcx
movl $0x5, %r8d
movq 0x30(%rsp), %r9
callq 0x1e9d4
movq %rax, %rbx
movq 0x38(%rsp), %rax
movl 0x6c(%rax), %ecx
movl 0x70(%rax), %r8d
leaq 0x40(%rsp), %rax
movq %rax, (%rsp)
leaq 0x44(%rsp), %r9
movq %rbx, %rdi
movl 0x8(%rsp), %esi
movq %r13, %rdx
callq 0x1ebc1
movl %eax, %ebp
movq %r12, %rdi
movq %r13, %rsi
callq 0x12587
movq %r12, %rdi
movq %rbx, %rsi
callq 0x12587
movl %ebp, %eax
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]minimap2/hit.c
// Function: mm_reg_set_coor
static inline void mm_reg_set_coor(mm_reg1_t *r, int32_t qlen, const mm128_t *a, int is_qstrand)
{ // NB: r->as and r->cnt MUST BE set correctly for this function to work
	int32_t k = r->as, q_span = (int32_t)(a[k].y>>32&0xff);
	r->rev = a[k].x>>63;
	r->rid = a[k].x<<1>>33;
	r->rs = (int32_t)a[k].x + 1 > q_span? (int32_t)a[k].x + 1 - q_span : 0; // NB: target span may be shorter, so this test is necessary
	r->re = (int32_t)a[k + r->cnt - 1].x + 1;
	if (!r->rev || is_qstrand) {
		r->qs = (int32_t)a[k].y + 1 - q_span;
		r->qe = (int32_t)a[k + r->cnt - 1].y + 1;
	} else {
		r->qs = qlen - ((int32_t)a[k + r->cnt - 1].y + 1);
		r->qe = qlen - ((int32_t)a[k].y + 1 - q_span);
	}
	mm_cal_fuzzy_len(r, a);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movslq 0x28(%rdi), %rax
movq %rax, %r8
shlq $0x4, %r8
leaq (%rdx,%r8), %r11
movzbl 0xc(%rdx,%r8), %r9d
movq (%rdx,%r8), %rbx
shrq $0x35, %rbx
movl $0xfffffbff, %r10d      # imm = 0xFFFFFBFF
andl 0x3c(%rdi), %r10d
andl $0x400, %ebx            # imm = 0x400
orl %ebx, %r10d
movl %r10d, 0x3c(%rdi)
movq (%rdx,%r8), %r8
movq %r8, %r10
shrq $0x20, %r10
andl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
xorl %ebp, %ebp
subl %r9d, %r8d
leal 0x1(%r8), %r8d
cmovll %ebp, %r8d
movl %r10d, 0x8(%rdi)
movl %r8d, 0x18(%rdi)
movl 0x4(%rdi), %r10d
leal (%r10,%rax), %r8d
movslq %r8d, %r8
movq %r8, %r15
shlq $0x4, %r15
leaq (%rdx,%r15), %r14
movl -0x10(%rdx,%r15), %ebp
incl %ebp
movl %ebp, 0x1c(%rdi)
testl %ecx, %ecx
jne 0x1be06
testl %ebx, %ebx
je 0x1be06
movl -0x8(%r14), %ebx
notl %ebx
addl %esi, %ebx
movq 0x8(%r11), %rcx
movl %ecx, %r11d
notl %r11d
addl %esi, %r9d
addl %r11d, %r9d
jmp 0x1be18
movq 0x8(%r11), %rcx
movl %ecx, %ebx
subl %r9d, %ebx
incl %ebx
movl -0x8(%r14), %r9d
incl %r9d
movl %ebx, 0x10(%rdi)
movl %r9d, 0x14(%rdi)
movq $0x0, 0x2c(%rdi)
testl %r10d, %r10d
jle 0x1bebc
shrq $0x20, %rcx
movzbl %cl, %ecx
movl %ecx, 0x30(%rdi)
cmpl $0x1, %r10d
jne 0x1be45
movl %ecx, %r9d
jmp 0x1beb8
leal 0x1(%rax), %esi
movslq %esi, %rsi
movq %rsi, %r9
shlq $0x4, %r9
leaq (%r9,%rdx), %r10
addq $0x8, %r10
movl %ecx, %r9d
movq (%r10), %r11
movq %r11, %rbx
shrq $0x20, %rbx
movzbl %bl, %ebx
movl -0x8(%r10), %ebp
cltq
movq %rax, %r14
shlq $0x4, %r14
subl (%rdx,%r14), %ebp
subl 0x8(%rdx,%r14), %r11d
cmpl %r11d, %ebp
movl %r11d, %r14d
cmovgl %ebp, %r14d
movl %r11d, %r15d
cmovll %ebp, %r15d
addl %r14d, %ecx
cmpl %ebx, %r11d
movl %r15d, %r11d
cmovgl %ebx, %r11d
cmpl %ebx, %ebp
cmovlel %r15d, %r11d
addl %r11d, %r9d
incq %rsi
incl %eax
addq $0x10, %r10
cmpq %r8, %rsi
jl 0x1be5d
movl %ecx, 0x30(%rdi)
movl %r9d, 0x2c(%rdi)
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/hit.c
// Function: mm_mark_alt
void mm_mark_alt(const mm_idx_t *mi, int n, mm_reg1_t *r)
{
	int i;
	if (mi->n_alt == 0) return;
	for (i = 0; i < n; ++i)
		if (mi->seq[r[i].rid].is_alt)
			r[i].is_alt = 1;
}

// Assembly:
cmpl $0x0, 0x18(%rdi)
sete %al
testl %esi, %esi
setle %cl
orb %al, %cl
jne 0x1bf02
movl %esi, %eax
shlq $0x4, %rax
leaq (%rax,%rax,4), %rax
xorl %ecx, %ecx
movq 0x20(%rdi), %rsi
movslq 0x8(%rdx,%rcx), %r8
leaq (%r8,%r8,2), %r8
cmpl $0x0, 0x14(%rsi,%r8,8)
je 0x1bef9
orb $0x2, 0x3f(%rdx,%rcx)
addq $0x50, %rcx
cmpq %rcx, %rax
jne 0x1bedf
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/hit.c
// Function: mm_split_reg
void mm_split_reg(mm_reg1_t *r, mm_reg1_t *r2, int n, int qlen, mm128_t *a, int is_qstrand)
{
	if (n <= 0 || n >= r->cnt) return;
	*r2 = *r;
	r2->id = -1;
	r2->sam_pri = 0;
	r2->p = 0;
	r2->split_inv = 0;
	r2->cnt = r->cnt - n;
	r2->score = (int32_t)(r->score * ((float)r2->cnt / r->cnt) + .499);
	r2->as = r->as + n;
	if (r->parent == r->id) r2->parent = MM_PARENT_TMP_PRI;
	mm_reg_set_coor(r2, qlen, a, is_qstrand);
	r->cnt -= r2->cnt;
	r->score -= r2->score;
	mm_reg_set_coor(r, qlen, a, is_qstrand);
	r->split |= 1, r2->split |= 2;
}

// Assembly:
testl %edx, %edx
jle 0x1bfdb
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
cmpl %edx, 0x4(%rdi)
jle 0x1bfd3
movl %r9d, %ebp
movq %r8, %r15
movl %ecx, %r12d
movq %rsi, %rbx
movl $0xa, %ecx
movq %rsi, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
movq $0x0, 0x48(%rbx)
andl $0xfeffefff, 0x3c(%rbx) # imm = 0xFEFFEFFF
movl 0x4(%r14), %eax
subl %edx, %eax
movl %eax, 0x4(%rbx)
cvtsi2ssl 0xc(%r14), %xmm0
cvtsi2ss %eax, %xmm1
cvtsi2ssl 0x4(%r14), %xmm2
divss %xmm2, %xmm1
mulss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
addsd 0xf0a2(%rip), %xmm0     # 0x2b020
cvttsd2si %xmm0, %eax
movl %eax, 0xc(%rbx)
addl 0x28(%r14), %edx
movl %edx, 0x28(%rbx)
movl 0x20(%r14), %eax
cmpl (%r14), %eax
jne 0x1bf9c
movl $0xfffffffe, 0x20(%rbx) # imm = 0xFFFFFFFE
movq %rbx, %rdi
movl %r12d, %esi
movq %r15, %rdx
movl %ebp, %ecx
callq 0x1bd63
movl 0x4(%rbx), %eax
subl %eax, 0x4(%r14)
movl 0xc(%rbx), %eax
subl %eax, 0xc(%r14)
movq %r14, %rdi
movl %r12d, %esi
movq %r15, %rdx
movl %ebp, %ecx
callq 0x1bd63
orb $0x1, 0x3d(%r14)
orb $0x2, 0x3d(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/hit.c
// Function: mm_set_sam_pri
int mm_set_sam_pri(int n, mm_reg1_t *r)
{
	int i, n_pri = 0;
	for (i = 0; i < n; ++i)
		if (r[i].id == r[i].parent) {
			++n_pri;
			r[i].sam_pri = (n_pri == 1);
		} else r[i].sam_pri = 0;
	return n_pri;
}

// Assembly:
testl %edi, %edi
jle 0x1c729
movl %edi, %eax
shlq $0x4, %rax
leaq (%rax,%rax,4), %rcx
xorl %edx, %edx
movl $0xffffefff, %edi       # imm = 0xFFFFEFFF
xorl %eax, %eax
movl (%rsi,%rdx), %r8d
cmpl 0x20(%rsi,%rdx), %r8d
jne 0x1c71a
xorl %r8d, %r8d
testl %eax, %eax
leal 0x1(%rax), %eax
sete %r8b
shll $0xc, %r8d
movl 0x3c(%rsi,%rdx), %r9d
andl %edi, %r9d
orl %r8d, %r9d
movl %r9d, 0x3c(%rsi,%rdx)
jmp 0x1c71f
andb $-0x11, 0x3d(%rsi,%rdx)
addq $0x50, %rdx
cmpq %rdx, %rcx
jne 0x1c6ed
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/hit.c
// Function: mm_sync_regs
void mm_sync_regs(void *km, int n_regs, mm_reg1_t *regs) // keep mm_reg1_t::{id,parent} in sync; also reset id
{
	int *tmp, i, max_id = -1, n_tmp;
	if (n_regs <= 0) return;
	for (i = 0; i < n_regs; ++i) // NB: doesn't work if mm_reg1_t::id is negative
		max_id = max_id > regs[i].id? max_id : regs[i].id;
	n_tmp = max_id + 1;
	tmp = (int*)kmalloc(km, n_tmp * sizeof(int));
	for (i = 0; i < n_tmp; ++i) tmp[i] = -1;
	for (i = 0; i < n_regs; ++i)
		if (regs[i].id >= 0) tmp[regs[i].id] = i;
	for (i = 0; i < n_regs; ++i) {
		mm_reg1_t *r = &regs[i];
		r->id = i;
		if (r->parent == MM_PARENT_TMP_PRI)
			r->parent = i;
		else if (r->parent >= 0 && tmp[r->parent] >= 0)
			r->parent = tmp[r->parent];
		else r->parent = MM_PARENT_UNSET;
	}
	kfree(km, tmp);
	mm_set_sam_pri(n_regs, regs);
}

// Assembly:
testl %esi, %esi
jle 0x1c810
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r15
movl %esi, %r14d
movq %r14, %rax
shlq $0x4, %rax
leaq (%rax,%rax,4), %rax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movl %ebp, %edx
movl (%rbx,%rcx), %ebp
cmpl %ebp, %edx
cmovgl %edx, %ebp
addq $0x50, %rcx
cmpq %rcx, %rax
jne 0x1c75a
leal 0x1(%rbp), %r13d
shlq $0x2, %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x1264d
movq %rax, %r12
testl %ebp, %ebp
js 0x1c797
movq %r12, %rdi
movl $0xff, %esi
movq %r13, %rdx
callq 0x21b0
xorl %eax, %eax
movq %rbx, %rcx
movslq (%rcx), %rdx
testq %rdx, %rdx
js 0x1c7a8
movl %eax, (%r12,%rdx,4)
incq %rax
addq $0x50, %rcx
cmpq %rax, %r14
jne 0x1c79c
leaq 0x20(%rbx), %rax
xorl %ecx, %ecx
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
movl %ecx, -0x20(%rax)
movl (%rax), %esi
cmpq %rdx, %rsi
jne 0x1c7cd
movl %ecx, %esi
jmp 0x1c7de
testl %esi, %esi
js 0x1c7d9
movl (%r12,%rsi,4), %esi
testl %esi, %esi
jns 0x1c7de
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl %esi, (%rax)
incq %rcx
addq $0x50, %rax
cmpq %rcx, %r14
jne 0x1c7bf
movq %r15, %rdi
movq %r12, %rsi
callq 0x12587
movl %r14d, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1c6d6
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/hit.c
// Function: mm_filter_strand_retained
int mm_filter_strand_retained(int n_regs, mm_reg1_t *r)
{
	int i, k;
	for (i = k = 0; i < n_regs; ++i) {
		int p = r[i].parent;
		if (!r[i].strand_retained || r[i].div < r[p].div * 5.0f || r[i].div < 0.01f) {
			if (k < i) r[k++] = r[i];
			else ++k;
		}
	}
	return k;
}

// Assembly:
testl %edi, %edi
jle 0x1caa2
movq %rsi, %rdx
movl %edi, %r8d
leaq 0x44(%rsi), %r9
xorl %r10d, %r10d
movss 0x11f85(%rip), %xmm0    # 0x2e9c0
movss 0x11f81(%rip), %xmm1    # 0x2e9c4
xorl %eax, %eax
testb $0x4, -0x5(%r9)
jne 0x1ca70
movslq %eax, %rcx
leal 0x1(%rcx), %eax
cmpq %rcx, %r10
jle 0x1ca95
leaq -0x44(%r9), %rsi
leaq (%rcx,%rcx,4), %rdi
shlq $0x4, %rdi
addq %rdx, %rdi
movl $0xa, %ecx
rep  movsq (%rsi), %es:(%rdi)
jmp 0x1ca95
movslq -0x24(%r9), %rcx
movss (%r9), %xmm2
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
movss 0x44(%rdx,%rcx), %xmm3
mulss %xmm0, %xmm3
ucomiss %xmm2, %xmm1
ja 0x1ca4c
ucomiss %xmm2, %xmm3
ja 0x1ca4c
incq %r10
addq $0x50, %r9
cmpq %r10, %r8
jne 0x1ca45
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/lh3[P]minimap2/hit.c
// Function: mm_filter_regs
void mm_filter_regs(const mm_mapopt_t *opt, int qlen, int *n_regs, mm_reg1_t *regs)
{ // NB: after this call, mm_reg1_t::parent can be -1 if its parent filtered out
	int i, k;
	for (i = k = 0; i < *n_regs; ++i) {
		mm_reg1_t *r = &regs[i];
		int flt = 0;
		if (!r->inv && !r->seg_split && r->cnt < opt->min_cnt) flt = 1;
		if (r->p) { // these filters are only applied when base-alignment is available
			if (r->mlen < opt->min_chain_score) flt = 1;
			else if (r->p->dp_max < opt->min_dp_max) flt = 1;
			else if (r->qs > qlen * opt->max_clip_ratio && qlen - r->qe > qlen * opt->max_clip_ratio) flt = 1;
			if (flt) free(r->p);
		}
		if (!flt) {
			if (k < i) regs[k++] = regs[i];
			else ++k;
		}
	}
	*n_regs = k;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
cmpl $0x0, (%rdx)
jle 0x1cb9d
movq %rcx, %r14
movq %rdi, %r15
movl %esi, (%rsp)
cvtsi2ss %esi, %xmm0
movss %xmm0, 0x4(%rsp)
leaq 0x48(%rcx), %r12
xorl %r13d, %r13d
xorl %ebp, %ebp
testb $-0x78, -0xb(%r12)
je 0x1caed
movq (%r12), %rdi
movb $0x1, %al
testq %rdi, %rdi
jne 0x1cb04
jmp 0x1cb65
movl -0x44(%r12), %ecx
movl 0x30(%r15), %edx
cmpl %edx, %ecx
setge %al
movq (%r12), %rdi
testq %rdi, %rdi
je 0x1cb5b
movl -0x1c(%r12), %ecx
cmpl 0x34(%r15), %ecx
jl 0x1cb1b
movl 0x8(%rdi), %ecx
cmpl 0x9c(%r15), %ecx
jge 0x1cb22
callq 0x2040
jmp 0x1cb88
xorps %xmm1, %xmm1
cvtsi2ssl -0x38(%r12), %xmm1
movss 0xac(%r15), %xmm0
mulss 0x4(%rsp), %xmm0
ucomiss %xmm0, %xmm1
jbe 0x1cb61
movl (%rsp), %ecx
subl -0x34(%r12), %ecx
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
ucomiss %xmm0, %xmm1
setbe %cl
testb %al, %cl
je 0x1cb1b
jmp 0x1cb65
cmpl %edx, %ecx
jge 0x1cb65
jmp 0x1cb88
testb %al, %al
je 0x1cb1b
movslq %ebp, %rax
leal 0x1(%rax), %ebp
cmpq %rax, %r13
jle 0x1cb88
leaq -0x48(%r12), %rsi
leaq (%rax,%rax,4), %rdi
shlq $0x4, %rdi
addq %r14, %rdi
movl $0xa, %ecx
rep  movsq (%rsi), %es:(%rdi)
incq %r13
movslq (%rbx), %rax
addq $0x50, %r12
cmpq %rax, %r13
jl 0x1cad8
jmp 0x1cb9f
xorl %ebp, %ebp
movl %ebp, (%rbx)
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]minimap2/hit.c
// Function: mm_squeeze_a
int mm_squeeze_a(void *km, int n_regs, mm_reg1_t *regs, mm128_t *a)
{ // squeeze out regions in a[] that are not referenced by regs[]
	int i, as = 0;
	uint64_t *aux;
	aux = (uint64_t*)kmalloc(km, n_regs * 8);
	for (i = 0; i < n_regs; ++i)
		aux[i] = (uint64_t)regs[i].as << 32 | i;
	radix_sort_64(aux, aux + n_regs);
	for (i = 0; i < n_regs; ++i) {
		mm_reg1_t *r = &regs[(int32_t)aux[i]];
		if (r->as != as) {
			memmove(&a[as], &a[r->as], r->cnt * 16);
			r->as = as;
		}
		as += r->cnt;
	}
	kfree(km, aux);
	return as;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, %r12
movl %esi, %r13d
leal (,%r13,8), %eax
movslq %eax, %rsi
movq %rdi, 0x8(%rsp)
callq 0x1264d
movq %rax, %r14
testl %r13d, %r13d
jle 0x1cc71
movl %r13d, %ebx
leaq 0x28(%r12), %rax
xorl %ecx, %ecx
movl (%rax), %edx
shlq $0x20, %rdx
addq %rcx, %rdx
movq %rdx, (%r14,%rcx,8)
incq %rcx
addq $0x50, %rax
cmpq %rcx, %rbx
jne 0x1cbf4
leaq (%r14,%rbx,8), %rsi
movq %r14, %rdi
callq 0x5c97
testl %r13d, %r13d
jle 0x1cc80
xorl %r13d, %r13d
xorl %ebp, %ebp
movslq (%r14,%r13,8), %rax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r12,%rax), %r15
movslq 0x28(%r12,%rax), %rsi
cmpl %ebp, %esi
je 0x1cc63
movslq %ebp, %rdi
shlq $0x4, %rdi
movq 0x10(%rsp), %rax
addq %rax, %rdi
shlq $0x4, %rsi
addq %rax, %rsi
movslq 0x4(%r15), %rdx
shlq $0x4, %rdx
callq 0x2340
movl %ebp, 0x28(%r15)
addl 0x4(%r15), %ebp
incq %r13
cmpq %r13, %rbx
jne 0x1cc23
jmp 0x1cc82
movslq %r13d, %rax
leaq (%r14,%rax,8), %rsi
movq %r14, %rdi
callq 0x5c97
xorl %ebp, %ebp
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x12587
movl %ebp, %eax
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]minimap2/hit.c
// Function: mm_seg_free
void mm_seg_free(void *km, int n_segs, mm_seg_t *segs)
{
	int i;
	for (i = 0; i < n_segs; ++i) kfree(km, segs[i].u);
	for (i = 0; i < n_segs; ++i) kfree(km, segs[i].a);
	kfree(km, segs);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
testl %esi, %esi
jle 0x1d08b
movl %esi, %ebp
movl %esi, %r15d
leaq (,%r15,8), %rax
leaq (%rax,%rax,2), %r12
xorl %r13d, %r13d
movq 0x8(%rbx,%r13), %rsi
movq %r14, %rdi
callq 0x12587
addq $0x18, %r13
cmpq %r13, %r12
jne 0x1d050
testl %ebp, %ebp
jle 0x1d08b
shlq $0x3, %r15
leaq (%r15,%r15,2), %r15
xorl %r12d, %r12d
movq 0x10(%rbx,%r12), %rsi
movq %r14, %rdi
callq 0x12587
addq $0x18, %r12
cmpq %r12, %r15
jne 0x1d075
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x12587