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

	/* Add the pointer to the end of the queue. */
	if (elasticqueue_add(M->ptrs, &ptr))
		goto err0;
	M->len += 1;

	/* Check for overflow. */
#if SIZE_MAX > INT64_MAX
	assert(M->len <= (uint64_t)INT64_MAX);
#endif
	assert(INT64_MAX - (int64_t)M->len >= M->offset);

	/* Return associated integer. */
	return (M->offset + (int64_t)M->len - 1);

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

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rax
movq %rsi, (%rax)
movq (%rdi), %rdi
movq %rax, %rsi
callq 0x9a29
movl %eax, %ecx
movq $-0x1, %rax
testl %ecx, %ecx
jne 0x7de8
movq 0x10(%rbx), %rcx
movq %rcx, %rax
incq %rax
movq %rax, 0x10(%rbx)
js 0x7dee
movabsq $0x7ffffffffffffffe, %rdx # imm = 0x7FFFFFFFFFFFFFFE
subq %rcx, %rdx
movq 0x8(%rbx), %rax
cmpq %rax, %rdx
jl 0x7e0d
addq %rcx, %rax
addq $0x10, %rsp
popq %rbx
retq
leaq 0x42eb(%rip), %rdi      # 0xc0e0
leaq 0x4302(%rip), %rsi      # 0xc0fe
leaq 0x4321(%rip), %rcx      # 0xc124
movl $0x3e, %edx
callq 0x2180
leaq 0x4342(%rip), %rdi      # 0xc156
leaq 0x42e3(%rip), %rsi      # 0xc0fe
leaq 0x4302(%rip), %rcx      # 0xc124
movl $0x40, %edx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O3/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 0x7ec5
pushq %rbx
movq %rdi, %rbx
cmpq 0x10(%rdi), %rsi
jae 0x7ec4
movq (%rbx), %rdi
callq 0x9ae5
movq $0x0, (%rax)
movq (%rbx), %rdi
callq 0x9ae0
testq %rax, %rax
je 0x7ec4
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x9ae5
cmpq $0x0, (%rax)
jne 0x7ec4
movq (%rbx), %rdi
callq 0x9a51
movdqu 0x8(%rbx), %xmm0
paddq 0x4213(%rip), %xmm0     # 0xc0d0
movdqu %xmm0, 0x8(%rbx)
jmp 0x7e8b
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x80c7
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 0x80bf
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rbx)
jmp 0x80c9
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x82ad
movq $0x0, 0x28(%rdi)
movq 0x10(%rdi), %rax
movq 0x18(%rdi), %rdi
xorl %esi, %esi
jmpq *%rax
pushq %rax
leaq 0x3ff3(%rip), %rdi      # 0xc2a8
leaq 0x3eda(%rip), %rsi      # 0xc196
leaq 0x4001(%rip), %rcx      # 0xc2c4
movl $0xd0, %edx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O3/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 0x834a
cmpq $0x0, 0x8(%rbx)
je 0x833d
callq *0x3a3a5(%rip)          # 0x426e0
jmp 0x8342
callq 0x8b9c
movq $0x0, 0x20(%rbx)
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x8360
callq 0x2e86
movq $0x0, 0x28(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x83c3
movq %rdi, %rbx
cmpq $0x0, 0x20(%rdi)
jne 0x83c5
cmpq $0x0, 0x28(%rbx)
jne 0x83e4
movq 0x30(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
popq %rbx
jmp 0x2040
popq %rbx
retq
leaq 0x3db3(%rip), %rdi      # 0xc17f
leaq 0x3dc3(%rip), %rsi      # 0xc196
leaq 0x3ea2(%rip), %rcx      # 0xc27c
movl $0x132, %edx            # imm = 0x132
callq 0x2180
leaq 0x3e20(%rip), %rdi      # 0xc20b
leaq 0x3da4(%rip), %rsi      # 0xc196
leaq 0x3e83(%rip), %rcx      # 0xc27c
movl $0x133, %edx            # imm = 0x133
callq 0x2180
nop
// File: /workspace/github_c_makefile_star2_O3/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
movq %rax, %rbx
testq %rax, %rax
je 0x849d
movl %ebp, (%rbx)
movq %r14, 0x8(%rbx)
xorl %eax, %eax
movq %rax, 0x10(%rbx)
testq %r12, %r12
leaq 0x7c(%rip), %rcx        # 0x84cc
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 0x849d
testl %ebp, %ebp
js 0x84ad
leaq 0xc(%rsp), %rcx
movl $0x1, (%rcx)
movl %ebp, %edi
movl $0x6, %esi
movl $0x1, %edx
movl $0x4, %r8d
callq 0x20e0
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3e67(%rip), %rdi      # 0xc31b
leaq 0x3e6a(%rip), %rsi      # 0xc325
leaq 0x3e88(%rip), %rcx      # 0xc34a
movl $0xc3, %edx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O3/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 0x856b
movq %rsi, %r14
movq %rdi, %rbx
movl $0x1, 0x10(%rdi)
cmpq $0x0, 0x28(%rdi)
je 0x8506
movq 0x30(%rbx), %rcx
movq -0x10(%rcx), %rdx
movq -0x8(%rcx), %rax
subq %rax, %rdx
cmpq %r14, %rdx
jae 0x8555
movl $0x20, %edi
callq 0x2220
testq %rax, %rax
je 0x8563
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 0x855b
movq %r15, %rcx
addq $0x18, %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r15)
movq 0x30(%rbx), %rdx
movq %r15, (%rdx)
movq %rcx, 0x30(%rbx)
jmp 0x8565
addq -0x18(%rcx), %rax
jmp 0x8565
movq %r15, %rdi
callq 0x2040
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3e38(%rip), %rdi      # 0xc3aa
leaq 0x3dac(%rip), %rsi      # 0xc325
leaq 0x3e3b(%rip), %rcx      # 0xc3bb
movl $0xe8, %edx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O3/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 0x85c3
cmpq $0x0, 0x28(%rdi)
je 0x85e2
movq 0x30(%rdi), %rax
movq -0x10(%rax), %rdx
movq -0x8(%rax), %rcx
subq %rcx, %rdx
cmpq %rsi, %rdx
jb 0x8601
cmpl $0x0, 0x14(%rdi)
jne 0x85b9
addq %rsi, %rcx
movq %rcx, -0x8(%rax)
movl $0x0, 0x10(%rdi)
popq %rax
jmp 0x8620
leaq 0x3e2e(%rip), %rdi      # 0xc3f8
leaq 0x3d54(%rip), %rsi      # 0xc325
leaq 0x3e31(%rip), %rcx      # 0xc409
movl $0x120, %edx            # imm = 0x120
callq 0x2180
leaq 0x3e58(%rip), %rdi      # 0xc441
leaq 0x3d35(%rip), %rsi      # 0xc325
leaq 0x3e12(%rip), %rcx      # 0xc409
movl $0x126, %edx            # imm = 0x126
callq 0x2180
leaq 0x3e44(%rip), %rdi      # 0xc44c
leaq 0x3d16(%rip), %rsi      # 0xc325
leaq 0x3df3(%rip), %rcx      # 0xc409
movl $0x129, %edx            # imm = 0x129
callq 0x2180
// File: /workspace/github_c_makefile_star2_O3/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 0x8636
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
movq %rdi, %r14
movq 0x28(%rdi), %r15
testq %r15, %r15
je 0x862e
cmpl $0x0, 0x14(%r14)
jne 0x862e
cmpq $0x0, 0x40(%r14)
jne 0x86ee
movq 0x8(%r14), %rdi
movq (%r15), %rsi
movq 0x10(%r15), %rcx
testq %rdi, %rdi
je 0x8679
leaq 0x17a(%rip), %r8        # 0x87e5
movq %rcx, %rdx
movq %r14, %r9
callq *0x3a071(%rip)          # 0x426e8
jmp 0x868e
movl (%r14), %edi
leaq 0x162(%rip), %r8        # 0x87e5
movq %rcx, %rdx
movq %r14, %r9
callq 0x8e10
movq %rax, 0x38(%r14)
testq %rax, %rax
je 0x86c7
movq %r15, 0x40(%r14)
movq 0x28(%r14), %rcx
cmpq %r15, %rcx
je 0x86d1
movq %rcx, %rax
movq 0x18(%rcx), %rcx
cmpq %r15, %rcx
jne 0x86a4
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
testq %rcx, %rcx
jne 0x862e
addq $0x18, %rax
jmp 0x86e5
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x862e
leaq 0x28(%r14), %rax
movq 0x18(%rcx), %rcx
movq %rcx, (%rax)
testq %rcx, %rcx
jne 0x862e
movq %rax, 0x30(%r14)
jmp 0x862e
leaq 0x3d77(%rip), %rdi      # 0xc46c
leaq 0x3c29(%rip), %rsi      # 0xc325
leaq 0x3d79(%rip), %rcx      # 0xc47c
movl $0x72, %edx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O3/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 0x8755
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movq %rdx, %rsi
callq 0x84cf
testq %rax, %rax
je 0x8750
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x2200
movq %r15, %rdi
movq %r14, %rsi
callq 0x858a
testl %eax, %eax
je 0x8755
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_O3/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 0x8788
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
testq %rdi, %rdi
je 0x87a3
cmpq $0x0, 0x8(%rbx)
je 0x8789
callq *0x39f6a(%rip)          # 0x426f0
jmp 0x878e
retq
callq 0x90eb
movq 0x40(%rbx), %rax
movq (%rax), %rdi
callq 0x2040
movq 0x40(%rbx), %rdi
callq 0x2040
movq 0x28(%rbx), %r14
testq %r14, %r14
je 0x87d8
leaq 0x28(%rbx), %r15
movq 0x18(%r14), %rax
movq %rax, (%r15)
testq %rax, %rax
jne 0x87c0
movq %r15, 0x30(%rbx)
movq (%r14), %rdi
callq 0x2040
movq %r14, %rdi
callq 0x2040
movq (%r15), %r14
testq %r14, %r14
jne 0x87b0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O3/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 0x8865
movq %rdi, %rcx
cmpq $0x0, 0x38(%rdi)
je 0x8884
movq 0x40(%rcx), %rbx
testq %rbx, %rbx
je 0x88a3
leaq 0x38(%rcx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
cmpl $0x0, 0x14(%rcx)
jne 0x88c2
cmpq %rsi, 0x10(%rbx)
je 0x882b
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 0x8856
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 0x8620
leaq 0x3b3e(%rip), %rdi      # 0xc3aa
leaq 0x3ab2(%rip), %rsi      # 0xc325
leaq 0x3c22(%rip), %rcx      # 0xc49c
movl $0x42, %edx
callq 0x2180
leaq 0x3c2e(%rip), %rdi      # 0xc4b9
leaq 0x3a93(%rip), %rsi      # 0xc325
leaq 0x3c03(%rip), %rcx      # 0xc49c
movl $0x45, %edx
callq 0x2180
leaq 0x3c27(%rip), %rdi      # 0xc4d1
leaq 0x3a74(%rip), %rsi      # 0xc325
leaq 0x3be4(%rip), %rcx      # 0xc49c
movl $0x46, %edx
callq 0x2180
leaq 0x3c18(%rip), %rdi      # 0xc4e1
leaq 0x3a55(%rip), %rsi      # 0xc325
leaq 0x3bc5(%rip), %rcx      # 0xc49c
movl $0x4d, %edx
callq 0x2180
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x10(%rdi), %edi
movl $0x1, %esi
callq 0x3531
movq 0x848d(%rip), %r12      # 0x11598
movq 0x848e(%rip), %r13      # 0x115a0
cmpq %r13, %r12
jae 0x9133
movq 0x848a(%rip), %rax      # 0x115a8
leaq 0x1(%r12), %rcx
movq %rcx, 0x846e(%rip)      # 0x11598
movq %rbx, (%rax,%r12,8)
jmp 0x91d2
movq 0x8476(%rip), %rax      # 0x115b0
shrq $0x8, %rax
cmpq %rax, 0x8473(%rip)      # 0x115b8
jbe 0x91c0
testq %r13, %r13
je 0x91dc
movq %r13, %rdi
shlq $0x4, %rdi
callq 0x2220
testq %rax, %rax
je 0x91c0
movq %rax, %r14
movq 0x843d(%rip), %r15      # 0x115a8
leaq (,%r13,8), %rdx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2200
cmpq 0x8443(%rip), %r15      # 0x115c8
je 0x919d
movq %r15, %rdi
callq 0x2040
movq 0x840a(%rip), %r13      # 0x115a0
movq 0x83fb(%rip), %r12      # 0x11598
movq %r14, 0x8404(%rip)      # 0x115a8
addq %r13, %r13
movq %r13, 0x83f2(%rip)      # 0x115a0
leaq 0x1(%r12), %rax
movq %rax, 0x83de(%rip)      # 0x11598
movq %rbx, (%r14,%r12,8)
jmp 0x91c8
movq %rbx, %rdi
callq 0x2040
xorps %xmm0, %xmm0
movups %xmm0, 0x83de(%rip)     # 0x115b0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x1eed(%rip), %rdi      # 0xb0d0
leaq 0x1ef7(%rip), %rsi      # 0xb0e1
leaq 0x1f12(%rip), %rcx      # 0xb103
movl $0x5a, %edx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x8(%rdi), %rdi
callq *(%r14)
movl %eax, %ebx
movq 0x832b(%rip), %r13      # 0x11598
movq 0x832c(%rip), %rbp      # 0x115a0
cmpq %rbp, %r13
jae 0x9294
movq 0x8328(%rip), %rax      # 0x115a8
leaq 0x1(%r13), %rcx
movq %rcx, 0x830d(%rip)      # 0x11598
movq %r14, (%rax,%r13,8)
jmp 0x9332
movq 0x8315(%rip), %rax      # 0x115b0
shrq $0x8, %rax
cmpq %rax, 0x8312(%rip)      # 0x115b8
jbe 0x9320
testq %rbp, %rbp
je 0x9343
movq %rbp, %rdi
shlq $0x4, %rdi
callq 0x2220
testq %rax, %rax
je 0x9320
movq %rax, %r15
movq 0x82dc(%rip), %r12      # 0x115a8
leaq (,%rbp,8), %rdx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2200
cmpq 0x82e2(%rip), %r12      # 0x115c8
je 0x92fe
movq %r12, %rdi
callq 0x2040
movq 0x82a9(%rip), %rbp      # 0x115a0
movq 0x829a(%rip), %r13      # 0x11598
movq %r15, 0x82a3(%rip)      # 0x115a8
addq %rbp, %rbp
movq %rbp, 0x8291(%rip)      # 0x115a0
leaq 0x1(%r13), %rax
movq %rax, 0x827e(%rip)      # 0x11598
movq %r14, (%r15,%r13,8)
jmp 0x9328
movq %r14, %rdi
callq 0x2040
xorps %xmm0, %xmm0
movups %xmm0, 0x827e(%rip)     # 0x115b0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d86(%rip), %rdi      # 0xb0d0
leaq 0x1d90(%rip), %rsi      # 0xb0e1
leaq 0x1dab(%rip), %rcx      # 0xb103
movl $0x5a, %edx
callq 0x2180
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x80d1
xorl %ebp, %ebp
cmpq $0x14, (%r14)
jb 0x9589
leaq 0x1c(%rsp), %r14
movq %r14, %rdi
callq 0x7548
movq 0x10(%rsp), %rsi
movl $0xc, %edx
movq %r14, %rdi
callq 0x77f8
leaq 0xc(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x78e0
movq 0x10(%rsp), %rax
movl 0xc(%rax), %ecx
cmpl (%r15), %ecx
je 0x94fa
leaq 0x3160(%rip), %rdi      # 0xc63e
xorl %eax, %eax
callq 0x516f
callq 0x2090
movl $0x0, (%rax)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x9589
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 0x9589
leaq 0x1c(%rsp), %r14
movq %r14, %rdi
callq 0x7548
movq 0x10(%rsp), %rsi
addq $0x10, %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x77f8
leaq 0xc(%rsp), %rdi
movq %r14, %rsi
callq 0x78e0
movq 0x10(%rsp), %rax
movq 0x8(%rbx), %rcx
addq %rax, %rcx
addq $0x10, %rcx
xorl %edx, %edx
movb (%rcx,%rdx), %sil
xorb %sil, 0xc(%rsp,%rdx)
incq %rdx
cmpq $0x4, %rdx
jne 0x9558
movl 0xc(%rax), %ecx
cmpl 0xc(%rsp), %ecx
je 0x957f
leaq 0x30e3(%rip), %rdi      # 0xc65d
jmp 0x94de
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_O3/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 0x8048(%rip)            # 0x115f0
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8023(%rip), %rax      # 0x115d8
testq %rax, %rax
je 0x95d3
movq 0x8027(%rip), %rcx      # 0x115e8
leaq -0x1(%rax), %rdx
movq %rdx, 0x800c(%rip)      # 0x115d8
movq -0x8(%rcx,%rax,8), %r12
jmp 0x9606
incq 0x801e(%rip)            # 0x115f8
cmpl $0x0, 0x801f(%rip)      # 0x11600
jne 0x95f9
movq 0x8026(%rip), %rdi      # 0x11610
callq 0xa0d0
movl $0x1, 0x8007(%rip)      # 0x11600
movl $0x18, %edi
callq 0x2220
movq %rax, %r12
testq %r12, %r12
je 0x9634
movq %rbx, (%r12)
movq %r15, 0x8(%r12)
movq %r14, 0x10(%r12)
leaq 0x26(%rip), %rdx        # 0x9646
movl $0x10, %esi
movq %rbx, %rdi
movq %r12, %rcx
callq 0x80ea
testl %eax, %eax
je 0x9637
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x96e5
movq (%rbx), %rdi
leaq 0x18(%rsp), %r14
leaq 0x10(%rsp), %rdx
movq %r14, %rsi
callq 0x80d1
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x7548
movq (%r14), %rsi
movl $0xc, %edx
movq %r15, %rdi
callq 0x77f8
leaq 0xc(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x78e0
movq (%r14), %rax
movl 0xc(%rax), %ecx
cmpl (%r12), %ecx
je 0x96c6
leaq 0x2f8c(%rip), %rdi      # 0xc63e
xorl %eax, %eax
callq 0x516f
callq 0x2090
movl $0x0, (%rax)
jmp 0x96e5
movl 0x8(%rax), %esi
bswapl %esi
movq (%rbx), %rdi
addq $0x14, %rsi
leaq 0x2ad(%rip), %rdx       # 0x9986
movq %rbx, %rcx
callq 0x80ea
testl %eax, %eax
je 0x970a
movq 0x10(%rbx), %rdi
movl $0x1, %esi
callq *0x8(%rbx)
movl %eax, %ebp
movq %rbx, %rdi
callq 0x9819
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
jmp 0x96fb
// File: /workspace/github_c_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x8321
movq 0x7eaf(%rip), %r12      # 0x115d8
movq 0x7eb0(%rip), %r13      # 0x115e0
cmpq %r13, %r12
jae 0x9751
movq 0x7eac(%rip), %rax      # 0x115e8
leaq 0x1(%r12), %rcx
movq %rcx, 0x7e90(%rip)      # 0x115d8
movq %rbx, (%rax,%r12,8)
jmp 0x97f0
movq 0x7e98(%rip), %rax      # 0x115f0
shrq $0x8, %rax
cmpq %rax, 0x7e95(%rip)      # 0x115f8
jbe 0x97de
testq %r13, %r13
je 0x97fa
movq %r13, %rdi
shlq $0x4, %rdi
callq 0x2220
testq %rax, %rax
je 0x97de
movq %rax, %r14
movq 0x7e5f(%rip), %r15      # 0x115e8
leaq (,%r13,8), %rdx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2200
cmpq 0x7e65(%rip), %r15      # 0x11608
je 0x97bb
movq %r15, %rdi
callq 0x2040
movq 0x7e2c(%rip), %r13      # 0x115e0
movq 0x7e1d(%rip), %r12      # 0x115d8
movq %r14, 0x7e26(%rip)      # 0x115e8
addq %r13, %r13
movq %r13, 0x7e14(%rip)      # 0x115e0
leaq 0x1(%r12), %rax
movq %rax, 0x7e00(%rip)      # 0x115d8
movq %rbx, (%r14,%r12,8)
jmp 0x97e6
movq %rbx, %rdi
callq 0x2040
xorps %xmm0, %xmm0
movups %xmm0, 0x7e00(%rip)     # 0x115f0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x18cf(%rip), %rdi      # 0xb0d0
leaq 0x18d9(%rip), %rsi      # 0xb0e1
leaq 0x18f4(%rip), %rcx      # 0xb103
movl $0x5a, %edx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O3/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 0x9a0a
movq %rdi, %r14
movl $0x20, %edi
callq 0x2220
testq %rax, %rax
je 0x99fd
movq %rax, %rbx
movq %r14, 0x18(%rax)
xorl %edi, %edi
movq %r14, %rsi
callq 0x7a00
movq %rax, (%rbx)
testq %rax, %rax
je 0x99f5
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
jmp 0x99ff
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x25ba(%rip), %rdi      # 0xbfcb
leaq 0x2c62(%rip), %rsi      # 0xc67a
leaq 0x2c84(%rip), %rcx      # 0xc6a3
movl $0x1b, %edx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O3/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 0x9adf
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rsi
incq %rsi
movq %rsi, 0x8(%rdi)
decq %rax
movq %rax, 0x10(%rdi)
cmpq %rax, %rsi
jbe 0x9ada
testq %rax, %rax
je 0x9ac6
xorl %r14d, %r14d
movq (%rbx), %rdi
movq 0x18(%rbx), %rdx
movq %r14, %rsi
callq 0x7ca8
movq %rax, %r15
movq 0x8(%rbx), %rsi
addq %r14, %rsi
movq (%rbx), %rdi
movq 0x18(%rbx), %rdx
callq 0x7ca8
movq 0x18(%rbx), %rdx
movq %r15, %rdi
movq %rax, %rsi
callq 0x2200
incq %r14
cmpq 0x10(%rbx), %r14
jb 0x9a85
movq 0x8(%rbx), %rsi
movq (%rbx), %rdi
movq 0x18(%rbx), %rdx
callq 0x7c13
movq $0x0, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4ffc
cmpl $0x11, %edi
je 0x4fdb
cmpl $0x10, %edi
jne 0x5000
callq 0x501d
testl %eax, %eax
sete %bl
xorb $0x3, %bl
jmp 0x5014
callq 0x501d
testl %eax, %eax
je 0x4ffc
callq 0x3070
movl %eax, %edi
callq 0x3040
cmpb $0xa, %al
movl $0xd, %ebx
cmovnel %eax, %ebx
jmp 0x5014
xorl %ebx, %ebx
jmp 0x5014
movzbl %dil, %esi
leaq 0x100b(%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_O3/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 0x518c
movl %esi, %eax
andb $0x7f, %al
cmpb $0x20, %al
setae %cl
cmpb $0x7f, %al
setne %dl
testb %dl, %cl
je 0x5164
pushq %rbp
movq %rsp, %rbp
movzbl %al, %edi
callq 0x3030
movq 0x2e75(%rip), %rax      # 0x7fd0
movq (%rax), %rdi
popq %rbp
jmp 0x30a0
movzbl %sil, %ecx
cmpl $0x89, %ecx
jg 0x517c
cmpl $0xa, %ecx
je 0x5148
cmpl $0xd, %ecx
je 0x5148
jmp 0x518c
cmpl $0x8d, %ecx
je 0x5148
cmpl $0x8a, %ecx
je 0x5148
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: slaveMode
static void slaveMode(void) {
    int fd = context->fd;
    unsigned long long payload = sendSync(fd);
    char buf[1024];
    int original_output = config.output;

    fprintf(stderr,"SYNC with master, discarding %llu "
                   "bytes of bulk transfer...\n", payload);

    /* Discard the payload. */
    while(payload) {
        ssize_t nread;

        nread = read(fd,buf,(payload > sizeof(buf)) ? sizeof(buf) : payload);
        if (nread <= 0) {
            fprintf(stderr,"Error reading RDB payload while SYNCing\n");
            exit(1);
        }
        payload -= nread;
    }
    fprintf(stderr,"SYNC done. Logging commands from master.\n");

    /* Now we can use hiredis to read the incoming protocol. */
    config.output = OUTPUT_CSV;
    while (cliReadReply(0) == REDIS_OK);
    config.output = original_output;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq 0x49de0(%rip), %rax     # 0x5a558
movl 0x84(%rax), %ebx
movl %ebx, %edi
callq 0x1623c
movq %rax, %r14
movl 0x49d1a(%rip), %ebp     # 0x5a4a8
movq 0x47863(%rip), %r12     # 0x57ff8
movq (%r12), %rdi
leaq 0x346b0(%rip), %rsi     # 0x44e50
movq %rax, %rdx
xorl %eax, %eax
callq 0x103b0
testq %r14, %r14
je 0x107d8
movl $0x400, %r13d           # imm = 0x400
movq %rsp, %r15
cmpq %r13, %r14
movl $0x400, %edx            # imm = 0x400
cmovbq %r14, %rdx
movl %ebx, %edi
movq %r15, %rsi
callq 0x102f0
testq %rax, %rax
jle 0x1081b
subq %rax, %r14
jne 0x107b8
movq (%r12), %rcx
leaq 0x346d3(%rip), %rdi     # 0x44eb6
pushq $0x29
popq %rsi
pushq $0x1
popq %rdx
callq 0x10650
movl $0x2, 0x49cb0(%rip)     # 0x5a4a8
xorl %edi, %edi
callq 0x19433
testl %eax, %eax
je 0x107f8
movl %ebp, 0x49c9f(%rip)     # 0x5a4a8
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r12), %rcx
leaq 0x34667(%rip), %rdi     # 0x44e8d
pushq $0x28
popq %rsi
pushq $0x1
popq %rdx
callq 0x10650
pushq $0x1
popq %rdi
callq 0x10630
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/deps/jemalloc/include/jemalloc/internal/jemalloc_internal.h
// Function: je_malloc.cold.2
JEMALLOC_ALWAYS_INLINE size_t
s2u_compute(size_t size)
{

#if (NTBINS > 0)
	if (size <= (ZU(1) << LG_TINY_MAXCLASS)) {
		size_t lg_tmin = LG_TINY_MAXCLASS - NTBINS + 1;
		size_t lg_ceil = lg_floor(pow2_ceil(size));
		return (lg_ceil < lg_tmin ? (ZU(1) << lg_tmin) :
		    (ZU(1) << lg_ceil));
	}
#endif
	{
		size_t x = unlikely(ZI(size) < 0) ? ((size<<1) ?
		    (ZU(1)<<(LG_SIZEOF_PTR+3)) : ((ZU(1)<<(LG_SIZEOF_PTR+3))-1))
		    : lg_floor((size<<1)-1);
		size_t lg_delta = (x < LG_SIZE_CLASS_GROUP + LG_QUANTUM + 1)
		    ?  LG_QUANTUM : x - LG_SIZE_CLASS_GROUP - 1;
		size_t delta = ZU(1) << lg_delta;
		size_t delta_mask = delta - 1;
		size_t usize = (size + delta_mask) & ~delta_mask;
		return (usize);
	}
}

// Assembly:
testq %rdi, %rdi
js 0x110ba
leaq -0x1(,%rdi,2), %rax
bsrq %rax, %rax
leal -0x3(%rax), %ecx
pushq $-0x1
popq %rdx
shlq %cl, %rdx
cmpq $0x6, %rax
notq %rdx
pushq $0x7
popq %rax
cmovaeq %rdx, %rax
addq %rax, %rdi
notq %rax
andq %rdi, %rax
movq %rax, (%rsi)
retq
movq %rdi, %rax
btrq $0x3f, %rax
cmpq $0x1, %rax
pushq $0x40
popq %rax
sbbq $0x0, %rax
jmp 0x11096
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/anet.c
// Function: anetSetBlock
int anetSetBlock(char *err, int fd, int non_block) {
    int flags;

    /* Set the socket blocking (if non_block is zero) or non-blocking.
     * Note that fcntl(2) for F_GETFL and F_SETFL can't be
     * interrupted by a signal. */
    if ((flags = fcntl(fd, F_GETFL)) == -1) {
        anetSetError(err, "fcntl(F_GETFL): %s", strerror(errno));
        return ANET_ERR;
    }

    if (non_block)
        flags |= O_NONBLOCK;
    else
        flags &= ~O_NONBLOCK;

    if (fcntl(fd, F_SETFL, flags) == -1) {
        anetSetError(err, "fcntl(F_SETFL,O_NONBLOCK): %s", strerror(errno));
        return ANET_ERR;
    }
    return ANET_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r15d
movl %esi, %r14d
movq %rdi, %rbx
xorl %ebp, %ebp
movl %esi, %edi
movl $0x3, %esi
xorl %eax, %eax
callq 0x10530
cmpl $-0x1, %eax
je 0x148e0
xorl %edx, %edx
testl %r15d, %r15d
setne %dl
andl $0xfffff7ff, %eax       # imm = 0xFFFFF7FF
shll $0xb, %edx
orl %eax, %edx
movl %r14d, %edi
movl $0x4, %esi
xorl %eax, %eax
callq 0x10530
cmpl $-0x1, %eax
jne 0x14908
leaq 0x2b739(%rip), %r14     # 0x40017
jmp 0x148e7
leaq 0x2b71d(%rip), %r14     # 0x40004
callq 0x100a0
movl (%rax), %edi
callq 0x10690
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x14915
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/anet.c
// Function: anetKeepAlive
int anetKeepAlive(char *err, int fd, int interval)
{
    int val = 1;

    if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &val, sizeof(val)) == -1)
    {
        anetSetError(err, "setsockopt SO_KEEPALIVE: %s", strerror(errno));
        return ANET_ERR;
    }

#ifdef __linux__
    /* Default settings are more or less garbage, with the keepalive time
     * set to 7200 by default on Linux. Modify settings to make the feature
     * actually useful. */

    /* Send first probe after interval. */
    val = interval;
    if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &val, sizeof(val)) < 0) {
        anetSetError(err, "setsockopt TCP_KEEPIDLE: %s\n", strerror(errno));
        return ANET_ERR;
    }

    /* Send next probes after the specified interval. Note that we set the
     * delay as interval / 3, as we send three probes before detecting
     * an error (see the next setsockopt call). */
    val = interval/3;
    if (val == 0) val = 1;
    if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &val, sizeof(val)) < 0) {
        anetSetError(err, "setsockopt TCP_KEEPINTVL: %s\n", strerror(errno));
        return ANET_ERR;
    }

    /* Consider the socket in error state after three we send three ACK
     * probes without getting a reply. */
    val = 3;
    if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &val, sizeof(val)) < 0) {
        anetSetError(err, "setsockopt TCP_KEEPCNT: %s\n", strerror(errno));
        return ANET_ERR;
    }
#else
    ((void) interval); /* Avoid unused var warning for non Linux systems. */
#endif

    return ANET_OK;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
leaq 0xc(%rsp), %rcx
movl $0x1, (%rcx)
movl %esi, %edi
movl $0x1, %esi
movl $0x9, %edx
movl $0x4, %r8d
callq 0x10120
cmpl $-0x1, %eax
je 0x14a9c
leaq 0xc(%rsp), %rcx
movl %r14d, (%rcx)
movl %ebp, %edi
movl $0x6, %esi
movl $0x4, %edx
movl $0x4, %r8d
callq 0x10120
testl %eax, %eax
js 0x14aa5
movslq %r14d, %rax
imulq $0x55555556, %rax, %rax # imm = 0x55555556
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x20, %rax
addl %ecx, %eax
addl $0x2, %r14d
cmpl $0x5, %r14d
movl $0x1, %edx
cmovael %eax, %edx
leaq 0xc(%rsp), %rcx
movl %edx, (%rcx)
movl %ebp, %edi
movl $0x6, %esi
movl $0x5, %edx
movl $0x4, %r8d
callq 0x10120
testl %eax, %eax
js 0x14aae
leaq 0xc(%rsp), %rcx
movl $0x3, (%rcx)
movl %ebp, %edi
movl $0x6, %esi
movl $0x6, %edx
movl $0x4, %r8d
callq 0x10120
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jns 0x14ad6
leaq 0x2b5f2(%rip), %r14     # 0x4008c
jmp 0x14ab5
leaq 0x2b592(%rip), %r14     # 0x40035
jmp 0x14ab5
leaq 0x2b5a5(%rip), %r14     # 0x40051
jmp 0x14ab5
leaq 0x2b5b9(%rip), %r14     # 0x4006e
callq 0x100a0
movl (%rax), %edi
callq 0x10690
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x14915
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/anet.c
// Function: anetSendTimeout
int anetSendTimeout(char *err, int fd, long long ms) {
    struct timeval tv;

    tv.tv_sec = ms/1000;
    tv.tv_usec = (ms%1000)*1000;
    if (setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv)) == -1) {
        anetSetError(err, "setsockopt SO_SNDTIMEO: %s", strerror(errno));
        return ANET_ERR;
    }
    return ANET_OK;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r8
movabsq $0x20c49ba5e353f7cf, %rcx # imm = 0x20C49BA5E353F7CF
movq %rdx, %rax
imulq %rcx
movq %rdi, %rbx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
movq %rsp, %rcx
movq %rdx, (%rcx)
imulq $0x3e8, %rdx, %rax      # imm = 0x3E8
subq %rax, %r8
imulq $0x3e8, %r8, %rax       # imm = 0x3E8
movq %rax, 0x8(%rcx)
movl %esi, %edi
movl $0x1, %esi
movl $0x15, %edx
movl $0x10, %r8d
callq 0x10120
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
jne 0x14c85
callq 0x100a0
movl (%rax), %edi
callq 0x10690
leaq 0x2b44e(%rip), %rsi     # 0x400c1
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x14915
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/anet.c
// Function: anetGenericResolve
int anetGenericResolve(char *err, char *host, char *ipbuf, size_t ipbuf_len,
                       int flags)
{
    struct addrinfo hints, *info;
    int rv;

    memset(&hints,0,sizeof(hints));
    if (flags & ANET_IP_ONLY) hints.ai_flags = AI_NUMERICHOST;
    hints.ai_family = AF_UNSPEC;
    hints.ai_socktype = SOCK_STREAM;  /* specify socktype to avoid dups */

    if ((rv = getaddrinfo(host, NULL, &hints, &info)) != 0) {
        anetSetError(err, "%s", gai_strerror(rv));
        return ANET_ERR;
    }
    if (info->ai_family == AF_INET) {
        struct sockaddr_in *sa = (struct sockaddr_in *)info->ai_addr;
        inet_ntop(AF_INET, &(sa->sin_addr), ipbuf, ipbuf_len);
    } else {
        struct sockaddr_in6 *sa = (struct sockaddr_in6 *)info->ai_addr;
        inet_ntop(AF_INET6, &(sa->sin6_addr), ipbuf, ipbuf_len);
    }

    freeaddrinfo(info);
    return ANET_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
testb $0x1, %r8b
je 0x14cbf
movl $0x4, 0x10(%rsp)
movabsq $0x100000000, %rax      # imm = 0x100000000
leaq 0x10(%rsp), %rdx
movq %rax, 0x4(%rdx)
xorl %r15d, %r15d
leaq 0x8(%rsp), %rcx
movq %rsi, %rdi
xorl %esi, %esi
callq 0x10670
testl %eax, %eax
je 0x14d0b
movl %eax, %edi
callq 0x10220
leaq 0x2b33c(%rip), %rsi     # 0x40032
movq %r12, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x14915
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x14d40
movq 0x8(%rsp), %rax
xorl %ecx, %ecx
cmpl $0x2, 0x4(%rax)
setne %cl
movq 0x18(%rax), %rax
leal 0x2(,%rcx,8), %edi
leaq (%rax,%rcx,4), %rsi
addq $0x4, %rsi
movq %r14, %rdx
movl %ebx, %ecx
callq 0x10040
movq 0x8(%rsp), %rdi
callq 0x10730
movl %r15d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/anet.c
// Function: anetUnixGenericConnect
int anetUnixGenericConnect(char *err, char *path, int flags)
{
    int s;
    struct sockaddr_un sa;

    if ((s = anetCreateSocket(err,AF_LOCAL)) == ANET_ERR)
        return ANET_ERR;

    sa.sun_family = AF_LOCAL;
    strncpy(sa.sun_path,path,sizeof(sa.sun_path)-1);
    if (flags & ANET_CONNECT_NONBLOCK) {
        if (anetNonBlock(err,s) != ANET_OK)
            return ANET_ERR;
    }
    if (connect(s,(struct sockaddr*)&sa,sizeof(sa)) == -1) {
        if (errno == EINPROGRESS &&
            flags & ANET_CONNECT_NONBLOCK)
            return s;

        anetSetError(err, "connect: %s", strerror(errno));
        close(s);
        return ANET_ERR;
    }
    return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %r14
callq 0x150b4
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $-0x1, %eax
je 0x150a5
movl %eax, %ebp
leaq 0x4(%rsp), %rdi
movw $0x1, -0x2(%rdi)
movl $0x6b, %edx
movq %r12, %rsi
callq 0x100b0
testb $0x1, %r15b
je 0x15059
movq %r14, %rdi
movl %ebp, %esi
movl $0x1, %edx
callq 0x1488c
testl %eax, %eax
jne 0x150a5
leaq 0x2(%rsp), %rsi
movl %ebp, %edi
movl $0x6e, %edx
callq 0x10640
cmpl $-0x1, %eax
jne 0x150a3
callq 0x100a0
movl (%rax), %edi
cmpl $0x73, %edi
sete %al
testb %al, %r15b
jne 0x150a3
callq 0x10690
leaq 0x2b04f(%rip), %rsi     # 0x400dc
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x14915
movl %ebp, %edi
callq 0x102a0
jmp 0x150a5
movl %ebp, %ebx
movl %ebx, %eax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq