LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/ToniWestbrook[P]paladin/bwt.c
// Function: fread_fix
static bwtint_t fread_fix(FILE *fp, bwtint_t size, void *a)
{ // Mac/Darwin has a bug when reading data longer than 2GB. This function fixes this issue by reading data in small chunks
	const int bufsize = 0x1000000; // 16M block
	bwtint_t offset = 0;
	while (size) {
		int x = bufsize < size? bufsize : size;
		if ((x = err_fread_noeof(a + offset, 1, x, fp)) == 0) break;
		size -= x; offset += x;
	}
	return offset;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
movl $0x1000000, %r13d       # imm = 0x1000000
testq %r14, %r14
je 0xff3d
cmpq %r13, %r14
movl $0x1000000, %edx        # imm = 0x1000000
cmovbq %r14, %rdx
leaq (%rbx,%r12), %rdi
movl $0x1, %esi
movq %r15, %rcx
callq 0xe127
movl %eax, %ecx
testq %rcx, %rcx
cltq
cmoveq %rcx, %rax
subq %rax, %r14
addq %rax, %r12
testq %rcx, %rcx
jne 0xff05
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x18204(%rip), %r12     # 0x2815d
leaq 0x18294(%rip), %r15     # 0x281f4
movl $0x1, %edi
movl $0x140, %esi            # imm = 0x140
movq %r12, %rdx
movl $0x1f5, %ecx            # imm = 0x1F5
movq %r15, %r8
callq 0x22cb4
movq %rax, %rbx
leaq 0x18a24(%rip), %rdx     # 0x289a8
movq %r15, %rdi
movq %r14, %rsi
callq 0xdd8e
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0xe1c3
movq %r14, %rdi
callq 0xe1ec
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 0x22cb4
movq %rax, 0x120(%rbx)
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xe1c3
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rcx
callq 0xe127
leaq 0x10(%rbx), %rdi
movl $0x8, %esi
movl $0x20, %edx
movq %r14, %rcx
callq 0xe127
movq 0x118(%rbx), %rsi
movq 0x120(%rbx), %rdx
shlq $0x2, %rsi
movq %r14, %rdi
callq 0xfeea
movq 0x108(%rbx), %rax
movq %rax, 0x110(%rbx)
movq %r14, %rdi
callq 0xe490
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x10bfe
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
je 0x10ba7
callq 0xe490
movq 0x20(%rbx), %rdi
callq 0x3390
cmpl $0x0, 0x8(%rbx)
jle 0x10be8
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 0x10bbc
movq 0x10(%rbx), %rdi
callq 0x3390
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3390
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x17d0d(%rip), %rdx     # 0x28e33
callq 0x3090
xorl %r14d, %r14d
testl %eax, %eax
js 0x11157
movl $0x1, %r12d
leaq 0x17cf4(%rip), %r15     # 0x28e33
cmpl $0x66, %eax
cmovel %r12d, %r14d
movl %ebp, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x3090
testl %eax, %eax
jns 0x1113f
movq 0x1ee7a(%rip), %r12     # 0x2ffd8
movslq (%r12), %rax
cmpl %ebp, %eax
je 0x111b0
movq (%rbx,%rax,8), %rsi
leaq 0x171be(%rip), %rdi     # 0x2832f
leaq 0x15ca6(%rip), %rdx     # 0x26e1e
callq 0xdf35
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 0x10e8d
movq %r15, %rdi
callq 0xe4b9
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x4310
movl $0x1, %eax
jmp 0x111a7
// File: /workspace/github_c_makefile_star2_O1/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 0x11208
movl 0x8(%rdi), %r8d
testl %r8d, %r8d
jle 0x11209
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 0x11200
cmpl %ecx, %eax
je 0x11208
leal 0x1(%rax), %edi
leaq (%rdi,%rdi,4), %r10
movl %r8d, %r9d
cmpq %rsi, (%rdx,%r10,8)
jg 0x11208
movl %r9d, %r8d
cmpl %r9d, %edi
jl 0x111d9
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1127b
movq %rsi, %r15
cmpq %r14, %rsi
jg 0x11284
movq %rdi, %rbx
cmpq %r15, %r12
movq %r15, %rax
notq %rax
leaq (%rax,%r12,2), %rsi
cmovgq %r15, %rsi
callq 0x111bc
movl %eax, %ebp
cmpq %r14, %r15
jge 0x11271
leaq (%r12,%r12), %rsi
leaq -0x1(%r14), %rax
subq %r14, %rsi
cmpq %r14, %r12
cmovgeq %rax, %rsi
movq %rbx, %rdi
callq 0x111bc
cmpl %eax, %ebp
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovel %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x170af(%rip), %rdi     # 0x2833a
leaq 0x16fbe(%rip), %rsi     # 0x28250
leaq 0x170aa(%rip), %rcx     # 0x28343
movl $0x1b3, %edx            # imm = 0x1B3
callq 0x31a0
// File: /workspace/github_c_makefile_star2_O1/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 0x112ca
movq %rcx, %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0x111bc
movl %eax, (%r12)
movl 0x18(%r15), %esi
testl %esi, %esi
jle 0x1130f
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 0x11303
cmpq %r10, %rax
jle 0x11309
jmp 0x1131f
incl %edi
movl %edi, %edx
movl %esi, %edi
movl %edi, %esi
cmpl %edi, %edx
jl 0x112de
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
cmpq %r10, %r14
jge 0x11336
subl %r10d, %r14d
addl %ebx, %r14d
cmpq %rax, %r8
cmovll %r9d, %r14d
movl %r14d, %ebx
jmp 0x11311
movl %r8d, %ecx
subl %r14d, %ecx
cmpq %rax, %r8
cmovll %ecx, %ebx
jmp 0x11311
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpq %rdx, %rcx
movq %rdx, %r15
cmovgq %rcx, %r15
cmovlq %rcx, %rdx
leaq (%rdi,%rdi), %r12
cmpq %r12, %r15
cmovgeq %r12, %r15
xorl %r13d, %r13d
testq %rdx, %rdx
cmovgq %rdx, %r13
cmpq %rdi, %r13
setl %al
cmpq %rdi, %r15
setg %cl
testb %cl, %al
je 0x11393
movq $0x0, (%r8)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rsi, %rbx
movq %rdi, %r14
movq %r15, %rdi
subq %r13, %rdi
movq %rdi, (%r8)
leaq 0x16ea7(%rip), %rsi     # 0x28250
leaq 0x16fc8(%rip), %rcx     # 0x28378
movl $0x1d9, %edx            # imm = 0x1D9
callq 0x22d2b
cmpq %r14, %r13
jge 0x113d9
subq %r13, %r15
jle 0x11389
addq %r13, %rbx
xorl %ecx, %ecx
movb (%rbx,%rcx), %dl
movb %dl, (%rax,%rcx)
incq %rcx
cmpq %rcx, %r15
jne 0x113c9
jmp 0x11389
cmpq %r13, %r15
jle 0x11389
decq %r12
movq %r12, %rcx
subq %r15, %rcx
subq %r13, %r12
movq %rax, %rdx
movb $0x15, %sil
subb (%rbx,%r12), %sil
movb %sil, (%rdx)
decq %r12
incq %rdx
cmpq %rcx, %r12
jg 0x113ed
jmp 0x11389
// File: /workspace/github_c_makefile_star2_O1/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 0x11ec5
movl %ecx, %r10d
subl %r11d, %r10d
leal 0x1(%r10), %ecx
sarq $0x20, %r9
movb $-0x1, (%rdx,%r9)
incl %r8d
cmpl $0x15, %r8d
jne 0x11eb7
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_O1/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 0x15baf(%rip), %rsi     # 0x284d5
leaq 0x15c3c(%rip), %rcx     # 0x28569
movl $0xe1, %edx
callq 0x22d2b
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 0x1604b(%rip), %rsi     # 0x289a8
movq %rbx, %rdi
callq 0x3380
testq %rax, %rax
je 0x1297e
movq %rbx, %r15
addq %r14, %r15
movq %rax, %rdi
callq 0x32f0
movb $0x0, (%r15)
jmp 0x12988
movq %rbx, %rdi
callq 0x3390
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x12909
testq %rax, %rax
je 0x12a37
movq %rax, %rbx
movq %rax, %rdi
callq 0x3100
leaq 0x5(%rax), %rdi
leaq 0x15b1b(%rip), %rdx     # 0x284d5
leaq 0x15bbb(%rip), %r8      # 0x2857c
movl $0x1, %esi
movl $0xf7, %ecx
callq 0x22cb4
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 0xff47
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 0xfda8
movq %r15, %rdi
callq 0x3390
movq %rbx, %rdi
callq 0x3390
jmp 0x12a54
leaq 0x15b3e(%rip), %rdi     # 0x2857c
leaq 0x15b46(%rip), %rdx     # 0x2858b
xorl %r14d, %r14d
movl $0x1, %esi
xorl %eax, %eax
callq 0xdbeb
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x12909
testq %rax, %rax
je 0x12b2f
movq %rax, %rbx
movq %rax, %rdi
callq 0x3100
leaq 0x5(%rax), %rdi
leaq 0x15a44(%rip), %r15     # 0x284d5
leaq 0x15b15(%rip), %r13     # 0x285ad
movq %r15, %rsi
movl $0x10c, %edx            # imm = 0x10C
movq %r13, %rcx
callq 0x22d2b
movq %rax, %r14
leaq 0x12949(%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 0x22cb4
movq %rax, %r15
testb $0x1, %bpl
je 0x12aed
movq %r12, %rdi
callq 0x12991
movq %rax, (%r15)
testb $0x2, %bpl
je 0x12bd2
movq %r12, %rdi
callq 0x1069b
movq %rax, 0x8(%r15)
movslq 0x8(%rax), %rcx
testq %rcx, %rcx
jle 0x12b51
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 0x12b1c
jmp 0x12b53
leaq 0x15a77(%rip), %rdi     # 0x285ad
leaq 0x15a4e(%rip), %rdx     # 0x2858b
xorl %r15d, %r15d
movl $0x1, %esi
xorl %eax, %eax
callq 0xdbeb
jmp 0x12be2
xorl %ecx, %ecx
leaq 0x15a53(%rip), %rdi     # 0x285ad
leaq 0x15a61(%rip), %rdx     # 0x285c2
movl $0x3, %esi
xorl %eax, %eax
callq 0xdbeb
testb $0x4, %bpl
je 0x12bd2
movq 0x8(%r15), %rax
movq (%rax), %rdi
incq %rdi
leaq 0x15951(%rip), %rdx     # 0x284d5
leaq 0x15a22(%rip), %r8      # 0x285ad
movl $0x1, %esi
movl $0x11a, %ecx            # imm = 0x11A
callq 0x22cb4
movq %rax, 0x10(%r15)
movq 0x8(%r15), %rcx
movq (%rcx), %rdx
movq 0x28(%rcx), %rcx
incq %rdx
movl $0x1, %esi
movq %rax, %rdi
callq 0xe127
movq 0x8(%r15), %rax
movq 0x28(%rax), %rdi
callq 0xe490
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_O1/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 0x12c33
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x28(%rdi)
movq (%rdi), %rdi
je 0x12c34
callq 0x3390
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rdi
callq 0x3390
movq 0x8(%rbx), %rdi
callq 0x3390
cmpl $0x0, 0x18(%rbx)
jne 0x12c5a
movq 0x28(%rbx), %rdi
jmp 0x12c55
retq
testq %rdi, %rdi
je 0x12c3e
callq 0x1004d
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x12c4c
callq 0x10b8c
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x12c5a
callq 0x3390
movq %rbx, %rdi
popq %rbx
jmp 0x3390
// File: /workspace/github_c_makefile_star2_O1/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
xorl %ebp, %ebp
testq %rsi, %rsi
je 0x131ba
leaq 0x154a7(%rip), %rsi     # 0x2862a
movq %r14, %rdi
callq 0x3080
testq %rax, %rax
je 0x131ba
xorl %ebp, %ebp
leaq 0x15491(%rip), %r12     # 0x2862a
cmpq %r14, %rax
je 0x131a4
cmpb $0xa, -0x1(%rax)
jne 0x131a6
incl %ebp
addq $0x4, %rax
movq %rax, %rdi
movq %r12, %rsi
callq 0x3080
testq %rax, %rax
jne 0x13199
movl 0x8(%r15), %r8d
testl %ebp, %ebp
je 0x131f3
cmpl %r8d, %ebp
je 0x13231
cmpl $0x2, 0x1dc72(%rip)     # 0x30e40
jl 0x13231
movq 0x1cdf9(%rip), %rax     # 0x2ffd0
movq (%rax), %rdi
leaq 0x1545f(%rip), %rsi     # 0x28640
leaq 0x154ac(%rip), %rdx     # 0x28694
movl %ebp, %ecx
xorl %eax, %eax
callq 0x3500
jmp 0x13231
testl %r8d, %r8d
jle 0x13231
movl $0x18, %r13d
leaq 0x1542a(%rip), %r12     # 0x2862f
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 0xe2d2
incq %rbp
movslq 0x8(%r15), %rax
addq $0x28, %r13
cmpq %rax, %rbp
jl 0x13207
testq %r14, %r14
je 0x1324a
leaq 0x13d79(%rip), %rsi     # 0x26fb6
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xe2d2
movq 0x1dc1f(%rip), %rdx     # 0x30e70
testq %rdx, %rdx
je 0x13275
leaq 0x13d59(%rip), %rsi     # 0x26fb6
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe2d2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1dbed(%rip), %r14     # 0x30e80
xorl %ebx, %ebx
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x3140
leaq 0x153fb(%rip), %rsi     # 0x286a6
movl $0x3, %edx
movq %r15, %rdi
callq 0x3120
testl %eax, %eax
je 0x132e9
leaq 0x153f2(%rip), %rdx     # 0x286b5
leaq 0x153e0(%rip), %rdi     # 0x286aa
movl $0x1, %esi
xorl %eax, %eax
callq 0xdbeb
movq %rbx, %rdi
callq 0x3390
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x151e5(%rip), %rsi     # 0x284d5
leaq 0x153b3(%rip), %rcx     # 0x286aa
movq %r15, %rdi
movl $0x1ac, %edx            # imm = 0x1AC
callq 0x22d9d
movq %rax, %rbx
movq %rax, %rdi
callq 0x13382
leaq 0x153cc(%rip), %rsi     # 0x286e2
movq %rbx, %rdi
callq 0x3080
testq %rax, %rax
je 0x13353
xorl %ecx, %ecx
movl $0x601, %edx            # imm = 0x601
movzbl 0x4(%rax,%rcx), %esi
cmpl $0xa, %esi
ja 0x13339
btl %esi, %edx
jb 0x1333e
incq %rcx
jmp 0x1332a
cmpq $0xff, %rcx
jle 0x1335f
leaq 0x153b7(%rip), %rdx     # 0x28705
jmp 0x132c3
leaq 0x1538d(%rip), %rdx     # 0x286e7
jmp 0x132c3
xorl %ecx, %ecx
movl $0x601, %edx            # imm = 0x601
movzbl 0x4(%rax,%rcx), %esi
cmpl $0xa, %esi
ja 0x13379
btl %esi, %edx
jb 0x132e0
movb %sil, (%rcx,%r14)
incq %rcx
jmp 0x13366
// File: /workspace/github_c_makefile_star2_O1/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 0x133a2
testl %esi, %esi
je 0x133d6
movb %sil, (%rcx)
incq %rcx
incq %rdx
jmp 0x1338b
movzbl 0x1(%rdx), %edi
incq %rdx
cmpl $0x71, %edi
jg 0x133bd
cmpl $0x5c, %edi
je 0x133cc
cmpl $0x6e, %edi
jne 0x1339d
movb $0xa, %sil
jmp 0x13397
cmpl $0x72, %edi
je 0x133d1
movb $0x9, %sil
cmpl $0x74, %edi
je 0x13397
jmp 0x1339d
movb $0x5c, %sil
jmp 0x13397
movb $0xd, %sil
jmp 0x13397
movb $0x0, (%rcx)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1347a
movq %rdi, %r14
cmpb $0x40, (%rdi)
jne 0x1347a
testq %rbx, %rbx
je 0x1344e
movq %rbx, %rdi
callq 0x3100
movslq %eax, %r15
movq %r14, %rdi
callq 0x3100
leaq (%rax,%r15), %rsi
addq $0x2, %rsi
leaq 0x150b7(%rip), %rdx     # 0x284d5
leaq 0x15306(%rip), %r8      # 0x2872b
movq %rbx, %rdi
movl $0x1c7, %ecx            # imm = 0x1C7
callq 0x22d64
movq %rax, %rbx
movb $0xa, (%rax,%r15)
incl %r15d
movslq %r15d, %r15
leaq (%rax,%r15), %rdi
movq %r14, %rsi
callq 0x32c0
jmp 0x1346f
leaq 0x15080(%rip), %rsi     # 0x284d5
leaq 0x152cf(%rip), %rcx     # 0x2872b
movq %r14, %rdi
movl $0x1ca, %edx            # imm = 0x1CA
callq 0x22d9d
movq %rax, %rbx
xorl %r15d, %r15d
addq %rbx, %r15
movq %r15, %rdi
callq 0x13382
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x15344(%rip), %rdx     # 0x287d0
leaq 0x15346(%rip), %r8      # 0x287d9
movl $0x1, %edi
movl $0x2a8, %esi            # imm = 0x2A8
movl $0x35, %ecx
callq 0x22cb4
movq %rax, %rbx
movq 0x1caf7(%rip), %rax     # 0x2ffa8
movq (%rax), %rax
movq %rax, 0x38(%rbx)
movaps 0x152a1(%rip), %xmm0    # 0x28760
movups %xmm0, 0x40(%rbx)
movabsq $0x300000001, %rax      # imm = 0x300000001
movq %rax, (%rbx)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x10(%rbx)
movq %rax, 0x8(%rbx)
movl $0x64, 0x28(%rbx)
movq $0x11, 0x18(%rbx)
movabsq $0x6400000000, %rax     # imm = 0x6400000000
movq %rax, 0x20(%rbx)
movq $0x14, 0x30(%rbx)
movq $0xfa, 0x68(%rbx)
movl $0xb, 0x78(%rbx)
movabsq $0x1f40000000a, %rax    # imm = 0x1F40000000A
movq %rax, 0x88(%rbx)
movl $0x2710, %eax           # imm = 0x2710
movl %eax, 0x90(%rbx)
movl %eax, 0xb4(%rbx)
movabsq $0x3f0000003f000000, %rax # imm = 0x3F0000003F000000
movq %rax, 0x9c(%rbx)
movl $0x3f4ccccd, 0xa4(%rbx) # imm = 0x3F4CCCCD
movl $0x3fc00000, 0x84(%rbx) # imm = 0x3FC00000
movl $0x989680, 0x98(%rbx)   # imm = 0x989680
movl $0x1, 0x94(%rbx)
movabsq $0xc800000005, %rax     # imm = 0xC800000005
movq %rax, 0xbc(%rbx)
movl $0x32, 0xb8(%rbx)
movl $0x3f733333, 0xa8(%rbx) # imm = 0x3F733333
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq %rax, 0x7c(%rbx)
movabsq $0x342480000, %rax      # imm = 0x342480000
movq %rax, 0xac(%rbx)
leaq 0xc4(%rbx), %rdx
movl $0x1, %edi
movl $0x3, %esi
callq 0x11ea5
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x136bb
movl %esi, %r14d
decl %r14d
xorl %r13d, %r13d
xorl %r15d, %r15d
movl $0x0, (%rsp)
xorl %r12d, %r12d
testl %ebp, %ebp
je 0x1361d
movq 0x38(%rbx), %rax
movq %r13, %rcx
shlq $0x5, %rcx
movl $0x1, 0x10(%rax,%rcx)
jmp 0x136ac
movq 0x30(%rbx), %rax
leaq (,%r13,2), %rcx
addq %r13, %rcx
shlq $0x4, %rcx
movq 0x8(%rax,%rcx), %rdi
leaq 0x151aa(%rip), %rsi     # 0x287e6
leaq 0x4(%rsp), %rdx
xorl %eax, %eax
callq 0x32e0
movl (%rsp), %eax
cmpl %eax, 0x4(%rsp)
je 0x13671
movq 0x38(%rbx), %rax
movslq %r12d, %rcx
shlq $0x5, %rcx
movl $0x1, 0x10(%rax,%rcx)
movl 0x4(%rsp), %eax
movl %eax, (%rsp)
xorl %r15d, %r15d
movl %r13d, %r12d
movq 0x38(%rbx), %rax
movq %r13, %rdx
shlq $0x5, %rdx
movq (%rax,%rdx), %rcx
testq %rcx, %rcx
je 0x1369f
addq %rdx, %rax
movq 0x18(%rax), %rdx
addq $0x1c, %rdx
xorl %eax, %eax
addl (%rdx), %eax
addq $0x60, %rdx
decq %rcx
jne 0x13692
jmp 0x136a1
xorl %eax, %eax
cmpl %r15d, %eax
cmovgl %r13d, %r12d
cmovgl %eax, %r15d
incq %r13
cmpq %r14, %r13
jne 0x13601
movslq %r12d, %rax
testl %ebp, %ebp
jne 0x136cf
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_O1/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 0x13753
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpl %r9d, %edi
jl 0x13752
addq %rsi, %r8
cmpl $0x3fffffff, 0x48(%r8)  # imm = 0x3FFFFFFF
ja 0x13752
cmpl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
je 0x1374d
cvtsi2ss %edi, %xmm0
leaq (%rdx,%rdx,2), %rdx
shlq $0x5, %rdx
cvtsi2ssl 0x1c(%rsi,%rdx), %xmm1
mulss 0xa0(%rcx), %xmm1
ucomiss %xmm0, %xmm1
ja 0x13752
movl $0x1, %eax
retq
xorl %eax, %eax
cmpl %r9d, %edi
setl %al
negl %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbx
movslq (%rdi), %rdx
xorl %ecx, %ecx
movl $0x0, %eax
testq %rdx, %rdx
jle 0x14325
movq 0x20(%rdi), %rsi
leaq (,%rdx,8), %rax
leaq (%rax,%rax,2), %r8
xorl %r9d, %r9d
xorl %r10d, %r10d
xorl %eax, %eax
movslq 0x8(%rsi,%r9), %r11
movslq 0xc(%rsi,%r9), %rbx
cmpq %r11, %r10
jle 0x14309
addq %r11, %rbx
cmpq %rbx, %r10
jge 0x1430d
subl %r10d, %eax
addl %ebx, %eax
jmp 0x1430d
addl %eax, %ebx
movl %ebx, %eax
movslq 0xc(%rsi,%r9), %rbx
addq %r11, %rbx
cmpq %rbx, %r10
cmovleq %rbx, %r10
addq $0x18, %r9
cmpq %r9, %r8
jne 0x142eb
testl %edx, %edx
jle 0x14378
movq 0x20(%rdi), %rsi
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rdx
xorl %edi, %edi
xorl %r8d, %r8d
xorl %ecx, %ecx
movq (%rsi,%rdi), %r9
movslq 0xc(%rsi,%rdi), %r10
cmpq %r8, %r9
jge 0x1435a
addq %r9, %r10
cmpq %r8, %r10
jle 0x14360
subl %r8d, %r10d
addl %r10d, %ecx
jmp 0x14360
addl %ecx, %r10d
movl %r10d, %ecx
movslq 0xc(%rsi,%rdi), %r10
addq %r10, %r9
cmpq %r9, %r8
cmovleq %r9, %r8
addq $0x18, %rdi
cmpq %rdi, %rdx
jne 0x1433c
cmpl %eax, %ecx
cmovll %ecx, %eax
movl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
cmpl %ecx, %eax
cmovgel %ecx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x144b8
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
leaq 0x1449a(%rip), %r12     # 0x28845
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 0x142c3
leaq 0x14451(%rip), %rdi     # 0x28822
movq %rbx, 0x10(%rsp)
movl %ebx, %esi
movl %r15d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0xe215
cmpl $0x0, (%rbp)
jle 0x14480
movl $0x10, %r15d
xorl %r13d, %r13d
movq 0x20(%rbp), %rax
movq -0x10(%rax,%r15), %r8
movq (%r14), %rcx
movq %r8, %rdx
notq %rdx
leaq (%rdx,%rcx,2), %r10
cmpq %r8, %rcx
cmovgq %r8, %r10
jg 0x14421
movslq -0x4(%rax,%r15), %rdx
subq %rdx, %r10
incq %r10
xorl %edi, %edi
cmpq %r8, %rcx
setle %dil
movl (%rax,%r15), %esi
movl -0x8(%rax,%r15), %ecx
movl -0x4(%rax,%r15), %edx
movq 0x10(%r14), %rax
movslq 0xc(%rbp), %r9
leaq (%r9,%r9,4), %r11
movq 0x18(%rax,%r11,8), %r9
leaq 0x1440d(%rip), %rbx     # 0x2885d
movsbl (%rdi,%rbx), %ebx
subq (%rax,%r11,8), %r10
incq %r10
movq %r12, %rdi
xorl %eax, %eax
pushq %r10
pushq %rbx
callq 0xe215
addq $0x10, %rsp
incq %r13
movslq (%rbp), %rax
addq $0x18, %r15
cmpq %rax, %r13
jl 0x143f7
movq 0x1bb21(%rip), %rax     # 0x2ffa8
movq (%rax), %rsi
movl $0xa, %edi
callq 0xe37b
movq 0x10(%rsp), %rbx
incq %rbx
movq 0x8(%rsp), %rsi
cmpq %rbx, (%rsi)
ja 0x143b2
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ToniWestbrook[P]paladin/bwamem.c
// Function: smem_aux_destroy
static void smem_aux_destroy(smem_aux_t *a)
{	
	free(a->tmpv[0]->a); free(a->tmpv[0]);
	free(a->tmpv[1]->a); free(a->tmpv[1]);
	free(a->mem.a); free(a->mem1.a);
	free(a);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rax
movq 0x10(%rax), %rdi
callq 0x3390
movq 0x30(%rbx), %rdi
callq 0x3390
movq 0x38(%rbx), %rax
movq 0x10(%rax), %rdi
callq 0x3390
movq 0x38(%rbx), %rdi
callq 0x3390
movq 0x10(%rbx), %rdi
callq 0x3390
movq 0x28(%rbx), %rdi
callq 0x3390
movq %rbx, %rdi
popq %rbx
jmp 0x3390
// File: /workspace/github_c_makefile_star2_O1/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 %rdi, %r14
movslq 0xc(%r9), %rdi
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
cmpq $0xc7, %rdi
jg 0x1a63e
movq %r8, %rbx
movl %ecx, %ebp
movq (%rsi), %rax
movl 0x8(%r9), %r8d
movq (%r9), %r9
leaq (%r9,%rdi), %rcx
addq %r9, %rcx
sarq %rcx
cmpl $0x33, %r8d
movl $0x32, %r13d
cmovgel %r8d, %r13d
addl $-0x32, %r13d
addl %edi, %r8d
addl $0x32, %r8d
cmpl %ebp, %r8d
cmovll %r8d, %ebp
cmpq $0x33, %r9
movl $0x32, %r8d
cmovgeq %r9, %r8
addq $-0x32, %r8
movq %r8, 0x8(%rsp)
addq %rdi, %r9
addq $0x32, %r9
leaq (%rax,%rax), %rdi
cmpq %rdi, %r9
cmovlq %r9, %rdi
movq %rdi, 0x10(%rsp)
cmpq %rax, %r8
jge 0x1a591
cmpq %rdi, %rax
jge 0x1a591
cmpq %rax, %rcx
jge 0x1a58c
movq %rax, 0x10(%rsp)
jmp 0x1a591
movq %rax, 0x8(%rsp)
subl %r13d, %ebp
cmpl $0xc7, %ebp
jg 0x1a63e
movq 0x10(%rsp), %rax
subq 0x8(%rsp), %rax
cmpq $0xc7, %rax
jg 0x1a63e
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 0x11404
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 0x239fc
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_O1/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 0x1a692
cvtsi2ss %eax, %xmm0
mulss 0xe13c(%rip), %xmm0     # 0x287c8
cvtss2sd %xmm0, %xmm0
jmp 0x1a6a7
cvtsi2sd %ecx, %xmm0
callq 0x3250
movl 0xc(%rsp), %ecx
mulsd 0xe0f1(%rip), %xmm0     # 0x28798
cvtsi2ss %ecx, %xmm1
mulss 0xe119(%rip), %xmm1     # 0x287cc
cvtss2sd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
seta %al
testl %r13d, %r13d
setle %dl
orb %al, %dl
jne 0x1a7b7
movq 0x10(%rsp), %rax
xorps %xmm1, %xmm1
cvtsi2sdl (%rax), %xmm1
mulsd %xmm0, %xmm1
addsd 0xb0bc(%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 0x1a7a0
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 0x1a4e7
movl %eax, 0x10(%r12,%r15)
testl %eax, %eax
js 0x1a756
cmpl 0x1c(%rsp), %eax
jl 0x1a78c
testl %eax, %eax
jns 0x1a767
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 0x1a723
movl %r14d, (%rbp)
movq 0x28(%rsp), %rax
incq %rax
cmpq 0x20(%rsp), %rax
jne 0x1a6f6
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1dc96
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 0x1dbd4
testq %rdi, %rdi
jns 0x1dc0b
movb $0x2d, (%rsp,%r14)
incq %r14
movq (%rbx), %rax
addq %r14, %rax
incq %rax
cmpq 0x8(%rbx), %rax
jb 0x1dc72
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 0xaaeb(%rip), %rdx      # 0x28748
leaq 0xb4a3(%rip), %r8       # 0x29107
movl $0x6a, %ecx
callq 0x22d64
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 0x1dc75
jmp 0x1dd0c
movq (%rbx), %rax
incq %rax
cmpq 0x8(%rbx), %rax
jb 0x1dcfa
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 0xaa63(%rip), %rdx      # 0x28748
leaq 0xaa6e(%rip), %r8       # 0x2875a
movl $0x37, %ecx
callq 0x22d64
movq %rax, 0x10(%rbx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rbx)
movb $0x30, (%rcx,%rax)
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_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %r14d
movq %rdi, %rbx
movq (%rdi), %rax
testb $0x2, 0x48(%rax)
leaq 0x11ecc(%rip), %rax     # 0x30e40
movl (%rax), %eax
jne 0x1f00b
cmpl $0x4, %eax
jl 0x1efa3
movq 0x30(%rbx), %rax
movslq %r14d, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movq 0x8(%rax,%rcx), %rsi
leaq 0xa1e1(%rip), %rdi      # 0x2917d
xorl %eax, %eax
callq 0x3060
movq (%rbx), %rdi
testb $-0x80, 0x48(%rdi)
jne 0x1f0ad
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 0x1a040
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 0x1df0b
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
cmpl $0x4, %eax
jl 0x1f036
movq 0x30(%rbx), %rax
leal (%r14,%r14), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movq 0x8(%rax,%rcx), %rsi
leaq 0xa172(%rip), %rdi      # 0x291a1
xorl %eax, %eax
callq 0x3060
movq (%rbx), %rdi
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
movq 0x20(%rbx), %rcx
movq 0x40(%rbx), %rax
sarq %rax
movslq %r14d, %r8
leal (%r14,%r14), %r9d
movslq %r9d, %r15
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 0x20883
movq 0x38(%rbx), %rax
movq 0x18(%rax,%r15), %rdi
callq 0x3390
movq 0x38(%rbx), %rax
leal 0x1(,%r14,2), %ecx
movslq %ecx, %rcx
shlq $0x5, %rcx
movq 0x18(%rax,%rcx), %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x3390
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 $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x21995