LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwt.c
// Function: bwt_restore_bwt
bwt_t *bwt_restore_bwt(const char *fn) {
	bwt_t *bwt;
	FILE *fp;

	bwt = (bwt_t*)calloc(1, sizeof(bwt_t));
	fp = xopen(fn, "rb");
	err_fseek(fp, 0, SEEK_END);

	// Populate BWT Size and allocate BWT
	bwt->bwt_size = (err_ftell(fp) - sizeof(bwtint_t) * (VALUE_DOMAIN + 1)) / sizeof(uint32_t);
	bwt->bwt = (uint32_t*)calloc(bwt->bwt_size, sizeof(uint32_t));

	// Populate Primary, L2[1::], and BWT
	err_fseek(fp, 0, SEEK_SET);
	err_fread_noeof(&bwt->primary, sizeof(bwtint_t), 1, fp);
	err_fread_noeof(bwt->L2+1, sizeof(bwtint_t), VALUE_DOMAIN, fp);
	fread_fix(fp, bwt->bwt_size * sizeof(uint32_t), bwt->bwt);

	// Sequence length in end of L2 array
	bwt->seq_len = bwt->L2[VALUE_DOMAIN];

	err_fclose(fp);

	return bwt;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x17f6e(%rip), %r12     # 0x281f2
leaq 0x17ffe(%rip), %r15     # 0x28289
movl $0x1, %edi
movl $0x140, %esi            # imm = 0x140
movq %r12, %rdx
movl $0x1f5, %ecx            # imm = 0x1F5
movq %r15, %r8
callq 0x2319c
movq %rax, %rbx
leaq 0x187e9(%rip), %rdx     # 0x28a98
movq %r15, %rdi
movq %r14, %rsi
callq 0xe023
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0xe451
movq %r14, %rdi
callq 0xe47a
leaq -0x108(%rax), %rdi
shrq $0x2, %rdi
movq %rdi, 0x118(%rbx)
movl $0x4, %esi
movq %r12, %rdx
movl $0x1fb, %ecx            # imm = 0x1FB
movq %r15, %r8
callq 0x2319c
movq %rax, 0x120(%rbx)
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xe451
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rcx
callq 0xe3b2
leaq 0x10(%rbx), %rdi
movl $0x8, %esi
movl $0x20, %edx
movq %r14, %rcx
callq 0xe3b2
movq 0x118(%rbx), %rsi
movq 0x120(%rbx), %rdx
shlq $0x2, %rsi
movq %r14, %rdi
callq 0x1021f
movq 0x108(%rbx), %rax
movq %rax, 0x110(%rbx)
movq %r14, %rdi
callq 0xe71e
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bntseq.c
// Function: bns_destroy
void bns_destroy(bntseq_t *bns)
{
	if (bns == 0) return;
	else {
		int i;
		if (bns->fp_pac) err_fclose(bns->fp_pac);
		free(bns->ambs);
		for (i = 0; i < bns->n_seqs; ++i) {
			free(bns->anns[i].name);
			free(bns->anns[i].anno);
		}
		free(bns->anns);
		free(bns);
	}
}

// Assembly:
testq %rdi, %rdi
je 0x10ed3
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
je 0x10e7c
callq 0xe71e
movq 0x20(%rbx), %rdi
callq 0x3390
cmpl $0x0, 0x8(%rbx)
jle 0x10ebd
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movq 0x18(%rax,%r14), %rdi
callq 0x3390
movq 0x10(%rbx), %rax
movq 0x20(%rax,%r14), %rdi
callq 0x3390
incq %r15
movslq 0x8(%rbx), %rax
addq $0x28, %r14
cmpq %rax, %r15
jl 0x10e91
movq 0x10(%rbx), %rdi
callq 0x3390
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3390
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bntseq.c
// Function: bwa_fa2pac
int bwa_fa2pac(int argc, char *argv[])
{
	int c, for_only = 0;
	gzFile fp;
	while ((c = getopt(argc, argv, "f")) >= 0) {
		switch (c) {
			case 'f': for_only = 1; break;
		}
	}
	if (argc == optind) {
		fprintf(stderr, "Usage: bwa fa2pac [-f] <in.fasta> [<out.prefix>]\n");
		return 1;
	}
	fp = xzopen(argv[optind], "r");
	bns_fasta2bntseq(fp, (optind+1 < argc)? argv[optind+1] : argv[optind], for_only);
	err_gzclose(fp);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x17b25(%rip), %rdx     # 0x28f23
callq 0x3090
xorl %r14d, %r14d
testl %eax, %eax
js 0x1142f
movl $0x1, %r12d
leaq 0x17b0c(%rip), %r15     # 0x28f23
cmpl $0x66, %eax
cmovel %r12d, %r14d
movl %ebp, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x3090
testl %eax, %eax
jns 0x11417
movq 0x1eba2(%rip), %r12     # 0x2ffd8
movslq (%r12), %rax
cmpl %ebp, %eax
je 0x11488
movq (%rbx,%rax,8), %rsi
leaq 0x16f7e(%rip), %rdi     # 0x283c7
leaq 0x15a1a(%rip), %rdx     # 0x26e6a
callq 0xe1c4
movq %rax, %r15
movl (%r12), %eax
leal 0x1(%rax), %ecx
cmpl %ebp, %ecx
cmovll %ecx, %eax
cltq
movq (%rbx,%rax,8), %rsi
movq %r15, %rdi
movl %r14d, %edx
callq 0x11164
movq %r15, %rdi
callq 0xe747
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x4308
movl $0x1, %eax
jmp 0x1147f
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bntseq.c
// Function: bns_pos2rid
int bns_pos2rid(const bntseq_t *bns, int64_t pos_f)
{
	int left, mid, right;
	if (pos_f >= bns->l_pac) return -1;
	left = 0; mid = 0; right = bns->n_seqs;
	while (left < right) { // binary search
		mid = (left + right) >> 1;
		if (pos_f >= bns->anns[mid].offset) {
			if (mid == bns->n_seqs - 1) break;
			if (pos_f < bns->anns[mid+1].offset) break; // bracketed
			left = mid + 1;
		} else right = mid;
	}
	return mid;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rsi, (%rdi)
jle 0x114e0
movl 0x8(%rdi), %r8d
testl %r8d, %r8d
jle 0x114e1
leal -0x1(%r8), %ecx
movq 0x10(%rdi), %rdx
xorl %edi, %edi
leal (%r8,%rdi), %eax
shrl %eax
leaq (%rax,%rax,4), %r10
movl %eax, %r9d
cmpq %rsi, (%rdx,%r10,8)
jg 0x114d8
cmpl %ecx, %eax
je 0x114e4
leal 0x1(%rax), %edi
leaq (%rdi,%rdi,4), %r10
movl %r8d, %r9d
cmpq %rsi, (%rdx,%r10,8)
jg 0x114e0
movl %r9d, %r8d
cmpl %r9d, %edi
jl 0x114b1
retq
xorl %eax, %eax
retq
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bntseq.c
// Function: bns_intv2rid
int bns_intv2rid(const bntseq_t *bns, int64_t rb, int64_t re)
{
	int is_rev, rid_b, rid_e;
	if (rb < bns->l_pac && re > bns->l_pac) return -2;
	assert(rb <= re);
	rid_b = bns_pos2rid(bns, bns_depos(bns, rb, &is_rev));
	rid_e = rb < re? bns_pos2rid(bns, bns_depos(bns, re - 1, &is_rev)) : rid_b;
	return rid_b == rid_e? rid_b : -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq (%rdi), %r12
cmpq %rsi, %r12
setg %cl
cmpq %rdx, %r12
setl %dl
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
testb %dl, %cl
jne 0x11556
movq %rsi, %r15
cmpq %r14, %rsi
jg 0x1155f
movq %rdi, %rbx
cmpq %r15, %r12
movq %r15, %rax
notq %rax
leaq (%rax,%r12,2), %rsi
cmovgq %r15, %rsi
callq 0x11494
movl %eax, %ebp
cmpq %r14, %r15
jge 0x1154c
leaq (%r12,%r12), %rsi
leaq -0x1(%r14), %rax
subq %r14, %rsi
cmpq %r14, %r12
cmovgeq %rax, %rsi
movq %rbx, %rdi
callq 0x11494
cmpl %eax, %ebp
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovel %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x16e6c(%rip), %rdi     # 0x283d2
leaq 0x16d7b(%rip), %rsi     # 0x282e8
leaq 0x16e67(%rip), %rcx     # 0x283db
movl $0x1b3, %edx            # imm = 0x1B3
callq 0x31a0
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bntseq.c
// Function: bns_cnt_ambi
int bns_cnt_ambi(const bntseq_t *bns, int64_t pos_f, int len, int *ref_id)
{
	int left, mid, right, nn;
	if (ref_id) *ref_id = bns_pos2rid(bns, pos_f);
	left = 0; right = bns->n_holes; nn = 0;
	while (left < right) {
		mid = (left + right) >> 1;
		if (pos_f >= bns->ambs[mid].offset + bns->ambs[mid].len) left = mid + 1;
		else if (pos_f + len <= bns->ambs[mid].offset) right = mid;
		else { // overlap
			if (pos_f >= bns->ambs[mid].offset) {
				nn += bns->ambs[mid].offset + bns->ambs[mid].len < pos_f + len?
					bns->ambs[mid].offset + bns->ambs[mid].len - pos_f : len;
			} else {
				nn += bns->ambs[mid].offset + bns->ambs[mid].len < pos_f + len?
					bns->ambs[mid].len : len - (bns->ambs[mid].offset - pos_f);
			}
			break;
		}
	}
	return nn;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
testq %rcx, %rcx
je 0x115a5
movq %rcx, %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0x11494
movl %eax, (%r12)
movl 0x18(%r15), %esi
testl %esi, %esi
jle 0x115ea
movq 0x20(%r15), %rcx
movslq %ebx, %rax
addq %r14, %rax
xorl %edx, %edx
leal (%rsi,%rdx), %edi
shrl %edi
movq %rdi, %r8
shlq $0x4, %r8
movq (%rcx,%r8), %r10
movslq 0x8(%rcx,%r8), %r9
leaq (%r10,%r9), %r8
cmpq %r14, %r8
jle 0x115de
cmpq %r10, %rax
jle 0x115e4
jmp 0x115fa
incl %edi
movl %edi, %edx
movl %esi, %edi
movl %edi, %esi
cmpl %edi, %edx
jl 0x115b9
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
cmpq %r10, %r14
jge 0x11611
subl %r10d, %r14d
addl %ebx, %r14d
cmpq %rax, %r8
cmovll %r9d, %r14d
movl %r14d, %ebx
jmp 0x115ec
movl %r8d, %ecx
subl %r14d, %ecx
cmpq %rax, %r8
cmovll %ecx, %ebx
jmp 0x115ec
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bntseq.c
// Function: bns_get_seq
uint8_t *bns_get_seq(int64_t l_pac, const uint8_t *pac, int64_t beg, int64_t end, int64_t *len)
{
	uint8_t *seq = 0;
	if (end < beg) end ^= beg, beg ^= end, end ^= beg; // if end is smaller, swap
	if (end > l_pac<<1) end = l_pac<<1;
	if (beg < 0) beg = 0;
	if (beg >= l_pac || end <= l_pac) {
		int64_t k, l = 0;
		*len = end - beg;
		seq = malloc(end - beg);
		if (beg >= l_pac) { // reverse strand
			int64_t beg_f = (l_pac<<1) - 1 - end;
			int64_t end_f = (l_pac<<1) - 1 - beg;
			for (k = end_f; k > beg_f; --k)
				seq[l++] = VALUE_DEFINED - 1 - pac[k];
				//seq[l++] = 3 - _get_pac(pac, k);
		} else { // forward strand
			for (k = beg; k < end; ++k)
				seq[l++] = pac[k];
				//seq[l++] = _get_pac(pac, k);
		}
	} else *len = 0; // if bridging the forward-reverse boundary, return nothing
	return seq;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq %rdx, %rcx
movq %rdx, %r13
cmovgq %rcx, %r13
cmovlq %rcx, %rdx
leaq (%rdi,%rdi), %r12
cmpq %r12, %r13
cmovgeq %r12, %r13
xorl %ebp, %ebp
testq %rdx, %rdx
cmovgq %rdx, %rbp
cmpq %rdi, %rbp
setl %al
cmpq %rdi, %r13
setg %cl
testb %cl, %al
je 0x11674
movq $0x0, (%r8)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %rbx
movq %rdi, %r15
movq %r13, %r14
subq %rbp, %r14
movq %r14, (%r8)
leaq 0x16c5e(%rip), %rsi     # 0x282e8
leaq 0x16d7f(%rip), %rcx     # 0x28410
movq %r14, %rdi
movl $0x1d9, %edx            # imm = 0x1D9
callq 0x23213
cmpq %r15, %rbp
jge 0x116bd
cmpq %rbp, %r13
jle 0x11665
addq %rbp, %rbx
xorl %ecx, %ecx
movb (%rbx,%rcx), %dl
movb %dl, (%rax,%rcx)
incq %rcx
cmpq %rcx, %r14
jne 0x116ad
jmp 0x11665
cmpq %rbp, %r13
jle 0x11665
decq %r12
movq %r12, %rcx
subq %r13, %rcx
subq %rbp, %r12
movq %rax, %rdx
movb $0x15, %sil
subb (%rbx,%r12), %sil
movb %sil, (%rdx)
decq %r12
incq %rdx
cmpq %rcx, %r12
jg 0x116d1
jmp 0x11665
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwa.c
// Function: bwa_fill_scmat
void bwa_fill_scmat(int a, int b, int8_t mat[VALUE_SCORING])
{
	int i, j, k;
	for (i = k = 0; i < VALUE_DEFINED - 1; ++i) {
		for (j = 0; j < VALUE_DEFINED - 1; ++j)
			mat[k++] = i == j? a : -b;
		mat[k++] = -1; // ambiguous base
	}
	for (j = 0; j < VALUE_DEFINED ; ++j) mat[k++] = -1;
}

// Assembly:
pushq %rbx
negl %esi
xorl %ecx, %ecx
movabsq $0x100000000, %rax      # imm = 0x100000000
xorl %r8d, %r8d
movslq %ecx, %r9
leaq (%rdx,%r9), %r10
shlq $0x20, %r9
xorl %r11d, %r11d
movl %r8d, %ebx
addl %r11d, %ebx
movl %esi, %ebx
cmovel %edi, %ebx
movb %bl, (%r10)
decl %r11d
incq %r10
addq %rax, %r9
cmpl $-0x15, %r11d
jne 0x12259
movl %ecx, %r10d
subl %r11d, %r10d
leal 0x1(%r10), %ecx
sarq $0x20, %r9
movb $-0x1, (%rdx,%r9)
incl %r8d
cmpl $0x15, %r8d
jne 0x1224b
incl %r10d
movslq %r10d, %rax
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, (%rdx,%rax)
movq $-0x1, 0xe(%rdx,%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwa.c
// Function: index_infer_prefix
char *index_infer_prefix(const char *hint)
{
	char *prefix;
	int l_hint;
	FILE *fp;

	l_hint = strlen(hint);
	prefix = malloc(l_hint + 3 + 4 + 1);
	strcpy(prefix, hint);
	strcpy(prefix + l_hint, ".bwt");
	if ((fp = fopen(prefix, "rb")) == 0) {
		free(prefix);
		return 0;
	} else {
		fclose(fp);
		prefix[l_hint] = 0;
		return prefix;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x3100
movq %rax, %r15
addl $0x8, %eax
movslq %eax, %rdi
leaq 0x15883(%rip), %rsi     # 0x2856d
leaq 0x15910(%rip), %rcx     # 0x28601
movl $0xe1, %edx
callq 0x23213
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x32c0
movslq %r15d, %r14
movl $0x7477622e, (%rbx,%r14) # imm = 0x7477622E
movb $0x0, 0x4(%rbx,%r14)
leaq 0x15d77(%rip), %rsi     # 0x28a98
movq %rbx, %rdi
callq 0x3380
testq %rax, %rax
je 0x12d42
movq %rbx, %r15
addq %r14, %r15
movq %rax, %rdi
callq 0x32f0
movb $0x0, (%r15)
jmp 0x12d4c
movq %rbx, %rdi
callq 0x3390
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwa.c
// Function: index_load_bwt
bwt_t *index_load_bwt(const char *hint)
{
	char *tmp, *prefix;
	bwt_t *bwt;
	prefix = index_infer_prefix(hint);
	if (prefix == 0) {
		logMessage(__func__, LOG_LEVEL_ERROR, "Failed to locate the index files\n");
		return 0;
	}
	tmp = calloc(strlen(prefix) + 5, 1);
	strcat(strcpy(tmp, prefix), ".bwt"); // FM-index
	bwt = bwt_restore_bwt(tmp);
	strcat(strcpy(tmp, prefix), ".sa");  // partial suffix array (SA)
	bwt_restore_sa(tmp, bwt);
	free(tmp); free(prefix);
	return bwt;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
callq 0x12ccd
testq %rax, %rax
je 0x12dfb
movq %rax, %rbx
movq %rax, %rdi
callq 0x3100
leaq 0x5(%rax), %rdi
leaq 0x157ef(%rip), %rdx     # 0x2856d
leaq 0x1588f(%rip), %r8      # 0x28614
movl $0x1, %esi
movl $0xf7, %ecx
callq 0x2319c
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x32c0
movq %r15, %rdi
callq 0x3100
movl $0x7477622e, (%r15,%rax) # imm = 0x7477622E
movb $0x0, 0x4(%r15,%rax)
movq %r15, %rdi
callq 0x10272
movq %rax, %r14
movq %r15, %rdi
movq %rbx, %rsi
callq 0x32c0
movq %r15, %rdi
callq 0x3100
movl $0x61732e, (%r15,%rax)  # imm = 0x61732E
movq %r15, %rdi
movq %r14, %rsi
callq 0x100dd
movq %r15, %rdi
callq 0x3390
movq %rbx, %rdi
callq 0x3390
jmp 0x12e18
leaq 0x15812(%rip), %rdi     # 0x28614
leaq 0x1581a(%rip), %rdx     # 0x28623
xorl %r14d, %r14d
movl $0x1, %esi
xorl %eax, %eax
callq 0xde80
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwa.c
// Function: index_load_from_disk
bwaidx_t *index_load_from_disk(const char *hint, int which)
{
	bwaidx_t *idx;
	char *prefix, * proName;

	prefix = index_infer_prefix(hint);

	if (prefix == 0) {
		logMessage(__func__, LOG_LEVEL_ERROR, "Failed to locate the index files\n");
		return 0;
	}

	proName = malloc(strlen(prefix) + 5);
	sprintf(proName, "%s.pro", prefix);

	idx = calloc(1, sizeof(bwaidx_t));
	if (which & BWA_IDX_BWT) idx->bwt = index_load_bwt(hint);
	if (which & BWA_IDX_BNS) {
		int i, c;
		idx->bns = bns_restore(hint);
		for (i = c = 0; i < idx->bns->n_seqs; ++i)
			if (idx->bns->anns[i].is_alt) ++c;

		logMessage(__func__, LOG_LEVEL_MESSAGE, "Read %d ALT contigs\n", c);

		if (which & BWA_IDX_PAC) {
			idx->pac = calloc(idx->bns->l_pac+1, 1);
			err_fread_noeof(idx->pac, 1, idx->bns->l_pac+1, idx->bns->fp_pac); // concatenated 2-bit encoded sequence
			err_fclose(idx->bns->fp_pac);
			idx->bns->fp_pac = 0;
		}
	}
	free(prefix);
	free(proName);
	return idx;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %r12
callq 0x12ccd
testq %rax, %rax
je 0x12ef3
movq %rax, %rbx
movq %rax, %rdi
callq 0x3100
leaq 0x5(%rax), %rdi
leaq 0x15718(%rip), %r15     # 0x2856d
leaq 0x157e9(%rip), %r13     # 0x28645
movq %r15, %rsi
movl $0x10c, %edx            # imm = 0x10C
movq %r13, %rcx
callq 0x23213
movq %rax, %r14
leaq 0x12585(%rip), %rsi     # 0x253fb
movq %rax, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3070
movl $0x1, %edi
movl $0x30, %esi
movq %r15, %rdx
movl $0x10f, %ecx            # imm = 0x10F
movq %r13, %r8
callq 0x2319c
movq %rax, %r15
testb $0x1, %bpl
je 0x12eb1
movq %r12, %rdi
callq 0x12d55
movq %rax, (%r15)
testb $0x2, %bpl
je 0x12f96
movq %r12, %rdi
callq 0x1095e
movq %rax, 0x8(%r15)
movslq 0x8(%rax), %rcx
testq %rcx, %rcx
jle 0x12f15
movq 0x10(%rax), %rax
shlq $0x3, %rcx
leaq (%rcx,%rcx,4), %rdx
xorl %esi, %esi
xorl %ecx, %ecx
cmpl $0x1, 0x14(%rax,%rsi)
sbbl $-0x1, %ecx
addq $0x28, %rsi
cmpq %rsi, %rdx
jne 0x12ee0
jmp 0x12f17
leaq 0x1574b(%rip), %rdi     # 0x28645
leaq 0x15722(%rip), %rdx     # 0x28623
xorl %r15d, %r15d
movl $0x1, %esi
xorl %eax, %eax
callq 0xde80
jmp 0x12fa6
xorl %ecx, %ecx
leaq 0x15727(%rip), %rdi     # 0x28645
leaq 0x15735(%rip), %rdx     # 0x2865a
movl $0x3, %esi
xorl %eax, %eax
callq 0xde80
testb $0x4, %bpl
je 0x12f96
movq 0x8(%r15), %rax
movq (%rax), %rdi
incq %rdi
leaq 0x15625(%rip), %rdx     # 0x2856d
leaq 0x156f6(%rip), %r8      # 0x28645
movl $0x1, %esi
movl $0x11a, %ecx            # imm = 0x11A
callq 0x2319c
movq %rax, 0x10(%r15)
movq 0x8(%r15), %rcx
movq (%rcx), %rdx
movq 0x28(%rcx), %rcx
incq %rdx
movl $0x1, %esi
movq %rax, %rdi
callq 0xe3b2
movq 0x8(%r15), %rax
movq 0x28(%rax), %rdi
callq 0xe71e
movq 0x8(%r15), %rax
movq $0x0, 0x28(%rax)
movq %rbx, %rdi
callq 0x3390
movq %r14, %rdi
callq 0x3390
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwa.c
// Function: index_destroy
void index_destroy(bwaidx_t *idx)
{
	if (idx == 0) return;
	if (idx->mem == 0) {
		if (idx->bwt) bwt_destroy(idx->bwt);
		if (idx->bns) bns_destroy(idx->bns);
		if (idx->pac) free(idx->pac);
	} else {
		free(idx->bwt); free(idx->bns->anns); free(idx->bns);
		if (!idx->is_shm) free(idx->mem);
	}
	free(idx);
}

// Assembly:
testq %rdi, %rdi
je 0x12ff7
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x28(%rdi)
movq (%rdi), %rdi
je 0x12ff8
callq 0x3390
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rdi
callq 0x3390
movq 0x8(%rbx), %rdi
callq 0x3390
cmpl $0x0, 0x18(%rbx)
jne 0x1301e
movq 0x28(%rbx), %rdi
jmp 0x13019
retq
testq %rdi, %rdi
je 0x13002
callq 0x10378
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x13010
callq 0x10e61
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x1301e
callq 0x3390
movq %rbx, %rdi
popq %rbx
jmp 0x3390
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwa.c
// Function: bwa_print_sam_hdr
void bwa_print_sam_hdr(const bntseq_t *bns, const char *hdr_line, FILE * passStream)
{
	int i, n_SQ = 0;
	extern char *bwa_pg;
	if (hdr_line) {
		const char *p = hdr_line;
		while ((p = strstr(p, "@SQ\t")) != 0) {
			if (p == hdr_line || *(p-1) == '\n') ++n_SQ;
			p += 4;
		}
	}
	if (n_SQ == 0) {
		for (i = 0; i < bns->n_seqs; ++i)
			err_fprintf(passStream, "@SQ\tSN:%s\tLN:%d\n", bns->anns[i].name, bns->anns[i].len);
	} else if (n_SQ != bns->n_seqs && bwa_verbose >= 2)
		fprintf(stderr, "[W::%s] %d @SQ lines provided with -H; %d sequences in the index. Continue anyway.\n", __func__, n_SQ, bns->n_seqs);
	if (hdr_line) err_fprintf(passStream, "%s\n", hdr_line);
	if (bwa_pg) err_fprintf(passStream, "%s\n", bwa_pg);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testq %rsi, %rsi
je 0x135b8
leaq 0x1517a(%rip), %rsi     # 0x286c2
movq %r14, %rdi
callq 0x3080
testq %rax, %rax
je 0x135b8
xorl %ebp, %ebp
leaq 0x15164(%rip), %r12     # 0x286c2
cmpq %r14, %rax
je 0x13569
cmpb $0xa, -0x1(%rax)
jne 0x1356b
incl %ebp
addq $0x4, %rax
movq %rax, %rdi
movq %r12, %rsi
callq 0x3080
testq %rax, %rax
jne 0x1355e
testl %ebp, %ebp
je 0x135b8
movl 0x8(%r15), %r8d
cmpl %r8d, %ebp
je 0x135f8
cmpl $0x2, 0x1d8ad(%rip)     # 0x30e40
jl 0x135f8
movq 0x1ca34(%rip), %rax     # 0x2ffd0
movq (%rax), %rdi
leaq 0x15132(%rip), %rsi     # 0x286d8
leaq 0x1517f(%rip), %rdx     # 0x2872c
movl %ebp, %ecx
xorl %eax, %eax
callq 0x3500
jmp 0x135f8
cmpl $0x0, 0x8(%r15)
jle 0x135f8
movl $0x18, %r13d
leaq 0x150fb(%rip), %r12     # 0x286c7
xorl %ebp, %ebp
movq 0x10(%r15), %rax
movq (%rax,%r13), %rdx
movl -0x10(%rax,%r13), %ecx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0xe560
incq %rbp
movslq 0x8(%r15), %rax
addq $0x28, %r13
cmpq %rax, %rbp
jl 0x135ce
testq %r14, %r14
je 0x13611
leaq 0x139fe(%rip), %rsi     # 0x27002
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xe560
movq 0x1d858(%rip), %rdx     # 0x30e70
testq %rdx, %rdx
je 0x1363c
leaq 0x139de(%rip), %rsi     # 0x27002
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe560
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwa.c
// Function: bwa_set_rg
char *bwa_set_rg(const char *s)
{
	char *p, *q, *r, *rg_line = 0;
	memset(bwa_rg_id, 0, 256);
	if (strstr(s, "@RG") != s) {
		logMessage(__func__, LOG_LEVEL_ERROR, "The read group line does not start with @RG\n");
		goto err_set_rg;
	}
	rg_line = strdup(s);
	bwa_escape(rg_line);
	if ((p = strstr(rg_line, "\tID:")) == 0) {
		logMessage(__func__, LOG_LEVEL_ERROR, "No ID at the read group line\n");
		goto err_set_rg;
	}
	p += 4;
	for (q = p; *q && *q != '\t' && *q != '\n'; ++q);
	if (q - p + 1 > 256) {
		logMessage(__func__, LOG_LEVEL_ERROR, "@RG:ID is longer than 255 characters\n");
		goto err_set_rg;
	}
	for (q = p, r = bwa_rg_id; *q && *q != '\t' && *q != '\n'; ++q)
		*r++ = *q;
	return rg_line;

err_set_rg:
	free(rg_line);
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r15
leaq 0x1d826(%rip), %r14     # 0x30e80
xorl %ebx, %ebx
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x3140
leaq 0x150d7(%rip), %rdx     # 0x28749
cmpb $0x40, (%r15)
jne 0x136dd
cmpb $0x52, 0x1(%r15)
jne 0x136db
cmpb $0x47, 0x2(%r15)
jne 0x136db
leaq 0x14ee0(%rip), %rsi     # 0x2856d
leaq 0x150aa(%rip), %rcx     # 0x2873e
movq %r15, %rdi
movl $0x1ac, %edx            # imm = 0x1AC
callq 0x23285
movq %rax, %rbx
movq %rax, %rdi
callq 0x1373d
leaq 0x150c3(%rip), %rsi     # 0x28776
movq %rbx, %rdi
callq 0x3080
testq %rax, %rax
je 0x13715
xorl %ecx, %ecx
movl $0x601, %edx            # imm = 0x601
movzbl 0x4(%rax,%rcx), %esi
cmpl $0xa, %esi
ja 0x136d6
btl %esi, %edx
jb 0x13703
incq %rcx
jmp 0x136c7
xorl %ebx, %ebx
leaq 0x1505a(%rip), %rdi     # 0x2873e
movl $0x1, %esi
xorl %eax, %eax
callq 0xde80
movq %rbx, %rdi
callq 0x3390
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
cmpq $0xff, %rcx
jle 0x1371e
leaq 0x15086(%rip), %rdx     # 0x28799
jmp 0x136dd
leaq 0x1505f(%rip), %rdx     # 0x2877b
jmp 0x136dd
xorl %ecx, %ecx
movl $0x601, %edx            # imm = 0x601
movzbl 0x4(%rax,%rcx), %esi
cmpl $0xa, %esi
ja 0x13734
btl %esi, %edx
jb 0x136fa
movb %sil, (%rcx,%r14)
incq %rcx
jmp 0x13725
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwa.c
// Function: bwa_escape
static char *bwa_escape(char *s)
{
	char *p, *q;
	for (p = q = s; *p; ++p) {
		if (*p == '\\') {
			++p;
			if (*p == 't') *q++ = '\t';
			else if (*p == 'n') *q++ = '\n';
			else if (*p == 'r') *q++ = '\r';
			else if (*p == '\\') *q++ = '\\';
		} else *q++ = *p;
	}
	*q = '\0';
	return s;
}

// Assembly:
movq %rdi, %rax
movq %rdi, %rdx
movq %rdi, %rcx
movzbl (%rdx), %esi
cmpl $0x5c, %esi
je 0x1375d
testl %esi, %esi
je 0x13791
movb %sil, (%rcx)
incq %rcx
incq %rdx
jmp 0x13746
movzbl 0x1(%rdx), %edi
incq %rdx
cmpl $0x71, %edi
jg 0x13778
cmpl $0x5c, %edi
je 0x13787
cmpl $0x6e, %edi
jne 0x13758
movb $0xa, %sil
jmp 0x13752
cmpl $0x72, %edi
je 0x1378c
movb $0x9, %sil
cmpl $0x74, %edi
je 0x13752
jmp 0x13758
movb $0x5c, %sil
jmp 0x13752
movb $0xd, %sil
jmp 0x13752
movb $0x0, (%rcx)
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwa.c
// Function: bwa_insert_header
char *bwa_insert_header(const char *s, char *hdr)
{
	int len = 0;
	if (s == 0 || s[0] != '@') return hdr;
	if (hdr) {
		len = strlen(hdr);
		hdr = realloc(hdr, len + strlen(s) + 2);
		hdr[len++] = '\n';
		strcpy(hdr + len, s);
	} else hdr = strdup(s);
	bwa_escape(hdr + len);
	return hdr;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
testq %rdi, %rdi
je 0x13835
movq %rdi, %r14
cmpb $0x40, (%rdi)
jne 0x13835
testq %rbx, %rbx
je 0x13809
movq %rbx, %rdi
callq 0x3100
movslq %eax, %r15
movq %r14, %rdi
callq 0x3100
leaq (%rax,%r15), %rsi
addq $0x2, %rsi
leaq 0x14d94(%rip), %rdx     # 0x2856d
leaq 0x14fdf(%rip), %r8      # 0x287bf
movq %rbx, %rdi
movl $0x1c7, %ecx            # imm = 0x1C7
callq 0x2324c
movq %rax, %rbx
movb $0xa, (%rax,%r15)
incl %r15d
movslq %r15d, %r15
leaq (%rax,%r15), %rdi
movq %r14, %rsi
callq 0x32c0
jmp 0x1382a
leaq 0x14d5d(%rip), %rsi     # 0x2856d
leaq 0x14fa8(%rip), %rcx     # 0x287bf
movq %r14, %rdi
movl $0x1ca, %edx            # imm = 0x1CA
callq 0x23285
movq %rax, %rbx
xorl %r15d, %r15d
addq %rbx, %r15
movq %r15, %rdi
callq 0x1373d
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwamem.c
// Function: mem_opt_init
mem_opt_t *mem_opt_init()
{
	mem_opt_t *o;
	o = calloc(1, sizeof(mem_opt_t));
	o->outputStream = stdout;
	o->outputType = OUTPUT_TYPE_UNIPROT_FULL;
	o->flag = 0;
	o->a = 1; o->b = 3; //4;
	o->o_del = o->o_ins = 0; //6
	o->e_del = o->e_ins = 1;
	o->w = 100;
	o->T = 15;
	o->zdrop = 100;
	o->pen_unpaired = 17;
	o->pen_clip5 = o->pen_clip3 = 0;
	o->max_mem_intv = 20;
	o->min_orf_len = 250;
	o->min_orf_percent = 0;
	o->proteinFlag = 0;
	o->proteinFlag |= ALIGN_FLAG_BRUTE_ORF;
	o->proteinFlag |= ALIGN_FLAG_ADJUST_ORF;
	o->min_seed_len = 11;
	o->split_width = 10;
	o->max_occ = 500;
	o->max_chain_gap = 10000;
	o->max_ins = 10000;
	o->mask_level = 0.50;
	o->drop_ratio = 0.50;
	o->XA_drop_ratio = 0.8;
	o->split_factor = 1.5;
	o->chunk_size = 10000000;
	o->n_threads = 1;
	o->max_XA_hits = 5;
	o->max_XA_hits_alt = 200;
	o->max_matesw = 50;
	o->mask_level_redun = 0.95;
	o->min_chain_weight = 0;
	o->max_chain_extend = 1<<30;
	o->mapQ_coef_len = 50; o->mapQ_coef_fac = log(o->mapQ_coef_len);
	bwa_fill_scmat(o->a, o->b, o->mat);
	return o;
}

// Assembly:
pushq %rbx
leaq 0x15078(%rip), %rdx     # 0x288c0
leaq 0x1507a(%rip), %r8      # 0x288c9
movl $0x1, %edi
movl $0x2a8, %esi            # imm = 0x2A8
movl $0x35, %ecx
callq 0x2319c
movq %rax, %rbx
movq 0x1c73b(%rip), %rax     # 0x2ffa8
movq (%rax), %rax
movq %rax, 0x38(%rbx)
movaps 0x14f85(%rip), %xmm0    # 0x28800
movups %xmm0, 0x40(%rbx)
movaps 0x14f8a(%rip), %xmm0    # 0x28810
movups %xmm0, (%rbx)
movl $0x64, 0x28(%rbx)
movabsq $0x6400000000, %rax     # imm = 0x6400000000
movq %rax, 0x20(%rbx)
movaps 0x14f7b(%rip), %xmm0    # 0x28820
movups %xmm0, 0x10(%rbx)
movq $0x14, 0x30(%rbx)
movq $0xfa, 0x68(%rbx)
movl $0xb, 0x78(%rbx)
movl $0x3fc00000, 0x84(%rbx) # imm = 0x3FC00000
movl $0x989680, 0x98(%rbx)   # imm = 0x989680
movaps 0x14f55(%rip), %xmm0    # 0x28830
movups %xmm0, 0x88(%rbx)
movl $0xc8, 0xc0(%rbx)
movaps 0x14f4d(%rip), %xmm0    # 0x28840
movups %xmm0, 0x9c(%rbx)
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq %rax, 0x7c(%rbx)
movl $0x42480000, 0xac(%rbx) # imm = 0x42480000
movaps 0x14f37(%rip), %xmm0    # 0x28850
movups %xmm0, 0xb0(%rbx)
leaq 0xc4(%rbx), %rdx
movl $0x1, %edi
movl $0x3, %esi
callq 0x12239
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwamem.c
// Function: filterCompetingAln
void filterCompetingAln(worker_t * passWorker, int passCount, int passDisable) {
	int seqIdx, alnIdx, bestIdx;
	int currentSeq, readSeq;
	int seqTotal, bestTotal;

	currentSeq = 0;
	bestIdx = 0;
	bestTotal = 0;

	// Iterate through each sequence and alignment
	for (seqIdx = 0 ; seqIdx < passCount - 1 ; seqIdx++) {
        // If filtering disabled, simply mark sequence as best
        if (passDisable) {
            passWorker->regs[seqIdx].active = 1;
            continue;
        }

		// Check if we're in a new sequence or in an alternate frame
		sscanf(passWorker->seqs[seqIdx].name, "%d:", &readSeq);
		if (readSeq != currentSeq) {
			// New sequence - mark best as active in previous sequence
			passWorker->regs[bestIdx].active = 1;

			// Reset search to current sequence
			currentSeq = readSeq;
			bestTotal = 0;
			bestIdx = seqIdx;
		}

        // Aggregate all score totals for this sequence
        seqTotal = 0;
        for (alnIdx = 0 ; alnIdx < passWorker->regs[seqIdx].n ; alnIdx++) {
            seqTotal += passWorker->regs[seqIdx].a[alnIdx].score;
        }

		// Check if current alignment is best so far
		if (seqTotal > bestTotal) {
			bestTotal = seqTotal;
			bestIdx = seqIdx;
		}
	}

	// Filter final sequence
    if (!passDisable) passWorker->regs[bestIdx].active = 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %rbx
xorl %eax, %eax
cmpl $0x2, %esi
jl 0x13a22
movl %esi, %r14d
decl %r14d
xorl %r13d, %r13d
xorl %r12d, %r12d
movl $0x0, (%rsp)
xorl %r15d, %r15d
testl %ebp, %ebp
je 0x13988
movq 0x38(%rbx), %rax
movq %r13, %rcx
shlq $0x5, %rcx
movl $0x1, 0x10(%rax,%rcx)
jmp 0x13a13
movq 0x30(%rbx), %rax
leaq (,%r13,2), %rcx
addq %r13, %rcx
shlq $0x4, %rcx
movq 0x8(%rax,%rcx), %rdi
leaq 0x14f2f(%rip), %rsi     # 0x288d6
leaq 0x4(%rsp), %rdx
xorl %eax, %eax
callq 0x32e0
movq 0x38(%rbx), %rax
movl (%rsp), %ecx
cmpl %ecx, 0x4(%rsp)
je 0x139dc
movslq %r15d, %rcx
shlq $0x5, %rcx
movl $0x1, 0x10(%rax,%rcx)
movl 0x4(%rsp), %ecx
movl %ecx, (%rsp)
xorl %r12d, %r12d
movl %r13d, %r15d
movq %r13, %rdx
shlq $0x5, %rdx
movq (%rax,%rdx), %rcx
testq %rcx, %rcx
je 0x13a06
addq %rdx, %rax
movq 0x18(%rax), %rdx
addq $0x1c, %rdx
xorl %eax, %eax
addl (%rdx), %eax
addq $0x60, %rdx
decq %rcx
jne 0x139f9
jmp 0x13a08
xorl %eax, %eax
cmpl %r12d, %eax
cmovgl %r13d, %r15d
cmovgl %eax, %r12d
incq %r13
cmpq %r14, %r13
jne 0x1396c
movslq %r15d, %rax
testl %ebp, %ebp
jne 0x13a36
movq 0x38(%rbx), %rcx
shlq $0x5, %rax
movl $0x1, 0x10(%rcx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwamem.c
// Function: getAlignmentType
int getAlignmentType(worker_t * passWorker, int passEntry, int passAlignment) {
	mem_alnreg_t * currentAlignment;

	currentAlignment = passWorker->regs[passEntry].a + passAlignment;

	if (currentAlignment->secondary < 0) {
		// Primary scores below threshold are not aligned
		if (currentAlignment->score < passWorker->opt->T) return MEM_ALIGN_NONE_PRIMARY;

		return MEM_ALIGN_PRIMARY;
	}
	else {
		// Secondary scores below threshold are not aligned
		if (currentAlignment->score < passWorker->opt->T) return MEM_ALIGN_NONE_SECONDARY;

		// Secondary alignments must also pass score ratio requirements
		if (currentAlignment->is_alt) return MEM_ALIGN_NONE_SECONDARY;
		if (currentAlignment->secondary < INT_MAX &&
			currentAlignment->score < passWorker->regs[passEntry].a[currentAlignment->secondary].score * passWorker->opt->drop_ratio) return MEM_ALIGN_NONE_SECONDARY;

		return MEM_ALIGN_SECONDARY;
	}
}

// Assembly:
movq (%rdi), %rcx
movq 0x38(%rdi), %rax
movslq %esi, %rsi
shlq $0x5, %rsi
movq 0x18(%rax,%rsi), %rsi
movslq %edx, %rax
leaq (%rax,%rax,2), %r8
shlq $0x5, %r8
movslq 0x3c(%rsi,%r8), %rdx
movl 0x1c(%rsi,%r8), %edi
movl 0x44(%rcx), %r9d
testq %rdx, %rdx
js 0x13aba
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpl %r9d, %edi
jl 0x13ab9
addq %rsi, %r8
cmpl $0x3fffffff, 0x48(%r8)  # imm = 0x3FFFFFFF
ja 0x13ab9
cmpl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
je 0x13ab4
cvtsi2ss %edi, %xmm0
leaq (%rdx,%rdx,2), %rdx
shlq $0x5, %rdx
cvtsi2ssl 0x1c(%rsi,%rdx), %xmm1
mulss 0xa0(%rcx), %xmm1
ucomiss %xmm0, %xmm1
ja 0x13ab9
movl $0x1, %eax
retq
xorl %eax, %eax
cmpl %r9d, %edi
setl %al
negl %eax
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwamem.c
// Function: mem_chain_weight
int mem_chain_weight(const mem_chain_t *c)
{
	int64_t end;
	int j, w = 0, tmp;
	for (j = 0, end = 0; j < c->n; ++j) {
		const mem_seed_t *s = &c->seeds[j];
		if (s->qbeg >= end) w += s->len;
		else if (s->qbeg + s->len > end) w += s->qbeg + s->len - end;
		end = end > s->qbeg + s->len? end : s->qbeg + s->len;
	}
	tmp = w; w = 0;
	for (j = 0, end = 0; j < c->n; ++j) {
		const mem_seed_t *s = &c->seeds[j];
		if (s->rbeg >= end) w += s->len;
		else if (s->rbeg + s->len > end) w += s->rbeg + s->len - end;
		end = end > s->rbeg + s->len? end : s->rbeg + s->len;
	}
	w = w < tmp? w : tmp;
	return w < 1<<30? w : (1<<30)-1;
}

// Assembly:
movslq (%rdi), %rdx
testq %rdx, %rdx
jle 0x146d8
movq 0x20(%rdi), %rsi
movq %rdx, %rax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
xorl %eax, %eax
movslq 0x8(%rsi,%r8), %r10
movl 0xc(%rsi,%r8), %r11d
cmpq %r10, %r9
jle 0x14677
addl %r10d, %r11d
movslq %r11d, %r10
cmpq %r10, %r9
jge 0x14680
subl %r9d, %eax
addl %r11d, %eax
jmp 0x14680
addl %r11d, %eax
addl %r11d, %r10d
movslq %r10d, %r10
cmpq %r10, %r9
cmovleq %r10, %r9
addq $0x18, %r8
cmpq %r8, %rcx
jne 0x14655
testl %edx, %edx
jle 0x146da
movq 0x20(%rdi), %rsi
xorl %edi, %edi
xorl %r8d, %r8d
xorl %edx, %edx
movq (%rsi,%rdi), %r9
movslq 0xc(%rsi,%rdi), %r10
cmpq %r8, %r9
jge 0x146c0
addq %r10, %r9
cmpq %r8, %r9
jle 0x146c6
movl %r9d, %r10d
subl %r8d, %r10d
addl %r10d, %edx
jmp 0x146c6
addl %r10d, %edx
addq %r10, %r9
cmpq %r9, %r8
cmovleq %r9, %r8
addq $0x18, %rdi
cmpq %rdi, %rcx
jne 0x1469f
jmp 0x146dc
xorl %eax, %eax
xorl %edx, %edx
cmpl %eax, %edx
cmovll %edx, %eax
movl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
cmpl %ecx, %eax
cmovgel %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwamem.c
// Function: mem_print_chain
void mem_print_chain(const bntseq_t *bns, mem_chain_v *chn)
{
	int i, j;
	for (i = 0; i < chn->n; ++i) {
		mem_chain_t *p = &chn->a[i];
		err_printf("* Found CHAIN(%d): n=%d; weight=%d", i, p->n, mem_chain_weight(p));
		for (j = 0; j < p->n; ++j) {
			bwtint_t pos;
			int is_rev;
			pos = bns_depos(bns, p->seeds[j].rbeg, &is_rev);
			if (is_rev) pos -= p->seeds[j].len - 1;
			err_printf("\t%d;%d;%d,%ld(%s:%c%ld)", p->seeds[j].score, p->seeds[j].len, p->seeds[j].qbeg, (long)p->seeds[j].rbeg, bns->anns[p->rid].name, "+-"[is_rev], (long)(pos - bns->anns[p->rid].offset) + 1);
		}
		err_putchar('\n');
	}
}

// Assembly:
cmpq $0x0, (%rsi)
je 0x1481d
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
leaq 0x14227(%rip), %r12     # 0x28935
xorl %ebx, %ebx
movq %rsi, 0x8(%rsp)
movq 0x10(%rsi), %rax
leaq (%rbx,%rbx,4), %rcx
leaq (%rax,%rcx,8), %rbp
movl (%rbp), %r15d
movq %rbp, %rdi
callq 0x14632
leaq 0x141de(%rip), %rdi     # 0x28912
movq %rbx, 0x10(%rsp)
movl %ebx, %esi
movl %r15d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0xe4a3
cmpl $0x0, (%rbp)
jle 0x147e5
movl $0x10, %r15d
xorl %r13d, %r13d
movq 0x20(%rbp), %rax
movq -0x10(%rax,%r15), %r8
movq (%r14), %rcx
cmpq %r8, %rcx
jg 0x14783
leaq (%rcx,%rcx), %rsi
movl -0x4(%rax,%r15), %edx
subq %r8, %rsi
movl %edx, %edi
negl %edi
movslq %edi, %r10
addq %rsi, %r10
jmp 0x1478b
movl -0x4(%rax,%r15), %edx
movq %r8, %r10
xorl %edi, %edi
cmpq %r8, %rcx
setle %dil
movl -0x8(%rax,%r15), %ecx
movl (%rax,%r15), %esi
movq 0x10(%r14), %rax
movslq 0xc(%rbp), %r9
leaq (%r9,%r9,4), %r11
movq 0x18(%rax,%r11,8), %r9
leaq 0x14198(%rip), %rbx     # 0x2894d
movsbl (%rdi,%rbx), %ebx
subq (%rax,%r11,8), %r10
incq %r10
movq %r12, %rdi
xorl %eax, %eax
pushq %r10
pushq %rbx
callq 0xe4a3
addq $0x10, %rsp
incq %r13
movslq (%rbp), %rax
addq $0x18, %r15
cmpq %rax, %r13
jl 0x1475a
movq 0x1b7bc(%rip), %rax     # 0x2ffa8
movq (%rax), %rsi
movl $0xa, %edi
callq 0xe609
movq 0x10(%rsp), %rbx
incq %rbx
movq 0x8(%rsp), %rsi
cmpq %rbx, (%rsi)
ja 0x14715
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwamem.c
// Function: mem_seed_sw
int mem_seed_sw(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, int l_query, const uint8_t *query, const mem_seed_t *s)
{
	int qb, qe, rid;
	int64_t rb, re, mid, l_pac = bns->l_pac;
	uint8_t *rseq = 0;
	kswr_t x;

	if (s->len >= MEM_SHORT_LEN) return -1; // the seed is longer than the max-extend; no need to do SW
	qb = s->qbeg, qe = s->qbeg + s->len;
	rb = s->rbeg, re = s->rbeg + s->len;
	mid = (rb + re) >> 1;
	qb -= MEM_SHORT_EXT; qb = qb > 0? qb : 0;
	qe += MEM_SHORT_EXT; qe = qe < l_query? qe : l_query;
	rb -= MEM_SHORT_EXT; rb = rb > 0? rb : 0;
	re += MEM_SHORT_EXT; re = re < l_pac<<1? re : l_pac<<1;
	if (rb < l_pac && l_pac < re) {
		if (mid < l_pac) re = l_pac;
		else rb = l_pac;
	}
	if (qe - qb >= MEM_SHORT_LEN || re - rb >= MEM_SHORT_LEN) return -1; // the seed seems good enough; no need to do SW

	rseq = bns_fetch_seq(bns, pac, &rb, mid, &re, &rid);
	x = ksw_align2(qe - qb, (uint8_t*)query + qb, re - rb, rseq, VALUE_DEFINED, opt->mat, opt->o_del, opt->e_del, opt->o_ins, opt->e_ins, KSW_XSTART, 0);
	free(rseq);
	return x.score;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %rbx
movslq 0xc(%r9), %r8
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
cmpq $0xc7, %r8
jg 0x1abba
movl %ecx, %ebp
movq %rdi, %r14
movq (%rsi), %rax
movl 0x8(%r9), %edi
movq (%r9), %r9
leaq (%r9,%r8), %rcx
addq %r9, %rcx
sarq %rcx
cmpl $0x33, %edi
movl $0x32, %r13d
cmovgel %edi, %r13d
addl $-0x32, %r13d
addl %r8d, %edi
addl $0x32, %edi
cmpl %ebp, %edi
cmovll %edi, %ebp
cmpq $0x33, %r9
movl $0x32, %edi
cmovgeq %r9, %rdi
addq $-0x32, %rdi
movq %rdi, 0x8(%rsp)
addq %r8, %r9
addq $0x32, %r9
leaq (%rax,%rax), %r8
cmpq %r8, %r9
cmovlq %r9, %r8
movq %r8, 0x10(%rsp)
cmpq %rax, %rdi
jge 0x1ab11
cmpq %r8, %rax
jge 0x1ab11
cmpq %rax, %rcx
jge 0x1ab09
movq %rax, 0x10(%rsp)
jmp 0x1ab14
movq %rax, 0x8(%rsp)
movq %rax, %rdi
movq %r8, %rax
subl %r13d, %ebp
cmpl $0xc7, %ebp
jg 0x1abba
subq %rdi, %rax
cmpq $0xc7, %rax
jg 0x1abba
leaq 0x8(%rsp), %rax
leaq 0x10(%rsp), %r15
leaq 0x18(%rsp), %r9
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
movq %r15, %r8
callq 0x116eb
movq %rax, %r12
movl %r13d, %eax
addq %rax, %rbx
movl (%r15), %ecx
leaq 0x8(%rsp), %rax
subl (%rax), %ecx
leaq 0xc4(%r14), %rax
movl 0x8(%r14), %r10d
movl 0xc(%r14), %r11d
movl 0x10(%r14), %r15d
movl 0x14(%r14), %r13d
subq $0x8, %rsp
leaq 0x24(%rsp), %r14
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
movq %r12, %r8
movl $0x16, %r9d
pushq $0x0
pushq $0x80000                # imm = 0x80000
pushq %r13
pushq %r15
pushq %r11
pushq %r10
pushq %rax
callq 0x23f4d
addq $0x40, %rsp
movl (%r14), %r15d
movq %r12, %rdi
callq 0x3390
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwamem.c
// Function: mem_flt_chained_seeds
void mem_flt_chained_seeds(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, int l_query, const uint8_t *query, int n_chn, mem_chain_t *a)
{
	double min_l = opt->min_chain_weight? MEM_HSP_COEF * opt->min_chain_weight : MEM_MINSC_COEF * log(l_query);
	int i, j, k, min_HSP_score = (int)(opt->a * min_l + .499);
	if (min_l > MEM_SEEDSW_COEF * l_query) return; // don't run the following for short reads
	for (i = 0; i < n_chn; ++i) {
		mem_chain_t *c = &a[i];
		for (j = k = 0; j < c->n; ++j) {
			mem_seed_t *s = &c->seeds[j];
			s->score = mem_seed_sw(opt, bns, pac, l_query, query, s);
			if (s->score < 0 || s->score >= min_HSP_score) {
				s->score = s->score < 0? s->len * opt->a : s->score;
				c->seeds[k++] = *s;
			}
		}
		c->n = k;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r9d, %r13d
movq %r8, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdi, 0x10(%rsp)
movl 0x7c(%rdi), %eax
testl %eax, %eax
movl %ecx, 0xc(%rsp)
je 0x1ac0e
cvtsi2ss %eax, %xmm0
mulss 0xdcb0(%rip), %xmm0     # 0x288b8
cvtss2sd %xmm0, %xmm0
jmp 0x1ac23
cvtsi2sd %ecx, %xmm0
callq 0x3250
movl 0xc(%rsp), %ecx
mulsd 0xdc65(%rip), %xmm0     # 0x28888
cvtsi2ss %ecx, %xmm1
mulss 0xdc8d(%rip), %xmm1     # 0x288bc
cvtss2sd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
seta %al
testl %r13d, %r13d
setle %dl
orb %al, %dl
jne 0x1ad33
movq 0x10(%rsp), %rax
xorps %xmm1, %xmm1
cvtsi2sdl (%rax), %xmm1
mulsd %xmm0, %xmm1
addsd 0xab40(%rip), %xmm1     # 0x257a0
cvttsd2si %xmm1, %eax
movl %eax, 0x1c(%rsp)
movl %r13d, %eax
movq %rax, 0x20(%rsp)
xorl %eax, %eax
movq %rax, 0x28(%rsp)
leaq (%rax,%rax,4), %rax
movq 0x80(%rsp), %rdx
leaq (%rdx,%rax,8), %rbp
cmpl $0x0, (%rbp)
movl $0x0, %r14d
jle 0x1ad1c
xorl %r15d, %r15d
xorl %ebx, %ebx
xorl %r14d, %r14d
movq 0x20(%rbp), %r12
leaq (%r12,%r15), %r13
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %r8
movq %r13, %r9
callq 0x1aa69
movl %eax, 0x10(%r12,%r15)
testl %eax, %eax
js 0x1acd2
cmpl 0x1c(%rsp), %eax
jl 0x1ad08
testl %eax, %eax
jns 0x1ace3
movq 0x10(%rsp), %rax
movl (%rax), %eax
imull 0xc(%r12,%r15), %eax
movl %eax, 0x10(%r12,%r15)
movq 0x20(%rbp), %rax
movslq %r14d, %rcx
incl %r14d
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%r13), %rdx
movq %rdx, 0x10(%rax,%rcx,8)
movups (%r13), %xmm0
movups %xmm0, (%rax,%rcx,8)
movl 0xc(%rsp), %ecx
incq %rbx
movslq (%rbp), %rax
addq $0x18, %r15
cmpq %rax, %rbx
jl 0x1ac9f
movl %r14d, (%rbp)
movq 0x28(%rsp), %rax
incq %rax
cmpq 0x20(%rsp), %rax
jne 0x1ac72
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/./kstring.h
// Function: kputl
static inline int kputl(long c, kstring_t *s)
{
	char buf[32];
	long l, x;
	if (c == 0) return kputc('0', s);
	for (l = 0, x = c < 0? -c : c; x > 0; x /= 10) buf[l++] = x%10 + '0';
	if (c < 0) buf[l++] = '-';
	if (s->l + l + 1 >= s->m) {
		s->m = s->l + l + 2;
		kroundup32(s->m);
		s->s = (char*)realloc(s->s, s->m);
	}
	for (x = l - 1; x >= 0; --x) s->s[s->l++] = buf[x];
	s->s[s->l] = 0;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
testq %rdi, %rdi
je 0x1e37d
movq %rdi, %rcx
negq %rcx
cmovsq %rdi, %rcx
xorl %r14d, %r14d
movabsq $-0x3333333333333333, %rsi # imm = 0xCCCCCCCCCCCCCCCD
movq %rcx, %rax
mulq %rsi
shrq $0x3, %rdx
leal (%rdx,%rdx), %eax
leal (%rax,%rax,4), %eax
movl %ecx, %r8d
subl %eax, %r8d
orb $0x30, %r8b
movb %r8b, (%rsp,%r14)
incq %r14
cmpq $0x9, %rcx
movq %rdx, %rcx
ja 0x1e2bb
testq %rdi, %rdi
jns 0x1e2f2
movb $0x2d, (%rsp,%r14)
incq %r14
movq (%rbx), %rax
addq %r14, %rax
incq %rax
cmpq 0x8(%rbx), %rax
jb 0x1e359
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
leaq 0xa498(%rip), %rdx      # 0x287dc
leaq 0xaeac(%rip), %r8       # 0x291f7
movl $0x6a, %ecx
callq 0x2324c
movq %rax, 0x10(%rbx)
incq %r14
movb -0x2(%rsp,%r14), %al
movq (%rbx), %rcx
movq 0x10(%rbx), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%rbx)
movb %al, (%rdx,%rcx)
decq %r14
cmpq $0x1, %r14
jg 0x1e35c
jmp 0x1e3f6
movq (%rbx), %rdx
leaq 0x1(%rdx), %rcx
cmpq 0x8(%rbx), %rcx
jae 0x1e390
movq 0x10(%rbx), %rax
jmp 0x1e3ef
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
leaq 0xa409(%rip), %rdx      # 0x287dc
leaq 0xa414(%rip), %r8       # 0x287ee
movl $0x37, %ecx
callq 0x2324c
movq %rax, 0x10(%rbx)
movq (%rbx), %rdx
leaq 0x1(%rdx), %rcx
movq %rcx, (%rbx)
movb $0x30, (%rax,%rdx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwamem.c
// Function: worker2
static void worker2(void *data, int i, int tid)
{
	extern int mem_sam_pe(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, const mem_pestat_t pes[4], uint64_t id, bseq1_t s[2], mem_alnreg_v a[2]);
	extern void mem_reg2ovlp(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, bseq1_t *s, mem_alnreg_v *a);
	worker_t *w = (worker_t*)data;
	if (!(w->opt->flag&MEM_F_PE)) {
		if (bwa_verbose >= 4) printf("=====> Finalizing read '%s' <=====\n", w->seqs[i].name);
		if (w->opt->flag & MEM_F_ALN_REG) {
			mem_reg2ovlp(w->opt, w->bns, w->pac, &w->seqs[i], &w->regs[i]);
		} else {
			mem_mark_primary_se(w->opt, w->regs[i].n, w->regs[i].a, w->n_processed + i);
			mem_reg2sam(w->opt, w->bns, w->pac, &w->seqs[i], &w->regs[i], 0, 0);
		}

		//free(w->regs[i].a);
	} else {
		if (bwa_verbose >= 4) printf("=====> Finalizing read pair '%s' <=====\n", w->seqs[i<<1|0].name);
		mem_sam_pe(w->opt, w->bns, w->pac, w->pes, (w->n_processed>>1) + i, &w->seqs[i<<1], &w->regs[i<<1]);
		free(w->regs[i<<1|0].a); free(w->regs[i<<1|1].a);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movq (%rdi), %rdi
movl 0x48(%rdi), %eax
leaq 0x117e0(%rip), %rcx     # 0x30e40
movl (%rcx), %ecx
testb $0x2, %al
jne 0x1f6fb
cmpl $0x4, %ecx
jl 0x1f697
movq 0x30(%rbx), %rax
movslq %r14d, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movq 0x8(%rax,%rcx), %rsi
leaq 0x9be3(%rip), %rdi      # 0x2926d
xorl %eax, %eax
callq 0x3060
movq (%rbx), %rdi
movl 0x48(%rdi), %eax
testb %al, %al
js 0x1f72b
movq 0x38(%rbx), %rax
movslq %r14d, %r15
movq %r15, %r14
shlq $0x5, %r14
movl (%rax,%r14), %esi
movq 0x18(%rax,%r14), %rdx
movq 0x40(%rbx), %rcx
addq %r15, %rcx
callq 0x1a5f5
movq (%rbx), %rdi
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
leaq (%r15,%r15,2), %rcx
shlq $0x4, %rcx
addq 0x30(%rbx), %rcx
addq 0x38(%rbx), %r14
movq $0x0, (%rsp)
movq %r14, %r8
xorl %r9d, %r9d
callq 0x1e5f9
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3, %ecx
jle 0x1f759
movq 0x30(%rbx), %rax
leal (%r14,%r14), %ebp
movslq %ebp, %r15
leaq (%r15,%r15,2), %rcx
shlq $0x4, %rcx
movq 0x8(%rax,%rcx), %rsi
leaq 0x9b72(%rip), %rdi      # 0x29291
xorl %eax, %eax
callq 0x3060
movq (%rbx), %rdi
jmp 0x1f760
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
movslq %r14d, %r8
leaq (%r8,%r8,2), %rcx
shlq $0x4, %rcx
addq 0x30(%rbx), %rcx
shlq $0x5, %r8
addq 0x38(%rbx), %r8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x21eab
leal (%r14,%r14), %ebp
movslq %ebp, %r15
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
movq 0x20(%rbx), %rcx
movq 0x40(%rbx), %rax
sarq %rax
movslq %r14d, %r8
leaq (%r15,%r15,2), %r9
shlq $0x4, %r9
addq 0x30(%rbx), %r9
addq %rax, %r8
shlq $0x5, %r15
movq 0x38(%rbx), %rax
addq %r15, %rax
movq %rax, (%rsp)
callq 0x20d6c
movq 0x38(%rbx), %rax
movq 0x18(%rax,%r15), %rdi
callq 0x3390
movq 0x38(%rbx), %rax
orl $0x1, %ebp
movslq %ebp, %rcx
shlq $0x5, %rcx
movq 0x18(%rax,%rcx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3390
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwamem_pair.c
// Function: cal_sub
static int cal_sub(const mem_opt_t *opt, mem_alnreg_v *r)
{
	int j;
	for (j = 1; j < r->n; ++j) { // choose unique alignment
		int b_max = r->a[j].qb > r->a[0].qb? r->a[j].qb : r->a[0].qb;
		int e_min = r->a[j].qe < r->a[0].qe? r->a[j].qe : r->a[0].qe;
		if (e_min > b_max) { // have overlap
			int min_l = r->a[j].qe - r->a[j].qb < r->a[0].qe - r->a[0].qb? r->a[j].qe - r->a[j].qb : r->a[0].qe - r->a[0].qb;
			if (e_min - b_max >= min_l * opt->mask_level) break; // significant overlap
		}
	}
	return j < r->n? r->a[j].score : opt->min_seed_len * opt->a;
}

// Assembly:
pushq %rbx
movq (%rsi), %rax
cmpq $0x2, %rax
jb 0x2009d
movq 0x18(%rsi), %rcx
movl 0x10(%rcx), %edx
movl 0x14(%rcx), %esi
movl %esi, %r8d
subl %edx, %r8d
addq $0x7c, %rcx
decq %rax
movl -0xc(%rcx), %r10d
movl -0x8(%rcx), %r9d
cmpl %edx, %r10d
movl %edx, %ebx
cmovgl %r10d, %ebx
cmpl %esi, %r9d
movl %esi, %r11d
cmovll %r9d, %r11d
subl %ebx, %r11d
jle 0x20094
subl %r10d, %r9d
cmpl %r8d, %r9d
cmovgel %r8d, %r9d
xorps %xmm0, %xmm0
cvtsi2ss %r11d, %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %r9d, %xmm1
mulss 0x9c(%rdi), %xmm1
ucomiss %xmm1, %xmm0
jae 0x200a5
addq $0x60, %rcx
decq %rax
jne 0x2004d
movl (%rdi), %eax
imull 0x78(%rdi), %eax
popq %rbx
retq
movl (%rcx), %eax
jmp 0x200a3