LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/rk11.c
// Function: svc_rk11
int
svc_rk11(Bus *bus, void *dev)
{
	int i;
	RK11 *rk = dev;

	if((rk->rkcs & RDY) && (rk->rkcs & GO)){
		rk->rkcs &= ~GO;
		start_rk11(&rk->drives[rk->d], rk);
	}
	for(i = 0; i < 8; i++)
		svc_rk05(&rk->drives[i], rk, rk->d == i);

	if(rk->rker & 177740)
		rk->rkcs |= HE;
	else
		rk->rkcs &= ~HE;
	if(rk->rker)
		rk->rkcs |= ERR;
	else
		rk->rkcs &= ~ERR;

	return (rk->rkcs&IDE) &&
// TODO: probably just have one interrupt bit?
	       (rk->done || (rk->rkcs&HE) || (rk->rkcs&ERR) && (rk->rkcs&SSE)) ?
		5 : 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl 0xc(%rsi), %eax
movl %eax, %ecx
notl %ecx
testb $-0x7f, %cl
jne 0x5cb0
andl $0xfffe, %eax           # imm = 0xFFFE
movw %ax, 0xc(%rbx)
movslq 0x20(%rbx), %rax
imulq $0x30, %rax, %rax
leaq (%rbx,%rax), %rdi
addq $0x28, %rdi
movq %rbx, %rsi
callq 0x5b01
leaq 0x28(%rbx), %r14
xorl %r15d, %r15d
cmpq $0x8, %r15
je 0x5cdc
movl 0x20(%rbx), %eax
xorl %edx, %edx
cmpq %rax, %r15
sete %dl
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5d41
incq %r15
addq $0x30, %r14
jmp 0x5cb7
movzwl 0xa(%rbx), %eax
movzwl 0xc(%rbx), %ecx
testw $0xb64c, %ax            # imm = 0xB64C
je 0x5cf2
orl $0x4000, %ecx           # imm = 0x4000
jmp 0x5cfd
testw %ax, %ax
je 0x5d39
andl $0xbfff, %ecx           # imm = 0xBFFF
orl $0x8000, %ecx           # imm = 0x8000
movw %cx, 0xc(%rbx)
movzwl %cx, %edx
xorl %eax, %eax
testb $0x40, %dl
je 0x5d33
movl %edx, %esi
andl $0x4000, %esi           # imm = 0x4000
orl 0x1c(%rbx), %esi
je 0x5d23
pushq $0x5
popq %rax
jmp 0x5d33
testw %cx, %cx
jns 0x5d33
shll $0x17, %edx
sarl $0x1f, %edx
andl $0x5, %edx
movl %edx, %eax
popq %rbx
popq %r14
popq %r15
retq
andl $0x3fff, %ecx           # imm = 0x3FFF
jmp 0x5d03
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/rk11.c
// Function: attach_rk05
void
attach_rk05(RK11 *rk, int n, char *path)
{
	if(rk->drives[n].fp)
		detach_rk05(rk, n);
	rk->drives[n].fp = fopen(path, "r+");
	if(rk->drives[n].fp == nil)
		rk->drives[n].fp = fopen(path, "w+");
	if(rk->drives[n].fp == nil)
		fprintf(stderr, "couldn't open '%s'\n", path);
	reset_rk05(&rk->drives[n]);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movslq %esi, %rax
imulq $0x30, %rax, %rax
leaq (%rdi,%rax), %r14
addq $0x28, %r14
cmpq $0x0, (%r14)
je 0x60d7
callq 0x6141
leaq 0x15a5(%rip), %rsi      # 0x7683
movq %rbx, %rdi
callq 0x21b0
movq %rax, (%r14)
testq %rax, %rax
jne 0x6105
leaq 0x1591(%rip), %rsi      # 0x7686
movq %rbx, %rdi
callq 0x21b0
movq %rax, (%r14)
testq %rax, %rax
je 0x6124
movw $0x800, 0xc(%r14)       # imm = 0x800
andq $0x0, 0x10(%r14)
andl $0x0, 0x20(%r14)
andw $0x0, 0x2c(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x3ecd(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x1554(%rip), %rsi      # 0x7689
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2120
jmp 0x6105
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/rk11.c
// Function: detach_rk05
void
detach_rk05(RK11 *rk, int n)
{
	if(rk->drives[n].fp){
		fclose(rk->drives[n].fp);
		rk->drives[n].fp = nil;
	}
	reset_rk05(&rk->drives[n]);
}

// Assembly:
pushq %rbx
movslq %esi, %rax
imulq $0x30, %rax, %rax
leaq (%rdi,%rax), %rbx
addq $0x28, %rbx
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x6162
callq 0x2090
andq $0x0, (%rbx)
movw $0x800, 0xc(%rbx)       # imm = 0x800
andq $0x0, 0x10(%rbx)
andl $0x0, 0x20(%rbx)
andw $0x0, 0x2c(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/rk11.c
// Function: busaddr
static int
busaddr(RK11 *rk)
{
	int addr = rk->rkba | (rk->rkcs&060)<<12;
	if((rk->rkcs & IBA)==0){
		rk->rkba += 2;
		if(rk->rkba == 0)
			SETMASK(rk->rkcs, rk->rkcs+020, 060);
	}
	return addr;
}

// Assembly:
movzwl 0x10(%rdi), %ecx
movzwl 0xc(%rdi), %eax
btl $0xb, %eax
jb 0x61a3
movl %ecx, %edx
addw $0x2, %dx
movw %dx, 0x10(%rdi)
jne 0x61a3
movl %eax, %edx
andl $-0x31, %edx
leal 0x10(%rax), %esi
andl $0x30, %esi
orl %edx, %esi
movw %si, 0xc(%rdi)
andl $0x30, %eax
shll $0xc, %eax
orl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/mem.c
// Function: datob_mem
int
datob_mem(Bus *bus, void *dev)
{
	Memory *mem = dev;
	uint32 waddr = bus->addr>>1;
	if(waddr >= mem->start && waddr < mem->end){
		mem->mem[waddr-mem->start] &= (bus->addr&1) ? 0377 : ~0377;
		mem->mem[waddr-mem->start] |= bus->data & ((bus->addr&1) ? ~0377 : 0377);
		return 0;
	}
	return 1;
}

// Assembly:
movl 0x8(%rdi), %edx
movl %edx, %r8d
shrl %r8d
pushq $0x1
popq %rax
movl %r8d, %ecx
subl 0x8(%rsi), %ecx
jb 0x623e
cmpl 0xc(%rsi), %r8d
jae 0x623e
testb $0x1, %dl
movl $0xff00, %eax           # imm = 0xFF00
movl $0xff, %edx
movl $0xff, %r8d
cmovel %eax, %r8d
movq (%rsi), %rsi
cmovel %edx, %eax
andw (%rsi,%rcx,2), %r8w
movw %r8w, (%rsi,%rcx,2)
andw 0xc(%rdi), %ax
orl %r8d, %eax
movw %ax, (%rsi,%rcx,2)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/unix.c
// Function: handleclock
int
handleclock(Clock *clk)
{
	struct timespec diff;
	clock_gettime(CLOCK_REALTIME, &clk->newtime);
	diff.tv_sec = clk->newtime.tv_sec - clk->oldtime.tv_sec;
	diff.tv_nsec = clk->newtime.tv_nsec - clk->oldtime.tv_nsec;
	if(diff.tv_nsec < 0){
		diff.tv_nsec += 1000000000;
		diff.tv_sec -= 1;
	}
	if(diff.tv_nsec >= clk->period){
		clk->oldtime.tv_nsec += clk->period;
		if(clk->oldtime.tv_nsec >= 1000000000){
			clk->oldtime.tv_nsec -= 1000000000;
			clk->oldtime.tv_sec += 1;
		}
		return 1;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %rsi
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x2070
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rcx
subq %rax, %rcx
leaq 0x3b9aca00(%rcx), %rdx
testq %rcx, %rcx
cmovnsq %rcx, %rdx
movq 0x20(%rbx), %rcx
cmpq %rcx, %rdx
jl 0x630c
addq %rax, %rcx
movq %rcx, 0x8(%rbx)
pushq $0x1
popq %rbp
cmpq $0x3b9aca00, %rcx       # imm = 0x3B9ACA00
jl 0x630c
addq $-0x3b9aca00, %rcx      # imm = 0xC4653600
movq %rcx, 0x8(%rbx)
incq (%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/unix.c
// Function: timestamp
int
timestamp(char *buffer, size_t n)
{
	struct tm *tm;
	time_t t;

	t = time(NULL);
	if (t == (time_t)-1)
		return -1;
	tm = localtime(&t);
	if (tm == NULL)
		return -1;
	if(strftime(buffer, n, "%Y%m%d%H%M%S", tm) == 0)
		return -1;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorl %edi, %edi
callq 0x2140
movq %rax, 0x8(%rsp)
pushq $-0x1
popq %rbp
cmpq $-0x1, %rax
je 0x63c6
leaq 0x8(%rsp), %rdi
callq 0x2030
testq %rax, %rax
je 0x63c6
leaq 0x13ce(%rip), %rdx      # 0x777e
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rcx
callq 0x2190
xorl %ebp, %ebp
cmpq $0x1, %rax
sbbl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/util.c
// Function: hasinput
int
hasinput(int fd)
{
	fd_set fds;
	struct timeval timeout;

	if(fd < 0) return 0;

	timeout.tv_sec = 0;
	timeout.tv_usec = 0;
	FD_ZERO(&fds);
	FD_SET(fd, &fds);
	return select(fd+1, &fds, NULL, NULL, &timeout) > 0;
}

// Assembly:
testl %edi, %edi
js 0x642f
subq $0x98, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
xorl %eax, %eax
cmpq $0x10, %rax
je 0x63f9
andq $0x0, 0x18(%rsp,%rax,8)
incq %rax
jmp 0x63e8
pushq $0x1
popq %rax
movl %edi, %ecx
shlq %cl, %rax
movl %edi, %ecx
shrl $0x6, %ecx
orq %rax, 0x18(%rsp,%rcx,8)
incl %edi
leaq 0x18(%rsp), %rsi
movq %rsp, %r8
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2150
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setg %al
addq $0x98, %rsp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/util.c
// Function: readn
int
readn(int fd, void *data, int n)
{
	int m;

	while(n > 0){
		m = read(fd, data, n);
		if(m <= 0)
			return -1;
		data += m;
		n -= m;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movl %edi, %r15d
pushq $-0x1
popq %rbx
testl %ebp, %ebp
jle 0x6468
movl %ebp, %edx
movl %r15d, %edi
movq %r14, %rsi
callq 0x2100
testl %eax, %eax
jle 0x646a
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
addq %rcx, %r14
subl %eax, %ebp
jmp 0x6444
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/util.c
// Function: writen
int
writen(int fd, void *data, int n)
{
	int m;

	while(n > 0){
		m = write(fd, data, n);
		if(m <= 0)
			return -1;
		data += m;
		n -= m;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movl %edi, %r15d
pushq $-0x1
popq %rbx
testl %ebp, %ebp
jle 0x64ad
movl %ebp, %edx
movl %r15d, %edi
movq %r14, %rsi
callq 0x2080
testl %eax, %eax
jle 0x64af
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
addq %rcx, %r14
subl %eax, %ebp
jmp 0x6489
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/util.c
// Function: dial
int
dial(char *host, int port)
{
	char portstr[32];
	int sockfd;
	struct addrinfo *result, *rp, hints;

	memset(&hints, 0, sizeof(hints));
	hints.ai_family = AF_UNSPEC;
	hints.ai_socktype = SOCK_STREAM;

	snprintf(portstr, 32, "%d", port);
	if(getaddrinfo(host, portstr, &hints, &result)){
		perror("error: getaddrinfo");
		return -1;
	}

	for(rp = result; rp; rp = rp->ai_next){
		sockfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
		if(sockfd < 0)
			continue;
		if(connect(sockfd, rp->ai_addr, rp->ai_addrlen) >= 0)
			goto win;
		close(sockfd);
	}
	freeaddrinfo(result);
	perror("error");
	return -1;

win:
	freeaddrinfo(result);
	return sockfd;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movl %esi, %ecx
movq %rdi, %r14
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %r15
movaps %xmm0, (%r15)
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x10(%r15)
movl $0x1, 0x8(%r15)
leaq 0x1299(%rip), %rdx      # 0x778b
leaq 0x10(%rsp), %r12
pushq $0x20
popq %rsi
movq %r12, %rdi
xorl %eax, %eax
callq 0x20b0
leaq 0x8(%rsp), %rbx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x2210
testl %eax, %eax
jne 0x6585
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x6572
movl 0x4(%rbx), %edi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
callq 0x2240
testl %eax, %eax
js 0x6553
movl %eax, %ebp
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movl %eax, %edi
callq 0x21f0
testl %eax, %eax
jns 0x6559
movl %ebp, %edi
callq 0x20f0
addq $0x28, %rbx
jmp 0x651e
movq 0x8(%rsp), %rdi
callq 0x2230
movl %ebp, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdi
callq 0x2230
leaq 0x121e(%rip), %rdi      # 0x77a1
jmp 0x658c
leaq 0x1202(%rip), %rdi      # 0x778e
callq 0x21c0
pushq $-0x1
popq %rbp
jmp 0x6563
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/util.c
// Function: serve
void
serve(int port, void (*handlecon)(int, void*), void *arg)
{
	int sockfd, confd;
	socklen_t len;
	struct sockaddr_in server, client;
	int x;

	sockfd = socket(AF_INET, SOCK_STREAM, 0);
	if(sockfd < 0){
		perror("error: socket");
		return;
	}

	x = 1;
	setsockopt (sockfd, SOL_SOCKET, SO_REUSEADDR, (void *)&x, sizeof x);

	memset(&server, 0, sizeof(server));
	server.sin_family = AF_INET;
	server.sin_addr.s_addr = INADDR_ANY;
	server.sin_port = htons(port);
	if(bind(sockfd, (struct sockaddr*)&server, sizeof(server)) < 0){
		perror("error: bind");
		return;
	}
	listen(sockfd, 5);
	len = sizeof(client);
	while(confd = accept(sockfd, (struct sockaddr*)&client, &len),
	      confd >= 0)
		handlecon(confd, arg);
	perror("error: accept");
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %r15d
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x2240
testl %eax, %eax
jns 0x65d4
leaq 0x11e4(%rip), %rdi      # 0x77a7
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x21c0
movl %eax, %ebp
leaq 0x8(%rsp), %rcx
movl $0x1, (%rcx)
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
pushq $0x4
popq %r8
movl %eax, %edi
callq 0x2060
leaq 0x20(%rsp), %rsi
andq $0x0, 0x8(%rsi)
movw $0x2, (%rsi)
andl $0x0, 0x4(%rsi)
rolw $0x8, %r15w
movw %r15w, 0x2(%rsi)
pushq $0x10
popq %rdx
movl %ebp, %edi
callq 0x2180
testl %eax, %eax
jns 0x6626
leaq 0x1191(%rip), %rdi      # 0x77b5
jmp 0x6663
pushq $0x5
popq %rsi
movl %ebp, %edi
callq 0x2160
leaq 0xc(%rsp), %r15
movl $0x10, (%r15)
leaq 0x10(%rsp), %r12
movl %ebp, %edi
movq %r12, %rsi
movq %r15, %rdx
callq 0x21d0
testl %eax, %eax
js 0x665c
movl %eax, %edi
movq %rbx, %rsi
callq *%r14
jmp 0x6641
leaq 0x115e(%rip), %rdi      # 0x77c1
callq 0x21c0
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/util.c
// Function: sleep_ms
void
sleep_ms (uint32 ms)
{
	struct timespec ts;

	if (ms == 0)
		return;

	ts.tv_sec = ms / 1000;
	ts.tv_nsec = (ms % 1000) * 1000000;
	(void)nanosleep (&ts, NULL);
}

// Assembly:
testl %edi, %edi
je 0x66c2
subq $0x18, %rsp
movl $0x3e8, %ecx            # imm = 0x3E8
movl %edi, %eax
xorl %edx, %edx
divl %ecx
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
imull $0xf4240, %edx, %eax    # imm = 0xF4240
movq %rax, 0x8(%rdi)
xorl %esi, %esi
callq 0x20c0
addq $0x18, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/w4kfu[P]HommI/Bmp/main.c
// Function: main
int main(int argc, char *argv[])
{
	struct bmp *bmp = NULL;

	if (argc != 4)
	{
		fprintf(stderr, "%s <*.BMP|*.bmp|*.bkg> <*.pal> outfile\n", argv[0]);
		return EXIT_FAILURE;
	}

	if ((bmp = convertbmp(argv[1], argv[2])))
	{
		writeImage(argv[3], bmp->width, bmp->height, bmp->data, argv[3]);
		closebmp(bmp);
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
cmpl $0x4, %edi
jne 0x1532
movq 0x8(%r14), %rdi
movq 0x10(%r14), %rsi
callq 0x1694
xorl %ebx, %ebx
testq %rax, %rax
je 0x152a
movq %rax, %r15
movq 0x18(%r14), %rdi
movzwl 0x2(%rax), %esi
movzwl 0x4(%rax), %edx
movq 0x10(%rax), %rcx
movq %rdi, %r8
callq 0x1296
movq %r15, %rdi
callq 0x166f
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
movq 0x2abf(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq (%r14), %rdx
leaq 0xb32(%rip), %rsi       # 0x2078
xorl %eax, %eax
callq 0x10c0
pushq $0x1
popq %rbx
jmp 0x152a
nop
// File: /workspace/github_c_makefile_star2_O2/w4kfu[P]HommI/Bmp/bmp.c
// Function: openbmp
struct bmp *openbmp(char *filename)
{
	struct bmp *newbmp = NULL;
	FILE *fin = NULL;
	unsigned int filesize = 0;

	if (!(fin = fopen(filename, "rb")))
	{
		perror("fopen()");
		return NULL;
	}
	if (!(newbmp = malloc(sizeof (struct bmp))))
	{
		perror("malloc()");
		return NULL;
	}

        fseek(fin, 0, SEEK_END);
        filesize = ftell(fin);
        fseek(fin, 0, SEEK_SET);
	if (!(newbmp->buf = malloc(sizeof (char) * filesize)))
	{
		perror("malloc()");
		free(newbmp);
		fclose(fin);
		return NULL;
	}
	if (fread(newbmp->buf, 1, filesize, fin) != filesize)
	{
		perror("fread()");
		free(newbmp);
		fclose(fin);
		return NULL;
	}
	memcpy(newbmp, newbmp->buf, 3 * sizeof (unsigned short));
	if (newbmp->sig != 0x0021)
	{
		fprintf(stderr, "[-] Wrong signature\n");
		free(newbmp->buf);
		free(newbmp);
		fclose(fin);
		return NULL;
	}
	newbmp->data = NULL;
	fclose(fin);
	return newbmp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0xb3d(%rip), %rsi       # 0x20a0
callq 0x1140
testq %rax, %rax
je 0x15fc
movq %rax, %r14
pushq $0x18
popq %rdi
callq 0x1110
testq %rax, %rax
je 0x1605
movq %rax, %rbx
pushq $0x2
popq %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x1120
movq %r14, %rdi
callq 0x10d0
movq %rax, %r15
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1120
movl %r15d, %r12d
movq %r12, %rdi
callq 0x1110
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x1613
movq %rax, %r15
pushq $0x1
popq %rsi
movq %rax, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0x1050
cmpq %r12, %rax
jne 0x161c
movzwl 0x4(%r15), %eax
movw %ax, 0x4(%rbx)
movl (%r15), %eax
movl %eax, (%rbx)
cmpw $0x21, %ax
jne 0x162a
andq $0x0, 0x10(%rbx)
movq %r14, %rdi
callq 0x1070
jmp 0x1660
leaq 0xa04(%rip), %rdi       # 0x2007
jmp 0x160c
leaq 0xa97(%rip), %rdi       # 0x20a3
callq 0x1150
jmp 0x165e
leaq 0xa89(%rip), %rdi       # 0x20a3
jmp 0x1623
leaq 0xa89(%rip), %rdi       # 0x20ac
callq 0x1150
jmp 0x164e
movq 0x29c7(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xa79(%rip), %rdi       # 0x20b4
pushq $0x14
popq %rsi
pushq $0x1
popq %rdx
callq 0x1170
movq %r15, %rdi
callq 0x1040
movq %rbx, %rdi
callq 0x1040
movq %r14, %rdi
callq 0x1070
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/w4kfu[P]HommI/Bmp/bmp.c
// Function: closebmp
void closebmp(struct bmp *nbmp)
{
	if (nbmp)
	{
		if (nbmp->buf)
			free(nbmp->buf);
		if (nbmp->data)
			free(nbmp->data);
		free(nbmp);
	}
}

// Assembly:
testq %rdi, %rdi
je 0x1693
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x1040
movq 0x10(%rbx), %rdi
callq 0x1040
movq %rbx, %rdi
popq %rbx
jmp 0x1040
retq
// File: /workspace/github_c_makefile_star2_O2/w4kfu[P]HommI/Bmp/bmp.c
// Function: convertbmp
struct bmp* convertbmp(char *filename, char *palettefile)
{
	struct bmp *newbmp = NULL;
	unsigned char *pal = NULL;
	unsigned char *newdata = NULL;
	struct color *rgb = NULL;
	unsigned int y, x;

	if (!(pal = open_palette(palettefile)))
		return NULL;
	if (!(newbmp = openbmp(filename)))
	{
		free(pal);
		return NULL;
	}
	if (!(newdata = malloc(sizeof (char) * newbmp->width * newbmp->height * 3)))
	{
		perror("malloc()");
		free(pal);
		free(newbmp);
		return NULL;
	}
	newbmp->data = newdata;
	rgb = (struct color *)pal;
	for (y = 0; y < newbmp->height; y++)
	{
		for (x = 0; x < newbmp->width; x++)
		{
			memcpy(newdata, &rgb[*(newbmp->buf + (3 * 2) + (x + (y * newbmp->width)))], 3);
			newdata += 3;
		}
	}
	free(pal);
	return newbmp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x1770
testq %rax, %rax
je 0x1745
movq %rax, %r14
movq %rbx, %rdi
callq 0x1554
testq %rax, %rax
je 0x173d
movq %rax, %rbx
movzwl 0x2(%rax), %r15d
movzwl 0x4(%rax), %r12d
movq %r15, %rax
imulq %r12, %rax
leaq (%rax,%rax,2), %rdi
callq 0x1110
testq %rax, %rax
je 0x1756
movq %rax, 0x10(%rbx)
xorl %ecx, %ecx
movzwl %r12w, %edx
cmpl %edx, %ecx
jae 0x1733
xorl %edx, %edx
movzwl %r15w, %esi
cmpl %esi, %edx
jae 0x172a
movq 0x8(%rbx), %rdi
imull %ecx, %esi
addl %edx, %esi
movzbl 0x6(%rdi,%rsi), %esi
leaq (%rsi,%rsi,2), %rsi
movb 0x2(%r14,%rsi), %dil
movb %dil, 0x2(%rax)
movzwl (%r14,%rsi), %esi
movw %si, (%rax)
addq $0x3, %rax
incl %edx
movzwl 0x2(%rbx), %r15d
jmp 0x16f2
incl %ecx
movzwl 0x4(%rbx), %r12d
jmp 0x16e8
movq %r14, %rdi
callq 0x1040
jmp 0x1747
movq %r14, %rdi
callq 0x1040
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x946(%rip), %rdi       # 0x20a3
callq 0x1150
movq %r14, %rdi
callq 0x1040
movq %rbx, %rdi
jmp 0x1740
nop
// File: /workspace/github_c_makefile_star2_O2/JulStrat[P]bams/./sh_bisect.h
// Function: bisect_left
void *
bisect_left(const void *key, const void *arr,
            size_t el_num, size_t el_size,
            int (*compare) (const void *, const void *))
{
    size_t low = 0;
    size_t high = el_num;
    size_t mid;
    char *off;

    ASSERT_BISECT_ARGS();

    while (low < high) {
        mid = low + ((high - low) >> 1);
        off = (char *) arr + mid * el_size;
        if ((*compare) (key, off) > 0) {
            low = mid + 1;
        } else {
            high = mid;
        }
    }

    return (char *) arr + low * el_size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
testq %rdi, %rdi
je 0x1983
movq %rsi, %rbx
testq %rsi, %rsi
je 0x198c
cmpq $0x0, 0x8(%rsp)
je 0x1995
cmpq $0x0, 0x10(%rsp)
je 0x199e
movq %rdx, %r14
movq %rdi, %r13
xorl %ebp, %ebp
movq %r14, %r12
subq %rbp, %r12
jbe 0x1968
shrq %r12
leaq (%r12,%rbp), %r15
movq %r15, %rsi
imulq 0x8(%rsp), %rsi
addq %rbx, %rsi
movq %r13, %rdi
callq *0x10(%rsp)
testl %eax, %eax
jg 0x1960
movq %r15, %r14
jmp 0x1935
addq %r12, %rbp
incq %rbp
jmp 0x1935
imulq 0x8(%rsp), %rbp
addq %rbp, %rbx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x19a5(%rip), %rdi      # 0x332f
jmp 0x19a5
leaq 0x1a19(%rip), %rdi      # 0x33ac
jmp 0x19a5
leaq 0x18a0(%rip), %rdi      # 0x323c
jmp 0x19a5
leaq 0x1916(%rip), %rdi      # 0x32bb
leaq 0x198f(%rip), %rsi      # 0x333b
leaq 0x1996(%rip), %rcx      # 0x3349
pushq $0x5c
popq %rdx
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/JulStrat[P]bams/bams.c
// Function: bams_create
BAMS *
bams_create(size_t key_size, int (*compare) (const void *, const void *))
{
    BAMS *set;

    assert(NULL != compare);

    set = (BAMS *) malloc(sizeof (BAMS));
    if (!set) {
        return NULL;
    }

    if (key_size) {
        set->key_size = key_size;
        set->type = COPY_DATA;
    } else {
        set->key_size = sizeof (void *);
        set->type = COPY_POINTER;
    }
    set->compare = compare;
    set->head = NULL;
    set->size = 0;

    return set;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x1ac2
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x28
popq %rdi
callq 0x1090
testq %rax, %rax
je 0x1aba
xorl %ecx, %ecx
testq %r14, %r14
setne %cl
pushq $0x8
popq %rdx
cmovneq %r14, %rdx
movq %rdx, (%rax)
movl %ecx, 0x20(%rax)
movq %rbx, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x1953(%rip), %rdi      # 0x341c
leaq 0x195c(%rip), %rsi      # 0x342c
leaq 0x195c(%rip), %rcx      # 0x3433
pushq $0x52
popq %rdx
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/JulStrat[P]bams/bams.c
// Function: bams_insert
int
bams_insert(BAMS * set, const void *key)
{
    SET_NODE *curr;
    /** void *keys; */
    void *t;
    /** size_t length = 1; */
    SET_NODE *node;
    SET_NODE *next;

    assert(NULL != set);
    assert(NULL != key);

    curr = set->head;
    node = make_node(set, key);
    if (!node) {
        return 0;
    }

    node->next = curr;
    set->head = node;
    set->size += 1;

    /*
     * Normalize 
     */
    while (curr != NULL) {
        if ((node->length) >= (curr->length)) {
            next = curr->next;

            t = merge_into(curr->keys, curr->length, node->keys,
                           node->length, set->key_size, set->compare);
            if (NULL == t) {
                return 1;       /*
                                 * return norm error ! 
                                 */
            }
            curr->keys = t;
            curr->length += node->length;
            set->head = curr;

            /*
             * free node 
             */
            free(node->keys);
            free(node);

            node = curr;
            curr = next;
        } else
            break;
    }
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x1be1
movq %rsi, %r15
testq %rsi, %rsi
je 0x1bfa
movq %rdi, %rbx
movq 0x10(%rdi), %rbp
pushq $0x18
popq %rdi
callq 0x1090
testq %rax, %rax
je 0x1bcc
movq %rax, %r14
movq (%rbx), %r12
movq %r12, %rdi
callq 0x1090
testq %rax, %rax
je 0x1bc4
movq %rax, %r13
cmpl $0x0, 0x20(%rbx)
jne 0x1b40
movq %rsp, %rax
movq %r15, (%rax)
movq %rax, %r15
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x1070
movq %r13, 0x10(%r14)
movq $0x1, 0x8(%r14)
movq %rbp, (%r14)
movq %r14, 0x10(%rbx)
incq 0x18(%rbx)
pushq $0x1
popq %r15
testq %rbp, %rbp
je 0x1bcf
movq %rbp, %r12
movq 0x8(%r14), %rcx
movq 0x8(%rbp), %rsi
cmpq %rsi, %rcx
jb 0x1bcf
movq (%r12), %rbp
movq 0x10(%r12), %rdi
movq 0x10(%r14), %rdx
movq (%rbx), %r8
movq 0x8(%rbx), %r9
callq 0x17b0
testq %rax, %rax
je 0x1bcf
movq %rax, 0x10(%r12)
movq 0x8(%r14), %rax
addq %rax, 0x8(%r12)
movq %r12, 0x10(%rbx)
movq 0x10(%r14), %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
movq %r12, %r14
jmp 0x1b69
movq %r14, %rdi
callq 0x1030
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x188a(%rip), %rdi      # 0x3472
leaq 0x183d(%rip), %rsi      # 0x342c
leaq 0x1888(%rip), %rcx      # 0x347e
pushq $0x71
jmp 0x1c11
leaq 0x18a3(%rip), %rdi      # 0x34a4
leaq 0x1824(%rip), %rsi      # 0x342c
leaq 0x186f(%rip), %rcx      # 0x347e
pushq $0x72
popq %rdx
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/JulStrat[P]bams/bams.c
// Function: bams_min
const void *
bams_min(const BAMS * set)
{
    SET_NODE *curr;
    void *min_key = NULL;

    assert(NULL != set);

    curr = set->head;
    if (set->size > 0) {
        assert(curr != NULL);
        assert(curr->keys != NULL);

        min_key = curr->keys;
        while (NULL != curr->next) {
            curr = curr->next;
            if ((*(set->compare)) (min_key, curr->keys) > 0) {
                min_key = curr->keys;
            }
        }
    }

    if (set->type == COPY_POINTER) {
        return *(void **) min_key;
    } else {
        return min_key;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x1c8d
movq %rdi, %rbx
cmpq $0x0, 0x18(%rdi)
je 0x1c78
movq 0x10(%rbx), %r15
testq %r15, %r15
je 0x1cac
movq 0x10(%r15), %r14
testq %r14, %r14
jne 0x1c6e
leaq 0x189c(%rip), %rdi      # 0x34e0
leaq 0x17e1(%rip), %rsi      # 0x342c
leaq 0x185e(%rip), %rcx      # 0x34b0
movl $0xa9, %edx
callq 0x1050
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq *0x8(%rbx)
testl %eax, %eax
jle 0x1c6e
movq 0x10(%r15), %r14
movq (%r15), %r15
testq %r15, %r15
jne 0x1c5c
jmp 0x1c7b
xorl %r14d, %r14d
cmpl $0x0, 0x20(%rbx)
jne 0x1c84
movq (%r14), %r14
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x17de(%rip), %rdi      # 0x3472
leaq 0x1791(%rip), %rsi      # 0x342c
leaq 0x180e(%rip), %rcx      # 0x34b0
movl $0xa4, %edx
callq 0x1050
leaq 0x1820(%rip), %rdi      # 0x34d3
leaq 0x1772(%rip), %rsi      # 0x342c
leaq 0x17ef(%rip), %rcx      # 0x34b0
movl $0xa8, %edx
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/JulStrat[P]bams/bams.c
// Function: bams_max
const void *
bams_max(const BAMS * set)
{
    SET_NODE *curr;
    size_t key_size;
    char *last = NULL;
    char *max_key = NULL;

    assert(NULL != set);

    curr = set->head;
    key_size = set->key_size;

    if (set->size > 0) {
        assert(curr != NULL);
        assert(curr->keys != NULL);

        max_key = (char *) curr->keys + (curr->length - 1) * key_size;
        while (NULL != curr->next) {
            curr = curr->next;
            last = (char *) curr->keys + (curr->length - 1) * key_size;
            if ((*(set->compare)) (last, max_key) > 0) {
                max_key = last;
            }
        }
    }

    if (set->type == COPY_POINTER) {
        return *(void **) max_key;
    } else {
        return max_key;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x1d58
movq %rdi, %rbx
cmpq $0x0, 0x18(%rdi)
je 0x1d3f
movq 0x10(%rbx), %r12
testq %r12, %r12
je 0x1d77
movq 0x10(%r12), %r14
testq %r14, %r14
je 0x1d96
movq (%rbx), %r13
movq 0x8(%r12), %rax
decq %rax
imulq %r13, %rax
addq %rax, %r14
movq (%r12), %r12
testq %r12, %r12
je 0x1d42
movq 0x8(%r12), %r15
decq %r15
imulq %r13, %r15
addq 0x10(%r12), %r15
movq %r15, %rdi
movq %r14, %rsi
callq *0x8(%rbx)
testl %eax, %eax
jg 0x1d3a
movq %r14, %r15
movq %r15, %r14
jmp 0x1d10
xorl %r14d, %r14d
cmpl $0x0, 0x20(%rbx)
jne 0x1d4b
movq (%r14), %r14
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x1713(%rip), %rdi      # 0x3472
leaq 0x16c6(%rip), %rsi      # 0x342c
leaq 0x1786(%rip), %rcx      # 0x34f3
movl $0xc3, %edx
callq 0x1050
leaq 0x1755(%rip), %rdi      # 0x34d3
leaq 0x16a7(%rip), %rsi      # 0x342c
leaq 0x1767(%rip), %rcx      # 0x34f3
movl $0xc9, %edx
callq 0x1050
leaq 0x1743(%rip), %rdi      # 0x34e0
leaq 0x1688(%rip), %rsi      # 0x342c
leaq 0x1748(%rip), %rcx      # 0x34f3
movl $0xca, %edx
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/JulStrat[P]bams/bams.c
// Function: bams_count_less
size_t
bams_count_less(const BAMS * set, const void *key)
{
    SET_NODE *curr;
    size_t key_size;
    char *off;
    size_t less = 0;
    const void *tkey;

    assert(NULL != set);
    assert(NULL != key);

    curr = set->head;
    key_size = set->key_size;

    if (set->type == COPY_POINTER) {
        POINTER_ADDR(key, tkey);
    }

    while (NULL != curr) {
        off = (char *) bisect_left(key, curr->keys, curr->length,
                                   key_size, set->compare);
        assert(off >= (char *) curr->keys);
        less += off - (char *) curr->keys;
        curr = curr->next;
    }

    return (size_t) (less / key_size);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
testq %rdi, %rdi
je 0x1e5b
movq %rsi, %r14
testq %rsi, %rsi
je 0x1e7a
movq %rdi, %rbx
cmpl $0x0, 0x20(%rdi)
jne 0x1deb
leaq 0x8(%rsp), %rax
movq %r14, (%rax)
movq %rax, %r14
movq (%rbx), %r15
movq 0x10(%rbx), %r13
xorl %r12d, %r12d
testq %r13, %r13
je 0x1e26
movq 0x8(%r13), %rdx
movq 0x10(%r13), %rsi
movq 0x8(%rbx), %r8
movq %r14, %rdi
movq %r15, %rcx
callq 0x18f8
movq 0x10(%r13), %rcx
cmpq %rcx, %rax
jb 0x1e3c
addq %rax, %r12
subq %rcx, %r12
movq (%r13), %r13
jmp 0x1df5
movq %r12, %rax
xorl %edx, %edx
divq %r15
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x1706(%rip), %rdi      # 0x3549
leaq 0x15e2(%rip), %rsi      # 0x342c
leaq 0x16c5(%rip), %rcx      # 0x3516
movl $0xf3, %edx
callq 0x1050
leaq 0x1610(%rip), %rdi      # 0x3472
leaq 0x15c3(%rip), %rsi      # 0x342c
leaq 0x16a6(%rip), %rcx      # 0x3516
movl $0xe6, %edx
callq 0x1050
leaq 0x1623(%rip), %rdi      # 0x34a4
leaq 0x15a4(%rip), %rsi      # 0x342c
leaq 0x1687(%rip), %rcx      # 0x3516
movl $0xe7, %edx
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/JulStrat[P]bams/bams.c
// Function: bams_count_equal
size_t
bams_count_equal(const BAMS * set, const void *key)
{
    SET_NODE *curr;
    size_t key_size;
    char *low, *high;
    size_t equal = 0;
    const void *tkey;

    assert(NULL != set);
    assert(NULL != key);

    curr = set->head;
    key_size = set->key_size;

    if (set->type == COPY_POINTER) {
        POINTER_ADDR(key, tkey);
    }

    while (NULL != curr) {
        low = (char *) bisect_left(key, curr->keys, curr->length,
                                   key_size, set->compare);
        high = (char *) bisect_right(key, curr->keys, curr->length,
                                     key_size, set->compare);
        assert(high >= low);
        equal += high - low;
        curr = curr->next;
    }

    return (size_t) (equal / key_size);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x1f52
movq %rsi, %r14
testq %rsi, %rsi
je 0x1f71
movq %rdi, %rbx
cmpl $0x0, 0x20(%rdi)
jne 0x1ecb
movq %rsp, %rax
movq %r14, (%rax)
movq %rax, %r14
movq (%rbx), %r15
movq 0x10(%rbx), %rbp
xorl %r12d, %r12d
testq %rbp, %rbp
je 0x1f1c
movq 0x8(%rbp), %rdx
movq 0x10(%rbp), %rsi
movq 0x8(%rbx), %r8
movq %r14, %rdi
movq %r15, %rcx
callq 0x18f8
movq %rax, %r13
movq 0x8(%rbp), %rdx
movq 0x10(%rbp), %rsi
movq 0x8(%rbx), %r8
movq %r14, %rdi
movq %r15, %rcx
callq 0x19bb
cmpq %r13, %rax
jb 0x1f33
subq %r13, %r12
addq %rax, %r12
movq (%rbp), %rbp
jmp 0x1ed5
movq %r12, %rax
xorl %edx, %edx
divq %r15
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x165e(%rip), %rdi      # 0x3598
leaq 0x14eb(%rip), %rsi      # 0x342c
leaq 0x161c(%rip), %rcx      # 0x3564
movl $0x113, %edx            # imm = 0x113
callq 0x1050
leaq 0x1519(%rip), %rdi      # 0x3472
leaq 0x14cc(%rip), %rsi      # 0x342c
leaq 0x15fd(%rip), %rcx      # 0x3564
movl $0x104, %edx            # imm = 0x104
callq 0x1050
leaq 0x152c(%rip), %rdi      # 0x34a4
leaq 0x14ad(%rip), %rsi      # 0x342c
leaq 0x15de(%rip), %rcx      # 0x3564
movl $0x105, %edx            # imm = 0x105
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/JulStrat[P]bams/bams.c
// Function: bams_count_great
size_t
bams_count_great(const BAMS * set, const void *key)
{
    SET_NODE *curr;
    size_t key_size;
    char *low, *high;
    size_t great = 0;
    const void *tkey;

    assert(NULL != set);
    assert(NULL != key);

    curr = set->head;
    key_size = set->key_size;

    if (set->type == COPY_POINTER) {
        POINTER_ADDR(key, tkey);
    }

    while (NULL != curr) {
        low = (char *) bisect_right(key, curr->keys, curr->length,
                                    key_size, set->compare);
        high = (char *) curr->keys + curr->length * key_size;
        assert(high >= low);
        great += high - low;
        curr = curr->next;
    }

    return (size_t) (great / key_size);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
testq %rdi, %rdi
je 0x203e
movq %rsi, %r14
testq %rsi, %rsi
je 0x205d
movq %rdi, %rbx
cmpl $0x0, 0x20(%rdi)
jne 0x1fc6
leaq 0x8(%rsp), %rax
movq %r14, (%rax)
movq %rax, %r14
movq (%rbx), %r15
movq 0x10(%rbx), %r13
xorl %r12d, %r12d
testq %r13, %r13
je 0x2009
movq 0x8(%r13), %rdx
movq 0x10(%r13), %rsi
movq 0x8(%rbx), %r8
movq %r14, %rdi
movq %r15, %rcx
callq 0x19bb
movq 0x8(%r13), %rcx
imulq %r15, %rcx
addq 0x10(%r13), %rcx
cmpq %rax, %rcx
jb 0x201f
subq %rax, %r12
addq %rcx, %r12
movq (%r13), %r13
jmp 0x1fd0
movq %r12, %rax
xorl %edx, %edx
divq %r15
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x1572(%rip), %rdi      # 0x3598
leaq 0x13ff(%rip), %rsi      # 0x342c
leaq 0x1570(%rip), %rcx      # 0x35a4
movl $0x132, %edx            # imm = 0x132
callq 0x1050
leaq 0x142d(%rip), %rdi      # 0x3472
leaq 0x13e0(%rip), %rsi      # 0x342c
leaq 0x1551(%rip), %rcx      # 0x35a4
movl $0x124, %edx            # imm = 0x124
callq 0x1050
leaq 0x1440(%rip), %rdi      # 0x34a4
leaq 0x13c1(%rip), %rsi      # 0x342c
leaq 0x1532(%rip), %rcx      # 0x35a4
movl $0x125, %edx            # imm = 0x125
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/JulStrat[P]bams/bams.c
// Function: bams_less
void *
bams_less(const BAMS * set, const void *key, size_t *key_num)
{
    SET_NODE *curr;
    size_t key_size;
    char *off;
    char *r = NULL;
    char *t;
    size_t less = 0;
    const void *tkey;

    assert(NULL != set);
    assert(NULL != key);
    assert(NULL != key_num);

    curr = set->head;
    key_size = set->key_size;

    if (set->type == COPY_POINTER) {
        POINTER_ADDR(key, tkey);
    }

    *key_num = 0;
    while (NULL != curr) {
        off = (char *) bisect_left(key, curr->keys, curr->length,
                                   key_size, set->compare);
        assert(off >= (char *) curr->keys);
        less = (size_t) ((off - (char *) curr->keys) / key_size);
        if (less > 0) {
            t = merge_into(r, *key_num, curr->keys, less,
                           key_size, set->compare);
            /*
             * free(r); 
             */
            r = t;
            *key_num += less;
        }
        curr = curr->next;
    }

    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, (%rsp)
testq %rdi, %rdi
je 0x216a
movq %rsi, %r13
testq %rsi, %rsi
je 0x2189
cmpq $0x0, (%rsp)
je 0x21a8
movq %rdi, %r14
cmpl $0x0, 0x20(%rdi)
jne 0x20c2
leaq 0x10(%rsp), %rax
movq %r13, (%rax)
movq %rax, %r13
movq (%r14), %r12
movq 0x10(%r14), %rbx
movq (%rsp), %rax
andq $0x0, (%rax)
movq $0x0, 0x8(%rsp)
movq (%rsp), %r15
testq %rbx, %rbx
je 0x2137
movq 0x8(%rbx), %rdx
movq 0x10(%rbx), %rsi
movq 0x8(%r14), %r8
movq %r13, %rdi
movq %r12, %rcx
callq 0x18f8
movq 0x10(%rbx), %rcx
subq %rcx, %rax
jb 0x214b
cmpq %rax, %r12
ja 0x2132
xorl %edx, %edx
divq %r12
movq %rax, %rbp
movq (%r15), %rsi
movq 0x8(%r14), %r9
movq 0x8(%rsp), %rdi
movq %rcx, %rdx
movq %rax, %rcx
movq %r12, %r8
callq 0x17b0
movq %rax, 0x8(%rsp)
addq %rbp, (%r15)
movq (%rbx), %rbx
jmp 0x20de
movq 0x8(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x13f7(%rip), %rdi      # 0x3549
leaq 0x12d3(%rip), %rsi      # 0x342c
leaq 0x1478(%rip), %rcx      # 0x35d8
movl $0x154, %edx            # imm = 0x154
callq 0x1050
leaq 0x1301(%rip), %rdi      # 0x3472
leaq 0x12b4(%rip), %rsi      # 0x342c
leaq 0x1459(%rip), %rcx      # 0x35d8
movl $0x145, %edx            # imm = 0x145
callq 0x1050
leaq 0x1314(%rip), %rdi      # 0x34a4
leaq 0x1295(%rip), %rsi      # 0x342c
leaq 0x143a(%rip), %rcx      # 0x35d8
movl $0x146, %edx            # imm = 0x146
callq 0x1050
leaq 0x145f(%rip), %rdi      # 0x360e
leaq 0x1276(%rip), %rsi      # 0x342c
leaq 0x141b(%rip), %rcx      # 0x35d8
movl $0x147, %edx            # imm = 0x147
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/JulStrat[P]bams/bams.c
// Function: bams_great
void *
bams_great(const BAMS * set, const void *key, size_t *key_num)
{
    SET_NODE *curr;
    size_t key_size;
    char *low, *high;
    char *r = NULL;
    char *t;
    size_t great = 0;
    const void *tkey;

    assert(NULL != set);
    assert(NULL != key);
    assert(NULL != key_num);

    curr = set->head;
    key_size = set->key_size;

    if (set->type == COPY_POINTER) {
        POINTER_ADDR(key, tkey);
    }

    *key_num = 0;
    while (NULL != curr) {
        low = (char *) bisect_right(key, curr->keys, curr->length,
                                    key_size, set->compare);
        high = (char *) curr->keys + curr->length * key_size;
        assert(high >= low);
        great = (size_t) ((high - low) / key_size);
        if (great > 0) {
            t = merge_into(r, *key_num, low, great,
                           key_size, set->compare);
            /*
             * free(r); 
             */
            r = t;
            *key_num += great;
        }
        curr = curr->next;
    }

    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, (%rsp)
testq %rdi, %rdi
je 0x2480
movq %rsi, %r13
testq %rsi, %rsi
je 0x249f
cmpq $0x0, (%rsp)
je 0x24be
movq %rdi, %r14
cmpl $0x0, 0x20(%rdi)
jne 0x23cd
leaq 0x10(%rsp), %rax
movq %r13, (%rax)
movq %rax, %r13
movq (%r14), %r12
movq 0x10(%r14), %rbx
movq (%rsp), %rax
andq $0x0, (%rax)
movq $0x0, 0x8(%rsp)
movq (%rsp), %r15
testq %rbx, %rbx
je 0x244d
movq 0x8(%rbx), %rdx
movq 0x10(%rbx), %rsi
movq 0x8(%r14), %r8
movq %r13, %rdi
movq %r12, %rcx
callq 0x19bb
movq %rax, %rcx
movq 0x8(%rbx), %rax
imulq %r12, %rax
addq 0x10(%rbx), %rax
subq %rcx, %rax
jb 0x2461
cmpq %rax, %r12
ja 0x2448
xorl %edx, %edx
divq %r12
movq %rax, %rbp
movq (%r15), %rsi
movq 0x8(%r14), %r9
movq 0x8(%rsp), %rdi
movq %rcx, %rdx
movq %rax, %rcx
movq %r12, %r8
callq 0x17b0
movq %rax, 0x8(%rsp)
addq %rbp, (%r15)
movq (%rbx), %rbx
jmp 0x23e9
movq 0x8(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1130(%rip), %rdi      # 0x3598
leaq 0xfbd(%rip), %rsi       # 0x342c
leaq 0x11e9(%rip), %rcx      # 0x365f
movl $0x1aa, %edx            # imm = 0x1AA
callq 0x1050
leaq 0xfeb(%rip), %rdi       # 0x3472
leaq 0xf9e(%rip), %rsi       # 0x342c
leaq 0x11ca(%rip), %rcx      # 0x365f
movl $0x19a, %edx            # imm = 0x19A
callq 0x1050
leaq 0xffe(%rip), %rdi       # 0x34a4
leaq 0xf7f(%rip), %rsi       # 0x342c
leaq 0x11ab(%rip), %rcx      # 0x365f
movl $0x19b, %edx            # imm = 0x19B
callq 0x1050
leaq 0x1149(%rip), %rdi      # 0x360e
leaq 0xf60(%rip), %rsi       # 0x342c
leaq 0x118c(%rip), %rcx      # 0x365f
movl $0x19c, %edx            # imm = 0x19C
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/JulStrat[P]bams/bams.c
// Function: bams_array
void *
bams_array(const BAMS * set, size_t *key_num)
{
    SET_NODE *curr;
    char *r = NULL;
    char *t;

    assert(NULL != set);
    assert(NULL != key_num);

    curr = set->head;
    *key_num = 0;
    while (NULL != curr) {
        t = merge_into(r, *key_num, curr->keys, curr->length,
                       set->key_size, set->compare);
        /*
         * free(r); 
         */
        r = t;
        *key_num += curr->length;
        curr = curr->next;
    }

    return r;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x252f
movq %rsi, %rbx
testq %rsi, %rsi
je 0x254e
movq %rdi, %r14
movq 0x10(%rdi), %r15
andq $0x0, (%rbx)
xorl %esi, %esi
xorl %eax, %eax
testq %r15, %r15
je 0x2529
movq 0x8(%r15), %rcx
movq 0x10(%r15), %rdx
movq (%r14), %r8
movq 0x8(%r14), %r9
movq %rax, %rdi
callq 0x17b0
movq (%rbx), %rsi
addq 0x8(%r15), %rsi
movq %rsi, (%rbx)
movq (%r15), %r15
jmp 0x24fe
popq %rbx
popq %r14
popq %r15
retq
leaq 0xf3c(%rip), %rdi       # 0x3472
leaq 0xeef(%rip), %rsi       # 0x342c
leaq 0x1152(%rip), %rcx      # 0x3696
movl $0x1c2, %edx            # imm = 0x1C2
callq 0x1050
leaq 0x10b9(%rip), %rdi      # 0x360e
leaq 0xed0(%rip), %rsi       # 0x342c
leaq 0x1133(%rip), %rcx      # 0x3696
movl $0x1c3, %edx            # imm = 0x1C3
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/JulStrat[P]bams/bams.c
// Function: bams_clear
void
bams_clear(BAMS * set)
{
    SET_NODE *curr;
    SET_NODE *next;

    assert(NULL != set);

    curr = set->head;
    while (NULL != curr) {
        next = curr->next;
        free(curr->keys);
        free(curr);
        curr = next;
    }
    set->head = NULL;
    set->size = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x25d6
movq %rdi, %rbx
movq 0x10(%rdi), %r14
addq $0x10, %rbx
testq %r14, %r14
je 0x25ca
movq (%r14), %r15
movq 0x10(%r14), %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
movq %r15, %r14
jmp 0x25ac
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq 0xe95(%rip), %rdi       # 0x3472
leaq 0xe48(%rip), %rsi       # 0x342c
leaq 0x10f3(%rip), %rcx      # 0x36de
movl $0x1e3, %edx            # imm = 0x1E3
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/JulStrat[P]bams/bams.c
// Function: bams_free
void
bams_free(BAMS * set)
{
    SET_NODE *curr;
    SET_NODE *next;

    assert(NULL != set);

    curr = set->head;
    while (NULL != curr) {
        next = curr->next;
        free(curr->keys);
        free(curr);
        curr = next;
    }
    free(set);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x2631
movq %rdi, %rbx
movq 0x10(%rdi), %r14
testq %r14, %r14
je 0x2624
movq (%r14), %r15
movq 0x10(%r14), %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
movq %r15, %r14
jmp 0x2606
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1030
leaq 0xe3a(%rip), %rdi       # 0x3472
leaq 0xded(%rip), %rsi       # 0x342c
leaq 0x10b0(%rip), %rcx      # 0x36f6
movl $0x1f6, %edx            # imm = 0x1F6
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/JulStrat[P]bams/bams.c
// Function: bams_check_structure
int
bams_check_structure(const BAMS * set)
{
    SET_NODE *curr;
    char *off;

    size_t set_size = 0;
    size_t node_len = 0;
    size_t key_size;

    assert(NULL != set);

    curr = set->head;
    key_size = set->key_size;

    while (NULL != curr) {
        if ((node_len >= curr->length) || (0 == curr->length)) {
            return 1;
        }
        /*
         * check if node length is power of two 
         */
        node_len = curr->length;
        /*
         * printf("node len: %d\n", node_len); 
         */
        while (0 == (node_len & 1)) {
            node_len >>= 1;
        }
        if (node_len > 1) {
            return 2;
        }
        node_len = curr->length;
        set_size += node_len;

        /*
         * check current node keys 
         */
        off = (char *) (curr->keys);
        while (node_len-- > 1) {
            if ((set->compare) (off, off + key_size) > 0) {
                return 3;
            }
            off += key_size;
        }

        curr = curr->next;
    }
    if (set_size != set->size) {
        return 4;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x26e4
movq %rdi, %r14
leaq 0x10(%rdi), %r13
movq (%rdi), %rbp
xorl %r12d, %r12d
movq (%r13), %r13
testq %r13, %r13
je 0x26ce
movq 0x8(%r13), %rbx
testq %rbx, %rbx
je 0x26dc
movq %rbx, %rax
movq %rax, %rcx
shrq %rax
testb $0x1, %cl
je 0x2686
cmpq $0x1, %rcx
ja 0x26e0
addq %rbx, %r12
movq 0x10(%r13), %rdi
incq %rbx
decq %rbx
cmpq $0x2, %rbx
jb 0x2671
leaq (%rdi,%rbp), %r15
movq %r15, %rsi
callq *0x8(%r14)
movq %r15, %rdi
testl %eax, %eax
jle 0x26a1
pushq $0x3
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
cmpq 0x18(%r14), %r12
setne %al
shll $0x2, %eax
jmp 0x26bf
pushq $0x1
jmp 0x26be
pushq $0x2
jmp 0x26be
leaq 0xd87(%rip), %rdi       # 0x3472
leaq 0xd3a(%rip), %rsi       # 0x342c
leaq 0x1014(%rip), %rcx      # 0x370d
movl $0x20c, %edx            # imm = 0x20C
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/phluid61[P]hsf/src/key.c
// Function: SH_Key__init
SH_Key*
SH_Key__init(sh_char_t* value, size_t n, int* err) {
	SH_Key* obj;
	sh_char_t* ptr;
	sh_char_t  c;
	size_t m;

	__cascade(err, (SH_Key*)0);

	if (n < 1 || n > SH_KEY_LENGTH_MAX) {
		__raise(err, SH_E_KEY_TOO_LONG);
		return (SH_Key*)0;
	}

	if (*value < (sh_char_t)'a' || *value > (sh_char_t)'z') {
		__raise(err, SH_E_KEY_BAD_CHAR);
		return (SH_Key*)0;
	}

	ptr = value;
	m = 0;
	while (m < n) {
		c = *ptr;
		if (
				(c >= (sh_char_t)'a' && c <= (sh_char_t)'z') ||
				(c >= (sh_char_t)'0' && c <= (sh_char_t)'9') ||
				 c == (sh_char_t)'_' || c == (sh_char_t)'-' || c == (sh_char_t)'*') {
			ptr++;
			m++;
		} else {
			__raise(err, SH_E_KEY_BAD_CHAR);
			return (SH_Key*)0;
		}
	}

	obj = (SH_Key*)malloc(sizeof(SH_Key));
	if ((SH_Key*)0 == obj) {
		__raise(err, SH_E_MALLOC_ERROR);
		return (SH_Key*)0;
	}

	obj->value = (sh_char_t*)calloc(sizeof(sh_char_t), m + 1);
	if ((sh_char_t*)0 == obj->value) {
		free(obj);
		__raise(err, SH_E_MALLOC_ERROR);
		return (SH_Key*)0;
	}

	memcpy((void*)obj->value, (const void*)value, m);
	obj->length = m;

	__clear(err);
	return obj;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testq %rdx, %rdx
je 0x1168
cmpl $0x0, (%rbx)
jne 0x117b
leaq -0x41(%r14), %rax
cmpq $-0x40, %rax
jae 0x1183
movl $0x200001, %eax         # imm = 0x200001
jmp 0x1191
leaq -0x41(%r14), %rax
cmpq $-0x40, %rax
jb 0x117b
movb (%r15), %al
addb $-0x7b, %al
cmpb $-0x1a, %al
jae 0x1199
xorl %r12d, %r12d
jmp 0x1243
movb (%r15), %al
addb $-0x7b, %al
cmpb $-0x1a, %al
jae 0x1199
movl $0x200002, %eax         # imm = 0x200002
xorl %r12d, %r12d
jmp 0x1241
xorl %eax, %eax
movabsq $0x20000000000009, %rcx # imm = 0x20000000000009
cmpq %rax, %r14
je 0x11df
movb (%r15,%rax), %dl
leal -0x61(%rdx), %esi
cmpb $0x1a, %sil
setb %sil
leal -0x30(%rdx), %edi
cmpb $0xa, %dil
setb %dil
orb %sil, %dil
jne 0x11da
movzbl %dl, %edx
addl $-0x2a, %edx
cmpl $0x35, %edx
ja 0x1234
btq %rdx, %rcx
jae 0x1234
incq %rax
jmp 0x11a5
pushq $0x10
popq %rdi
callq 0x1060
testq %rax, %rax
je 0x121b
movq %rax, %r12
leaq 0x1(%r14), %rsi
pushq $0x1
popq %rdi
callq 0x1040
movq %rax, (%r12)
testq %rax, %rax
je 0x1222
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1050
xorl %eax, %eax
movq %r14, 0x8(%r12)
jmp 0x123c
movl $0x80000001, %eax       # imm = 0x80000001
jmp 0x1239
movq %r12, %rdi
callq 0x1030
xorl %r12d, %r12d
movl $0x80000001, %eax       # imm = 0x80000001
jmp 0x123c
movl $0x200002, %eax         # imm = 0x200002
xorl %r12d, %r12d
testq %rbx, %rbx
je 0x1243
movl %eax, (%rbx)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/phluid61[P]hsf/src/key.c
// Function: SH_Key__destroy
void
SH_Key__destroy(SH_Key* obj, int* err) {
	__cascade(err,);
	if ((sh_char_t*)0 != obj->value) {
		free(obj->value);
	}
	free(obj);
	__clear(err);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rsi, %rsi
je 0x1282
movq %rsi, %r14
cmpl $0x0, (%rsi)
jne 0x127a
movq (%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
andl $0x0, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq (%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1030