LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/uniprot.c
// Function: renderUniprotEntries
void renderUniprotEntries(UniprotList * passList, int passType, FILE * passStream) {
	int entryIdx, occurTotal;
	float occurPercent, avgQuality;
    char commonFields[] = "%d\t%.5f\t%.5f\t%d\t%s\n";

	// Count total occurrences for percentages
	for (entryIdx = 0, occurTotal = 0 ; entryIdx < passList->entryCount ; entryIdx++) {
		occurTotal += passList->entries[entryIdx].numOccurrence;
	}

	// Render fields
	for (entryIdx = 0 ; entryIdx < passList->entryCount ; entryIdx++) {
		occurPercent = (float) passList->entries[entryIdx].numOccurrence / (float) occurTotal * 100;
		avgQuality = (float) passList->entries[entryIdx].totalQuality / (float) passList->entries[entryIdx].numOccurrence;

		switch(passType) {
		    case UNIPROT_LIST_FULL:
		    	fprintf(passStream, commonFields, passList->entries[entryIdx].numOccurrence, occurPercent, avgQuality, passList->entries[entryIdx].maxQuality,  passList->entries[entryIdx].id);
		    	break;
		    case UNIPROT_LIST_GENES:
			    fprintf(passStream, commonFields, passList->entries[entryIdx].numOccurrence, occurPercent, avgQuality, passList->entries[entryIdx].maxQuality, passList->entries[entryIdx].gene);
			    break;
		    case UNIPROT_LIST_ORGANISM:
			    fprintf(passStream, commonFields, passList->entries[entryIdx].numOccurrence, occurPercent, avgQuality, passList->entries[entryIdx].maxQuality, passList->entries[entryIdx].organism);
			    break;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movl 0x8(%rdi), %eax
xorl %ecx, %ecx
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
imulq $0x28, %rdx, %rdx
xorl %esi, %esi
cmpq %rcx, %rdx
je 0x97ba
movq (%r14), %rdi
addl 0x18(%rdi,%rcx), %esi
addq $0x28, %rcx
jmp 0x97a8
cvtsi2ss %esi, %xmm0
movss %xmm0, 0x4(%rsp)
pushq $0x20
popq %r12
xorl %r13d, %r13d
leaq 0x1913e(%rip), %r15     # 0x22910
cltq
cmpq %rax, %r13
jge 0x984d
movq (%r14), %rax
movl -0x8(%rax,%r12), %edx
cvtsi2ss %edx, %xmm0
cvtsi2ssl -0x4(%rax,%r12), %xmm1
divss %xmm0, %xmm1
divss 0x4(%rsp), %xmm0
mulss 0x18a82(%rip), %xmm0    # 0x22280
cvtss2sd %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
cmpl $0x2, %ebp
je 0x982a
cmpl $0x1, %ebp
je 0x981f
testl %ebp, %ebp
jne 0x9840
movl (%rax,%r12), %ecx
movq -0x20(%rax,%r12), %r8
jmp 0x9833
movl (%rax,%r12), %ecx
movq -0x18(%rax,%r12), %r8
jmp 0x9833
movl (%rax,%r12), %ecx
movq -0x10(%rax,%r12), %r8
movq %rbx, %rdi
movq %r15, %rsi
movb $0x2, %al
callq 0x3500
incq %r13
movl 0x8(%r14), %eax
addq $0x28, %r12
jmp 0x97d2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/uniprot.c
// Function: cleanUniprotLists
void cleanUniprotLists(UniprotList * passLists, int passPrimary) {
	UniprotList * globalLists;
	int listIdx, entryIdx;

	globalLists = getGlobalLists(passPrimary);

	// Global list 0 contains pointers to all allocated strings, so delete from there. Do not repeat with other lists
	for (entryIdx = 0 ; entryIdx < globalLists[0].entryCount ; entryIdx++) {
		free(globalLists[0].entries[entryIdx].id);
		free(globalLists[0].entries[entryIdx].gene);
		free(globalLists[0].entries[entryIdx].organism);
	}

	free(globalLists[0].entries);
	free(globalLists);

	// Free local lists
	for (listIdx = 0 ; listIdx < 3 ; listIdx++) {
		free(passLists[listIdx].entries);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testl %esi, %esi
leaq 0x235eb(%rip), %rax     # 0x2ce60
leaq 0x235dc(%rip), %rcx     # 0x2ce58
cmoveq %rax, %rcx
movq %rdi, %rbx
movq (%rcx), %r14
xorl %r15d, %r15d
xorl %r12d, %r12d
movslq 0x8(%r14), %rax
movq (%r14), %rdi
cmpq %rax, %r12
jge 0x98c4
movq (%rdi,%r15), %rdi
callq 0x3390
movq (%r14), %rax
movq 0x8(%rax,%r15), %rdi
callq 0x3390
movq (%r14), %rax
movq 0x10(%rax,%r15), %rdi
callq 0x3390
incq %r12
addq $0x28, %r15
jmp 0x988c
callq 0x3390
movq %r14, %rdi
callq 0x3390
xorl %r14d, %r14d
cmpq $0x30, %r14
je 0x98e9
movq (%rbx,%r14), %rdi
callq 0x3390
addq $0x10, %r14
jmp 0x98d4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/uniprot.c
// Function: cleanUniprotReference
int cleanUniprotReference(int passReference, const char * passBase) {
	char * tempName;
	int indexed;
	IndexHeader newHeader;
	FILE * proHandle;

	logMessage(__func__, LOG_LEVEL_MESSAGE, "Cleaning UniProt reference...\n");

	// Check if reference has already been indexed
	tempName = malloc(strlen(passBase) + 5);
	sprintf(tempName, "%s.ann", passBase);
	indexed = (access(tempName, F_OK) != -1);

	// Begin reference-specific preparation
	switch (passReference) {
	case UNIPROT_REFERENCE_UNIREF90:
		cleanUniprotReferenceUniref(passBase, 0);
		if (indexed) cleanUniprotReferenceUniref(tempName, 1);
	}

	// If indexed, also fix protein header
	if (indexed) {
		sprintf(tempName, "%s.pro", passBase);
		proHandle = err_xopen_core(__func__, tempName, "w");

		newHeader.multiFrame = 1;
		newHeader.nucleotide = 0;
		newHeader.referenceType = passReference;
		writeIndexHeader(proHandle, newHeader);

		fclose(proHandle);
	}

	free(tempName);

	return indexed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r15
movl %edi, %ebx
leaq 0x18b83(%rip), %rdi     # 0x2248e
leaq 0x18b92(%rip), %rdx     # 0x224a4
pushq $0x3
popq %rsi
xorl %eax, %eax
callq 0xc78e
movq %r15, %rdi
callq 0x3100
leaq 0x5(%rax), %rdi
callq 0x3470
movq %rax, %r14
leaq 0x18b8c(%rip), %rsi     # 0x224c3
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3070
movq %r14, %rdi
xorl %esi, %esi
callq 0x3630
movl %eax, %ebp
cmpl $0x2, %ebx
jne 0x9971
movq %r15, %rdi
xorl %esi, %esi
callq 0x99f6
cmpl $-0x1, %ebp
je 0x99d9
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x99f6
jmp 0x9976
cmpl $-0x1, %ebp
je 0x99d9
leaq 0x16a7e(%rip), %rsi     # 0x203fb
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3070
leaq 0x18afd(%rip), %rdi     # 0x2248e
leaq 0x1ab47(%rip), %rdx     # 0x244df
movq %r14, %rsi
callq 0xc931
movq %rax, %r15
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x20(%rsp)
movl %ebx, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
callq 0x41e0
movq %r15, %rdi
callq 0x32f0
xorl %ebx, %ebx
cmpl $-0x1, %ebp
setne %bl
movq %r14, %rdi
callq 0x3390
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/uniprot.c
// Function: downloadUniprotReference
const char * downloadUniprotReference(int passReference, const char * passProxy) {
	CURL * curlHandle;
	CURLcode curlResult;
	FILE * fileHandle;
	const char * retFile;

	curlHandle = curl_easy_init();
	fileHandle = err_xopen_core(__func__, downloadNames[passReference], "w");
	retFile = downloadNames[passReference];

	curl_easy_setopt(curlHandle, CURLOPT_URL, downloadURLs[passReference]);
	curl_easy_setopt(curlHandle, CURLOPT_WRITEDATA, fileHandle);
    if (passProxy) curl_easy_setopt(curlHandle, CURLOPT_PROXY, passProxy);

	logMessage(__func__, LOG_LEVEL_MESSAGE, "Downloading %s...\n", downloadURLs[passReference]);
	curlResult = curl_easy_perform(curlHandle);

	if (curlResult != CURLE_OK) {
		logMessage(__func__, LOG_LEVEL_ERROR, "%s\n", curl_easy_strerror(curlResult));
		unlink(downloadNames[passReference]);
		retFile = "";
	}

	curl_easy_cleanup(curlHandle);
	fclose(fileHandle);

	return retFile;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movl %edi, %ebp
callq 0x3440
movq %rax, %rbx
movslq %ebp, %r13
leaq 0x22ec6(%rip), %r15     # 0x2cb00
movq (%r15,%r13,8), %rsi
leaq 0x188c0(%rip), %rdi     # 0x22505
leaq 0x1a893(%rip), %rdx     # 0x244df
callq 0xc931
movq %rax, %r14
movq (%r15,%r13,8), %r15
leaq 0x22ec1(%rip), %rbp     # 0x2cb20
movq (%rbp,%r13,8), %rdx
movq %rbx, %rdi
movl $0x2712, %esi           # imm = 0x2712
xorl %eax, %eax
callq 0x3350
movq %rbx, %rdi
movl $0x2711, %esi           # imm = 0x2711
movq %r14, %rdx
xorl %eax, %eax
callq 0x3350
testq %r12, %r12
je 0x9c9c
movq %rbx, %rdi
movl $0x2714, %esi           # imm = 0x2714
movq %r12, %rdx
xorl %eax, %eax
callq 0x3350
movq (%rbp,%r13,8), %rcx
leaq 0x1885d(%rip), %rdi     # 0x22505
leaq 0x1886f(%rip), %rdx     # 0x2251e
pushq $0x3
popq %rsi
xorl %eax, %eax
callq 0xc78e
movq %rbx, %rdi
callq 0x3460
testl %eax, %eax
je 0x9cfe
movl %eax, %edi
callq 0x3520
leaq 0x18832(%rip), %rdi     # 0x22505
leaq 0x182dc(%rip), %rdx     # 0x21fb6
pushq $0x1
popq %rsi
movq %rax, %rcx
xorl %eax, %eax
callq 0xc78e
leaq 0x22e12(%rip), %rax     # 0x2cb00
movq (%rax,%r13,8), %rdi
callq 0x3110
leaq 0x19960(%rip), %r15     # 0x2365e
movq %rbx, %rdi
callq 0x33f0
movq %r14, %rdi
callq 0x32f0
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_O2/ToniWestbrook[P]paladin/uniprot.c
// Function: initCURLBuffer
void initCURLBuffer(CURLBuffer * passBuffer, int passCapacity) {
	passBuffer->buffer = calloc(1, passCapacity);
	passBuffer->capacity = passCapacity;
	passBuffer->size = 0;
	passBuffer->buffer[0] = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq %esi, %r14
pushq $0x1
popq %rdi
movq %r14, %rsi
callq 0x31b0
movq %rax, (%rbx)
movl %r14d, 0xc(%rbx)
andl $0x0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/uniprot.c
// Function: receiveUniprotOutput
size_t receiveUniprotOutput(void * passString, size_t passSize, size_t passNum, void * retStream) {
	CURLBuffer * currentBuffer;

	currentBuffer = (CURLBuffer *) retStream;

	// Grow receive buffer if addition is greater than capacity
	if (currentBuffer->size + (int)(passSize * passNum) >= currentBuffer->capacity) {
		currentBuffer->buffer = realloc(currentBuffer->buffer, currentBuffer->capacity + UNIPROT_BUFFER_GROW);
		currentBuffer->capacity += UNIPROT_BUFFER_GROW;
	}

	// Concatenate results
	memcpy(currentBuffer->buffer + currentBuffer->size, passString, (int) (passSize * passNum));
	currentBuffer->size += (int) (passSize * passNum);
	currentBuffer->buffer[currentBuffer->size] = 0;

	return (size_t)(passSize * passNum);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0x8(%rcx), %ecx
imulq %rdx, %r14
leal (%rcx,%r14), %edx
movslq 0xc(%rbx), %rsi
movq (%rbx), %rax
cmpl %esi, %edx
jl 0x9d88
addq $0x2faf080, %rsi        # imm = 0x2FAF080
movq %rax, %rdi
callq 0x3610
movq %rax, (%rbx)
addl $0x2faf080, 0xc(%rbx)   # imm = 0x2FAF080
movl 0x8(%rbx), %ecx
movslq %ecx, %rdi
addq %rax, %rdi
movslq %r14d, %rdx
movq %r15, %rsi
callq 0x3260
movslq 0x8(%rbx), %rax
movslq %r14d, %rcx
addq %rax, %rcx
movl %ecx, 0x8(%rbx)
movq (%rbx), %rax
movb $0x0, (%rax,%rcx)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/uniprot.c
// Function: renderNumberAligned
void renderNumberAligned(const mem_opt_t * passOptions) {
	int listIdx, successTotal, alignTotal;

	// Primary alignments
	for (successTotal = 0, alignTotal = 0, listIdx = 0 ; listIdx < uniprotPriListCount ; listIdx++) {
		successTotal += uniprotPriEntryLists[listIdx].entryCount;
		alignTotal += uniprotPriEntryLists[listIdx].entryCount + uniprotPriEntryLists[listIdx].unalignedCount;
	}

	// Secondary alignments (if requested)
	if (passOptions->flag & MEM_F_ALL) {
		for (listIdx = 0 ; listIdx < uniprotSecListCount ; listIdx++) {
			successTotal += uniprotSecEntryLists[listIdx].entryCount;
			alignTotal += uniprotSecEntryLists[listIdx].entryCount;
		}
	}

	if (alignTotal == 0) {
		logMessage(__func__, LOG_LEVEL_MESSAGE, "No detected ORF sequences, no alignment performed\n");
	}
	else {
		logMessage(__func__, LOG_LEVEL_MESSAGE, "Aligned %d out of %d total detected ORF sequences (%.2f%%)\n", successTotal, alignTotal, (float) successTotal / (float) alignTotal * 100);
	}
}

// Assembly:
movl 0x230a1(%rip), %eax     # 0x2ce68
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
movq 0x23083(%rip), %rsi     # 0x2ce58
shlq $0x4, %rax
xorl %ecx, %ecx
xorl %r8d, %r8d
cmpq %rdx, %rax
je 0x9df9
movl 0x8(%rsi,%rdx), %r9d
addl %r9d, %ecx
addl %r9d, %r8d
addl 0xc(%rsi,%rdx), %r8d
addq $0x10, %rdx
jmp 0x9dde
testb $0x8, 0x48(%rdi)
jne 0x9e35
testl %r8d, %r8d
je 0x9e61
cvtsi2ss %ecx, %xmm0
cvtsi2ss %r8d, %xmm1
divss %xmm1, %xmm0
mulss 0x18467(%rip), %xmm0    # 0x22280
cvtss2sd %xmm0, %xmm0
leaq 0x189ee(%rip), %rdi     # 0x22812
leaq 0x18a2e(%rip), %rdx     # 0x22859
pushq $0x3
popq %rsi
movb $0x1, %al
jmp 0xc78e
movl 0x23031(%rip), %eax     # 0x2ce6c
movq 0x2301e(%rip), %rdx     # 0x2ce60
xorl %esi, %esi
testl %eax, %eax
cmovlel %esi, %eax
shlq $0x4, %rax
cmpq %rsi, %rax
je 0x9dff
movl 0x8(%rdx,%rsi), %edi
addl %edi, %ecx
addl %edi, %r8d
addq $0x10, %rsi
jmp 0x9e4d
leaq 0x189aa(%rip), %rdi     # 0x22812
leaq 0x189b7(%rip), %rdx     # 0x22826
pushq $0x3
popq %rsi
xorl %eax, %eax
jmp 0xc78e
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/bwashm.c
// Function: index_load_from_shm
bwaidx_t *index_load_from_shm(const char *hint)
{
	const char *name;
	uint8_t *shm, *shm_idx;
	uint16_t *cnt, i;
	char *p, path[PATH_MAX + 1];
	int shmid;
	int64_t l_mem;
	bwaidx_t *idx;

	if (hint == 0 || hint[0] == 0) return 0;
	for (name = hint + strlen(hint) - 1; name >= hint && *name != '/'; --name);
	++name;
	if ((shmid = shm_open("/bwactl", O_RDONLY, 0)) < 0) return 0;
	shm = mmap(0, BWA_CTL_SIZE, PROT_READ, MAP_SHARED, shmid, 0);
	cnt = (uint16_t*)shm;
	if (cnt[0] == 0) return 0;
	for (i = 0, p = (char*)(shm + 4); i < cnt[0]; ++i) {
		memcpy(&l_mem, p, 8); p += 8;
		if (strcmp(p, name) == 0) break;
		p += strlen(p) + 1;
	}
	if (i == cnt[0]) return 0;

	strcat(strcpy(path, "/bwaidx-"), name);
	if ((shmid = shm_open(path, O_RDONLY, 0)) < 0) return 0;
	shm_idx = mmap(0, l_mem, PROT_READ, MAP_SHARED, shmid, 0);
	idx = calloc(1, sizeof(bwaidx_t));
	bwa_mem2idx(l_mem, shm_idx, idx);
	idx->is_shm = 1;
	return idx;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
testq %rdi, %rdi
je 0xa929
movq %rdi, %rbx
cmpb $0x0, (%rdi)
je 0xa929
movq %rbx, %rdi
callq 0x3100
addq %rbx, %rax
decq %rax
movq %rax, %r14
cmpq %rbx, %rax
jb 0xa830
leaq -0x1(%r14), %rax
cmpb $0x2f, (%r14)
jne 0xa81e
leaq 0x180ed(%rip), %rdi     # 0x22924
xorl %ebx, %ebx
xorl %esi, %esi
xorl %edx, %edx
callq 0x3650
testl %eax, %eax
js 0xa92b
xorl %ebx, %ebx
pushq $0x1
popq %rcx
movl $0x10000, %esi          # imm = 0x10000
xorl %edi, %edi
movl %ecx, %edx
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x36c0
movzwl (%rax), %ebp
testw %bp, %bp
je 0xa92b
movq %rax, %r15
incq %r14
addq $0x4, %r15
xorl %ebx, %ebx
movl %ebp, %r13d
subw $0x1, %r13w
jb 0xa92b
leaq 0x8(%r15), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x34d0
testl %eax, %eax
je 0xa8b0
movq %r12, %rdi
callq 0x3100
leaq (%r12,%rax), %r15
incq %r15
movl %r13d, %ebp
jmp 0xa87e
testw %bp, %bp
je 0xa929
movq (%r15), %r15
movabsq $0x2d7864696177622f, %rax # imm = 0x2D7864696177622F
movq %rsp, %r12
movq %rax, (%r12)
movb $0x0, 0x8(%r12)
movq %r12, %rdi
movq %r14, %rsi
callq 0x36b0
xorl %ebx, %ebx
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3650
testl %eax, %eax
js 0xa92b
pushq $0x1
popq %rcx
xorl %edi, %edi
movq %r15, %rsi
movl %ecx, %edx
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x36c0
movq %rax, %r14
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x31b0
movq %rax, %rbx
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x11055
movl $0x1, 0x18(%rbx)
jmp 0xa92b
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/bwashm.c
// Function: bwa_shm_test
int bwa_shm_test(const char *hint)
{
	int shmid;
	uint16_t *cnt, i;
	char *p, *shm;
	const char *name;

	if (hint == 0 || hint[0] == 0) return 0;
	for (name = hint + strlen(hint) - 1; name >= hint && *name != '/'; --name);
	++name;
	if ((shmid = shm_open("/bwactl", O_RDONLY, 0)) < 0) return 0;
	shm = mmap(0, BWA_CTL_SIZE, PROT_READ, MAP_SHARED, shmid, 0);
	cnt = (uint16_t*)shm;
	for (i = 0, p = shm + 4; i < cnt[0]; ++i) {
		if (strcmp(p + 8, name) == 0) return 1;
		p += strlen(p) + 9;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %r14d, %r14d
testq %rdi, %rdi
je 0xa9eb
movq %rdi, %r15
cmpb $0x0, (%rdi)
je 0xa9eb
movq %r15, %rdi
callq 0x3100
addq %r15, %rax
decq %rax
movq %rax, %rbx
cmpq %r15, %rax
jb 0xa97f
leaq -0x1(%rbx), %rax
cmpb $0x2f, (%rbx)
jne 0xa96e
leaq 0x17f9e(%rip), %rdi     # 0x22924
xorl %r14d, %r14d
xorl %esi, %esi
xorl %edx, %edx
callq 0x3650
testl %eax, %eax
js 0xa9eb
incq %rbx
xorl %r14d, %r14d
pushq $0x1
popq %rbp
movl $0x10000, %esi          # imm = 0x10000
xorl %edi, %edi
movl %ebp, %edx
movl %ebp, %ecx
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x36c0
movq %rax, %r15
movzwl (%rax), %r12d
addq $0x4, %r15
subw $0x1, %r12w
jb 0xa9eb
leaq 0x8(%r15), %rdi
movq %rbx, %rsi
callq 0x34d0
testl %eax, %eax
je 0xa9e8
movq %r15, %rdi
callq 0x3100
addq %rax, %r15
addq $0x9, %r15
jmp 0xa9c0
movl %ebp, %r14d
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/bwashm.c
// Function: bwa_shm_list
int bwa_shm_list(void)
{
	int shmid;
	uint16_t *cnt, i;
	char *p, *shm;
	if ((shmid = shm_open("/bwactl", O_RDONLY, 0)) < 0) return -1;
	shm = mmap(0, BWA_CTL_SIZE, PROT_READ, MAP_SHARED, shmid, 0);
	cnt = (uint16_t*)shm;
	for (i = 0, p = shm + 4; i < cnt[0]; ++i) {
		int64_t l_mem;
		memcpy(&l_mem, p, 8); p += 8;
		printf("%s\t%ld\n", p, (long)l_mem);
		p += strlen(p) + 1;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x17f1b(%rip), %rdi     # 0x22924
xorl %esi, %esi
xorl %edx, %edx
callq 0x3650
testl %eax, %eax
js 0xaa70
xorl %ebx, %ebx
pushq $0x1
popq %rcx
movl $0x10000, %esi          # imm = 0x10000
xorl %edi, %edi
movl %ecx, %edx
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x36c0
movq %rax, %r14
movq %rax, %r13
addq $0x4, %r13
leaq 0x17f55(%rip), %r15     # 0x22995
xorl %ebp, %ebp
cmpw (%r14), %bp
jae 0xaa73
movq (%r13), %rdx
leaq 0x8(%r13), %r12
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x3060
movq %r12, %rdi
callq 0x3100
addq %rax, %r13
addq $0x9, %r13
incl %ebp
jmp 0xaa42
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/bwashm.c
// Function: bwa_shm_destroy
int bwa_shm_destroy(void)
{
	int shmid;
	uint16_t *cnt, i;
	char *p, *shm;
	char path[PATH_MAX + 1];

	if ((shmid = shm_open("/bwactl", O_RDONLY, 0)) < 0) return -1;
	shm = mmap(0, BWA_CTL_SIZE, PROT_READ, MAP_SHARED, shmid, 0);
	cnt = (uint16_t*)shm;
	for (i = 0, p = shm + 4; i < cnt[0]; ++i) {
		int64_t l_mem;
		memcpy(&l_mem, p, 8); p += 8;
		strcat(strcpy(path, "/bwaidx-"), p);
		shm_unlink(path);
		p += strlen(p) + 1;
	}
	munmap(shm, BWA_CTL_SIZE);
	shm_unlink("/bwactl");
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
leaq 0x17e88(%rip), %rdi     # 0x22924
xorl %esi, %esi
xorl %edx, %edx
callq 0x3650
testl %eax, %eax
js 0xab35
xorl %r12d, %r12d
pushq $0x1
popq %rcx
movl $0x10000, %esi          # imm = 0x10000
xorl %edi, %edi
movl %ecx, %edx
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x36c0
movq %rax, %rbx
movq %rax, %r13
addq $0x4, %r13
movabsq $0x2d7864696177622f, %rbp # imm = 0x2D7864696177622F
movq %rsp, %r14
cmpw (%rbx), %r12w
jae 0xab18
leaq 0x8(%r13), %r15
movq %rbp, (%rsp)
movb $0x0, 0x8(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x36b0
movq %r14, %rdi
callq 0x3740
movq %r15, %rdi
callq 0x3100
addq %rax, %r13
addq $0x9, %r13
incl %r12d
jmp 0xaade
movl $0x10000, %esi          # imm = 0x10000
movq %rbx, %rdi
callq 0x3170
leaq 0x17df8(%rip), %rdi     # 0x22924
callq 0x3740
xorl %eax, %eax
jmp 0xab38
pushq $-0x1
popq %rax
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/main.c
// Function: renderMainUsage
int renderMainUsage() {
	fprintf(stderr, "\n");
	fprintf(stderr, "Program: PALADIN (Protein Alignment and Detection Interface)\n\n");
	fprintf(stderr, "Usage:   paladin <command> [options]\n\n");
	fprintf(stderr, "Command: index         index NT or AA sequences in FASTA format\n");
	fprintf(stderr, "         prepare       download and index protein reference\n");
	fprintf(stderr, "         align         align single end read sequences\n");
	fprintf(stderr, "\n");
	fprintf(stderr, "         shm           manage indices in shared memory\n");
	fprintf(stderr, "         fa2pac        convert FASTA to PAC format\n");
	fprintf(stderr, "         pac2bwt       generate BWT from PAC\n");
	fprintf(stderr, "         bwtupdate     update .bwt to the new format\n");
	fprintf(stderr, "         bwt2sa        generate SA from BWT and Occ\n\n");
	fprintf(stderr, "         version       version and contact information\n");
	fprintf(stderr, "\n");
	fprintf(stderr,
"Note: To use PALADIN, first index the reference using the 'index' or 'prepare' command.\n"
"      Then align your reads using the 'align' command.\n\n");

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x20f84(%rip), %r12     # 0x2bfd0
movq (%r12), %rsi
pushq $0xa
popq %rbp
movl %ebp, %edi
callq 0x3410
movq (%r12), %rcx
leaq 0x17b75(%rip), %rdi     # 0x22bda
pushq $0x3e
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rcx
leaq 0x17b9b(%rip), %rdi     # 0x22c19
pushq $0x26
popq %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rcx
leaq 0x17bac(%rip), %rdi     # 0x22c40
pushq $0x40
popq %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rcx
leaq 0x17bd7(%rip), %rdi     # 0x22c81
pushq $0x3c
popq %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rcx
leaq 0x17bfe(%rip), %rdi     # 0x22cbe
pushq $0x37
popq %r14
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rsi
movl %ebp, %edi
callq 0x3410
movq (%r12), %rcx
leaq 0x17c11(%rip), %rdi     # 0x22cf6
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rcx
leaq 0x17c33(%rip), %rdi     # 0x22d2e
pushq $0x33
popq %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rcx
leaq 0x17c51(%rip), %rdi     # 0x22d62
pushq $0x2d
popq %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rcx
leaq 0x17c69(%rip), %rdi     # 0x22d90
pushq $0x35
popq %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rcx
leaq 0x17c85(%rip), %rdi     # 0x22dc6
movq %r15, %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rcx
leaq 0x17ca5(%rip), %rdi     # 0x22dfc
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rsi
movl %ebp, %edi
callq 0x3410
movq (%r12), %rcx
leaq 0x17cbc(%rip), %rdi     # 0x22e34
movl $0x90, %esi
movq %rbx, %rdx
callq 0x3790
pushq $0x1
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/main.c
// Function: renderVersion
int renderVersion() {
	fprintf(stderr, "\n");
	fprintf(stderr, "Program: PALADIN (Protein Alignment and Detection Interface)\n");

	fprintf(stderr, "Version: %s\n", PACKAGE_VERSION);
	fprintf(stderr, "Contact: Toni Westbrook (UNH) <anthony.westbrook@unh.edu>\n");
	fprintf(stderr, "Based on: BWA by Heng Li <lh3@sanger.ac.uk>\n\n");

	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x20e34(%rip), %r14     # 0x2bfd0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x3410
movq (%r14), %rcx
leaq 0x17d14(%rip), %rdi     # 0x22ec5
pushq $0x3d
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x3790
movq (%r14), %rdi
leaq 0x179d0(%rip), %rsi     # 0x22b99
leaq 0x14e7b(%rip), %rdx     # 0x2004b
xorl %eax, %eax
callq 0x3500
movq (%r14), %rcx
leaq 0x17d22(%rip), %rdi     # 0x22f03
pushq $0x3a
popq %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r14), %rcx
leaq 0x17d48(%rip), %rdi     # 0x22f3e
pushq $0x2d
popq %rsi
movq %rbx, %rdx
callq 0x3790
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/utils.c
// Function: logMessageRaw
void logMessageRaw(int passLevel, char * passFormat, ...) {
	va_list argList;
	char message[2048];

	// Exit if lesser verbosity requested
	if (passLevel > bwa_verbose) return;

	// Prepare message
	va_start(argList, passFormat);
	vsnprintf(message, 2048, passFormat, argList);
	va_end(argList);

	fprintf(stderr, "%s", message);
}

// Assembly:
pushq %rbx
subq $0x8d0, %rsp            # imm = 0x8D0
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0xc8c9
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
leaq 0x20570(%rip), %rax     # 0x2ce40
cmpl %edi, (%rax)
jge 0xc8dd
addq $0x8d0, %rsp            # imm = 0x8D0
popq %rbx
retq
movq %rsi, %r10
leaq 0x20(%rsp), %rax
movq %rsp, %rcx
movq %rax, 0x10(%rcx)
leaq 0x8e0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
leaq 0xd0(%rsp), %rbx
movl $0x800, %esi            # imm = 0x800
movq %rbx, %rdi
movq %r10, %rdx
callq 0x3190
movq 0x1f6ac(%rip), %rax     # 0x2bfd0
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x3340
jmp 0xc8d4
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/utils.c
// Function: err_xopen_core
FILE *err_xopen_core(const char *func, const char *fn, const char *mode)
{
	FILE *fp = 0;
	char * rwMessage = "reading writing";

	if (strcmp(fn, "-") == 0)
		return (strstr(mode, "r"))? stdin : stdout;
	if ((fp = fopen(fn, mode)) == 0) {
		if (mode[0] == 'w') rwMessage += 8;
		err_fatal(func, "Failed to open file '%s' for %s : %s", fn, rwMessage, strerror(errno));
	}
	return fp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x2d, (%rsi)
jne 0xc94a
cmpb $0x0, 0x1(%rbx)
je 0xc960
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3380
testq %rax, %rax
je 0xc985
popq %rbx
popq %r14
popq %r15
retq
pushq $0x72
popq %rsi
movq %r15, %rdi
callq 0x30f0
testq %rax, %rax
jne 0xc979
movq 0x1f631(%rip), %rax     # 0x2bfa8
jmp 0xc980
movq 0x1f648(%rip), %rax     # 0x2bfc8
movq (%rax), %rax
jmp 0xc95a
cmpb $0x77, (%r15)
leaq 0x1669a(%rip), %rax     # 0x2302a
leaq 0x1668b(%rip), %r15     # 0x23022
cmoveq %rax, %r15
callq 0x3050
movl (%rax), %edi
callq 0x30c0
leaq 0x16684(%rip), %rsi     # 0x23032
movq %r14, %rdi
movq %rbx, %rdx
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc9c1
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/utils.c
// Function: err_fatal
void err_fatal(const char *header, const char *fmt, ...)
{
	va_list args;
	va_start(args, fmt);
	fprintf(stderr, "[%s] ", header);
	vfprintf(stderr, fmt, args);
	fprintf(stderr, "\n");
	va_end(args);
	exit(EXIT_FAILURE);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rsi, %rbx
movq %rdi, %r10
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0xca23
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %r14
movq %rsi, 0x10(%r14)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%r14)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%r14)
movq 0x1f586(%rip), %r15     # 0x2bfd0
movq (%r15), %rdi
leaq 0x16621(%rip), %rsi     # 0x23075
movq %r10, %rdx
xorl %eax, %eax
callq 0x3500
movq (%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3480
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x3410
pushq $0x1
popq %rdi
callq 0x33c0
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/utils.c
// Function: err_xzopen_core
gzFile err_xzopen_core(const char *func, const char *fn, const char *mode)
{
	gzFile fp;
	if (strcmp(fn, "-") == 0) {
		fp = gzdopen(fileno((strstr(mode, "r"))? stdin : stdout), mode);
		/* According to zlib.h, this is the only reason gzdopen can fail */
		if (!fp) err_fatal(func, "Out of memory");
		return fp;
	}
	if ((fp = gzopen(fn, mode)) == 0) {
		err_fatal(func, "Failed to open file '%s' : %s", fn, errno ? strerror(errno) : "Out of memory");
	}
	return fp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x2d, (%rsi)
jne 0xcae6
cmpb $0x0, 0x1(%r14)
je 0xcafc
movq %r14, %rdi
movq %r15, %rsi
callq 0x3550
testq %rax, %rax
je 0xcb44
popq %rbx
popq %r14
popq %r15
retq
pushq $0x72
popq %rsi
movq %r15, %rdi
callq 0x30f0
testq %rax, %rax
jne 0xcb15
movq 0x1f495(%rip), %rax     # 0x2bfa8
jmp 0xcb1c
movq 0x1f4ac(%rip), %rax     # 0x2bfc8
movq (%rax), %rdi
callq 0x3300
movl %eax, %edi
movq %r15, %rsi
callq 0x36f0
testq %rax, %rax
jne 0xcaf6
leaq 0x13545(%rip), %rsi     # 0x2007f
movq %rbx, %rdi
xorl %eax, %eax
callq 0xc9c1
callq 0x3050
movl (%rax), %edi
testl %edi, %edi
jne 0xcb58
leaq 0x13529(%rip), %rcx     # 0x2007f
jmp 0xcb60
callq 0x30c0
movq %rax, %rcx
leaq 0x164f0(%rip), %rsi     # 0x23057
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xc9c1
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/utils.c
// Function: err_fatal_core
void err_fatal_core(const char *header, const char *fmt, ...)
{
	va_list args;
	va_start(args, fmt);
	fprintf(stderr, "[%s] ", header);
	vfprintf(stderr, fmt, args);
	fprintf(stderr, " Abort!\n");
	va_end(args);
	abort();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rsi, %rbx
movq %rdi, %r10
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0xcbd6
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %r14
movq %rsi, 0x10(%r14)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%r14)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%r14)
movq 0x1f3d3(%rip), %r15     # 0x2bfd0
movq (%r15), %rdi
leaq 0x1646e(%rip), %rsi     # 0x23075
movq %r10, %rdx
xorl %eax, %eax
callq 0x3500
movq (%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3480
movq (%r15), %rcx
leaq 0x16462(%rip), %rdi     # 0x2308b
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
callq 0x3790
callq 0x3150
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/utils.c
// Function: err_fwrite
size_t err_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
{
	size_t ret = fwrite(ptr, size, nmemb, stream);
	if (ret != nmemb) 
		_err_fatal_simple("fwrite", strerror(errno));
	return ret;
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
callq 0x3790
cmpq %rbx, %rax
jne 0xcc97
movq %rbx, %rax
popq %rbx
retq
callq 0x3050
movl (%rax), %edi
callq 0x30c0
leaq 0x163ea(%rip), %rdi     # 0x23094
movq %rax, %rsi
callq 0xcc39
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/utils.c
// Function: err_fread_noeof
size_t err_fread_noeof(void *ptr, size_t size, size_t nmemb, FILE *stream)
{
	size_t ret = fread(ptr, size, nmemb, stream);
	if (ret != nmemb)
	{
		_err_fatal_simple("fread", ferror(stream) ? strerror(errno) : "Unexpected end of file");
	}
	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
callq 0x3570
cmpq %r14, %rax
jne 0xccd1
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0x3750
testl %eax, %eax
jne 0xcce6
leaq 0x163bd(%rip), %rsi     # 0x230a1
jmp 0xccf5
callq 0x3050
movl (%rax), %edi
callq 0x30c0
movq %rax, %rsi
leaq 0x1639f(%rip), %rdi     # 0x2309b
callq 0xcc39
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/utils.c
// Function: err_gzread
int err_gzread(gzFile file, void *ptr, unsigned int len)
{
	int ret = gzread(file, ptr, len);

	if (ret < 0)
	{
		int errnum = 0;
		const char *msg = gzerror(file, &errnum);
		_err_fatal_simple("gzread", Z_ERRNO == errnum ? strerror(errno) : msg);
	}

	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3730
testl %eax, %eax
js 0xcd19
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x4(%rsp), %r14
andl $0x0, (%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3040
cmpl $-0x1, (%r14)
jne 0xcd3f
callq 0x3050
movl (%rax), %edi
callq 0x30c0
leaq 0x16372(%rip), %rdi     # 0x230b8
movq %rax, %rsi
callq 0xcc39
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/utils.c
// Function: err_fseek
int err_fseek(FILE *stream, long offset, int whence)
{
	int ret = fseek(stream, offset, whence);
	if (0 != ret)
	{
		_err_fatal_simple("fseek", strerror(errno));
	}
	return ret;
}

// Assembly:
pushq %rax
callq 0x3330
testl %eax, %eax
jne 0xcd5c
xorl %eax, %eax
popq %rcx
retq
callq 0x3050
movl (%rax), %edi
callq 0x30c0
leaq 0x16350(%rip), %rdi     # 0x230bf
movq %rax, %rsi
callq 0xcc39
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/utils.c
// Function: err_ftell
long err_ftell(FILE *stream)
{
	long ret = ftell(stream);
	if (-1 == ret)
	{
		_err_fatal_simple("ftell", strerror(errno));
	}
	return ret;
}

// Assembly:
pushq %rax
callq 0x3030
cmpq $-0x1, %rax
je 0xcd85
popq %rcx
retq
callq 0x3050
movl (%rax), %edi
callq 0x30c0
leaq 0x1632d(%rip), %rdi     # 0x230c5
movq %rax, %rsi
callq 0xcc39
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/utils.c
// Function: err_printf
int err_printf(const char *format, ...) 
{
	va_list arg;
	int done;
	va_start(arg, format);
	done = vfprintf(stdout, format, arg);
	int saveErrno = errno;
	va_end(arg);
	if (done < 0) _err_fatal_simple("vfprintf(stdout)", strerror(saveErrno));
	return done;
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %r10
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0xcdff
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rdx
movq %rdi, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq 0x1f182(%rip), %rax     # 0x2bfa8
movq (%rax), %rdi
movq %r10, %rsi
callq 0x3480
movl %eax, %ebx
callq 0x3050
testl %ebx, %ebx
js 0xce47
movl %ebx, %eax
addq $0xd0, %rsp
popq %rbx
retq
movl (%rax), %edi
callq 0x30c0
leaq 0x16276(%rip), %rdi     # 0x230cb
movq %rax, %rsi
callq 0xcc39
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/utils.c
// Function: err_fprintf
int err_fprintf(FILE *stream, const char *format, ...) 
{
	va_list arg;
	int done;
	va_start(arg, format);
	done = vfprintf(stream, format, arg);
	int saveErrno = errno;
	va_end(arg);
	if (done < 0) _err_fatal_simple("vfprintf", strerror(saveErrno));
	return done;
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
leaq 0x20(%rsp), %r10
movq %rdx, 0x10(%r10)
movq %rcx, 0x18(%r10)
movq %r8, 0x20(%r10)
movq %r9, 0x28(%r10)
testb %al, %al
je 0xceb5
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rdx
movq %r10, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
callq 0x3480
movl %eax, %ebx
callq 0x3050
testl %ebx, %ebx
js 0xcef0
movl %ebx, %eax
addq $0xd0, %rsp
popq %rbx
retq
movl (%rax), %edi
callq 0x30c0
leaq 0x161de(%rip), %rdi     # 0x230dc
movq %rax, %rsi
callq 0xcc39
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/utils.c
// Function: err_fputc
int err_fputc(int c, FILE *stream)
{
	int ret = putc(c, stream);
	if (EOF == ret)
	{
		_err_fatal_simple("fputc", strerror(errno));
	}

	return ret;
}

// Assembly:
pushq %rax
callq 0x3770
cmpl $-0x1, %eax
je 0xcf13
popq %rcx
retq
callq 0x3050
movl (%rax), %edi
callq 0x30c0
leaq 0x161bf(%rip), %rdi     # 0x230e5
movq %rax, %rsi
callq 0xcc39
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/utils.c
// Function: err_fputs
int err_fputs(const char *s, FILE *stream)
{
	int ret = fputs(s, stream);
	if (EOF == ret)
	{
		_err_fatal_simple("fputs", strerror(errno));
	}

	return ret;
}

// Assembly:
pushq %rax
callq 0x3340
cmpl $-0x1, %eax
je 0xcf3b
popq %rcx
retq
callq 0x3050
movl (%rax), %edi
callq 0x30c0
leaq 0x1619d(%rip), %rdi     # 0x230eb
movq %rax, %rsi
callq 0xcc39
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/utils.c
// Function: err_puts
int err_puts(const char *s)
{
	int ret = puts(s);
	if (EOF == ret)
	{
		_err_fatal_simple("puts", strerror(errno));
	}

	return ret;
}

// Assembly:
pushq %rax
callq 0x3590
cmpl $-0x1, %eax
je 0xcf63
popq %rcx
retq
callq 0x3050
movl (%rax), %edi
callq 0x30c0
leaq 0x16176(%rip), %rdi     # 0x230ec
movq %rax, %rsi
callq 0xcc39
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/utils.c
// Function: err_fflush
int err_fflush(FILE *stream) 
{
    int ret = fflush(stream);
    if (ret != 0) _err_fatal_simple("fflush", strerror(errno));

#ifdef FSYNC_ON_FLUSH
	/* Calling fflush() ensures that all the data has made it to the
	   kernel buffers, but this may not be sufficient for remote filesystems
	   (e.g. NFS, lustre) as an error may still occur while the kernel
	   is copying the buffered data to the file server.  To be sure of
	   catching these errors, we need to call fsync() on the file
	   descriptor, but only if it is a regular file.  */
	{
		struct stat sbuf;
		if (0 != fstat(fileno(stream), &sbuf))
			_err_fatal_simple("fstat", strerror(errno));
		
		if (S_ISREG(sbuf.st_mode))
		{
			if (0 != fsync(fileno(stream)))
				_err_fatal_simple("fsync", strerror(errno));
		}
	}
#endif
    return ret;
}

// Assembly:
pushq %rbx
subq $0x90, %rsp
movq %rdi, %rbx
callq 0x3370
testl %eax, %eax
jne 0xcfd6
movq %rbx, %rdi
callq 0x3300
movq %rsp, %rsi
movl %eax, %edi
callq 0x3640
testl %eax, %eax
jne 0xcfeb
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%rsp), %eax
cmpl $0x8000, %eax           # imm = 0x8000
jne 0xcfcb
movq %rbx, %rdi
callq 0x3300
movl %eax, %edi
callq 0x3290
testl %eax, %eax
jne 0xd000
xorl %eax, %eax
addq $0x90, %rsp
popq %rbx
retq
callq 0x3050
movl (%rax), %edi
callq 0x30c0
leaq 0x16108(%rip), %rdi     # 0x230f1
jmp 0xd013
callq 0x3050
movl (%rax), %edi
callq 0x30c0
leaq 0x160fa(%rip), %rdi     # 0x230f8
jmp 0xd013
callq 0x3050
movl (%rax), %edi
callq 0x30c0
leaq 0x160eb(%rip), %rdi     # 0x230fe
movq %rax, %rsi
callq 0xcc39
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/utils.c
// Function: err_gzclose
int err_gzclose(gzFile file)
{
	int ret = gzclose(file);
	if (Z_OK != ret)
	{
		_err_fatal_simple("gzclose", Z_ERRNO == ret ? strerror(errno) : zError(ret));
	}

	return ret;
}

// Assembly:
pushq %rax
callq 0x3660
testl %eax, %eax
jne 0xd052
xorl %eax, %eax
popq %rcx
retq
cmpl $-0x1, %eax
jne 0xd065
callq 0x3050
movl (%rax), %edi
callq 0x30c0
jmp 0xd06c
movl %eax, %edi
callq 0x3430
leaq 0x16098(%rip), %rdi     # 0x2310b
movq %rax, %rsi
callq 0xcc39
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/kstring.c
// Function: ksprintf
int ksprintf(kstring_t *s, const char *fmt, ...)
{
	va_list ap;
	int l;
	va_start(ap, fmt);
	l = vsnprintf(s->s + s->l, s->m - s->l, fmt, ap);
	va_end(ap);
	if (l + 1 > s->m - s->l) {
		s->m = s->l + l + 2;
		kroundup32(s->m);
		s->s = (char*)realloc(s->s, s->m);
		va_start(ap, fmt);
		l = vsnprintf(s->s + s->l, s->m - s->l, fmt, ap);
	}
	va_end(ap);
	s->l += l;
	return l;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %r15
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0xd4f6
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rcx
movq %r15, 0x10(%rcx)
leaq 0x100(%rsp), %r12
movq %r12, 0x8(%rcx)
movabsq $0x3000000010, %r13     # imm = 0x3000000010
movq %r13, (%rcx)
movq (%rdi), %rax
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rdi
addq %rax, %rdi
subq %rax, %rsi
movq %r14, %rdx
callq 0x3190
leal 0x1(%rax), %ecx
movslq %ecx, %rdx
movq (%rbx), %rcx
movq 0x8(%rbx), %rsi
subq %rcx, %rsi
cmpq %rdx, %rsi
jae 0xd5cd
cltq
addq %rcx, %rax
incq %rax
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 0x15b95(%rip), %rdx     # 0x23128
leaq 0x15b98(%rip), %r8      # 0x23132
pushq $0x13
popq %rcx
callq 0x1e0b4
movq %rax, 0x10(%rbx)
movq %rsp, %rcx
movq %r13, (%rcx)
movq %r12, 0x8(%rcx)
movq %r15, 0x10(%rcx)
movq (%rbx), %rax
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdi
addq %rax, %rdi
subq %rax, %rsi
movq %r14, %rdx
callq 0x3190
cltq
addq %rax, (%rbx)
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/bwt.c
// Function: unpackBWTValue
ubyte_t unpackBWTValue(const bwt_t * passBWT, int64_t passSeqIdx) {
	int64_t packShift;
	uint32_t * bwtValueStart;

	packShift = (8 * (sizeof(uint32_t) - 1)) - (8 * (passSeqIdx % sizeof(uint32_t)));

	bwtValueStart = getOccInterval(passBWT, passSeqIdx);
	bwtValueStart += sizeof(bwtint_t) / sizeof(uint32_t) * VALUE_DOMAIN;

	return (bwtValueStart[(passSeqIdx % 128) / sizeof(uint32_t)] >> packShift) & 0xFF;
}

// Assembly:
movl $0x80, %ecx
movq %rsi, %rax
cqto
idivq %rcx
movq %rax, %rcx
shlq $0x8, %rcx
addq 0x120(%rdi), %rcx
shlq $0x7, %rax
addq %rcx, %rax
andq $-0x4, %rdx
movl 0x100(%rdx,%rax), %eax
leal (,%rsi,8), %ecx
notb %cl
andb $0x18, %cl
shrl %cl, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/bwt.c
// Function: bwt_cal_sa
void bwt_cal_sa(bwt_t *bwt, int intv) {
	bwtint_t isa, sa, i; // S(isa) = sa
	int intv_round = intv;

	// Sanity checking
	kv_roundup32(intv_round);
	xassert(intv_round == intv, "SA sample interval is not a power of 2.");
	xassert(bwt->bwt, "bwt_t::bwt is not initialized.");

	// Initialize Suffix Array
	if (bwt->sa) free(bwt->sa);
	bwt->sa_intv = intv;
	bwt->n_sa = (bwt->seq_len + intv) / intv;
	bwt->sa = (bwtint_t*)calloc(bwt->n_sa, sizeof(bwtint_t));

	// Calculate Suffix Array Value
	isa = 0; sa = bwt->seq_len;
	for (i = 0; i < bwt->seq_len; ++i) {
		if (isa % intv == 0) bwt->sa[isa/intv] = sa;
		--sa;
		isa = bwt_invPsi(bwt, isa);
	}
	if (isa % intv == 0) bwt->sa[isa/intv] = sa;

	// SA[0] is currently set to sequence length - set to maximum value
	bwt->sa[0] = (bwtint_t)-1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
leal -0x1(%r14), %eax
movl %eax, %ecx
sarl %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x8, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x10, %ecx
orl %eax, %ecx
incl %ecx
cmpl %esi, %ecx
jne 0xd764
movq %rdi, %rbx
cmpq $0x0, 0x120(%rdi)
je 0xd777
movq 0x138(%rbx), %rdi
callq 0x3390
movl %r14d, 0x128(%rbx)
movslq %r14d, %r14
movq 0x110(%rbx), %rax
addq %r14, %rax
xorl %r15d, %r15d
xorl %edx, %edx
divq %r14
movq %rax, 0x130(%rbx)
leaq 0x15ab0(%rip), %rdx     # 0x2318d
leaq 0x15a57(%rip), %r8      # 0x2313b
pushq $0x8
popq %rsi
pushq $0x4a
popq %rcx
movq %rax, %rdi
callq 0x1dfd0
movq %rax, 0x138(%rbx)
movq 0x110(%rbx), %rcx
movq %rcx, %r12
xorl %esi, %esi
movq %rsi, %rax
xorl %edx, %edx
divq %r14
cmpq %rcx, %r15
jae 0xd744
testq %rdx, %rdx
jne 0xd72a
movq 0x138(%rbx), %rcx
movq %rsi, %rax
xorl %edx, %edx
divq %r14
movq %r12, (%rcx,%rax,8)
decq %r12
movq %rbx, %rdi
callq 0xd78a
movq %rax, %rsi
incq %r15
movq 0x110(%rbx), %rcx
jmp 0xd705
movq 0x138(%rbx), %rcx
testq %rdx, %rdx
jne 0xd754
movq %r12, (%rcx,%rax,8)
orq $-0x1, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x159d0(%rip), %rdi     # 0x2313b
leaq 0x159d4(%rip), %rsi     # 0x23146
callq 0xcc60
leaq 0x159bd(%rip), %rdi     # 0x2313b
leaq 0x159e9(%rip), %rsi     # 0x2316e
callq 0xcc60
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/bwt.c
// Function: bwt_invPsi
static inline bwtint_t bwt_invPsi(const bwt_t *bwt, bwtint_t k) {
	bwtint_t x = k - (k > bwt->primary);

	x = unpackBWTValue(bwt, x);
	x = bwt->L2[x] + bwt_occ(bwt, k, x);

	return k == bwt->primary? 0 : x;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpq %rsi, (%rdi)
sbbq $0x0, %rsi
callq 0xd607
movzbl %al, %edx
movq 0x8(%r14,%rdx,8), %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0xd812
addq %r15, %rax
xorl %ecx, %ecx
cmpq %rbx, (%r14)
cmoveq %rcx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/bwt.c
// Function: bwt_sa
bwtint_t bwt_sa(const bwt_t *bwt, bwtint_t k)
{
	bwtint_t sa = 0, mask = bwt->sa_intv - 1;
	while (k & mask) {
		++sa;
		k = bwt_invPsi(bwt, k);
	}
	/* without setting bwt->sa[0] = -1, the following line should be
	   changed to (sa + bwt->sa[k/bwt->sa_intv]) % (bwt->seq_len + 1) */
	return sa + bwt->sa[k/bwt->sa_intv];
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rax
movq %rdi, %r14
movslq 0x128(%rdi), %r15
decq %r15
xorl %ebx, %ebx
testq %r15, %rax
je 0xd7f2
incq %rbx
movq %r14, %rdi
movq %rax, %rsi
callq 0xd78a
jmp 0xd7dd
movq 0x138(%r14), %rcx
movslq 0x128(%r14), %rsi
xorl %edx, %edx
divq %rsi
addq (%rcx,%rax,8), %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/bwt.c
// Function: bwt_occ4
void bwt_occ4(const bwt_t *bwt, bwtint_t k, bwtint_t cnt[VALUE_DOMAIN])
{
	uint32_t *p, *end;

	// If K is set to max, set counts to 0
	if (k == (bwtint_t)(-1)) {
		memset(cnt, 0, VALUE_DOMAIN * sizeof(bwtint_t));
		return;
	}

	k -= (k >= bwt->primary); // because $ is not in bwt

	// Copy current occurrence interval
	p = getOccInterval(bwt, k);
	memcpy(cnt, p, VALUE_DOMAIN * sizeof(bwtint_t));

	// Loop from end of interval to K in unpacked space
	p += sizeof(bwtint_t) / sizeof(uint32_t) * VALUE_DOMAIN;
	end = p + (((k / 16) - ((k&~OCC_INTV_MASK) / 16)) * 4) + ((k % 16) - (k % 4))/4;
	int supercount = 0;

	for (; p < end; ++p) {
		cnt[unpackBWTValue(bwt, k/128*128 + supercount)]++;
		cnt[unpackBWTValue(bwt, k/128*128 + supercount+1)]++;
		cnt[unpackBWTValue(bwt, k/128*128 + supercount+2)]++;
		cnt[unpackBWTValue(bwt, k/128*128 + supercount+3)]++;
		supercount+=4;
	}

	int testIdx;

	for (testIdx = 0 ; testIdx < (k % 4) + 1 ; testIdx++) {
		cnt[unpackBWTValue(bwt, k/128*128 + supercount++)]++;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
cmpq $-0x1, %rsi
je 0xd959
movq %rsi, %r14
movq %rdi, %r15
cmpq (%rdi), %rsi
adcq $-0x1, %r14
movl $0x80, %ecx
movq %r14, %rax
cqto
idivq %rcx
movq %rax, %r12
movq %rax, %rbp
shlq $0x8, %rbp
addq 0x120(%rdi), %rbp
shlq $0x7, %r12
leaq (%r12,%rbp), %r13
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3260
addq %r12, %rbp
addq $0x100, %rbp            # imm = 0x100
movl %r14d, %eax
andl $0x70, %eax
addq %r13, %rax
addq $0x100, %rax            # imm = 0x100
movl %r14d, %r13d
andl $0xf, %r13d
movl %r14d, %r12d
andl $0x3, %r12d
subq %r12, %r13
andq $-0x4, %r13
addq %rax, %r13
andq $-0x80, %r14
cmpq %r13, %rbp
jae 0xd92a
movq %r15, %rdi
movq %r14, %rsi
callq 0xd607
movzbl %al, %eax
incq (%rbx,%rax,8)
leaq 0x1(%r14), %rsi
movq %r15, %rdi
callq 0xd607
movzbl %al, %eax
incq (%rbx,%rax,8)
leaq 0x2(%r14), %rsi
movq %r15, %rdi
callq 0xd607
movzbl %al, %eax
incq (%rbx,%rax,8)
leaq 0x3(%r14), %rsi
movq %r15, %rdi
callq 0xd607
movzbl %al, %eax
incq (%rbx,%rax,8)
addq $0x4, %rbp
addq $0x4, %r14
jmp 0xd8d0
incq %r12
subq $0x1, %r12
jb 0xd94a
movq %r15, %rdi
movq %r14, %rsi
callq 0xd607
movzbl %al, %eax
incq (%rbx,%rax,8)
incq %r14
jmp 0xd92d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3140