LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwtindex.c
// Function: getIndexCompatible
int getIndexCompatible(IndexHeader passHeader) {
	// Check if index newer than current version
	while (1) {
		if (passHeader.version[0] < PACKAGE_VERSION_MAJOR) break;
		if (passHeader.version[0] > PACKAGE_VERSION_MAJOR) return INDEX_COMPATBILITY_FUTURE;
		if (passHeader.version[1] < PACKAGE_VERSION_MINOR) break;
		if (passHeader.version[1] > PACKAGE_VERSION_MINOR) return INDEX_COMPATBILITY_FUTURE;
		if (passHeader.version[2] < PACKAGE_VERSION_REV) break;
		if (passHeader.version[2] > PACKAGE_VERSION_REV) return INDEX_COMPATBILITY_FUTURE;
		break;
	}

	// Check if reference new enough to be supported (1.1.0 for current version)
	while (1) {
		if (passHeader.version[0] < 1) return INDEX_COMPATIBILITY_NONE;
		if (passHeader.version[0] > 1) break;
		if (passHeader.version[1] < 1) return INDEX_COMPATIBILITY_NONE;
		if (passHeader.version[1] > 1) break;
		if (passHeader.version[2] < 0) return INDEX_COMPATIBILITY_NONE;
		if (passHeader.version[2] > 0) break;
		break;
	}

	return INDEX_COMPATIBLITY_FULL;
}

// Assembly:
movl 0x14(%rsp), %ecx
xorl %eax, %eax
testl %ecx, %ecx
jle 0x58fb
movl $0x2, %eax
cmpl $0x1, %ecx
jne 0x58fb
leaq 0x8(%rsp), %rcx
movl 0x10(%rcx), %edx
cmpl $0x6, %edx
jge 0x58fc
movl $0x0, %eax
testl %edx, %edx
jg 0x5904
retq
jne 0x58fb
cmpl $0x0, 0x14(%rcx)
jg 0x58fb
cmpl $0x1, %edx
setne %al
cmpl $0x0, 0x14(%rcx)
setns %cl
orb %al, %cl
movzbl %cl, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwtindex.c
// Function: bwa_seq_len
int64_t bwa_seq_len(const char *fn_pac) {
	FILE *fp;
	int64_t pac_len;
	ubyte_t c;

	fp = xopen(fn_pac, "rb");
	err_fseek(fp, -1, SEEK_END);
	pac_len = err_ftell(fp);
	err_fread_noeof(&c, 1, 1, fp);
	err_fclose(fp);
	return pac_len - 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rsi
leaq 0x1f76e(%rip), %rdi     # 0x250c8
leaq 0x23137(%rip), %rdx     # 0x28a98
callq 0xe023
movq %rax, %rbx
movq %rax, %rdi
movq $-0x1, %rsi
movl $0x2, %edx
callq 0xe451
movq %rbx, %rdi
callq 0xe47a
movq %rax, %r14
leaq 0x7(%rsp), %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0xe3b2
movq %rbx, %rdi
callq 0xe71e
decq %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwtindex.c
// Function: command_pac2bwt
int command_pac2bwt(int argc, char *argv[]) {
	bwt_t *bwt;
	int c;
	while ((c = getopt(argc, argv, "d")) >= 0) {
		switch (c) {
		default: return 1;
		}
	}
	if (optind + 2 > argc) {
		fprintf(stderr, "Usage: paladin pac2bwt <in.pac> <out.bwt>\n");
		return 1;
	}
	bwt = bwt_pac2bwt(argv[optind]);
	bwt_dump_bwt(argv[optind+1], bwt);
	bwt_destroy(bwt);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
leaq 0x1fbe3(%rip), %rdx     # 0x2575c
callq 0x3090
movl $0x1, %ebp
testl %eax, %eax
jns 0x5bbf
movq 0x2a44a(%rip), %r15     # 0x2ffd8
movslq (%r15), %rax
leal 0x2(%rax), %ecx
cmpl %r14d, %ecx
jg 0x5bcc
movq (%rbx,%rax,8), %rdi
callq 0x59b5
movq %rax, %r14
movslq (%r15), %rax
movq 0x8(%rbx,%rax,8), %rdi
movq %r14, %rsi
callq 0xffaa
movq %r14, %rdi
callq 0x10378
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x37c0
jmp 0x5bbf
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwtindex.c
// Function: bwt_bwtupdate_core
void bwt_bwtupdate_core(bwt_t *bwt) {
	int64_t i, k, counts[VALUE_DOMAIN], n_occ;
	uint32_t * bwtBuf;

	// Initialize counts array
	memset(counts, 0, sizeof(counts));

	// Adjust the FM-Index size by the number of interleaved occurrence counts
	n_occ = (bwt->seq_len + OCC_INTERVAL - 1) / OCC_INTERVAL + 1;
	bwt->bwt_size += n_occ * sizeof(bwtint_t) / sizeof(uint32_t) * VALUE_DOMAIN;
	bwtBuf = (uint32_t*)calloc(bwt->bwt_size, sizeof(uint32_t));

	// Iterate through each packed value in the current FM-Index
	for (i = k = 0; i < bwt->seq_len; ++i) {
		// For each occurrence interval, insert the number of running occurrences
		if (i % OCC_INTERVAL == 0) {
			memcpy(bwtBuf + k, counts, sizeof(bwtint_t) * VALUE_DOMAIN);
			k += sizeof(bwtint_t) / sizeof(uint32_t) * VALUE_DOMAIN;
		}

		// Copy packed value
		if (i % 4 == 0) bwtBuf[k++] = bwt->bwt[i/4];

		// Unpack and record current occurrence
		++counts[unpackValue(bwt, i)];
	}

	// Record last element
	memcpy(bwtBuf + k, counts, sizeof(bwtint_t) * VALUE_DOMAIN);
	xassert(k + sizeof(bwtint_t) / sizeof(uint32_t) * VALUE_DOMAIN == bwt->bwt_size, "inconsistent bwt_size");

	// Update FM-Index
	free(bwt->bwt);
	bwt->bwt = bwtBuf;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
movq %rsp, %rdi
xorl %r12d, %r12d
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x3140
movq 0x110(%rbx), %rax
movq 0x118(%rbx), %rcx
addq $0x7f, %rax
shrq %rax
andq $-0x40, %rax
leaq (%rcx,%rax), %rdi
addq $0x40, %rdi
movq %rdi, 0x118(%rbx)
leaq 0x1f4ac(%rip), %rdx     # 0x250d4
leaq 0x1f4e7(%rip), %r8      # 0x25116
movl $0x4, %esi
movl $0xc2, %ecx
callq 0x2319c
movq %rax, %r14
cmpq $0x0, 0x110(%rbx)
je 0x5cb2
movq %rsp, %r15
xorl %ebp, %ebp
xorl %r13d, %r13d
testb $0x7f, %bpl
jne 0x5c6e
leaq (%r14,%r13,4), %rdi
movl $0x100, %edx            # imm = 0x100
movq %r15, %rsi
callq 0x3260
addq $0x40, %r13
movq 0x120(%rbx), %rax
testb $0x3, %bpl
jne 0x5c85
movl (%rax,%rbp), %ecx
movl %ecx, (%r14,%r13,4)
incq %r13
movq %rbp, %rcx
andq $-0x4, %rcx
movl (%rax,%rcx), %eax
movl %r12d, %ecx
notb %cl
andb $0x18, %cl
shrl %cl, %eax
movzbl %al, %eax
incq (%rsp,%rax,8)
incq %rbp
addl $0x8, %r12d
cmpq 0x110(%rbx), %rbp
jb 0x5c53
jmp 0x5cb5
xorl %r13d, %r13d
leaq (%r14,%r13,4), %rdi
movq %rsp, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x3260
addq $0x40, %r13
cmpq 0x118(%rbx), %r13
jne 0x5cf8
movq 0x120(%rbx), %rdi
callq 0x3390
movq %r14, 0x120(%rbx)
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f417(%rip), %rdi     # 0x25116
leaq 0x1f423(%rip), %rsi     # 0x25129
callq 0xe360
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwtindex.c
// Function: command_bwtupdate
int command_bwtupdate(int argc, char *argv[]) {
	bwt_t *bwt;
	if (argc < 2) {
		fprintf(stderr, "Usage: paladin bwtupdate <the.bwt>\n");
		return 1;
	}
	bwt = bwt_restore_bwt(argv[1]);
	bwt_bwtupdate_core(bwt);
	bwt_dump_bwt(argv[1], bwt);
	bwt_destroy(bwt);
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x1, %edi
jle 0x5d49
movq %rsi, %rbx
movq 0x8(%rsi), %rdi
callq 0x10272
movq %rax, %r14
movq %rax, %rdi
callq 0x5bd3
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0xffaa
movq %r14, %rdi
callq 0x10378
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x37dc
movl $0x1, %eax
jmp 0x5d41
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwtindex.c
// Function: command_bwt2sa
int command_bwt2sa(int argc, char *argv[]) {
	bwt_t *bwt;
	int c, sa_intv = 32;
	while ((c = getopt(argc, argv, "i:")) >= 0) {
		switch (c) {
		case 'i': sa_intv = atoi(optarg); break;
		default: return 1;
		}
	}
	if (optind + 2 > argc) {
		fprintf(stderr, "Usage: paladin bwt2sa [-i %d] <in.bwt> <out.sa>\n", sa_intv);
		return 1;
	}
	bwt = bwt_restore_bwt(argv[optind]);
	bwt_cal_sa(bwt, sa_intv);
	bwt_dump_sa(argv[optind+1], bwt);
	bwt_destroy(bwt);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x2318b(%rip), %rdx     # 0x28ef4
callq 0x3090
testl %eax, %eax
js 0x5da8
movq 0x2a23f(%rip), %r12     # 0x2ffb8
leaq 0x23174(%rip), %r15     # 0x28ef4
cmpl $0x69, %eax
jne 0x5e0f
movq (%r12), %rdi
callq 0x35b0
movl %eax, %r14d
movl %ebp, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x3090
testl %eax, %eax
jns 0x5d80
jmp 0x5dae
movl $0x20, %r14d
movq 0x2a223(%rip), %r12     # 0x2ffd8
movslq (%r12), %rax
leal 0x2(%rax), %ecx
cmpl %ebp, %ecx
jg 0x5df4
movq (%rbx,%rax,8), %rdi
callq 0x10272
movq %rax, %r15
movq %rax, %rdi
movl %r14d, %esi
callq 0xed83
movslq (%r12), %rax
movq 0x8(%rbx,%rax,8), %rdi
movq %r15, %rsi
callq 0x10027
movq %r15, %rdi
callq 0x10378
xorl %eax, %eax
jmp 0x5e14
movq 0x2a1d5(%rip), %rax     # 0x2ffd0
movq (%rax), %rdi
leaq 0x1f35e(%rip), %rsi     # 0x25163
movl %r14d, %edx
xorl %eax, %eax
callq 0x3500
movl $0x1, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/kopen.c
// Function: cmd2argv
static char **cmd2argv(const char *cmd)
{
	int i, beg, end, argc;
	char **argv, *str;
	end = strlen(cmd);
	for (i = end - 1; i >= 0; --i)
		if (!isspace(cmd[i])) break;
	end = i + 1;
	for (beg = 0; beg < end; ++beg)
		if (!isspace(cmd[beg])) break;
	if (beg == end) return 0;
	for (i = beg + 1, argc = 0; i < end; ++i)
		if (isspace(cmd[i]) && !isspace(cmd[i-1]))
			++argc;
	argv = (char**)calloc(argc + 2, sizeof(void*));
	argv[0] = str = (char*)calloc(end - beg + 1, 1);
	strncpy(argv[0], cmd + beg, end - beg);
	for (i = argc = 1; i < end - beg; ++i)
		if (isspace(str[i])) str[i] = 0;
		else if (str[i] && str[i-1] == 0) argv[argc++] = &str[i];
	return argv;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3100
movl %eax, %r15d
movl %eax, %r14d
sarl $0x1f, %r14d
andl %eax, %r14d
incq %r15
leal -0x1(%r15), %eax
testl %eax, %eax
jle 0x705f
callq 0x3320
movq (%rax), %rax
movsbq -0x2(%rbx,%r15), %rcx
decq %r15
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x700f
callq 0x3320
movq (%rax), %rax
movl %r15d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %r14d, %r14d
xorl %r13d, %r13d
movsbq (%rbx,%r13), %rdx
testb $0x20, 0x1(%rax,%rdx,2)
je 0x7064
incq %r13
cmpq %r13, %rcx
jne 0x7046
jmp 0x7177
xorl %r13d, %r13d
jmp 0x7067
movl %r15d, %r14d
movl %r14d, %ebp
subl %r13d, %ebp
jne 0x7077
xorl %r14d, %r14d
jmp 0x7177
leal 0x1(%r13), %r15d
movl $0x2, %edi
cmpl %r14d, %r15d
jge 0x70d0
callq 0x3320
movq (%rax), %rax
movl %r15d, %ecx
addq %rbx, %rcx
xorl %edx, %edx
movl %r13d, %esi
movsbq (%rcx), %rdi
testb $0x20, 0x1(%rax,%rdi,2)
je 0x70ba
movl %esi, %edi
movsbq (%rbx,%rdi), %rdi
movb 0x1(%rax,%rdi,2), %dil
andb $0x20, %dil
cmpb $0x1, %dil
adcl $0x0, %edx
leal 0x1(%rsi), %edi
incq %rcx
addl $0x2, %esi
cmpl %esi, %r14d
movl %edi, %esi
jg 0x7098
addl $0x2, %edx
movslq %edx, %rdi
leaq 0x1e5b4(%rip), %r15     # 0x2568b
leaq 0x1e6a5(%rip), %r12     # 0x25783
movl $0x8, %esi
movq %r15, %rdx
movl $0xf6, %ecx
movq %r12, %r8
callq 0x2319c
movq %rax, %r14
leal 0x1(%rbp), %eax
movslq %eax, %rdi
movl $0x1, %esi
movq %r15, %rdx
movl $0xf7, %ecx
movq %r12, %r8
callq 0x2319c
movq %rax, %r15
movq %rax, (%r14)
movl %r13d, %eax
addq %rax, %rbx
movslq %ebp, %r12
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x3130
cmpl $0x2, %r12d
jl 0x7177
callq 0x3320
movl %ebp, %ecx
incq %r15
decq %rcx
movl $0x1, %edx
movq (%rax), %rdi
movsbq (%r15), %rsi
testb $0x20, 0x1(%rdi,%rsi,2)
jne 0x716b
testb %sil, %sil
je 0x716f
cmpb $0x0, -0x1(%r15)
jne 0x716f
movslq %edx, %rsi
incl %edx
movq %r15, (%r14,%rsi,8)
jmp 0x716f
movb $0x0, (%r15)
incq %r15
decq %rcx
jne 0x7146
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/kopen.c
// Function: kclose
int kclose(void *a)
{
	koaux_t *aux = (koaux_t*)a;
	if (aux->type == KO_PIPE) {
		int status;
		pid_t pid;
		pid = waitpid(aux->pid, &status, WNOHANG);
		if (pid != aux->pid) kill(aux->pid, 15);
	}
	free(aux);
	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpl $0x3, (%rdi)
jne 0x71b9
movl 0x8(%rbx), %edi
leaq 0xc(%rsp), %rsi
movl $0x1, %edx
callq 0x3240
movl 0x8(%rbx), %edi
cmpl %edi, %eax
je 0x71b9
movl $0xf, %esi
callq 0x34f0
movq %rbx, %rdi
callq 0x3390
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/kopen.c
// Function: socket_connect
static int socket_connect(const char *host, const char *port)
{
#define __err_connect(func) do { perror(func); freeaddrinfo(res); return -1; } while (0)

	int on = 1, fd;
	struct linger lng = { 0, 0 };
	struct addrinfo hints, *res = 0;
	memset(&hints, 0, sizeof(struct addrinfo));
	hints.ai_family = AF_UNSPEC;
	hints.ai_socktype = SOCK_STREAM;
	if (getaddrinfo(host, port, &hints, &res) != 0) __err_connect("getaddrinfo");
	if ((fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) == -1) __err_connect("socket");
	if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1) __err_connect("setsockopt");
	if (setsockopt(fd, SOL_SOCKET, SO_LINGER, &lng, sizeof(lng)) == -1) __err_connect("setsockopt");
	if (connect(fd, res->ai_addr, res->ai_addrlen) != 0) __err_connect("connect");
	freeaddrinfo(res);
	return fd;
#undef __err_connect
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
movl $0x1, %eax
movl %eax, 0x14(%rsp)
xorl %edx, %edx
movq %rdx, 0x18(%rsp)
leaq 0x8(%rsp), %rcx
movq %rdx, (%rcx)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, 0x20(%rdx)
movl %eax, 0x8(%rdx)
callq 0x3420
testl %eax, %eax
jne 0x728e
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edi
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
callq 0x30b0
cmpl $-0x1, %eax
je 0x7297
movl %eax, %ebx
leaq 0x14(%rsp), %rcx
movl %eax, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x36d0
leaq 0x1e4ac(%rip), %r14     # 0x256f4
cmpl $-0x1, %eax
je 0x729e
leaq 0x18(%rsp), %rcx
movl %ebx, %edi
movl $0x1, %esi
movl $0xd, %edx
movl $0x8, %r8d
callq 0x36d0
cmpl $-0x1, %eax
je 0x729e
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rsi
movl 0x10(%rax), %edx
movl %ebx, %edi
callq 0x3270
testl %eax, %eax
je 0x72ab
leaq 0x1e473(%rip), %r14     # 0x256ff
jmp 0x729e
leaq 0x1e44c(%rip), %r14     # 0x256e1
jmp 0x729e
leaq 0x1e44f(%rip), %r14     # 0x256ed
movq %r14, %rdi
callq 0x3280
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq 0x8(%rsp), %rdi
callq 0x3450
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/kopen.c
// Function: write_bytes
static int write_bytes(int fd, const char *buf, size_t len)
{
	ssize_t bytes;
	do {
		bytes = write(fd, buf, len);
		if (bytes >= 0) {
			len -= bytes;
		} else if (errno != EAGAIN && errno != EWOULDBLOCK && errno != EINTR) {
			return -1;
		}
	} while (len > 0);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
movl %ebp, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x30e0
testq %rax, %rax
js 0x72e2
subq %rax, %rbx
jmp 0x72f3
callq 0x3050
movl (%rax), %eax
cmpl $0xb, %eax
je 0x72f3
cmpl $0x4, %eax
jne 0x72ff
testq %rbx, %rbx
jne 0x72cb
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x72fa
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/kopen.c
// Function: kftp_get_response
static int kftp_get_response(ftpaux_t *aux)
{
	unsigned char c;
	int n = 0;
	char *p;
	if (socket_wait(aux->ctrl_fd, 1) <= 0) return 0;
	while (read(aux->ctrl_fd, &c, 1)) { // FIXME: this is *VERY BAD* for unbuffered I/O
		if (n >= aux->max_response) {
			aux->max_response = aux->max_response? aux->max_response<<1 : 256;
			aux->response = realloc(aux->response, aux->max_response);
		}
		aux->response[n++] = c;
		if (c == '\n') {
			if (n >= 4 && isdigit(aux->response[0]) && isdigit(aux->response[1]) && isdigit(aux->response[2])
				&& aux->response[3] != '-') break;
			n = 0;
			continue;
		}
	}
	if (n < 2) return -1;
	aux->response[n-2] = 0;
	return strtol(aux->response, &p, 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl 0x4(%rdi), %edi
movl $0x1, %esi
callq 0x74ae
testl %eax, %eax
jle 0x7439
movl 0x4(%rbx), %edi
leaq 0xf(%rsp), %rsi
movl $0x1, %edx
callq 0x3510
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x743b
xorl %r14d, %r14d
leaq 0xf(%rsp), %r15
leaq 0x1e330(%rip), %r12     # 0x2568b
leaq 0x1e408(%rip), %r13     # 0x2576a
movl (%rbx), %ecx
movq 0x8(%rbx), %rax
cmpl %ecx, %r14d
jl 0x7396
leal (%rcx,%rcx), %edx
testl %ecx, %ecx
movl $0x100, %ecx            # imm = 0x100
cmovel %ecx, %edx
movl %edx, (%rbx)
movslq %edx, %rsi
movq %rax, %rdi
movq %r12, %rdx
movl $0x9d, %ecx
movq %r13, %r8
callq 0x2324c
movq %rax, 0x8(%rbx)
movb 0xf(%rsp), %cl
leal 0x1(%r14), %ebp
movslq %r14d, %rdx
movb %cl, (%rax,%rdx)
cmpb $0xa, %cl
jne 0x73b4
cmpl $0x3, %r14d
jge 0x73ce
xorl %r14d, %r14d
jmp 0x73b7
movl %ebp, %r14d
movl 0x4(%rbx), %edi
movl $0x1, %edx
movq %r15, %rsi
callq 0x3510
testq %rax, %rax
jne 0x7362
jmp 0x740b
callq 0x3320
movq (%rax), %rcx
movq 0x8(%rbx), %rax
movsbq (%rax), %rdx
testb $0x8, 0x1(%rcx,%rdx,2)
je 0x73af
movsbq 0x1(%rax), %rdx
testb $0x8, 0x1(%rcx,%rdx,2)
je 0x73af
movsbq 0x2(%rax), %rdx
testb $0x8, 0x1(%rcx,%rdx,2)
je 0x73af
cmpb $0x2d, 0x3(%rax)
movl $0x0, %r14d
je 0x73b7
jmp 0x741d
cmpl $0x2, %r14d
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
jl 0x743b
movq 0x8(%rbx), %rax
movl %r14d, %ebp
movl %ebp, %ecx
movb $0x0, -0x2(%rax,%rcx)
movq 0x8(%rbx), %rdi
leaq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x34e0
movq %rax, %rcx
jmp 0x743b
xorl %ecx, %ecx
movl %ecx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/kopen.c
// Function: socket_wait
static int socket_wait(int fd, int is_read)
{
	fd_set fds, *fdr = 0, *fdw = 0;
	struct timeval tv;
	int ret;
	tv.tv_sec = 5; tv.tv_usec = 0; // 5 seconds time out
	FD_ZERO(&fds);
	FD_SET(fd, &fds);
	if (is_read) fdr = &fds;
	else fdw = &fds;
	ret = select(fd+1, fdr, fdw, 0, &tv);
	if (ret == -1) perror("select");
	return ret;
}

// Assembly:
pushq %rbx
subq $0x90, %rsp
movl %esi, %eax
movq %rsp, %r8
movq $0x5, (%r8)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x50(%rsi)
leal 0x3f(%rdi), %edx
testl %edi, %edi
cmovnsl %edi, %edx
movl %edx, %r9d
andl $-0x40, %r9d
movl %edi, %ecx
subl %r9d, %ecx
movl $0x1, %r9d
shlq %cl, %r9
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x70(%rsi)
sarl $0x6, %edx
movslq %edx, %rcx
orq %r9, 0x10(%rsp,%rcx,8)
xorl %ecx, %ecx
testl %eax, %eax
movl $0x0, %edx
cmoveq %rsi, %rdx
movq $0x0, 0x8(%r8)
cmoveq %rcx, %rsi
incl %edi
xorl %ecx, %ecx
callq 0x32d0
movl %eax, %ebx
cmpl $-0x1, %eax
je 0x7545
movl %ebx, %eax
addq $0x90, %rsp
popq %rbx
retq
leaq 0x1e230(%rip), %rdi     # 0x2577c
callq 0x3280
jmp 0x753a
nop
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/translations.c
// Function: convertTransArgs
int * convertTransArgs(const char * passArguments) {
    char * workArguments, * parseArgument;
    int * retTranslations;
    int argIdx;
    int transCount, valid;

    // Check for help mode
    if (passArguments[0] == '?') {
        renderTranslations();
        exit(0);
    }

    // Copy arguments over to temporary area
    workArguments = calloc(strlen(passArguments)+1, 1);
    memcpy(workArguments, passArguments, strlen(passArguments)+1);

    // Count commas to calculate array size, and replace with NULLs for parsing
    for (argIdx = 0, transCount = 0 ; workArguments[argIdx] ; argIdx++) {
        if (workArguments[argIdx] == ',') {
            workArguments[argIdx] = 0;
            transCount++;
        }
    }

    transCount++;
    retTranslations = calloc(transCount+1, sizeof(int));

    // Parse arguments
    parseArgument = workArguments;
    valid = 1;

    for (argIdx = 0 ; argIdx < transCount ; argIdx++) {
        retTranslations[argIdx] = atoi(parseArgument); 
        parseArgument += strlen(parseArgument) + 1;

        // Check for valid translation ID
        if (retTranslations[argIdx] < 1 || retTranslations[argIdx] > TRANSLATION_COUNT) {
            valid = 0; break;
        }

        if (translationNames[retTranslations[argIdx] - 1][0] == 0) {
            valid = 0; break;
        }
    }

    // If invalid, only translate for standard genetic code
    if (!valid) {
        retTranslations[0] = 1;
        retTranslations[1] = 0;
    }

    return retTranslations;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpb $0x3f, (%rdi)
je 0x9139
movq %rdi, %r14
callq 0x3100
leaq 0x1(%rax), %r15
movl $0x1, %esi
movq %r15, %rdi
callq 0x31b0
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3260
xorl %r15d, %r15d
movq %rbx, %rax
movzbl (%rax), %ecx
cmpl $0x2c, %ecx
je 0x90bc
testl %ecx, %ecx
jne 0x90c2
jmp 0x90c7
movb $0x0, (%rax)
incl %r15d
incq %rax
jmp 0x90ae
leal 0x2(%r15), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x31b0
movq %rax, %r14
testl %r15d, %r15d
js 0x912c
incl %r15d
xorl %r12d, %r12d
leaq 0x27943(%rip), %r13     # 0x30a30
movq %rbx, %rdi
callq 0x35b0
movl %eax, (%r14,%r12,4)
leal -0x1a(%rax), %ecx
cmpl $-0x19, %ecx
jb 0x9125
decl %eax
movq (%r13,%rax,8), %rax
cmpb $0x0, (%rax)
je 0x9125
incq %r12
movq %rbx, %rdi
callq 0x3100
addq %rax, %rbx
incq %rbx
cmpq %r12, %r15
jne 0x90ed
jmp 0x912c
movq $0x1, (%r14)
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x9145
xorl %edi, %edi
callq 0x33c0
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/translations.c
// Function: renderTranslations
void renderTranslations() {
    char * transName;
    int transIdx;

    printf("\nThe following genetic code translation tables are available to PALADIN.\n"
           "Multiple codes may be specified by a comma-delimited list with no spaces.\n"
           "If no translation codes are specified, code 1 is used.\n"
           "Details may be found at http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi\n\n"); 

    for (transIdx = 0 ; transIdx < TRANSLATION_COUNT ; transIdx++) {
        if ((transName = (char *) translationNames[transIdx])[0] != 0) {
            printf("%d. %s\n", transIdx + 1, transName); 
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x1deb2(%rip), %rdi     # 0x27006
callq 0x3590
movl $0x1, %ebx
leaq 0x278cb(%rip), %r15     # 0x30a30
leaq 0x1de92(%rip), %r14     # 0x26ffe
xorl %r12d, %r12d
movq (%r12,%r15), %rdx
cmpb $0x0, (%rdx)
je 0x9184
movq %r14, %rdi
movl %ebx, %esi
xorl %eax, %eax
callq 0x3060
addq $0x8, %r12
incl %ebx
cmpq $0xc8, %r12
jne 0x916f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/protein.c
// Function: encodeCodon
unsigned char encodeCodon(char * passSequence, int passStrand) {
	unsigned char retCodon;
	int relIdx, absIdx;

	retCodon = 0;

	for (relIdx = 0 ; relIdx < 3 ; relIdx++) {
		// Calculate absolute index from relative
		absIdx = relIdx;
		if (passStrand < 0) absIdx = absIdx * -1;

		// If this codon has any ambiguous nucleotides, signal with 0xFF
		if (nst_nt4_table[(int) passSequence[absIdx]] > 3) {
			return 0xFF;
		}

		retCodon = (retCodon << 2) | nst_nt4_table[(int) passSequence[absIdx]];
	}

	// Complement if reverse strand
	if (passStrand < 0) retCodon ^= 0x3F;

	return retCodon;
}

// Assembly:
xorl %ecx, %ecx
leaq 0x27997(%rip), %rdx     # 0x30b40
xorl %r8d, %r8d
xorl %eax, %eax
testl %esi, %esi
movl %r8d, %r9d
cmovsl %ecx, %r9d
movslq %r9d, %r9
movsbq (%rdi,%r9), %r9
movb (%rdx,%r9), %r9b
cmpb $0x3, %r9b
ja 0x91e7
shlb $0x2, %al
orb %r9b, %al
incl %r8d
decl %ecx
cmpl $-0x3, %ecx
jne 0x91ae
movzbl %al, %ecx
xorb $0x3f, %al
testl %esi, %esi
movzbl %al, %eax
cmovnsl %ecx, %eax
retq
movb $-0x1, %al
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/protein.c
// Function: convertToAA
int convertToAA(char * passSequence, CDS * passCDS, int passTrans, char ** retSequence, unsigned long * retSize) {
	unsigned long nucIdx, aaIdx;
	unsigned long seqLen, seqStart;
	unsigned char currentCodon;

	// Calculate sequence length and loop control from CDS entry
	seqLen = passCDS->endIdx + 1 - passCDS->startIdx - passCDS->phase;
	seqStart = (passCDS->strand == 1) ? passCDS->startIdx : passCDS->endIdx;

	// Reserve memory for amino acid sequence
	*retSize = (seqLen + 2) / 3;
	*retSequence = malloc(*retSize);

	// Iterate through all codons in the nucleotide sequence
	for (nucIdx = 0, aaIdx = 0 ; nucIdx < seqLen ; nucIdx += 3, aaIdx++) {
		// If we've exhausted nucleotides premature to a full frame, assign ambiguous AA and exit
		if (nucIdx + 3 > seqLen) {
			(*retSequence)[aaIdx] = 'X';
			break;
		}

		// Encode codon
		currentCodon = encodeCodon(passSequence + seqStart + (passCDS->strand * nucIdx), passCDS->strand);

		if (currentCodon == 0xFF) {
            // If ambiguous nucleotides are present, assign ambiguous AA
			(*retSequence)[aaIdx] = 'X';
		}
        else {
            // Hash to amino acid IUPAC
            (*retSequence)[aaIdx] = codon_aa_hash[passTrans][currentCodon];
        }
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movl %edx, 0xc(%rsp)
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rax
movq 0x8(%rsi), %r13
movswq 0x12(%rsi), %rbp
leaq 0x1(%r13), %r12
movq %rax, 0x10(%rsp)
addq %rax, %rbp
movq %r12, %rax
subq %rbp, %rax
addq $0x2, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
movq %rdx, %rdi
movzwl 0x10(%rsi), %eax
movw %ax, 0xa(%rsp)
shrq %rdi
movq %rdi, (%r8)
leaq 0x1def3(%rip), %rsi     # 0x27140
leaq 0x1def6(%rip), %rcx     # 0x2714a
movl $0x56, %edx
callq 0x23213
movq %rax, (%rbx)
subq %rbp, %r12
je 0x932f
cmpw $0x1, 0xa(%rsp)
cmoveq 0x10(%rsp), %r13
addq %r13, %r15
movslq 0xc(%rsp), %rax
xorl %ecx, %ecx
leaq 0x278b9(%rip), %rdx     # 0x30b40
shlq $0x6, %rax
addq 0x26d66(%rip), %rax     # 0x2fff8
xorl %esi, %esi
movq %rcx, %rdi
addq $0x3, %rcx
cmpq %r12, %rcx
ja 0x9328
movswq 0x10(%r14), %r8
imulq %r8, %rdi
addq %r15, %rdi
xorl %r10d, %r10d
xorl %r11d, %r11d
xorl %r9d, %r9d
testw %r8w, %r8w
movl %r11d, %ebp
cmovsl %r10d, %ebp
movslq %ebp, %r13
movsbq (%rdi,%r13), %r13
movb (%rdx,%r13), %bpl
cmpb $0x3, %bpl
ja 0x9310
shlb $0x2, %r9b
orb %bpl, %r9b
incl %r11d
decl %r10d
cmpl $-0x3, %r10d
jne 0x92b9
movzbl %r9b, %edi
xorb $0x3f, %r9b
testw %r8w, %r8w
movzbl %r9b, %r8d
cmovnsl %edi, %r8d
movq (%rbx), %rdi
cmpb $-0x1, %r8b
je 0x9313
movzbl %r8b, %r8d
movb (%r8,%rax), %r8b
jmp 0x9316
movq (%rbx), %rdi
movb $0x58, %r8b
movb %r8b, (%rdi,%rsi)
incq %rsi
cmpq %r12, %rcx
jb 0x9294
jmp 0x932f
movq (%rbx), %rax
movb $0x58, (%rax,%rsi)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/protein.c
// Function: getLastAlignedOrfPos
long getLastAlignedOrfPos(long passLength, int passFrame, mem_opt_t * passOptions) {
	long retValue;

	if (passOptions->min_orf_percent) {
		// Minimum ORF length specified as a read length percentage
		retValue = getLastAlignedPos(passOptions->min_orf_percent * passLength, passFrame);
	}
	else {
		// Minimum ORF length specified as constant value, check for adjustment
		if ((passOptions->proteinFlag & ALIGN_FLAG_ADJUST_ORF) && (passLength < passOptions->min_orf_len)) {
			retValue = getLastAlignedPos(passLength, passFrame);
		}
		else {
			retValue = getLastAlignedPos(passOptions->min_orf_len, passFrame);
		}
	}


	return retValue;
}

// Assembly:
movss 0x6c(%rdx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x93d1
jnp 0x9445
xorps %xmm1, %xmm1
cvtsi2ss %rdi, %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %rcx
movabsq $0x5555555555555556, %rdx # imm = 0x5555555555555556
movq %rcx, %rax
imulq %rdx
movq %rdx, %rax
shrq $0x3f, %rax
addq %rdx, %rax
leaq (%rax,%rax,2), %rax
movq %rcx, %rdx
subq %rax, %rdx
cmpl $0x2, %esi
jg 0x94c4
notq %rdx
movslq %esi, %rax
imulq $0x55555556, %rax, %rax # imm = 0x55555556
movq %rax, %rdi
shrq $0x3f, %rdi
shrq $0x20, %rax
addl %edi, %eax
leal (%rax,%rax,2), %eax
subl %eax, %esi
movslq %esi, %rax
addq %rcx, %rax
leaq (%rax,%rdx), %rsi
cmpq %rcx, %rsi
leaq -0x3(%rdx,%rax), %rax
jmp 0x953b
movb 0x4c(%rdx), %cl
shrb $0x3, %cl
movl 0x68(%rdx), %eax
cltq
cmpq %rdi, %rax
setg %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x94e7
movabsq $0x5555555555555556, %rcx # imm = 0x5555555555555556
movq %rdi, %rax
imulq %rcx
movq %rdx, %rax
shrq $0x3f, %rax
addq %rdx, %rax
leaq (%rax,%rax,2), %rax
movq %rdi, %rcx
subq %rax, %rcx
cmpl $0x2, %esi
jg 0x9540
notq %rcx
addq %rdi, %rcx
movslq %esi, %rax
imulq $0x55555556, %rax, %rax # imm = 0x55555556
movq %rax, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rax
addl %edx, %eax
leal (%rax,%rax,2), %eax
subl %eax, %esi
movslq %esi, %rax
leaq (%rcx,%rax), %rdx
cmpq %rdi, %rdx
leaq -0x3(%rax,%rcx), %rax
cmovlq %rdx, %rax
retq
movl %esi, %eax
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq %rax, %rcx
shrq $0x21, %rcx
leal (%rcx,%rcx,2), %eax
subl %eax, %esi
subq %rsi, %rdx
leaq 0x3(%rdx), %rax
testq %rdx, %rdx
cmovnsq %rdx, %rax
retq
imulq $0x55555556, %rax, %rcx # imm = 0x55555556
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,2), %ecx
movl %eax, %edx
subl %ecx, %edx
movslq %edx, %rcx
cmpl $0x2, %esi
jg 0x9540
notq %rcx
movslq %esi, %rdx
imulq $0x55555556, %rdx, %rdx # imm = 0x55555556
movq %rdx, %rdi
shrq $0x3f, %rdi
shrq $0x20, %rdx
addl %edi, %edx
leal (%rdx,%rdx,2), %edx
subl %edx, %esi
movslq %esi, %rdx
addq %rax, %rdx
leaq (%rdx,%rcx), %rsi
cmpq %rax, %rsi
leaq -0x3(%rcx,%rdx), %rax
cmovlq %rsi, %rax
retq
movl %esi, %eax
movl $0xaaaaaaab, %edx       # imm = 0xAAAAAAAB
imulq %rax, %rdx
shrq $0x21, %rdx
leal (%rdx,%rdx,2), %eax
subl %eax, %esi
subq %rsi, %rcx
leaq 0x3(%rcx), %rax
testq %rcx, %rcx
cmovnsq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/protein.c
// Function: addORFHistory
void addORFHistory(long * passHistory[2][6], long passHistorySize[6], unsigned long passIdx ) {
	int copyIdx;
	long * tempHistory;

	if (passHistorySize[passIdx] == 0) {
		// New array
		passHistory[0][passIdx] = malloc(sizeof(long));
		passHistory[1][passIdx] = malloc(sizeof(long));
	}
	else {
		// If array has existing items, resize, copy, and free old
		for (copyIdx = 0 ; copyIdx < 2 ; copyIdx++) {
			tempHistory = passHistory[copyIdx][passIdx];
			passHistory[copyIdx][passIdx] = malloc((passHistorySize[passIdx] + 1) * sizeof(long));
			memcpy(passHistory[copyIdx][passIdx], tempHistory, passHistorySize[passIdx] * sizeof(long));
			free(tempHistory);
		}
	}

	// Update size
	passHistorySize[passIdx]++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq $0x0, (%rsi,%rdx,8)
je 0x95ea
movb $0x1, %r12b
xorl %eax, %eax
leaq (%rax,%rax,2), %r13
shlq $0x4, %r13
addq %r15, %r13
movq (%r13,%rbx,8), %rbp
movq (%r14,%rbx,8), %rax
leaq 0x8(,%rax,8), %rdi
leaq 0x1db9a(%rip), %rsi     # 0x27140
movl $0xa5, %edx
leaq 0x1dba4(%rip), %rcx     # 0x27156
callq 0x23213
movq %rax, (%r13,%rbx,8)
movq (%r14,%rbx,8), %rdx
shlq $0x3, %rdx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x3260
movq %rbp, %rdi
callq 0x3390
movl $0x1, %eax
testb $0x1, %r12b
movl $0x0, %r12d
jne 0x9583
jmp 0x962b
leaq 0x1db4f(%rip), %r12     # 0x27140
leaq 0x1db5e(%rip), %r13     # 0x27156
movl $0x8, %edi
movq %r12, %rsi
movl $0x9e, %edx
movq %r13, %rcx
callq 0x23213
movq %rax, (%r15,%rbx,8)
movl $0x8, %edi
movq %r12, %rsi
movl $0x9f, %edx
movq %r13, %rcx
callq 0x23213
movq %rax, 0x30(%r15,%rbx,8)
incq (%r14,%rbx,8)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/protein.c
// Function: compileORFHistory
void compileORFHistory(long * passHistory[2][6], long passHistorySize[6], CDS * * retCDS, unsigned long * retCount) {
	unsigned long srcFrameIdx, srcHistoryIdx;
	unsigned long srcStart, srcEnd, totalSize;
	int relStart, validEntry;

	// Allocate potential CDS records per entry in history array
	totalSize = 0;
	for (srcFrameIdx = 0 ; srcFrameIdx < 6 ; srcFrameIdx++) totalSize += passHistorySize[srcFrameIdx];

	*retCDS = calloc(totalSize, sizeof(CDS));
	*retCount = 0;
	relStart = -1;

	// Iterate through each entry in each reading frame
	for (srcFrameIdx = 0 ; srcFrameIdx < 6 ; srcFrameIdx++) {
		for (srcHistoryIdx = 0 ; srcHistoryIdx < passHistorySize[srcFrameIdx] ; srcHistoryIdx++) {
			// Swap start/stop for reverse direction
			if (passHistory[0][srcFrameIdx][srcHistoryIdx] < passHistory[1][srcFrameIdx][srcHistoryIdx]) {
				srcStart = passHistory[0][srcFrameIdx][srcHistoryIdx];
				srcEnd = passHistory[1][srcFrameIdx][srcHistoryIdx];
			}
			else {
				srcStart = passHistory[1][srcFrameIdx][srcHistoryIdx];
				srcEnd = passHistory[0][srcFrameIdx][srcHistoryIdx];
			}

			validEntry = 1;

			// Filter minimum ORF size
			//if (srcLen < passMinORF) continue;

			// Add CDS record if valid (current strategy marks all as valid)
			if (validEntry) {
				if (relStart < 0) relStart = srcFrameIdx;

				(*retCDS)[*retCount].startIdx = srcStart;
				(*retCDS)[*retCount].endIdx = srcEnd;
				(*retCDS)[*retCount].strand = (srcFrameIdx < 3) ? 1 : -1;
				(*retCDS)[*retCount].relFrame = srcFrameIdx - relStart;

				(*retCount)++;
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
pxor %xmm0, %xmm0
xorl %eax, %eax
movdqu (%r14,%rax,8), %xmm1
paddq %xmm1, %xmm0
addq $0x2, %rax
cmpq $0x6, %rax
jne 0x965b
pshufd $0xee, %xmm0, %xmm1     # xmm1 = xmm0[2,3,2,3]
paddq %xmm0, %xmm1
movq %xmm1, %rdi
leaq 0x1dabc(%rip), %rdx     # 0x27140
leaq 0x1dad9(%rip), %r8      # 0x27164
movl $0x2018, %esi           # imm = 0x2018
movl $0xb9, %ecx
callq 0x2319c
movq %rax, (%r12)
movq $0x0, (%rbx)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %esi, %esi
xorl %edx, %edx
cmpq $0x0, (%r14,%rdx,8)
je 0x972e
movq (%r15,%rdx,8), %rdi
movq 0x30(%r15,%rdx,8), %r8
cmpq $0x3, %rdx
movl $0x0, %r9d
adcl $-0x1, %r9d
orl $0x1, %r9d
xorl %r10d, %r10d
movq (%rdi,%r10,8), %r11
movq (%r8,%r10,8), %r12
cmpq %r12, %r11
movq %r12, %r13
cmovlq %r11, %r13
cmovgq %r11, %r12
testl %ecx, %ecx
cmovsl %edx, %ecx
imulq $0x2018, %rsi, %rsi     # imm = 0x2018
movq %r13, (%rax,%rsi)
imulq $0x2018, (%rbx), %rsi   # imm = 0x2018
movq %r12, 0x8(%rax,%rsi)
movq (%rbx), %rsi
imulq $0x2018, %rsi, %r11     # imm = 0x2018
movw %r9w, 0x10(%rax,%r11)
movl %edx, %ebp
subl %ecx, %ebp
movw %bp, 0x14(%rax,%r11)
incq %rsi
movq %rsi, (%rbx)
incq %r10
cmpq (%r14,%rdx,8), %r10
jb 0x96d3
incq %rdx
cmpq $0x6, %rdx
jne 0x96ae
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/protein.c
// Function: writeIndexDirectProtein
int writeIndexDirectProtein(const char * passPrefix, const char * passProName, IndexHeader passHeader) {
	FILE * outputPtr;

	outputPtr = err_xopen_core(__func__, passProName, "w");

	// Write index type header
	passHeader.nucleotide = 0;
	writeIndexHeader(outputPtr, passHeader);

	// Close file
	fflush(outputPtr);
	err_fclose(outputPtr);

	return 0;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
leaq 0x1d196(%rip), %rdi     # 0x271ba
leaq 0x1f534(%rip), %rdx     # 0x2955f
callq 0xe023
movq %rax, %rbx
movl $0x0, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x57e4
movq %rbx, %rdi
callq 0x3370
movq %rbx, %rdi
callq 0xe71e
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/uniprot.c
// Function: prepareUniprotReport
void prepareUniprotReport(int passType, int passPrimary, UniprotList * passLists, CURLBuffer * passBuffer, const char * passProxy) {
	UniprotList * globalLists;

	// Aggregate and sort lists by value
	prepareUniprotLists(passLists, passPrimary);

	// Do not process if no results
	globalLists = getGlobalLists(passPrimary);
	if (globalLists[0].entryCount == 0) return;

	// Report specific preparation
	if (passType == OUTPUT_TYPE_UNIPROT_FULL) {
		// Submit entries to UniProt and retrieve full information
		retrieveUniprotOnline(passLists + UNIPROT_LIST_FULL, passBuffer, passProxy);
		joinOnlineLists(passLists + UNIPROT_LIST_FULL, passBuffer->buffer);
	}

	// Sort aggregated lists by count
	qsort(passLists[UNIPROT_LIST_FULL].entries, passLists[UNIPROT_LIST_FULL].entryCount, sizeof(UniprotEntry), uniprotEntryCompareID);
	qsort(passLists[UNIPROT_LIST_GENES].entries, passLists[UNIPROT_LIST_GENES].entryCount, sizeof(UniprotEntry), uniprotEntryCompareGene);
	qsort(passLists[UNIPROT_LIST_ORGANISM].entries, passLists[UNIPROT_LIST_ORGANISM].entryCount, sizeof(UniprotEntry), uniprotEntryCompareOrganism);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r8, %r15
movq %rcx, %r14
movq %rdx, %rbx
movl %esi, %r12d
movl %edi, %ebp
movq %rdx, %rdi
callq 0xa632
testl %r12d, %r12d
leaq 0x268bb(%rip), %rax     # 0x30e60
leaq 0x268ac(%rip), %rcx     # 0x30e58
cmoveq %rax, %rcx
movq (%rcx), %rax
cmpl $0x0, 0x8(%rax)
je 0xa629
cmpl $0x1, %ebp
jne 0xa5d7
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xa7eb
movq (%r14), %rsi
movq %rbx, %rdi
callq 0xac21
movq (%rbx), %rdi
movslq 0x8(%rbx), %rsi
leaq 0x7ab(%rip), %rcx       # 0xad90
movl $0x28, %edx
callq 0x3760
movq 0x10(%rbx), %rdi
movslq 0x18(%rbx), %rsi
leaq 0x7a6(%rip), %rcx       # 0xada4
movl $0x28, %edx
callq 0x3760
movq 0x20(%rbx), %rdi
movslq 0x28(%rbx), %rsi
leaq 0x7a3(%rip), %rcx       # 0xadba
movl $0x28, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3760
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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:
movslq 0x8(%rdi), %rax
testq %rax, %rax
jle 0xb019
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movq (%rdi), %rdx
leaq (,%rax,8), %rcx
leaq (%rcx,%rcx,4), %rsi
xorl %edi, %edi
xorl %ecx, %ecx
addl 0x18(%rdx,%rdi), %ecx
addq $0x28, %rdi
cmpq %rdi, %rsi
jne 0xaf4b
testl %eax, %eax
jle 0xb00b
cvtsi2ss %ecx, %xmm0
movss %xmm0, 0x4(%rsp)
movl $0x20, %r12d
xorl %r13d, %r13d
leaq 0x1c9e6(%rip), %r15     # 0x27960
movq (%r14), %rax
movl -0x8(%rax,%r12), %edx
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
xorps %xmm1, %xmm1
cvtsi2ssl -0x4(%rax,%r12), %xmm1
divss %xmm0, %xmm1
divss 0x4(%rsp), %xmm0
mulss 0x1c32b(%rip), %xmm0    # 0x272d0
cmpl $0x2, %ebp
je 0xafd9
cmpl $0x1, %ebp
je 0xafc6
testl %ebp, %ebp
jne 0xaff7
cvtss2sd %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
movl (%rax,%r12), %ecx
movq -0x20(%rax,%r12), %r8
jmp 0xafea
cvtss2sd %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
movl (%rax,%r12), %ecx
movq -0x18(%rax,%r12), %r8
jmp 0xafea
cvtss2sd %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
movl (%rax,%r12), %ecx
movq -0x10(%rax,%r12), %r8
movq %rbx, %rdi
movq %r15, %rsi
movb $0x2, %al
callq 0x3500
incq %r13
movslq 0x8(%r14), %rax
addq $0x28, %r12
cmpq %rax, %r13
jl 0xaf7a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/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 0x25e2d(%rip), %rax     # 0x30e60
leaq 0x25e1e(%rip), %rcx     # 0x30e58
cmoveq %rax, %rcx
movq %rdi, %rbx
movq (%rcx), %r14
cmpl $0x0, 0x8(%r14)
jle 0xb087
xorl %r15d, %r15d
xorl %r12d, %r12d
movq (%r14), %rax
movq (%rax,%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
movslq 0x8(%r14), %rax
addq $0x28, %r15
cmpq %rax, %r12
jl 0xb051
movq (%r14), %rdi
callq 0x3390
movq %r14, %rdi
callq 0x3390
xorl %r14d, %r14d
movq (%rbx,%r14), %rdi
callq 0x3390
addq $0x10, %r14
cmpq $0x30, %r14
jne 0xb09a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x1c40f(%rip), %rdi     # 0x274de
leaq 0x1c41e(%rip), %rdx     # 0x274f4
movl $0x3, %esi
xorl %eax, %eax
callq 0xde80
movq %r15, %rdi
callq 0x3100
leaq 0x5(%rax), %rdi
callq 0x3470
movq %rax, %r14
leaq 0x1c416(%rip), %rsi     # 0x27513
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 0xb139
movq %r15, %rdi
xorl %esi, %esi
callq 0xb1be
cmpl $-0x1, %ebp
je 0xb1a1
movq %r14, %rdi
movl $0x1, %esi
callq 0xb1be
jmp 0xb13e
cmpl $-0x1, %ebp
je 0xb1a1
leaq 0x1a2b6(%rip), %rsi     # 0x253fb
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3070
leaq 0x1c385(%rip), %rdi     # 0x274de
leaq 0x1e3ff(%rip), %rdx     # 0x2955f
movq %r14, %rsi
callq 0xe023
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 0x57e4
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_O3/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 0x256ee(%rip), %r15     # 0x30b00
movq (%r15,%r13,8), %rsi
leaq 0x1c138(%rip), %rdi     # 0x27555
leaq 0x1e13b(%rip), %rdx     # 0x2955f
callq 0xe023
movq %rax, %r14
movq (%r15,%r13,8), %r15
leaq 0x256e9(%rip), %rbp     # 0x30b20
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 0xb474
movq %rbx, %rdi
movl $0x2714, %esi           # imm = 0x2714
movq %r12, %rdx
xorl %eax, %eax
callq 0x3350
movq (%rbp,%r13,8), %rcx
leaq 0x1c0d5(%rip), %rdi     # 0x27555
leaq 0x1c0e7(%rip), %rdx     # 0x2756e
movl $0x3, %esi
xorl %eax, %eax
callq 0xde80
movq %rbx, %rdi
callq 0x3460
testl %eax, %eax
je 0xb4da
movl %eax, %edi
callq 0x3520
leaq 0x1c0a8(%rip), %rdi     # 0x27555
leaq 0x1bb4e(%rip), %rdx     # 0x27002
movl $0x1, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0xde80
leaq 0x25636(%rip), %rax     # 0x30b00
movq (%rax,%r13,8), %rdi
callq 0x3110
leaq 0x1d1ec(%rip), %r15     # 0x286c6
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_O3/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
movl $0x1, %edi
movq %r14, %rsi
callq 0x31b0
movq %rax, (%rbx)
movl %r14d, 0xc(%rbx)
movl $0x0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq