LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/bench/bench.c
// Function: bench_median
uint64_t
bench_median(struct bench * B)
{
	uint64_t median;
	size_t midpos;

	/* Make a copy of the ticks. */
	memcpy(B->sorted, B->ticks, B->num_seconds * sizeof(uint64_t));

	/* Sort the extra array. */
	qsort(B->sorted, B->num_seconds, sizeof(uint64_t), compar_uint64_t);

	/* Find the midpoint, or mean of nearest midpoints. */
	midpos = (B->num_seconds - 1) / 2;
	if ((B->num_seconds % 2) == 0)
		median = (B->sorted[midpos] + B->sorted[midpos + 1]) / 2;
	else
		median = B->sorted[midpos];

	/* Return the median. */
	return (median);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x8(%rbp), %rax
movq (%rax), %rdx
shlq $0x3, %rdx
callq 0x2210
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movl $0x8, %edx
leaq 0x79(%rip), %rcx        # 0x7180
callq 0x20c0
movq -0x8(%rbp), %rax
movq (%rax), %rax
subq $0x1, %rax
shrq %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
andq $0x1, %rax
cmpq $0x0, %rax
jne 0x7159
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x18(%rbp), %rdx
addq 0x8(%rcx,%rdx,8), %rax
shrq %rax
movq %rax, -0x10(%rbp)
jmp 0x716d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/bench/bench.c
// Function: compar_uint64_t
static int
compar_uint64_t(const void * ap, const void * bp)
{
	const uint64_t a = *(const uint64_t *)ap;
	const uint64_t b = *(const uint64_t *)bp;

	if (a > b)
		return (1);
	else if (b > a)
		return (-1);
	else
		return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jbe 0x71b5
movl $0x1, -0x4(%rbp)
jmp 0x71cf
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jbe 0x71c8
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x71cf
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/bench/bench.c
// Function: bench_free
void
bench_free(struct bench * B)
{

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

	free(B->sorted);
	free(B->ticks);
	free(B);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x71f5
jmp 0x7218
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2040
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2040
movq -0x8(%rbp), %rdi
callq 0x2040
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/datastruct/kvldskey.c
// Function: kvldskey_create
struct kvldskey *
kvldskey_create(const uint8_t * buf, size_t len)
{
	struct kvldskey * K;

	/* Sanity check. */
	assert(len <= UINT8_MAX);

	/* Allocate structure. */
	if ((K = malloc(sizeof(struct kvldskey) + len)) == NULL)
		goto err0;

	/* Copy data. */
	K->len = (uint8_t)len;
	memcpy(K->buf, buf, len);

	/* Success! */
	return (K);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0xff, -0x18(%rbp)
ja 0x723c
jmp 0x725b
leaq 0x8687(%rip), %rdi      # 0xf8ca
leaq 0x8691(%rip), %rsi      # 0xf8db
movl $0x13, %edx
leaq 0x86a2(%rip), %rcx      # 0xf8f8
callq 0x21a0
movq -0x18(%rbp), %rdi
addq $0x1, %rdi
callq 0x2230
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x7274
jmp 0x729f
movq -0x18(%rbp), %rax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, (%rax)
movq -0x20(%rbp), %rdi
addq $0x1, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x2210
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x72a7
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/datastruct/kvldskey.c
// Function: kvldskey_unserialize
size_t
kvldskey_unserialize(struct kvldskey ** K, const uint8_t * buf, size_t buflen)
{
	size_t len;

	/* Length. */
	if (buflen < 1)
		goto err1;
	if (buflen < (len = (size_t)(buf[0]) + 1))
		goto err1;

	/* Allocate structure and copy data. */
	if ((*K = malloc(len)) == NULL)
		goto err0;
	memcpy(*K, buf, len);

	/* Success! */
	return (len);

err1:
	errno = 0;
err0:
	/* Failure! */
	return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x1, -0x20(%rbp)
jae 0x72dd
jmp 0x732d
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
movzbl (%rcx), %ecx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
cmpq %rcx, %rax
jae 0x72f7
jmp 0x732d
movq -0x28(%rbp), %rdi
callq 0x2230
movq -0x10(%rbp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x730f
jmp 0x7338
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x2210
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7340
callq 0x20a0
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/datastruct/kvldskey.c
// Function: kvldskey_cmp2
int
kvldskey_cmp2(const struct kvldskey * x, const struct kvldskey * y,
    size_t mlen)
{
	size_t minlen = (x->len < y->len) ? x->len : y->len;
	int rc;

	for (; mlen < minlen; mlen++) {
		if ((rc = x->buf[mlen] - y->buf[mlen]) != 0)
			return (rc);
	}
	return (x->len - y->len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movq -0x18(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jge 0x73ae
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x30(%rbp)
jmp 0x73b8
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
cltq
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x7407
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movzbl 0x1(%rax,%rcx), %eax
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rdx
movzbl 0x1(%rcx,%rdx), %ecx
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
je 0x73f7
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x741a
jmp 0x73f9
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x73c1
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movq -0x18(%rbp), %rcx
movzbl (%rcx), %ecx
subl %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/datastruct/kvldskey.c
// Function: kvldskey_mlen
size_t
kvldskey_mlen(const struct kvldskey * x, const struct kvldskey * y)
{
	size_t mlen;

	/* So far we're aware of zero matching bytes. */
	mlen = 0;

	/* Consider positions one by one. */
	do {
		/* If ${x} has length mlen, it can't match any further. */
		if (x->len == mlen)
			break;

		/*
		 * ${y} is greater than ${x}, which is greater than their
		 * shared ${mlen}-byte prefix; so ${y} must also have length
		 * greater than ${mlen}.  Do the two keys match in their
		 * next position?
		 */
		if (x->buf[mlen] != y->buf[mlen])
			break;

		/* The keys match one byte further. */
		mlen += 1;
	} while (1);

	/* Return the matching length. */
	return (mlen);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
cmpq -0x18(%rbp), %rax
jne 0x7443
jmp 0x7477
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movzbl 0x1(%rax,%rcx), %eax
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rdx
movzbl 0x1(%rcx,%rdx), %ecx
cmpl %ecx, %eax
je 0x7463
jmp 0x7477
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movb $0x1, %al
testb $0x1, %al
jne 0x7434
jmp 0x7477
movq -0x18(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_client.c
// Function: proto_kvlds_request_params
int
proto_kvlds_request_params(struct wire_requestqueue * Q,
    int (* callback)(void *, int, size_t, size_t), void * cookie)
{
	struct params_cookie * C;
	uint8_t * buf;

	/* Bake a cookie. */
	if ((C = malloc(sizeof(struct params_cookie))) == NULL)
		goto err0;
	C->callback = callback;
	C->cookie = cookie;

	/* Start writing a request. */
	if ((buf = wire_requestqueue_add_getbuf(Q, 4,
	    callback_params, C)) == NULL)
		goto err1;

	/* Construct request. */
	be32enc(&buf[0], PROTO_KVLDS_PARAMS);

	/* Finish writing request. */
	if (wire_requestqueue_add_done(Q, buf, 4))
		goto err1;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x10, %edi
callq 0x2230
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x74aa
jmp 0x751f
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rcx
movl $0x4, %esi
leaq 0x5b(%rip), %rdx        # 0x7530
callq 0x9630
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x74e6
jmp 0x7516
movq -0x30(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x7600
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl $0x4, %edx
callq 0x97c0
cmpl $0x0, %eax
je 0x750d
jmp 0x7516
movl $0x0, -0x4(%rbp)
jmp 0x7526
movq -0x28(%rbp), %rdi
callq 0x2040
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_client.c
// Function: callback_params
static int
callback_params(void * cookie, uint8_t * buf, size_t buflen)
{
	struct params_cookie * C = cookie;
	int failed = 1;
	size_t kmax = 0;
	size_t vmax = 0;
	int rc;

	/* If we have a packet, parse it. */
	if (buf != NULL) {
		/* Is the packet length sane? */
		if (buflen != 8)
			BAD("params", "bogus length");

		/* Parse values. */
		kmax = be32dec(&buf[0]);
		vmax = be32dec(&buf[4]);

		/* We successfully parsed this response. */
		failed = 0;
	}

failed:
	/* Invoke the upstream callback. */
	rc = (C->callback)(C->cookie, failed, kmax, vmax);

	/* Free the cookie. */
	free(C);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x1, -0x24(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x75c7
cmpq $0x8, -0x18(%rbp)
je 0x759e
jmp 0x7573
jmp 0x7575
leaq 0x87ba(%rip), %rdi      # 0xfd36
leaq 0x87d0(%rip), %rsi      # 0xfd53
leaq 0x87d0(%rip), %rdx      # 0xfd5a
movb $0x0, %al
callq 0x6a10
callq 0x20a0
movl $0x0, (%rax)
jmp 0x75c9
movq -0x10(%rbp), %rdi
callq 0x8dc0
movl %eax, %eax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
addq $0x4, %rdi
callq 0x8dc0
movl %eax, %eax
movq %rax, -0x38(%rbp)
movl $0x0, -0x24(%rbp)
jmp 0x75c9
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x8(%rcx), %rdi
movl -0x24(%rbp), %esi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq *%rax
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rdi
callq 0x2040
movl -0x3c(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_client.c
// Function: callback_done
static int
callback_done(void * cookie, uint8_t * buf, size_t buflen)
{
	struct done_cookie * C = cookie;
	int failed = 1;
	int rc;

	/* If we have a packet, parse it. */
	if (buf != NULL) {
		/* Is the status code sane? */
		if (buflen < 4)
			BAD(C->type, "bogus length");
		if (be32dec(&buf[0]) > 0)
			BAD(C->type, "bogus status code");

		/* We successfully parsed this response. */
		failed = 0;
	}

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

	/* Free the cookie. */
	mpool_done_free(C);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x1, -0x24(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x78c2
cmpq $0x4, -0x18(%rbp)
jae 0x787f
jmp 0x7853
jmp 0x7855
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x84d2(%rip), %rdi      # 0xfd36
leaq 0x84ef(%rip), %rdx      # 0xfd5a
movb $0x0, %al
callq 0x6a10
callq 0x20a0
movl $0x0, (%rax)
jmp 0x78c4
movq -0x10(%rbp), %rdi
callq 0x8dc0
cmpl $0x0, %eax
jbe 0x78bb
jmp 0x788f
jmp 0x7891
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x8496(%rip), %rdi      # 0xfd36
leaq 0x84c0(%rip), %rdx      # 0xfd67
movb $0x0, %al
callq 0x6a10
callq 0x20a0
movl $0x0, (%rax)
jmp 0x78c4
movl $0x0, -0x24(%rbp)
jmp 0x78c4
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x8(%rcx), %rdi
movl -0x24(%rbp), %esi
callq *%rax
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x78f0
movl -0x28(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_client.c
// Function: callback_donep
static int
callback_donep(void * cookie, uint8_t * buf, size_t buflen)
{
	struct donep_cookie * C = cookie;
	int failed = 1;
	int status = 0;
	int rc;

	/* If we have a packet, parse it. */
	if (buf != NULL) {
		/* Is the status code sane? */
		if (buflen < 4)
			BAD(C->type, "bogus length");
		if (be32dec(&buf[0]) > 1)
			BAD(C->type, "bogus status code");
		status = (int)be32dec(&buf[0]);

		/* We successfully parsed this response. */
		failed = 0;
	}

failed:
	/* Invoke the upstream callback. */
	rc = (C->callback)(C->cookie, failed, status);

	/* Free the cookie. */
	mpool_donep_free(C);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x1, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x7bc9
cmpq $0x4, -0x18(%rbp)
jae 0x7b7a
jmp 0x7b4e
jmp 0x7b50
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x81d7(%rip), %rdi      # 0xfd36
leaq 0x81f4(%rip), %rdx      # 0xfd5a
movb $0x0, %al
callq 0x6a10
callq 0x20a0
movl $0x0, (%rax)
jmp 0x7bcb
movq -0x10(%rbp), %rdi
callq 0x8dc0
cmpl $0x1, %eax
jbe 0x7bb6
jmp 0x7b8a
jmp 0x7b8c
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x819b(%rip), %rdi      # 0xfd36
leaq 0x81c5(%rip), %rdx      # 0xfd67
movb $0x0, %al
callq 0x6a10
callq 0x20a0
movl $0x0, (%rax)
jmp 0x7bcb
movq -0x10(%rbp), %rdi
callq 0x8dc0
movl %eax, -0x28(%rbp)
movl $0x0, -0x24(%rbp)
jmp 0x7bcb
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x8(%rcx), %rdi
movl -0x24(%rbp), %esi
movl -0x28(%rbp), %edx
callq *%rax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rdi
callq 0x7c00
movl -0x2c(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_client.c
// Function: proto_kvlds_request_delete
int
proto_kvlds_request_delete(struct wire_requestqueue * Q,
    const struct kvldskey * key,
    int (* callback)(void *, int), void * cookie)
{
	struct done_cookie * C;
	uint8_t * buf;
	size_t buflen;

	/* Bake a cookie. */
	if ((C = mpool_done_malloc()) == NULL)
		goto err0;
	C->callback = callback;
	C->cookie = cookie;
	C->type = "DELETE";

	/* Compute request size. */
	buflen = 4;
	buflen += kvldskey_serial_size(key);

	/* Start writing a request. */
	if ((buf = wire_requestqueue_add_getbuf(Q, buflen,
	    callback_done, C)) == NULL)
		goto err1;

	/* Construct request. */
	be32enc(&buf[0], PROTO_KVLDS_DELETE);
	kvldskey_serialize(key, &buf[4]);

	/* Finish writing request. */
	if (wire_requestqueue_add_done(Q, buf, buflen))
		goto err1;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
callq 0x7800
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x7f7c
jmp 0x8037
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
leaq 0x7c2b(%rip), %rcx      # 0xfbc9
movq %rcx, 0x10(%rax)
movq $0x4, -0x40(%rbp)
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
addq $0x1, %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x30(%rbp), %rcx
leaq -0x7b0(%rip), %rdx      # 0x7820
callq 0x9630
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x7fe1
jmp 0x802e
movq -0x38(%rbp), %rdi
movl $0x120, %esi            # imm = 0x120
callq 0x7600
movq -0x38(%rbp), %rdi
addq $0x4, %rdi
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rdx
callq 0x2210
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x97c0
cmpl $0x0, %eax
je 0x8025
jmp 0x802e
movl $0x0, -0x4(%rbp)
jmp 0x803e
movq -0x30(%rbp), %rdi
callq 0x78f0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_client.c
// Function: proto_kvlds_request_get
int
proto_kvlds_request_get(struct wire_requestqueue * Q,
    const struct kvldskey * key,
    int (* callback)(void *, int, struct kvldskey *), void * cookie)
{
	struct get_cookie * C;
	uint8_t * buf;
	size_t buflen;

	/* Bake a cookie. */
	if ((C = mpool_get_malloc()) == NULL)
		goto err0;
	C->callback = callback;
	C->cookie = cookie;

	/* Compute request size. */
	buflen = 4;
	buflen += kvldskey_serial_size(key);

	/* Start writing a request. */
	if ((buf = wire_requestqueue_add_getbuf(Q, buflen,
	    callback_get, C)) == NULL)
		goto err1;

	/* Construct request. */
	be32enc(&buf[0], PROTO_KVLDS_GET);
	kvldskey_serialize(key, &buf[4]);

	/* Finish writing request. */
	if (wire_requestqueue_add_done(Q, buf, buflen))
		goto err1;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
callq 0x82d0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x820c
jmp 0x82b8
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq $0x4, -0x40(%rbp)
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
addq $0x1, %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x30(%rbp), %rcx
leaq 0x9f(%rip), %rdx        # 0x82f0
callq 0x9630
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x8262
jmp 0x82af
movq -0x38(%rbp), %rdi
movl $0x130, %esi            # imm = 0x130
callq 0x7600
movq -0x38(%rbp), %rdi
addq $0x4, %rdi
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rdx
callq 0x2210
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x97c0
cmpl $0x0, %eax
je 0x82a6
jmp 0x82af
movl $0x0, -0x4(%rbp)
jmp 0x82bf
movq -0x30(%rbp), %rdi
callq 0x84a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_client.c
// Function: callback_get
static int
callback_get(void * cookie, uint8_t * buf, size_t buflen)
{
	struct get_cookie * C = cookie;
	int failed = 1;
	int status = 0;
	struct kvldskey * value = NULL;
	size_t valuelen = 0;
	int rc;

	/* If we have a packet, parse it. */
	if (buf != NULL) {
		/* Is the status code sane? */
		if (buflen < 4)
			BAD("GET", "bogus length");
		if (be32dec(&buf[0]) > 1)
			BAD("GET", "bogus status code");
		status = (int)be32dec(&buf[0]);

		/* Parse a value if one exists. */
		if (status == 0) {
			if ((valuelen = kvldskey_unserialize(&value, &buf[4],
			    buflen - 4)) == 0) {
				warnp("Error parsing GET response value");
				goto failed;
			}
		} else {
			value = NULL;
			valuelen = 0;
		}

		/* Verify packet length. */
		if (buflen != 4 + valuelen)
			BAD("GET", "wrong length");

		/* We successfully parsed this response. */
		failed = 0;
	}

failed:
	/* Invoke the upstream callback. */
	rc = (C->callback)(C->cookie, failed, value);

	/* Free the cookie. */
	mpool_get_free(C);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x1, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x846f
cmpq $0x4, -0x18(%rbp)
jae 0x836c
jmp 0x833e
jmp 0x8340
leaq 0x79ef(%rip), %rdi      # 0xfd36
leaq 0x7a2b(%rip), %rsi      # 0xfd79
leaq 0x7a05(%rip), %rdx      # 0xfd5a
movb $0x0, %al
callq 0x6a10
callq 0x20a0
movl $0x0, (%rax)
jmp 0x8471
movq -0x10(%rbp), %rdi
callq 0x8dc0
cmpl $0x1, %eax
jbe 0x83aa
jmp 0x837c
jmp 0x837e
leaq 0x79b1(%rip), %rdi      # 0xfd36
leaq 0x79ed(%rip), %rsi      # 0xfd79
leaq 0x79d4(%rip), %rdx      # 0xfd67
movb $0x0, %al
callq 0x6a10
callq 0x20a0
movl $0x0, (%rax)
jmp 0x8471
movq -0x10(%rbp), %rdi
callq 0x8dc0
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0x841a
movq -0x10(%rbp), %rsi
addq $0x4, %rsi
movq -0x18(%rbp), %rdx
subq $0x4, %rdx
leaq -0x30(%rbp), %rdi
callq 0x72c0
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x8418
jmp 0x83e1
callq 0x20a0
cmpl $0x0, (%rax)
je 0x8406
leaq 0x798b(%rip), %rdi      # 0xfd7d
movb $0x0, %al
callq 0x67c0
callq 0x20a0
movl $0x0, (%rax)
jmp 0x8414
leaq 0x7970(%rip), %rdi      # 0xfd7d
movb $0x0, %al
callq 0x6a10
jmp 0x8416
jmp 0x8471
jmp 0x842a
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
addq $0x4, %rcx
cmpq %rcx, %rax
je 0x8468
jmp 0x843d
jmp 0x843f
leaq 0x78f0(%rip), %rdi      # 0xfd36
leaq 0x792c(%rip), %rsi      # 0xfd79
leaq 0x794a(%rip), %rdx      # 0xfd9e
movb $0x0, %al
callq 0x6a10
callq 0x20a0
movl $0x0, (%rax)
jmp 0x8471
movl $0x0, -0x24(%rbp)
jmp 0x8471
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x8(%rcx), %rdi
movl -0x24(%rbp), %esi
movq -0x30(%rbp), %rdx
callq *%rax
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rdi
callq 0x84a0
movl -0x3c(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_client.c
// Function: proto_kvlds_request_range2
int
proto_kvlds_request_range2(struct wire_requestqueue * Q,
    const struct kvldskey * start, const struct kvldskey * end,
    int (* callback_item)(void *,
	const struct kvldskey *, const struct kvldskey *),
    int (* callback)(void *, int), void * cookie)
{
	struct range2_cookie * C;

	/* Bake a cookie. */
	if ((C = malloc(sizeof(struct range2_cookie))) == NULL)
		goto err0;
	C->Q = Q;
	C->callback_item = callback_item;
	C->callback = callback;
	C->cookie = cookie;
	C->failed = 0;
	C->reqdone = 0;

	/* Duplicate start and end keys. */
	if ((C->start = kvldskey_create(start->buf, start->len)) == NULL)
		goto err1;
	if ((C->end = kvldskey_create(end->buf, end->len)) == NULL)
		goto err2;

	/* Start issuing RANGE requests. */
	if (!events_immediate_register(poke_range2, C, 0))
		goto err3;

	/* Success! */
	return (0);

err3:
	kvldskey_free(C->end);
err2:
	kvldskey_free(C->start);
err1:
	free(C);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movl $0x38, %edi
callq 0x2230
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0x8ba9
jmp 0x8c80
movq -0x10(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x40(%rbp), %rax
movl $0x0, 0x20(%rax)
movq -0x40(%rbp), %rax
movl $0x0, 0x24(%rax)
movq -0x18(%rbp), %rdi
addq $0x1, %rdi
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %esi
callq 0x7220
movq -0x40(%rbp), %rcx
movq %rax, 0x28(%rcx)
cmpq $0x0, %rax
jne 0x8c14
jmp 0x8c77
movq -0x20(%rbp), %rdi
addq $0x1, %rdi
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %esi
callq 0x7220
movq -0x40(%rbp), %rcx
movq %rax, 0x30(%rcx)
cmpq $0x0, %rax
jne 0x8c3a
jmp 0x8c6a
movq -0x40(%rbp), %rsi
leaq 0x4b(%rip), %rdi        # 0x8c90
xorl %edx, %edx
callq 0x2fb0
cmpq $0x0, %rax
jne 0x8c54
jmp 0x8c5d
movl $0x0, -0x4(%rbp)
jmp 0x8c87
movq -0x40(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x2040
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2040
movq -0x40(%rbp), %rdi
callq 0x2040
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_client.c
// Function: poke_range2
static int
poke_range2(void * cookie)
{
	struct range2_cookie * C = cookie;
	int doreq;
	int rc = 0;

	/* We need to issue a RANGE request iff start < end... */
	if (kvldskey_cmp(C->start, C->end) < 0)
		doreq = 1;
	else
		doreq = 0;

	/* ... except that an end of "" is special... */
	if (C->end->len == 0) {
		/*
		 * We want to issue a RANGE request unless start is also ""
		 * AND we've already done at least one RANGE request (i.e.,
		 * start is the empty key at the end of the keyspace, not the
		 * empty key at the beginning of the keyspace).
		 */
		if ((C->reqdone != 0) && (C->start->len == 0))
			doreq = 0;
		else
			doreq = 1;
	}

	/* ... but if we've failed, we never want to do any requests. */
	if (C->failed)
		doreq = 0;

	/* Send a RANGE request if we need one. */
	if (doreq) {
		if (proto_kvlds_request_range(C->Q, C->start, C->end,
		    0x100000, callback_range2, C))
			goto err0;
		goto done;
	}

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

	/* Free the cookie. */
	kvldskey_free(C->start);
	kvldskey_free(C->end);
	free(C);

done:
	/* Return success or status code from callback. */
	return (rc);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x7350
cmpl $0x0, %eax
jge 0x8cce
movl $0x1, -0x1c(%rbp)
jmp 0x8cd5
movl $0x0, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x8d11
movq -0x18(%rbp), %rax
cmpl $0x0, 0x24(%rax)
je 0x8d08
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x8d08
movl $0x0, -0x1c(%rbp)
jmp 0x8d0f
movl $0x1, -0x1c(%rbp)
jmp 0x8d11
movq -0x18(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0x8d22
movl $0x0, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x8d5d
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdx
movq -0x18(%rbp), %r9
movl $0x100000, %ecx         # imm = 0x100000
leaq 0x421(%rip), %r8        # 0x9170
callq 0x84d0
cmpl $0x0, %eax
je 0x8d5b
jmp 0x8da4
jmp 0x8d9c
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rdi
movq -0x18(%rbp), %rcx
movl 0x20(%rcx), %esi
callq *%rax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2040
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x2040
movq -0x18(%rbp), %rdi
callq 0x2040
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x8dab
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_client.c
// Function: callback_range2
static int
callback_range2(void * cookie, int failed, size_t nkeys,
    struct kvldskey * next,
    struct kvldskey ** keys, struct kvldskey ** values)
{
	struct range2_cookie * C = cookie;
	size_t i;
	int rc = 0;

	/* We've done a request. */
	C->reqdone = 1;

	/* If we failed, record it and skip to poking. */
	if (failed) {
		C->failed = 1;
		goto poke;
	}

	/* Record our new starting position. */
	kvldskey_free(C->start);
	C->start = next;

	/* Invoke callbacks. */
	for (i = 0; i < nkeys; i++) {
		if ((C->callback_item)(C->cookie, keys[i], values[i]))
			rc = -1;
	}

	/* Free keys. */
	for (i = 0; i < nkeys; i++)
		kvldskey_free(keys[i]);
	free(keys);

	/* Free values. */
	for (i = 0; i < nkeys; i++)
		kvldskey_free(values[i]);
	free(values);

poke:
	/* Do another RANGE request or perform the final callback. */
	if (poke_range2(cookie))
		rc = -1;

	/* Return success or failure if anything failed. */
	return (rc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x38(%rbp), %rax
movl $0x1, 0x24(%rax)
cmpl $0x0, -0xc(%rbp)
je 0x91bf
movq -0x38(%rbp), %rax
movl $0x1, 0x20(%rax)
jmp 0x92a4
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2040
movq -0x20(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x28(%rax)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x9230
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x18(%rcx), %rdi
movq -0x28(%rbp), %rcx
movq -0x40(%rbp), %rdx
movq (%rcx,%rdx,8), %rsi
movq -0x30(%rbp), %rcx
movq -0x40(%rbp), %rdx
movq (%rcx,%rdx,8), %rdx
callq *%rax
cmpl $0x0, %eax
je 0x9220
movl $0xffffffff, -0x44(%rbp) # imm = 0xFFFFFFFF
jmp 0x9222
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x91e0
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x9261
movq -0x28(%rbp), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2040
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x9238
movq -0x28(%rbp), %rdi
callq 0x2040
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x929b
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2040
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x9272
movq -0x30(%rbp), %rdi
callq 0x2040
movq -0x8(%rbp), %rdi
callq 0x8c90
cmpl $0x0, %eax
je 0x92b9
movl $0xffffffff, -0x44(%rbp) # imm = 0xFFFFFFFF
movl -0x44(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/wire/wire_requestqueue.c
// Function: wire_requestqueue_init
struct wire_requestqueue *
wire_requestqueue_init(int s)
{
	struct wire_requestqueue * Q;

	/* Allocate structure. */
	if ((Q = malloc(sizeof(struct wire_requestqueue))) == NULL)
		goto err0;

	/* We have not failed, nor have we been destroyed. */
	Q->failed = 0;
	Q->destroyed = 0;

	/* Create a buffered writer. */
	if ((Q->WQ = netbuf_write_init(s, failqueue, Q)) == NULL)
		goto err1;

	/* Create a buffered reader. */
	if ((Q->R = netbuf_read_init(s)) == NULL)
		goto err2;

	/* Create a request ID -> request mapping table. */
	if ((Q->reqs = seqptrmap_init()) == NULL)
		goto err3;

	/* Wait for a packet to arrive. */
	if ((Q->read_cookie =
	    wire_readpacket_wait(Q->R, readpackets, Q)) == NULL)
		goto err4;

	/* Success! */
	return (Q);

err4:
	seqptrmap_free(Q->reqs);
err3:
	netbuf_read_free(Q->R);
err2:
	netbuf_write_free(Q->WQ);
err1:
	free(Q);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0xc(%rbp)
movl $0x28, %edi
callq 0x2230
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x92f4
jmp 0x93bc
movq -0x18(%rbp), %rax
movl $0x0, 0x20(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x24(%rax)
movl -0xc(%rbp), %edi
movq -0x18(%rbp), %rdx
leaq 0xb8(%rip), %rsi        # 0x93d0
callq 0xbca0
movq -0x18(%rbp), %rcx
movq %rax, 0x8(%rcx)
cmpq $0x0, %rax
jne 0x9330
jmp 0x93b3
movl -0xc(%rbp), %edi
callq 0xb5c0
movq -0x18(%rbp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x9347
jmp 0x93a6
callq 0xaf00
movq -0x18(%rbp), %rcx
movq %rax, 0x18(%rcx)
cmpq $0x0, %rax
jne 0x935c
jmp 0x939a
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0x182(%rip), %rsi       # 0x94f0
callq 0xd4c0
movq -0x18(%rbp), %rcx
movq %rax, 0x10(%rcx)
cmpq $0x0, %rax
jne 0x9383
jmp 0x938d
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x93c4
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xb1f0
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0xbc10
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xc2e0
movq -0x18(%rbp), %rdi
callq 0x2040
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/wire/wire_requestqueue.c
// Function: failqueue
static int
failqueue(void * cookie)
{
	struct wire_requestqueue * Q = cookie;
	struct request * R;
	int64_t ID;
	int rc = 0;	/* Success unless we fail to schedule a callback. */

	/* This queue is dying. */
	assert(Q->failed == 0);
	Q->failed = 1;

	/* Cancel any pending packet-reading wait. */
	if (Q->read_cookie != NULL) {
		wire_readpacket_wait_cancel(Q->read_cookie);
		Q->read_cookie = NULL;
	}

	/* Free the buffered writer. */
	netbuf_write_free(Q->WQ);

	/* Schedule callbacks for pending requests. */
	while ((ID = seqptrmap_getmin(Q->reqs)) != -1) {
		/* Get the first pending request. */
		R = seqptrmap_get(Q->reqs, ID);

		/* Said request can't be NULL unless seqptrmap is broken. */
		assert(R != NULL);

		/* Schedule a failure callback to occur later. */
		if (events_immediate_register(failreq, R, 0) == NULL)
			rc = -1;

		/* Delete the request from the map. */
		seqptrmap_delete(Q->reqs, ID);
	}

	/* Success unless we failed to schedule a callback. */
	return (rc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jne 0x93f7
jmp 0x9416
leaq 0x6abb(%rip), %rdi      # 0xfeb9
leaq 0x6a3c(%rip), %rsi      # 0xfe41
movl $0x7d, %edx
leaq 0x6ab7(%rip), %rcx      # 0xfec8
callq 0x21a0
movq -0x10(%rbp), %rax
movl $0x1, 0x20(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x9445
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xd690
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xc2e0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xb0e0
movq %rax, -0x20(%rbp)
cmpq $-0x1, %rax
je 0x94db
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0xb060
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x9487
jmp 0x94a6
leaq 0x6a50(%rip), %rdi      # 0xfede
leaq 0x69ac(%rip), %rsi      # 0xfe41
movl $0x8f, %edx
leaq 0x6a27(%rip), %rcx      # 0xfec8
callq 0x21a0
movq -0x18(%rbp), %rsi
leaq 0x28f(%rip), %rdi       # 0x9740
xorl %edx, %edx
callq 0x2fb0
cmpq $0x0, %rax
jne 0x94c5
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0xb120
jmp 0x9452
movl -0x24(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/wire/wire_requestqueue.c
// Function: readpackets
static int
readpackets(void * cookie, int status)
{
	struct wire_requestqueue * Q = cookie;
	struct wire_packet P;
	struct request * R;

	/* We're not waiting for a packet to be available any more. */
	Q->read_cookie = NULL;

	/* If the wait failed, the connection is dying. */
	if (status)
		goto fail;

	/* Handle packets until there are no more or we encounter an error. */
	do {
		/* Grab a packet. */
		if (wire_readpacket_peek(Q->R, &P))
			goto fail;

		/* Exit the loop if no packet is available. */
		if (P.buf == NULL)
			break;

		/* Look up the request associated with this response. */
		if ((R = seqptrmap_get(Q->reqs, (int64_t)P.ID)) == NULL) {
			/* Is this response ID reasonable? */
			warn0("Received bogus response ID: %016" PRIx64, P.ID);

			/* This connection is not useful. */
			goto fail;
		}

		/* Delete the request from the pending request map. */
		seqptrmap_delete(Q->reqs, (int64_t)P.ID);

		/* Invoke the upstream callback. */
		if ((R->callback)(R->cookie, P.buf, P.len))
			goto err0;

		/* Free the request structure. */
		mpool_request_free(R);

		/* Consume the packet. */
		wire_readpacket_consume(Q->R, &P);
	} while (1);

	/* Wait for another packet to arrive. */
	if ((Q->read_cookie =
	    wire_readpacket_wait(Q->R, readpackets, Q)) == NULL)
		goto err0;

	/* Success! */
	return (0);

fail:
	/* This request queue has failed. */
	return (failqueue(Q));

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq $0x0, 0x10(%rax)
cmpl $0x0, -0x14(%rbp)
je 0x951e
jmp 0x960b
jmp 0x9520
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0xd220
cmpl $0x0, %eax
je 0x953a
jmp 0x960b
cmpq $0x0, -0x28(%rbp)
jne 0x9546
jmp 0x95db
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x38(%rbp), %rsi
callq 0xb060
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0x9585
jmp 0x9563
movq -0x38(%rbp), %rsi
leaq 0x697a(%rip), %rdi      # 0xfee8
movb $0x0, %al
callq 0x6a10
callq 0x20a0
movl $0x0, (%rax)
jmp 0x960b
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x38(%rbp), %rsi
callq 0xb120
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movq 0x8(%rcx), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq *%rax
cmpl $0x0, %eax
je 0x95b6
jmp 0x9619
movq -0x40(%rbp), %rdi
callq 0x9790
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0xd6f0
movb $0x1, %al
testb $0x1, %al
jne 0x9520
jmp 0x95db
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rdx
leaq -0xfd(%rip), %rsi       # 0x94f0
callq 0xd4c0
movq -0x20(%rbp), %rcx
movq %rax, 0x10(%rcx)
cmpq $0x0, %rax
jne 0x9602
jmp 0x9619
movl $0x0, -0x4(%rbp)
jmp 0x9620
movq -0x20(%rbp), %rdi
callq 0x93d0
movl %eax, -0x4(%rbp)
jmp 0x9620
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/wire/wire_requestqueue.c
// Function: wire_requestqueue_add_getbuf
uint8_t *
wire_requestqueue_add_getbuf(struct wire_requestqueue * Q, size_t len,
    int (* callback)(void *, uint8_t *, size_t), void * cookie)
{
	struct request * R;
	uint8_t * wbuf;
	uint64_t ID;

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

	/* If the request queue has failed, we can't send a request. */
	if (Q->failed) {
		/* Schedule a failure callback. */
		if (events_immediate_register(failreq, R, 0) == NULL)
			goto err1;

		/* Return a dummy buffer for the request. */
		return (malloc(len));
	}

	/* Insert the cookie into the pending request map. */
	if ((ID = (uint64_t)seqptrmap_add(Q->reqs, R)) == (uint64_t)(-1))
		goto err1;

	/* Start writing a packet. */
	if ((wbuf = wire_writepacket_getbuf(Q->WQ, ID, len)) == NULL)
		goto err2;

	/* Return a pointer to the packet data buffer. */
	return (wbuf);

err2:
	seqptrmap_delete(Q->reqs, (int64_t)ID);
err1:
	mpool_request_free(R);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
callq 0x9720
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x965c
jmp 0x9708
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0x96a6
movq -0x30(%rbp), %rsi
leaq 0xb8(%rip), %rdi        # 0x9740
xorl %edx, %edx
callq 0x2fb0
cmpq $0x0, %rax
jne 0x9697
jmp 0x96ff
movq -0x18(%rbp), %rdi
callq 0x2230
movq %rax, -0x8(%rbp)
jmp 0x9710
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0xaf80
movq %rax, -0x40(%rbp)
cmpq $-0x1, %rax
jne 0x96c3
jmp 0x96ff
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x40(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x9c10
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x96e4
jmp 0x96ee
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x9710
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x40(%rbp), %rsi
callq 0xb120
movq -0x30(%rbp), %rdi
callq 0x9790
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/wire/wire_requestqueue.c
// Function: failreq
static int
failreq(void * cookie)
{
	struct request * R = cookie;
	int rc;

	/* Perform a no-response callback. */
	rc = (R->callback)(R->cookie, NULL, 0);

	/* Free the request structure. */
	mpool_request_free(R);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rdi
xorl %ecx, %ecx
movl %ecx, %edx
movq %rdx, %rsi
callq *%rax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0x9790
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/wire/wire_requestqueue.c
// Function: wire_requestqueue_add_done
int
wire_requestqueue_add_done(struct wire_requestqueue * Q, uint8_t * wbuf,
    size_t len)
{

	/* If the request queue has failed, just free the dummy buffer. */
	if (Q->failed) {
		free(wbuf);
		return (0);
	}

	/* We've finished writing this packet. */
	return (wire_writepacket_done(Q->WQ, wbuf, len));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0x97f0
movq -0x18(%rbp), %rdi
callq 0x2040
movl $0x0, -0x4(%rbp)
jmp 0x9808
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x9e50
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/wire/wire_requestqueue.c
// Function: wire_requestqueue_add
int
wire_requestqueue_add(struct wire_requestqueue * Q,
    uint8_t * buf, size_t buflen,
    int (* callback)(void *, uint8_t *, size_t), void * cookie)
{
	uint8_t * wbuf;

	/* Start writing the request. */
	if ((wbuf = wire_requestqueue_add_getbuf(Q, buflen,
	    callback, cookie)) == NULL)
		goto err0;

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

	/* Finish writing the request. */
	if (wire_requestqueue_add_done(Q, wbuf, buflen))
		goto err0;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x9630
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x985d
jmp 0x988f
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x2210
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x97c0
cmpl $0x0, %eax
je 0x9886
jmp 0x988f
movl $0x0, -0x4(%rbp)
jmp 0x9896
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/wire/wire_requestqueue.c
// Function: wire_requestqueue_destroy
int
wire_requestqueue_destroy(struct wire_requestqueue * Q)
{

	/* We are being destroyed. */
	Q->destroyed = 1;

	/* If we've already failed, there's no need to do anything more. */
	if (Q->failed)
		return (0);

	/* Tear everything down as if there was an error. */
	return (failqueue(Q));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl $0x1, 0x24(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0x98ca
movl $0x0, -0x4(%rbp)
jmp 0x98d6
movq -0x10(%rbp), %rdi
callq 0x93d0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/wire/wire_requestqueue.c
// Function: wire_requestqueue_free
void
wire_requestqueue_free(struct wire_requestqueue * Q)
{

	/* Sanity check: The queue must have been destroyed. */
	assert(Q->destroyed);

	/* Sanity check: There must be no pending requests. */
	assert(seqptrmap_getmin(Q->reqs) == -1);

	/* Free the pending request map. */
	seqptrmap_free(Q->reqs);

	/* Free the buffered reader. */
	netbuf_read_free(Q->R);

	/* Free the request queue. */
	free(Q);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x24(%rax)
je 0x98f8
jmp 0x9917
leaq 0x6535(%rip), %rdi      # 0xfe34
leaq 0x653b(%rip), %rsi      # 0xfe41
movl $0x161, %edx            # imm = 0x161
leaq 0x654f(%rip), %rcx      # 0xfe61
callq 0x21a0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xb0e0
cmpq $-0x1, %rax
jne 0x992c
jmp 0x994b
leaq 0x6566(%rip), %rdi      # 0xfe99
leaq 0x6507(%rip), %rsi      # 0xfe41
movl $0x164, %edx            # imm = 0x164
leaq 0x651b(%rip), %rcx      # 0xfe61
callq 0x21a0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xb1f0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0xbc10
movq -0x8(%rbp), %rdi
callq 0x2040
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/wire/wire_writepacket.c
// Function: wire_writepacket_getbuf
uint8_t *
wire_writepacket_getbuf(struct netbuf_write * W, uint64_t ID, size_t len)
{
	CRC32C_CTX ctx;
	uint8_t * wbuf;

	/* Sanity-check packet length. */
	assert(len <= UINT32_MAX);
	assert(len <= SIZE_MAX - 20);

	/* Reserve space to write the serialized packet into. */
	if ((wbuf = netbuf_write_reserve(W, len + 20)) == NULL)
		goto err0;

	/* Construct the header in-place. */
	be64enc(&wbuf[0], ID);
	be32enc(&wbuf[8], (uint32_t)len);
	CRC32C_Init(&ctx);
	CRC32C_Update(&ctx, wbuf, 12);
	CRC32C_Final(&wbuf[12], &ctx);

	/* Return a pointer to where the data should be written. */
	return (&wbuf[16]);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, -0x20(%rbp)
ja 0x9c31
jmp 0x9c50
leaq 0x62d3(%rip), %rdi      # 0xff0b
leaq 0x62de(%rip), %rsi      # 0xff1d
movl $0x18, %edx
leaq 0x62f1(%rip), %rcx      # 0xff3c
callq 0x21a0
cmpq $-0x15, -0x20(%rbp)
ja 0x9c59
jmp 0x9c78
leaq 0x6326(%rip), %rdi      # 0xff86
leaq 0x62b6(%rip), %rsi      # 0xff1d
movl $0x19, %edx
leaq 0x62c9(%rip), %rcx      # 0xff3c
callq 0x21a0
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x14, %rsi
callq 0xbe20
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x9c95
jmp 0x9cef
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9d10
movq -0x30(%rbp), %rdi
addq $0x8, %rdi
movq -0x20(%rbp), %rax
movl %eax, %esi
callq 0x9de0
leaq -0x24(%rbp), %rdi
callq 0x9ff0
movq -0x30(%rbp), %rsi
leaq -0x24(%rbp), %rdi
movl $0xc, %edx
callq 0xa190
movq -0x30(%rbp), %rdi
addq $0xc, %rdi
leaq -0x24(%rbp), %rsi
callq 0xa300
movq -0x30(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x8(%rbp)
jmp 0x9cf7
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)