LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/datastruct/seqptrmap.c
// Function: seqptrmap_delete
void
seqptrmap_delete(struct seqptrmap * M, int64_t i)
{

	/* No valid pointer is less than the offset. */
	if (i < M->offset)
		return;

	/*
	 * If the provided integer is not within the bounds of our elastic
	 * queue, return without taking any action.
	 */
	if ((uint64_t)(i - M->offset) >= (uint64_t)(M->len))
		return;

	/* Delete the specified pointer by setting it to NULL. */
	*(void **)elasticqueue_get(M->ptrs, (size_t)(i - M->offset)) = NULL;

	/* Delete leading NULLs from the queue. */
	while ((elasticqueue_getlen(M->ptrs) > 0) &&
	    (*(void **)elasticqueue_get(M->ptrs, 0) == NULL)) {
		elasticqueue_delete(M->ptrs);
		M->offset += 1;
		M->len -= 1;
	}
}

// Assembly:
subq 0x8(%rdi), %rsi
jl 0x7e93
pushq %rbx
movq %rdi, %rbx
cmpq 0x10(%rdi), %rsi
jae 0x7e92
movq (%rbx), %rdi
callq 0x9a73
movq $0x0, (%rax)
movq (%rbx), %rdi
callq 0x9a6e
testq %rax, %rax
je 0x7e92
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x9a73
cmpq $0x0, (%rax)
jne 0x7e92
movq (%rbx), %rdi
callq 0x99dd
incq 0x8(%rbx)
decq 0x10(%rbx)
jmp 0x7e63
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/netbuf/netbuf_read.c
// Function: netbuf_read_init2
struct netbuf_read *
netbuf_read_init2(int s, struct network_ssl_ctx * ssl)
{
	struct netbuf_read * R;

	/* Bake a cookie. */
	if ((R = malloc(sizeof(struct netbuf_read))) == NULL)
		goto err0;
	R->s = s;
	R->ssl = ssl;
	R->read_cookie = NULL;
	R->immediate_cookie = NULL;

	/* Allocate buffer. */
	R->buflen = 4096;
	if ((R->buf = malloc(R->buflen)) == NULL)
		goto err1;
	R->bufpos = 0;
	R->datalen = 0;

	/* Success! */
	return (R);

err1:
	free(R);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
movl $0x50, %edi
callq 0x2220
testq %rax, %rax
je 0x8093
movq %rax, %rbx
movl %ebp, (%rax)
movq %r14, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movq $0x1000, 0x38(%rax)     # imm = 0x1000
movl $0x1000, %edi           # imm = 0x1000
callq 0x2220
movq %rax, 0x30(%rbx)
testq %rax, %rax
je 0x808b
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rbx)
jmp 0x8095
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/netbuf/netbuf_read.c
// Function: callback_success
static int
callback_success(void * cookie)
{
	struct netbuf_read * R = cookie;

	/* Sanity-check: We should be expecting this callback. */
	assert(R->immediate_cookie != NULL);

	/* This callback is no longer pending. */
	R->immediate_cookie = NULL;

	/* Perform callback. */
	return ((R->callback)(R->cookie, 0));
}

// Assembly:
cmpq $0x0, 0x28(%rdi)
je 0x8273
movq $0x0, 0x28(%rdi)
movq 0x10(%rdi), %rax
movq 0x18(%rdi), %rdi
xorl %esi, %esi
jmpq *%rax
pushq %rax
leaq 0x3fff(%rip), %rdi      # 0xc27a
leaq 0x3ee6(%rip), %rsi      # 0xc168
leaq 0x400d(%rip), %rcx      # 0xc296
movl $0xd0, %edx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/netbuf/netbuf_read.c
// Function: netbuf_read_wait_cancel
void
netbuf_read_wait_cancel(struct netbuf_read * R)
{

	/* If we have an in-progress read, cancel it. */
	if (R->read_cookie != NULL) {
		if (R->ssl)
			(netbuf_read_ssl_cancel_func)(R->read_cookie);
		else
			network_read_cancel(R->read_cookie);
		R->read_cookie = NULL;
	}

	/* If we have an immediate callback pending, cancel it. */
	if (R->immediate_cookie != NULL) {
		events_immediate_cancel(R->immediate_cookie);
		R->immediate_cookie = NULL;
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0x8310
cmpq $0x0, 0x8(%rbx)
je 0x8303
callq *0x3a3df(%rip)          # 0x426e0
jmp 0x8308
callq 0x8b77
movq $0x0, 0x20(%rbx)
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x8326
callq 0x2e62
movq $0x0, 0x28(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/netbuf/netbuf_read.c
// Function: netbuf_read_free
void
netbuf_read_free(struct netbuf_read * R)
{

	/* Behave consistently with free(NULL). */
	if (R == NULL)
		return;

	/* Can't free a reader which is busy. */
	assert(R->read_cookie == NULL);
	assert(R->immediate_cookie == NULL);

	/* Free the buffer and the reader. */
	free(R->buf);
	free(R);
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x8389
movq %rdi, %rbx
cmpq $0x0, 0x20(%rdi)
jne 0x838b
cmpq $0x0, 0x28(%rbx)
jne 0x83aa
movq 0x30(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
popq %rbx
jmp 0x2040
popq %rbx
retq
leaq 0x3dbf(%rip), %rdi      # 0xc151
leaq 0x3dcf(%rip), %rsi      # 0xc168
leaq 0x3eae(%rip), %rcx      # 0xc24e
movl $0x132, %edx            # imm = 0x132
callq 0x2180
leaq 0x3e2c(%rip), %rdi      # 0xc1dd
leaq 0x3db0(%rip), %rsi      # 0xc168
leaq 0x3e8f(%rip), %rcx      # 0xc24e
movl $0x133, %edx            # imm = 0x133
callq 0x2180
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/netbuf/netbuf_write.c
// Function: netbuf_write_init2
struct netbuf_write *
netbuf_write_init2(int s, struct network_ssl_ctx * ssl,
    int (* fail_callback)(void *), void * fail_cookie)
{
	struct netbuf_write * W;
	int val;

	/* Bake a cookie. */
	if ((W = malloc(sizeof(struct netbuf_write))) == NULL)
		goto err0;
	W->s = s;
	W->ssl = ssl;
	W->reserved = 0;
	W->failed = 0;
	W->fail_callback = (fail_callback != NULL) ? fail_callback : dummyfail;
	W->fail_cookie = fail_cookie;
	STAILQ_INIT(&W->buffers);
	W->write_cookie = NULL;
	W->curr = NULL;

	/* Additional configuration if we're using a socket. */
	if (W->ssl == NULL) {
		/* Sanity check. */
		assert(W->s >= 0);

		/*
		 * Request that the OS not attempt to coalesce small segments.
		 * We do this ourselves, and we're smarter than the OS is.  We
		 * don't check the error code here, because POSIX does not
		 * require that TCP_NODELAY be implemented (although it must
		 * be defined); and we might not even be operating on a TCP
		 * socket.
		 */
		val = 1;
		(void)setsockopt(W->s, IPPROTO_TCP, TCP_NODELAY, &val,
		    sizeof(int));
	}

	/* Success! */
	return (W);

err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
movl %edi, %ebp
movl $0x48, %edi
callq 0x2220
testq %rax, %rax
je 0x8467
movq %rax, %rbx
movl %ebp, (%rax)
movq %r14, 0x8(%rax)
xorl %eax, %eax
movq %rax, 0x10(%rbx)
testq %r12, %r12
leaq 0x80(%rip), %rcx        # 0x8498
cmovneq %r12, %rcx
movq %rcx, 0x18(%rbx)
movq %r15, 0x20(%rbx)
movq %rbx, %rcx
addq $0x28, %rcx
movq %rax, 0x28(%rbx)
movq %rcx, 0x30(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
testq %r14, %r14
jne 0x8469
testl %ebp, %ebp
js 0x8479
leaq 0xc(%rsp), %rcx
movl $0x1, (%rcx)
movl %ebp, %edi
movl $0x6, %esi
movl $0x1, %edx
movl $0x4, %r8d
callq 0x20e0
jmp 0x8469
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3e6d(%rip), %rdi      # 0xc2ed
leaq 0x3e70(%rip), %rsi      # 0xc2f7
leaq 0x3e8e(%rip), %rcx      # 0xc31c
movl $0xc3, %edx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/netbuf/netbuf_write.c
// Function: netbuf_write_reserve
uint8_t *
netbuf_write_reserve(struct netbuf_write * W, size_t len)
{
	struct writebuf * WB;

	/* Sanity-check: No calls while buffer space reserved. */
	assert(W->reserved == 0);

	/* We're reserving some space. */
	W->reserved = 1;

	/* Do we have a buffer with enough space?  Return it. */
	if ((WB = STAILQ_LAST(&W->buffers, writebuf, entries)) != NULL) {
		if (WB->buflen - WB->datalen >= len)
			goto oldbuf;
	}

	/* We need to add a new buffer to the queue. */
	if ((WB = malloc(sizeof(struct writebuf))) == NULL)
		goto err0;

	/* We want to hold this write or WBUFLEN of small writes. */
	if (len > WBUFLEN)
		WB->buflen = len;
	else
		WB->buflen = WBUFLEN;

	/* Allocate memory. */
	if ((WB->buf = malloc(WB->buflen)) == NULL)
		goto err1;

	/* No data in this buffer yet. */
	WB->datalen = 0;

	/* Add this buffer to the queue. */
	STAILQ_INSERT_TAIL(&W->buffers, WB, entries);

	/* Return a pointer to the new buffer. */
	return (WB->buf);

oldbuf:
	/* Return a pointer into the old buffer. */
	return (&WB->buf[WB->datalen]);

err1:
	free(WB);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpl $0x0, 0x10(%rdi)
jne 0x8546
movq %rsi, %r14
movq %rdi, %rbx
movl $0x1, 0x10(%rdi)
cmpq $0x0, 0x28(%rdi)
je 0x84c8
movq 0x30(%rbx), %rcx
addq $-0x18, %rcx
jmp 0x84ca
xorl %ecx, %ecx
testq %rcx, %rcx
je 0x84df
movq 0x8(%rcx), %rdx
movq 0x10(%rcx), %rax
subq %rax, %rdx
cmpq %r14, %rdx
jae 0x8531
movl $0x20, %edi
callq 0x2220
testq %rax, %rax
je 0x853e
movq %rax, %r15
cmpq $0x1001, %r14           # imm = 0x1001
movl $0x1000, %edi           # imm = 0x1000
cmovaeq %r14, %rdi
movq %rdi, 0x8(%rax)
callq 0x2220
movq %rax, (%r15)
testq %rax, %rax
je 0x8536
movq %r15, %rax
addq $0x18, %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r15)
movq 0x30(%rbx), %rcx
movq %r15, (%rcx)
movq %rax, 0x30(%rbx)
movq (%r15), %rax
jmp 0x8540
addq (%rcx), %rax
jmp 0x8540
movq %r15, %rdi
callq 0x2040
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3e2f(%rip), %rdi      # 0xc37c
leaq 0x3da3(%rip), %rsi      # 0xc2f7
leaq 0x3e32(%rip), %rcx      # 0xc38d
movl $0xe8, %edx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/netbuf/netbuf_write.c
// Function: netbuf_write_consume
int
netbuf_write_consume(struct netbuf_write * W, size_t len)
{
	struct writebuf * WB;

	/* Sanity-check: We must have space reserved. */
	assert(W->reserved == 1);

	/* Get the old buffer. */
	WB = STAILQ_LAST(&W->buffers, writebuf, entries);

	/* Sanity-check: We must have a buffer. */
	assert(WB != NULL);

	/* Sanity-check: We must have enough space reserved. */
	assert(WB->buflen - WB->datalen >= len);

	/*
	 * Advance the buffer pointer, unless we've failed -- if we've failed
	 * there's no point since we're never going to look at the buffered
	 * data anyway.
	 */
	if (W->failed == 0)
		WB->datalen += len;

	/* We no longer have space reserved. */
	W->reserved = 0;

	/* Poke the queue to see if we can launch more writing now. */
	return (poke(W));
}

// Assembly:
pushq %rax
cmpl $0x1, 0x10(%rdi)
jne 0x85ab
cmpq $0x0, 0x28(%rdi)
je 0x857d
movq 0x30(%rdi), %rax
addq $-0x18, %rax
jmp 0x857f
xorl %eax, %eax
testq %rax, %rax
je 0x85ca
movq 0x8(%rax), %rdx
movq 0x10(%rax), %rcx
subq %rcx, %rdx
cmpq %rsi, %rdx
jb 0x85e9
cmpl $0x0, 0x14(%rdi)
jne 0x85a1
addq %rsi, %rcx
movq %rcx, 0x10(%rax)
movl $0x0, 0x10(%rdi)
popq %rax
jmp 0x8608
leaq 0x3e18(%rip), %rdi      # 0xc3ca
leaq 0x3d3e(%rip), %rsi      # 0xc2f7
leaq 0x3e1b(%rip), %rcx      # 0xc3db
movl $0x120, %edx            # imm = 0x120
callq 0x2180
leaq 0x3e42(%rip), %rdi      # 0xc413
leaq 0x3d1f(%rip), %rsi      # 0xc2f7
leaq 0x3dfc(%rip), %rcx      # 0xc3db
movl $0x126, %edx            # imm = 0x126
callq 0x2180
leaq 0x3e2e(%rip), %rdi      # 0xc41e
leaq 0x3d00(%rip), %rsi      # 0xc2f7
leaq 0x3ddd(%rip), %rcx      # 0xc3db
movl $0x129, %edx            # imm = 0x129
callq 0x2180
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/netbuf/netbuf_write.c
// Function: poke
static int
poke(struct netbuf_write * W)
{
	struct writebuf * WB;

	/* If a write is in progress or we have nothing to write, return. */
	if ((W->write_cookie != NULL) || (STAILQ_EMPTY(&W->buffers)))
		return (0);

	/* If we've failed, don't try to do anything more. */
	if (W->failed)
		return (0);

	/* Sanity-check: We don't have a buffer in progress. */
	assert(W->curr == NULL);

	/* Start writing a buffer. */
	WB = STAILQ_FIRST(&W->buffers);
	if (W->ssl) {
		if ((W->write_cookie = (netbuf_write_ssl_func)(W->ssl,
		    WB->buf, WB->datalen, WB->datalen, writbuf, W)) == NULL)
			goto err0;
	} else {
		if ((W->write_cookie = network_write(W->s, WB->buf,
		    WB->datalen, WB->datalen, writbuf, W)) == NULL)
			goto err0;
	}
	W->curr = WB;

	/* Remove the buffer from the queue. */
	STAILQ_REMOVE(&W->buffers, WB, writebuf, entries);

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
xorl %ebx, %ebx
cmpq $0x0, 0x38(%rdi)
je 0x861e
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
movq %rdi, %r14
movq 0x28(%rdi), %r15
testq %r15, %r15
je 0x8616
cmpl $0x0, 0x14(%r14)
jne 0x8616
cmpq $0x0, 0x40(%r14)
jne 0x86d6
movq 0x8(%r14), %rdi
movq (%r15), %rsi
movq 0x10(%r15), %rcx
testq %rdi, %rdi
je 0x8661
leaq 0x17a(%rip), %r8        # 0x87cd
movq %rcx, %rdx
movq %r14, %r9
callq *0x3a089(%rip)          # 0x426e8
jmp 0x8676
movl (%r14), %edi
leaq 0x162(%rip), %r8        # 0x87cd
movq %rcx, %rdx
movq %r14, %r9
callq 0x8dd8
movq %rax, 0x38(%r14)
testq %rax, %rax
je 0x86af
movq %r15, 0x40(%r14)
movq 0x28(%r14), %rcx
cmpq %r15, %rcx
je 0x86b9
movq %rcx, %rax
movq 0x18(%rcx), %rcx
cmpq %r15, %rcx
jne 0x868c
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
testq %rcx, %rcx
jne 0x8616
addq $0x18, %rax
jmp 0x86cd
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x8616
leaq 0x28(%r14), %rax
movq 0x18(%rcx), %rcx
movq %rcx, (%rax)
testq %rcx, %rcx
jne 0x8616
movq %rax, 0x30(%r14)
jmp 0x8616
leaq 0x3d61(%rip), %rdi      # 0xc43e
leaq 0x3c13(%rip), %rsi      # 0xc2f7
leaq 0x3d63(%rip), %rcx      # 0xc44e
movl $0x72, %edx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/netbuf/netbuf_write.c
// Function: netbuf_write_write
int
netbuf_write_write(struct netbuf_write * W, const uint8_t * buf, size_t buflen)
{
	uint8_t * wbuf;

	/* If we've failed, just silently discard writes. */
	if (W->failed)
		return (0);

	/* Reserve space to write the data into. */
	if ((wbuf = netbuf_write_reserve(W, buflen)) == NULL)
		goto err0;

	/* Copy data into the returned buffer. */
	memcpy(wbuf, buf, buflen);

	/* Consume the reservation. */
	if (netbuf_write_consume(W, buflen))
		goto err0;

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
xorl %ebx, %ebx
cmpl $0x0, 0x14(%rdi)
jne 0x873d
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movq %rdx, %rsi
callq 0x849b
testq %rax, %rax
je 0x8738
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x2200
movq %r15, %rdi
movq %r14, %rsi
callq 0x8565
testl %eax, %eax
je 0x873d
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/netbuf/netbuf_write.c
// Function: netbuf_write_free
void
netbuf_write_free(struct netbuf_write * W)
{
	struct writebuf * WB;

	/* Behave consistently with free(NULL). */
	if (W == NULL)
		return;

	/* Cancel any in-progress write. */
	if (W->write_cookie != NULL) {
		if (W->ssl)
			(netbuf_write_ssl_cancel_func)(W->write_cookie);
		else
			network_write_cancel(W->write_cookie);
		free(W->curr->buf);
		free(W->curr);
	}

	/* Free write buffers. */
	while (!STAILQ_EMPTY(&W->buffers)) {
		WB = STAILQ_FIRST(&W->buffers);
		STAILQ_REMOVE_HEAD(&W->buffers, entries);
		free(WB->buf);
		free(WB);
	}

	/* Free the buffered writer. */
	free(W);
}

// Assembly:
testq %rdi, %rdi
je 0x8770
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
testq %rdi, %rdi
je 0x878b
cmpq $0x0, 0x8(%rbx)
je 0x8771
callq *0x39f82(%rip)          # 0x426f0
jmp 0x8776
retq
callq 0x90a6
movq 0x40(%rbx), %rax
movq (%rax), %rdi
callq 0x2040
movq 0x40(%rbx), %rdi
callq 0x2040
movq 0x28(%rbx), %r14
testq %r14, %r14
je 0x87c0
leaq 0x28(%rbx), %r15
movq 0x18(%r14), %rax
movq %rax, (%r15)
testq %rax, %rax
jne 0x87a8
movq %r15, 0x30(%rbx)
movq (%r14), %rdi
callq 0x2040
movq %r14, %rdi
callq 0x2040
movq (%r15), %r14
testq %r14, %r14
jne 0x8798
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/netbuf/netbuf_write.c
// Function: writbuf
static int
writbuf(void * cookie, ssize_t writelen)
{
	struct netbuf_write * W = cookie;
	struct writebuf * WB = W->curr;

	/* Sanity-check: No callbacks while buffer space reserved. */
	assert(W->reserved == 0);

	/* Sanity-check: We must have had a write in progress. */
	assert(W->write_cookie != NULL);
	assert(W->curr != NULL);

	/* This write is no longer in progress. */
	W->write_cookie = NULL;
	W->curr = NULL;

	/* Sanity-check: We can't get here if we've previously failed. */
	assert(W->failed == 0);

	/*
	 * If we didn't write the correct number of bytes, mark the queue as
	 * failed.  Note that since datalen can't be equal to (size_t)(-1)
	 * this also handles the case of writelen == -1.
	 */
	if ((size_t)(writelen) != WB->datalen)
		W->failed = 1;

	/* Free this buffer. */
	free(WB->buf);
	free(WB);

	/* If we failed, invoke the failure callback. */
	if (W->failed)
		return ((W->fail_callback)(W->fail_cookie));

	/* Poke the queue to launch more writes. */
	return (poke(W));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x0, 0x10(%rdi)
jne 0x884d
movq %rdi, %rcx
cmpq $0x0, 0x38(%rdi)
je 0x886c
movq 0x40(%rcx), %rbx
testq %rbx, %rbx
je 0x888b
leaq 0x38(%rcx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
cmpl $0x0, 0x14(%rcx)
jne 0x88aa
cmpq %rsi, 0x10(%rbx)
je 0x8813
movl $0x1, 0x14(%rcx)
movq (%rbx), %rdi
movq %rcx, %r14
callq 0x2040
movq %rbx, %rdi
callq 0x2040
movq %r14, %rax
cmpl $0x0, 0x14(%r14)
je 0x883e
movq 0x20(%rax), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *0x18(%rax)
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8608
leaq 0x3b28(%rip), %rdi      # 0xc37c
leaq 0x3a9c(%rip), %rsi      # 0xc2f7
leaq 0x3c0c(%rip), %rcx      # 0xc46e
movl $0x42, %edx
callq 0x2180
leaq 0x3c18(%rip), %rdi      # 0xc48b
leaq 0x3a7d(%rip), %rsi      # 0xc2f7
leaq 0x3bed(%rip), %rcx      # 0xc46e
movl $0x45, %edx
callq 0x2180
leaq 0x3c11(%rip), %rdi      # 0xc4a3
leaq 0x3a5e(%rip), %rsi      # 0xc2f7
leaq 0x3bce(%rip), %rcx      # 0xc46e
movl $0x46, %edx
callq 0x2180
leaq 0x3c02(%rip), %rdi      # 0xc4b3
leaq 0x3a3f(%rip), %rsi      # 0xc2f7
leaq 0x3baf(%rip), %rcx      # 0xc46e
movl $0x4d, %edx
callq 0x2180
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/network/network_write.c
// Function: network_write_cancel
void
network_write_cancel(void * cookie)
{
	struct network_write_cookie * C = cookie;

	/* Kill the network event. */
	events_network_cancel(C->fd, EVENTS_NETWORK_OP_WRITE);

	/* Free the cookie. */
	mpool_network_write_cookie_free(C);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x10(%rdi), %edi
movl $0x1, %esi
callq 0x3503
testq %rbx, %rbx
je 0x9188
movq 0x84ca(%rip), %rax      # 0x11598
movq 0x84cb(%rip), %r14      # 0x115a0
cmpq %r14, %rax
jae 0x90f5
movq 0x84c7(%rip), %rcx      # 0x115a8
leaq 0x1(%rax), %rdx
movq %rdx, 0x84ac(%rip)      # 0x11598
movq %rbx, (%rcx,%rax,8)
jmp 0x9188
movq 0x84b4(%rip), %rax      # 0x115b0
shrq $0x8, %rax
cmpq %rax, 0x84b1(%rip)      # 0x115b8
jbe 0x9176
testq %r14, %r14
je 0x9194
movq %r14, %rdi
shlq $0x4, %rdi
callq 0x2220
testq %rax, %rax
je 0x9176
movq %rax, %r15
movq 0x847b(%rip), %r12      # 0x115a8
shlq $0x3, %r14
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x2200
cmpq 0x8482(%rip), %r12      # 0x115c8
je 0x9150
movq %r12, %rdi
callq 0x2040
movq %r15, 0x8451(%rip)      # 0x115a8
shlq 0x8442(%rip)            # 0x115a0
movq 0x8433(%rip), %rax      # 0x11598
leaq 0x1(%rax), %rcx
movq %rcx, 0x8428(%rip)      # 0x11598
movq %rbx, (%r15,%rax,8)
jmp 0x917e
movq %rbx, %rdi
callq 0x2040
xorps %xmm0, %xmm0
movups %xmm0, 0x8428(%rip)     # 0x115b0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1f35(%rip), %rdi      # 0xb0d0
leaq 0x1f3f(%rip), %rsi      # 0xb0e1
leaq 0x1f5a(%rip), %rcx      # 0xb103
movl $0x5a, %edx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/network/network_write.c
// Function: docallback
static int
docallback(struct network_write_cookie * C, ssize_t nbytes)
{
	int rc;

	/* Invoke the callback. */
	rc = (C->callback)(C->cookie, nbytes);

	/* Clean up. */
	mpool_network_write_cookie_free(C);

	/* Return the callback's status. */
	return (rc);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rdi
callq *(%r14)
movl %eax, %ebx
movq 0x8375(%rip), %rax      # 0x11598
movq 0x8376(%rip), %r15      # 0x115a0
cmpq %r15, %rax
jae 0x924a
movq 0x8372(%rip), %rcx      # 0x115a8
leaq 0x1(%rax), %rdx
movq %rdx, 0x8357(%rip)      # 0x11598
movq %r14, (%rcx,%rax,8)
jmp 0x92dd
movq 0x835f(%rip), %rax      # 0x115b0
shrq $0x8, %rax
cmpq %rax, 0x835c(%rip)      # 0x115b8
jbe 0x92cb
testq %r15, %r15
je 0x92e9
movq %r15, %rdi
shlq $0x4, %rdi
callq 0x2220
testq %rax, %rax
je 0x92cb
movq %rax, %r12
movq 0x8326(%rip), %r13      # 0x115a8
shlq $0x3, %r15
movq %rax, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x2200
cmpq 0x832d(%rip), %r13      # 0x115c8
je 0x92a5
movq %r13, %rdi
callq 0x2040
movq %r12, 0x82fc(%rip)      # 0x115a8
shlq 0x82ed(%rip)            # 0x115a0
movq 0x82de(%rip), %rax      # 0x11598
leaq 0x1(%rax), %rcx
movq %rcx, 0x82d3(%rip)      # 0x11598
movq %r14, (%r12,%rax,8)
jmp 0x92d3
movq %r14, %rdi
callq 0x2040
xorps %xmm0, %xmm0
movups %xmm0, 0x82d3(%rip)     # 0x115b0
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x1de0(%rip), %rdi      # 0xb0d0
leaq 0x1dea(%rip), %rsi      # 0xb0e1
leaq 0x1e05(%rip), %rcx      # 0xb103
movl $0x5a, %edx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../lib/wire/wire_readpacket.c
// Function: wire_readpacket_peek
int
wire_readpacket_peek(struct netbuf_read * R, struct wire_packet * P)
{
	CRC32C_CTX ctx;
	uint8_t * data;
	size_t datalen;
	uint8_t cbuf[4];
	size_t i;

	/* No packet data yet. */
	P->buf = NULL;

	/* Ask the buffered reader what it has. */
	netbuf_read_peek(R, &data, &datalen);

	/* If we have less than 20 bytes, we don't have a complete packet. */
	if (datalen < 20)
		goto nopacket;

	/* Verify the header checksum. */
	CRC32C_Init(&ctx);
	CRC32C_Update(&ctx, data, 12);
	CRC32C_Final(cbuf, &ctx);
	if (memcmp(&data[12], cbuf, 4)) {
		warn0("Incorrect CRC on packet header");
		goto failed;
	}

	/* Parse ID and length. */
	P->ID = be64dec(&data[0]);
	P->len = be32dec(&data[8]);

	/* Make sure the length is reasonable. */
	if (P->len > SIZE_MAX - 20)
		goto failed;

	/* Do we have the complete packet? */
	if (datalen < P->len + 20)
		goto nopacket;

	/* Verify the data checksum. */
	CRC32C_Init(&ctx);
	CRC32C_Update(&ctx, &data[16], P->len);
	CRC32C_Final(cbuf, &ctx);
	for (i = 0; i < 4; i++)
		cbuf[i] ^= data[16 + P->len + i];
	if (memcmp(&data[12], cbuf, 4)) {
		warn0("Incorrect CRC on packet data");
		goto failed;
	}

	/* Point at the data. */
	P->buf = &data[16];

nopacket:
	/* Success! */
	return (0);

failed:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq $0x0, 0x10(%rsi)
leaq 0x10(%rsp), %rsi
leaq 0x20(%rsp), %r14
movq %r14, %rdx
callq 0x809d
xorl %ebp, %ebp
cmpq $0x14, (%r14)
jb 0x9530
leaq 0x1c(%rsp), %r14
movq %r14, %rdi
callq 0x7510
movq 0x10(%rsp), %rsi
movl $0xc, %edx
movq %r14, %rdi
callq 0x77c0
leaq 0xc(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x78a8
movq 0x10(%rsp), %rax
movl 0xc(%rax), %ecx
cmpl (%r15), %ecx
je 0x949e
leaq 0x318e(%rip), %rdi      # 0xc610
xorl %eax, %eax
callq 0x514b
callq 0x2090
movl $0x0, (%rax)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x9530
movq (%rax), %rcx
bswapq %rcx
movq %rcx, (%rbx)
movl 0x8(%rax), %eax
bswapl %eax
movq %rax, 0x8(%rbx)
addq $0x14, %rax
cmpq %rax, 0x20(%rsp)
jb 0x9530
leaq 0x1c(%rsp), %r14
movq %r14, %rdi
callq 0x7510
movq 0x10(%rsp), %rsi
addq $0x10, %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x77c0
leaq 0xc(%rsp), %rdi
movq %r14, %rsi
callq 0x78a8
movq 0x10(%rsp), %rax
movq 0x8(%rbx), %rcx
addq %rcx, %rax
addq $0x10, %rax
xorl %ecx, %ecx
movb (%rax,%rcx), %dl
xorb %dl, 0xc(%rsp,%rcx)
incq %rcx
cmpq $0x4, %rcx
jne 0x94fc
movq 0x10(%rsp), %rax
movl 0xc(%rax), %ecx
cmpl 0xc(%rsp), %ecx
je 0x9526
leaq 0x310e(%rip), %rdi      # 0xc62f
jmp 0x9482
addq $0x10, %rax
movq %rax, 0x10(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../lib/wire/wire_readpacket.c
// Function: wire_readpacket_wait
void *
wire_readpacket_wait(struct netbuf_read * R,
    int (* callback)(void *, int), void * cookie)
{
	struct wait_cookie * W;

	/* Bake a cookie. */
	if ((W = mpool_wait_cookie_malloc()) == NULL)
		goto err0;
	W->R = R;
	W->callback = callback;
	W->cookie = cookie;

	/* Wait for a header to be available. */
	if (netbuf_read_wait(W->R, 16, callback_wait_gotheader, W))
		goto err0;

	/* Success! */
	return (W);

err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
incq 0x80a1(%rip)            # 0x115f0
movq %rsi, %r15
movq %rdi, %rbx
movq 0x807c(%rip), %rax      # 0x115d8
testq %rax, %rax
je 0x957a
movq 0x8080(%rip), %rcx      # 0x115e8
leaq -0x1(%rax), %rdx
movq %rdx, 0x8065(%rip)      # 0x115d8
movq -0x8(%rcx,%rax,8), %r12
jmp 0x95ad
incq 0x8077(%rip)            # 0x115f8
cmpl $0x0, 0x8078(%rip)      # 0x11600
jne 0x95a0
movq 0x807f(%rip), %rdi      # 0x11610
callq 0xa050
movl $0x1, 0x8060(%rip)      # 0x11600
movl $0x18, %edi
callq 0x2220
movq %rax, %r12
testq %r12, %r12
je 0x95db
movq %rbx, (%r12)
movq %r15, 0x8(%r12)
movq %r14, 0x10(%r12)
leaq 0x26(%rip), %rdx        # 0x95ed
movl $0x10, %esi
movq %rbx, %rdi
movq %r12, %rcx
callq 0x80b6
testl %eax, %eax
je 0x95de
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../lib/wire/wire_readpacket.c
// Function: callback_wait_gotheader
static int
callback_wait_gotheader(void * cookie, int status)
{
	CRC32C_CTX ctx;
	struct wait_cookie * W = cookie;
	uint8_t * data;
	size_t datalen;
	size_t len;
	uint8_t cbuf[4];
	int rc;

	/* Did we fail or prematurely EOF? */
	if (status)
		goto failed;

	/* Grab the header and verify the checksum. */
	netbuf_read_peek(W->R, &data, &datalen);
	CRC32C_Init(&ctx);
	CRC32C_Update(&ctx, data, 12);
	CRC32C_Final(cbuf, &ctx);
	if (memcmp(&data[12], cbuf, 4)) {
		warn0("Incorrect CRC on packet header");
		goto failed;
	}

	/* Parse length and wait for the complete packet to be available. */
	len = be32dec(&data[8]);
	if (len > SIZE_MAX - 20)
		goto failed;
	if (netbuf_read_wait(W->R, len + 20, callback_wait_gotdata, W))
		goto failed;

	/* Success! */
	return (0);

failed:
	/* Perform a failure callback. */
	rc = (W->callback)(W->cookie, 1);

	/* Free the cookie. */
	mpool_wait_cookie_free(W);

	/* Return status from callback. */
	return (rc);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
testl %esi, %esi
jne 0x968c
movq (%rbx), %rdi
leaq 0x18(%rsp), %r14
leaq 0x10(%rsp), %rdx
movq %r14, %rsi
callq 0x809d
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x7510
movq (%r14), %rsi
movl $0xc, %edx
movq %r15, %rdi
callq 0x77c0
leaq 0xc(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x78a8
movq (%r14), %rax
movl 0xc(%rax), %ecx
cmpl (%r12), %ecx
je 0x966d
leaq 0x2fb7(%rip), %rdi      # 0xc610
xorl %eax, %eax
callq 0x514b
callq 0x2090
movl $0x0, (%rax)
jmp 0x968c
movl 0x8(%rax), %esi
bswapl %esi
movq (%rbx), %rdi
addq $0x14, %rsi
leaq 0x295(%rip), %rdx       # 0x9915
movq %rbx, %rcx
callq 0x80b6
testl %eax, %eax
je 0x96b1
movq 0x10(%rbx), %rdi
movl $0x1, %esi
callq *0x8(%rbx)
movl %eax, %ebp
movq %rbx, %rdi
callq 0x97b4
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
jmp 0x96a2
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../lib/wire/wire_readpacket.c
// Function: wire_readpacket_wait_cancel
void
wire_readpacket_wait_cancel(void * cookie)
{
	struct wait_cookie * W = cookie;

	/* Cancel the buffered reader wait. */
	netbuf_read_wait_cancel(W->R);

	/* Free the cookie. */
	mpool_wait_cookie_free(W);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x82e7
movq 0x7f09(%rip), %rax      # 0x115d8
movq 0x7f0a(%rip), %r14      # 0x115e0
cmpq %r14, %rax
jae 0x96f6
movq 0x7f06(%rip), %rcx      # 0x115e8
leaq 0x1(%rax), %rdx
movq %rdx, 0x7eeb(%rip)      # 0x115d8
movq %rbx, (%rcx,%rax,8)
jmp 0x9789
movq 0x7ef3(%rip), %rax      # 0x115f0
shrq $0x8, %rax
cmpq %rax, 0x7ef0(%rip)      # 0x115f8
jbe 0x9777
testq %r14, %r14
je 0x9795
movq %r14, %rdi
shlq $0x4, %rdi
callq 0x2220
testq %rax, %rax
je 0x9777
movq %rax, %r15
movq 0x7eba(%rip), %r12      # 0x115e8
shlq $0x3, %r14
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x2200
cmpq 0x7ec1(%rip), %r12      # 0x11608
je 0x9751
movq %r12, %rdi
callq 0x2040
movq %r15, 0x7e90(%rip)      # 0x115e8
shlq 0x7e81(%rip)            # 0x115e0
movq 0x7e72(%rip), %rax      # 0x115d8
leaq 0x1(%rax), %rcx
movq %rcx, 0x7e67(%rip)      # 0x115d8
movq %rbx, (%r15,%rax,8)
jmp 0x977f
movq %rbx, %rdi
callq 0x2040
xorps %xmm0, %xmm0
movups %xmm0, 0x7e67(%rip)     # 0x115f0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1934(%rip), %rdi      # 0xb0d0
leaq 0x193e(%rip), %rsi      # 0xb0e1
leaq 0x1959(%rip), %rcx      # 0xb103
movl $0x5a, %edx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/datastruct/elasticqueue.c
// Function: elasticqueue_init
struct elasticqueue *
elasticqueue_init(size_t reclen)
{
	struct elasticqueue * EQ;

	/* Sanity check. */
	assert(reclen > 0);

	/* Allocate structure. */
	if ((EQ = malloc(sizeof(struct elasticqueue))) == NULL)
		goto err0;
	EQ->reclen = reclen;

	/* Create (empty) elastic array. */
	if ((EQ->EA = elasticarray_init(0, EQ->reclen)) == NULL)
		goto err1;

	/* The queue is empty so far. */
	EQ->offset = EQ->len = 0;

	/* Success! */
	return (EQ);

err1:
	free(EQ);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x9996
movq %rdi, %r14
movl $0x20, %edi
callq 0x2220
testq %rax, %rax
je 0x9989
movq %rax, %rbx
movq %r14, 0x18(%rax)
xorl %edi, %edi
movq %r14, %rsi
callq 0x79cc
movq %rax, (%rbx)
testq %rax, %rax
je 0x9981
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
jmp 0x998b
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x261e(%rip), %rdi      # 0xbfbb
leaq 0x2ca8(%rip), %rsi      # 0xc64c
leaq 0x2cca(%rip), %rcx      # 0xc675
movl $0x1b, %edx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/datastruct/elasticqueue.c
// Function: elasticqueue_delete
void
elasticqueue_delete(struct elasticqueue * EQ)
{
	size_t i;
	void * oldpos;
	void * newpos;

	/* Return immediately if the queue is empty. */
	if (EQ->len == 0)
		return;

	/* Adjust pointers to remove the record from the logical queue. */
	EQ->offset += 1;
	EQ->len -= 1;

	/* Should we move everything to the front of the array? */
	if (EQ->offset > EQ->len) {
		/* Move records. */
		for (i = 0; i < EQ->len; i++) {
			newpos = elasticarray_get(EQ->EA, i, EQ->reclen);
			oldpos = elasticarray_get(EQ->EA, i + EQ->offset,
			    EQ->reclen);
			memcpy(newpos, oldpos, EQ->reclen);
		}

		/* Remove the unused space at the end. */
		elasticarray_shrink(EQ->EA, EQ->offset, EQ->reclen);

		/* And remember that everything is now at the front. */
		EQ->offset = 0;
	}
}

// Assembly:
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x9a6d
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rcx
incq %rcx
movq %rcx, 0x8(%rdi)
decq %rax
movq %rax, 0x10(%rdi)
cmpq %rax, %rcx
jbe 0x9a68
cmpq $0x0, 0x10(%rbx)
je 0x9a50
xorl %r14d, %r14d
movq (%rbx), %rdi
movq 0x18(%rbx), %rdx
movq %r14, %rsi
callq 0x7c7d
movq %rax, %r15
movq 0x8(%rbx), %rsi
addq %r14, %rsi
movq (%rbx), %rdi
movq 0x18(%rbx), %rdx
callq 0x7c7d
movq 0x18(%rbx), %rdx
movq %r15, %rdi
movq %rax, %rsi
callq 0x2200
incq %r14
cmpq 0x10(%rbx), %r14
jb 0x9a13
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
movq 0x18(%rbx), %rdx
callq 0x7be8
movq $0x0, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Xyene[P]macro8080/keyboard.c
// Function: handle_in
uint8_t handle_in(uint8_t dev) {
  switch (dev) {
    case 16:
      return has_keyboard_input() ? 0x03 : 0x02;
    case 17: {
      char ret = has_keyboard_input() ? read_keyboard_input() : '\0';
      return ret;
    }
    case 255:
      return 0;
    default:
      printf("Invalid device read %02X\n", dev);
      return 0;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
cmpl $0xff, %edi
je 0x4fb8
cmpl $0x11, %edi
je 0x4f97
cmpl $0x10, %edi
jne 0x4fbc
callq 0x4fd9
testl %eax, %eax
sete %bl
xorb $0x3, %bl
jmp 0x4fd0
callq 0x4fd9
testl %eax, %eax
je 0x4fb8
callq 0x3070
movl %eax, %edi
callq 0x3040
cmpb $0xa, %al
movl $0xd, %ebx
cmovnel %eax, %ebx
jmp 0x4fd0
xorl %ebx, %ebx
jmp 0x4fd0
movzbl %dil, %esi
leaq 0x104f(%rip), %rdi      # 0x6016
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x3060
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Xyene[P]macro8080/terminal.c
// Function: handle_out
void handle_out(uint8_t dev, uint8_t A) {
  // printf("Printing %02X to dev=%02X\n", A, dev);
  if (dev == 0x11) {
    char c = A & 0x7F;
    if ((' ' <= c && c <= '~') || c == '\r' || c == '\n') {
      terminal_out(c);
    }
  }
}

// Assembly:
cmpl $0x11, %edi
jne 0x515c
movl %esi, %eax
andb $0x7f, %al
cmpb $0x20, %al
setae %cl
cmpb $0x7f, %al
setne %dl
testb %dl, %cl
je 0x5134
pushq %rbp
movq %rsp, %rbp
movzbl %al, %edi
callq 0x3030
movq 0x2ea5(%rip), %rax      # 0x7fd0
movq (%rax), %rdi
popq %rbp
jmp 0x30a0
movzbl %sil, %ecx
cmpl $0x89, %ecx
jg 0x514c
cmpl $0xa, %ecx
je 0x5118
cmpl $0xd, %ecx
je 0x5118
jmp 0x515c
cmpl $0x8d, %ecx
je 0x5118
cmpl $0x8a, %ecx
je 0x5118
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/annot-tsv.c
// Function: cols_split
cols_t *cols_split(const char *line, cols_t *cols, char delim)
{
    if ( !cols ) cols = (cols_t*) calloc(1,sizeof(cols_t));
    if ( !cols ) error("Out of memory, failed to allocate %zu bytes\n",sizeof(cols_t));
    if ( cols->rmme ) free(cols->rmme);
    cols->n = 0;
    cols->rmme = strdup(line);
    if ( !cols->rmme ) error("Out of memory\n");
    char *ss = cols->rmme;
    while (1)
    {
        char *se = ss;
        while ( *se && *se!=delim ) se++;
        char tmp = *se;
        *se = 0;
        cols->n++;
        if ( cols->n > cols->m )
        {
            cols->m += 10;
            cols->off = realloc(cols->off, sizeof(*cols->off)*cols->m);
            if ( !cols->off ) error("Out of memory, failed to allocate %zu bytes\n",sizeof(*cols->off)*cols->m);
        }
        cols->off[ cols->n - 1 ] = ss;
        if ( !tmp ) break;
        ss = se + 1;
    }
    return cols;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
testq %rsi, %rsi
jne 0x5e03
movl $0x1, %edi
movl $0x18, %esi
callq 0x4300
movq %rax, %r14
testq %r14, %r14
je 0x5eb8
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x5e1a
callq 0x45c0
movl $0x0, (%r14)
movq %r15, %rdi
callq 0x4930
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0x5ec6
movq %rax, %r15
movq %r15, %r12
movb (%r12), %bpl
incq %r12
testb %bpl, %bpl
je 0x5e4d
cmpb %bl, %bpl
jne 0x5e3c
movb $0x0, -0x1(%r12)
movl (%r14), %eax
movl 0x4(%r14), %esi
incl %eax
movl %eax, (%r14)
cmpl %esi, %eax
jbe 0x5e80
addl $0xa, %esi
movl %esi, 0x4(%r14)
movq 0x8(%r14), %rdi
shlq $0x3, %rsi
callq 0x4840
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x5ea2
movl (%r14), %eax
decl %eax
movq 0x8(%r14), %rcx
movq %r15, (%rcx,%rax,8)
testb %bpl, %bpl
cmovneq %r12, %r15
jne 0x5e39
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0x4(%r14), %esi
shlq $0x3, %rsi
leaq 0x902ff(%rip), %rdi     # 0x961b0
xorl %eax, %eax
callq 0x5ed4
leaq 0x902f1(%rip), %rdi     # 0x961b0
movl $0x18, %esi
jmp 0x5eb1
leaq 0x90310(%rip), %rdi     # 0x961dd
xorl %eax, %eax
callq 0x5ed4
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/annot-tsv.c
// Function: error
static void HTS_FORMAT(HTS_PRINTF_FMT, 1, 2) HTS_NORETURN
error(const char *format, ...)
{
    va_list ap;
    fflush(stdout);
    va_start(ap, format);
    vfprintf(stderr, format, ap);
    va_end(ap);
    fflush(stderr);
    exit(EXIT_FAILURE);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %rsi, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq %rcx, 0x18(%r14)
movq %r8, 0x20(%r14)
movq %r9, 0x28(%r14)
testb %al, %al
je 0x5f35
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq 0xb3074(%rip), %rax     # 0xb8fb0
movq (%rax), %rdi
callq 0x45a0
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rsp, %rdx
movq %rax, (%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movq %r14, 0x10(%rdx)
movq 0xb306d(%rip), %r14     # 0xb8fd8
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x4690
movq (%r14), %rdi
callq 0x45a0
movl $0x1, %edi
callq 0x45e0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/annot-tsv.c
// Function: cols_clear
void cols_clear(cols_t *cols)
{
    if ( !cols ) return;
    free(cols->rmme);
    free(cols->off);
    cols->rmme = NULL;
    cols->off  = NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x6158
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
callq 0x45c0
movq 0x8(%rbx), %rdi
callq 0x45c0
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/./htslib/kstring.h
// Function: kputw
static inline int kputw(int c, kstring_t *s)
{
    unsigned int x = c;
    if (c < 0) {
        x = -x;
        if (ks_resize(s, s->l + 3) < 0)
            return EOF;
        s->s[s->l++] = '-';
    }

    return kputuw(x, s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
testl %edi, %edi
jns 0x6833
movq (%rbx), %rax
addq $0x3, %rax
cmpq %rax, 0x8(%rbx)
jae 0x681e
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rax, %rdx
shrq %rdx
xorl %r15d, %r15d
testq %rcx, %rcx
cmoveq %rdx, %r15
addq %rax, %r15
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x4840
testq %rax, %rax
je 0x6970
movq %rax, 0x10(%rbx)
movq %r15, 0x8(%rbx)
negl %r14d
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rbx)
movb $0x2d, (%rcx,%rax)
cmpl $0x9, %r14d
ja 0x689f
movq (%rbx), %rax
addq $0x2, %rax
cmpq %rax, 0x8(%rbx)
jae 0x687d
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rax, %rdx
shrq %rdx
xorl %r15d, %r15d
testq %rcx, %rcx
cmoveq %rdx, %r15
addq %rax, %r15
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x4840
testq %rax, %rax
je 0x6970
movq %rax, 0x10(%rbx)
movq %r15, 0x8(%rbx)
orb $0x30, %r14b
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rbx)
movb %r14b, (%rcx,%rax)
movq 0x10(%rbx), %r12
addq (%rbx), %r12
jmp 0x696b
bsrl %r14d, %eax
xorl $0x1f, %eax
shll $0x2, %eax
leaq 0x8f800(%rip), %rcx     # 0x960b0
movl (%rax,%rcx), %r13d
leaq 0x8f875(%rip), %rcx     # 0x96130
xorl %ebp, %ebp
cmpl %r14d, (%rax,%rcx)
seta %bpl
movl %r13d, %r12d
subl %ebp, %r12d
movq (%rbx), %rax
addq %r12, %rax
addq $0x2, %rax
cmpq %rax, 0x8(%rbx)
jae 0x690e
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rax, %rdx
shrq %rdx
xorl %r15d, %r15d
testq %rcx, %rcx
cmoveq %rdx, %r15
addq %rax, %r15
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x4840
testq %rax, %rax
je 0x6970
movq %rax, 0x10(%rbx)
movq %r15, 0x8(%rbx)
negl %ebp
movq 0x10(%rbx), %rax
addq (%rbx), %rax
leal -0x2(%r13,%rbp), %ecx
leaq 0x90e6d(%rip), %rdx     # 0x97790
movl %r14d, %esi
movl %r14d, %edi
imulq $0x51eb851f, %rdi, %r14 # imm = 0x51EB851F
shrq $0x25, %r14
imull $0x64, %r14d, %edi
movl %esi, %r8d
subl %edi, %r8d
movl %ecx, %edi
movzwl (%rdx,%r8,2), %r8d
movw %r8w, (%rax,%rdi)
addl $-0x2, %ecx
cmpl $0x3e7, %esi            # imm = 0x3E7
ja 0x6923
cmpl $-0x1, %ecx
jne 0x6961
orb $0x30, %r14b
movb %r14b, (%rax)
addq (%rbx), %r12
movq %r12, (%rbx)
addq 0x10(%rbx), %r12
movb $0x0, (%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/./htslib/khash_str2int.h
// Function: khash_str2int_set
static inline int khash_str2int_set(void *_hash, const char *str, int value)
{
    khint_t k;
    int ret;
    khash_t(str2int) *hash = (khash_t(str2int)*)_hash;
    if ( !hash ) return -1;
    k = kh_put(str2int, hash, str, &ret);
    if (ret < 0) return -1;
    kh_val(hash,k) = value;
    return k;
}

// Assembly:
testq %rdi, %rdi
je 0x6b6e
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebx
movq %rsi, %rbp
movq %rdi, %r14
movl 0x8(%rdi), %eax
cmpl 0xc(%rdi), %eax
jb 0x69c9
movl (%r14), %esi
movl 0x4(%r14), %eax
addl %eax, %eax
cmpl %eax, %esi
jbe 0x69b7
decl %esi
jmp 0x69b9
incl %esi
movq %r14, %rdi
callq 0x9124
testl %eax, %eax
js 0x6aa6
movl (%r14), %edx
leal -0x1(%rdx), %edi
movb (%rbp), %cl
testb %cl, %cl
je 0x69f8
leaq 0x1(%rbp), %rax
movl $0x811c9dc5, %r13d      # imm = 0x811C9DC5
movzbl %cl, %ecx
xorl %r13d, %ecx
imull $0x1000193, %ecx, %r13d # imm = 0x1000193
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x69e0
jmp 0x69fe
movl $0x811c9dc5, %r13d      # imm = 0x811C9DC5
andl %edi, %r13d
movq 0x10(%r14), %rsi
movl %r13d, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %eax
leal (,%r13,2), %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x6aec
movq %rbp, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movl %ebx, 0x8(%rsp)
movl $0x1, %r14d
movl %r13d, %r12d
movq %rdx, (%rsp)
movl %edx, %r15d
movq %rsi, 0x20(%rsp)
movl %edi, 0xc(%rsp)
movl %r12d, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %ebx
leal (%r12,%r12), %ebp
andl $0x1e, %ebp
movl %ebx, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x6ab0
testb $0x1, %al
jne 0x6a8c
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movl %r12d, %ecx
movq (%rax,%rcx,8), %rdi
movq 0x10(%rsp), %rsi
callq 0x46c0
movl 0xc(%rsp), %edi
movq 0x20(%rsp), %rsi
testl %eax, %eax
je 0x6ab0
btl %ebp, %ebx
cmovbl %r12d, %r15d
addl %r14d, %r12d
andl %edi, %r12d
incl %r14d
movl %r15d, %eax
cmpl %r13d, %r12d
jne 0x6a47
jmp 0x6ab4
movl (%r14), %r13d
movb $0x1, %al
jmp 0x6b52
movq (%rsp), %rax
movl %eax, %r13d
movq (%rsp), %rdx
cmpl %edx, %eax
movl 0x8(%rsp), %ebx
movq 0x18(%rsp), %r14
movq 0x10(%rsp), %rbp
jne 0x6aec
movl %r12d, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %eax
leal (%r12,%r12), %ecx
shrl %cl, %eax
cmpl %edx, %r15d
cmovel %r12d, %r15d
testb $0x2, %al
cmovel %r12d, %r15d
movl %r15d, %r13d
movl %r13d, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %edx
leal (,%r13,2), %ecx
andl $0x1e, %ecx
shrl %cl, %edx
testb $0x2, %dl
jne 0x6b2d
testb $0x1, %dl
je 0x6b50
movq 0x18(%r14), %rdx
movl %r13d, %esi
movq %rbp, (%rdx,%rsi,8)
movl $0x3, %edx
shll %cl, %edx
notl %edx
movq 0x10(%r14), %rcx
andl %edx, (%rcx,%rax,4)
incl 0x4(%r14)
jmp 0x6b50
movq 0x18(%r14), %rdx
movl %r13d, %esi
movq %rbp, (%rdx,%rsi,8)
movl $0x3, %edx
shll %cl, %edx
notl %edx
movq 0x10(%r14), %rcx
andl %edx, (%rcx,%rax,4)
incl 0x4(%r14)
incl 0x8(%r14)
xorl %eax, %eax
testb %al, %al
jne 0x6b60
movq 0x20(%r14), %rax
movl %r13d, %ecx
movl %ebx, (%rax,%rcx,4)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/annot-tsv.c
// Function: sanity_check_columns
void sanity_check_columns(char *fname, hdr_t *hdr, cols_t *cols, int **col2idx, int force)
{
    *col2idx = (int*)malloc(sizeof(int)*cols->n);
    if ( !*col2idx ) error("Out of memory, failed to allocate %zu bytes\n",sizeof(int)*cols->n);
    int i, idx;
    for (i=0; i<cols->n; i++)
    {
        if ( khash_str2int_get(hdr->name2idx, cols->off[i], &idx) < 0 )
        {
            if ( !force ) error("The key \"%s\" not found in %s\n", cols->off[i],fname);
            idx = -1;
        }
        (*col2idx)[i] = idx;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %r8d, %ebp
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, 0x40(%rsp)
movl (%rdx), %r13d
shlq $0x2, %r13
movq %r13, %rdi
callq 0x4680
movq %rax, (%rbx)
testq %rax, %rax
je 0x7178
movl (%r15), %r11d
testq %r11, %r11
je 0x7156
movq %rax, %rdx
movq (%r12), %rdi
movq 0x8(%r15), %r8
xorl %r9d, %r9d
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
movl %ebp, 0xc(%rsp)
movq %rax, 0x28(%rsp)
movq %r11, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movq %rdi, 0x48(%rsp)
xorl %r14d, %r14d
movq (%r8,%r9,8), %rsi
testq %rdi, %rdi
je 0x7135
movl (%rdi), %ebx
testl %ebx, %ebx
je 0x711e
movl %ecx, 0x10(%rsp)
movq %r9, 0x38(%rsp)
movb (%rsi), %cl
testb %cl, %cl
je 0x7062
leaq 0x1(%rsi), %rax
movl $0x811c9dc5, %r15d      # imm = 0x811C9DC5
movzbl %cl, %ecx
xorl %r15d, %ecx
imull $0x1000193, %ecx, %r15d # imm = 0x1000193
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x704a
jmp 0x7068
movl $0x811c9dc5, %r15d      # imm = 0x811C9DC5
movq %rbx, 0x30(%rsp)
leal -0x1(%rbx), %edx
andl %edx, %r15d
movq 0x10(%rdi), %r8
movl $0x1, %ebp
movl %r15d, %r14d
movl %edx, 0x14(%rsp)
movq %r8, 0x50(%rsp)
movl %r14d, %eax
shrl $0x4, %eax
movl (%r8,%rax,4), %r13d
leal (%r14,%r14), %r12d
andl $0x1e, %r12d
movl %r13d, %eax
movl %r12d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x70e9
testb $0x1, %al
jne 0x70d2
movq 0x18(%rdi), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rdi
movq %rsi, %rbx
callq 0x46c0
movq 0x50(%rsp), %r8
movl 0x14(%rsp), %edx
movq %rbx, %rsi
movq 0x48(%rsp), %rdi
testl %eax, %eax
je 0x70e9
addl %ebp, %r14d
andl %edx, %r14d
incl %ebp
cmpl %r15d, %r14d
jne 0x7088
movq 0x30(%rsp), %rbx
movl %ebx, %r14d
jmp 0x70fc
movl %r12d, %ecx
shrl %cl, %r13d
testb $0x3, %r13b
movq 0x30(%rsp), %rbx
cmovnel %ebx, %r14d
movl 0xc(%rsp), %ebp
movq 0x28(%rsp), %rdx
movq 0x20(%rsp), %r11
movq 0x18(%rsp), %r8
movq 0x38(%rsp), %r9
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
movl 0x10(%rsp), %ecx
cmpl %ebx, %r14d
jne 0x7128
xorl %r14d, %r14d
jmp 0x7135
movq 0x20(%rdi), %rax
movl %r14d, %ecx
movl (%rax,%rcx,4), %ecx
movb $0x1, %r14b
testl %ebp, %ebp
setne %al
orb %r14b, %al
je 0x7165
testb %r14b, %r14b
cmovel %r10d, %ecx
movl %ecx, (%rdx,%r9,4)
incq %r9
cmpq %r11, %r9
jne 0x7017
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8f236(%rip), %rdi     # 0x963a2
movq 0x40(%rsp), %rdx
xorl %eax, %eax
callq 0x5ed4
leaq 0x8f031(%rip), %rdi     # 0x961b0
movq %r13, %rsi
xorl %eax, %eax
callq 0x5ed4
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/annot-tsv.c
// Function: parse_coor_base
void parse_coor_base(args_t *args, char *str, dat_t *dat)
{
    int len = strlen(dat->fname);
    int beg = 1, end = 1;
    if ( *str )
    {
        if ( str[0]=='0' ) beg = 0;
        else if ( str[0]=='1' ) beg = 1;
        else error("Could not parse: --coords %s\n",args->coords_str);

        if ( str[1]=='0' ) end = 0;
        else if ( str[1]=='1' ) end = 1;
        else error("Could not parse: --coords %s\n",args->coords_str);
    }
    else if ( len>=4 && !strcasecmp(".bed",dat->fname+len-4) ) beg = 0;
    else if ( len>=7 && !strcasecmp(".bed.gz",dat->fname+len-7) ) beg = 0;
    dat->coor_base[0] = beg;
    dat->coor_base[1] = end;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r15
movq (%rdx), %r14
movq %r14, %rdi
callq 0x41d0
movq %rax, %r12
movzbl (%r13), %eax
testl %eax, %eax
je 0x71e3
xorl %ecx, %ecx
cmpl $0x30, %eax
je 0x71c9
cmpl $0x31, %eax
jne 0x725f
movl $0x1, %ecx
movzbl 0x1(%r13), %eax
cmpl $0x30, %eax
je 0x7238
cmpl $0x31, %eax
jne 0x725f
movl $0x1, %ebp
jmp 0x724a
cmpl $0x4, %r12d
jl 0x7209
movl %r12d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
leaq (%r14,%rax), %rsi
addq $-0x4, %rsi
leaq 0x8f1de(%rip), %rdi     # 0x963de
callq 0x4520
testl %eax, %eax
je 0x7243
movl $0x1, %ebp
cmpl $0x7, %r12d
jl 0x723c
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
leaq (%r14,%r12), %rsi
addq $-0x7, %rsi
leaq 0x8f1b9(%rip), %rdi     # 0x963e3
callq 0x4520
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
jmp 0x724a
xorl %ebp, %ebp
jmp 0x724a
movl $0x1, %ecx
jmp 0x724a
movl $0x1, %ebp
xorl %ecx, %ecx
movl %ecx, 0x70(%rbx)
movl %ebp, 0x74(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x150(%r15), %rsi
leaq 0x8f153(%rip), %rdi     # 0x963c0
xorl %eax, %eax
callq 0x5ed4