LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/bench/bulk_update/main.c
// Function: callback_done
static int
callback_done(void * cookie, int failed)
{
	struct bulkupdate_state * C = cookie;

	/* This request is no longer in progress. */
	C->Nip -= 1;

	/* Did we fail? */
	if (failed) {
		C->done = 1;
		C->failed = 1;
	}

	/* Notify the benchmarking code, and check if we should quit. */
	if (bench_tick(C->B, &C->done)) {
		warnp("bench_tick");
		goto err0;
	}

	/* Send more requests if possible. */
	if ((!C->done) && sendbatch(C))
		goto err0;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
decq 0x10(%rdi)
testl %esi, %esi
je 0x277f
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x1c(%rbx)
movq 0x38(%rbx), %rdi
leaq 0x20(%rbx), %r14
movq %r14, %rsi
callq 0x4ee5
testl %eax, %eax
je 0x27b3
callq 0x2090
cmpl $0x0, (%rax)
je 0x27c9
movq %rax, %rbx
leaq 0x6902(%rip), %rdi      # 0x90a9
xorl %eax, %eax
callq 0x4a55
andl $0x0, (%rbx)
jmp 0x27d7
xorl %ebp, %ebp
cmpl $0x0, (%r14)
jne 0x27da
movq %rbx, %rdi
callq 0x26b1
testl %eax, %eax
jne 0x27d7
jmp 0x27da
leaq 0x68d9(%rip), %rdi      # 0x90a9
xorl %eax, %eax
callq 0x4be4
pushq $-0x1
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/bench/bench.c
// Function: bench_init
struct bench *
bench_init(size_t start, size_t num_seconds)
{
	struct bench * B;
	struct timeval tv_now;

	/* Sanity checks. */
	assert((start + num_seconds) < INT_MAX);
	assert(num_seconds > 0);

	/* Allocate and initialize cookie. */
	if ((B = malloc(sizeof(struct bench))) == NULL) {
		warn0("malloc");
		goto err0;
	}
	B->num_seconds = num_seconds;
	B->started = 0;

	/* Allocate and initialize tick counts. */
	if ((B->ticks = malloc(num_seconds * sizeof(uint64_t))) == NULL) {
		warn0("malloc");
		goto err1;
	}
	if ((B->sorted = malloc(num_seconds * sizeof(uint64_t))) == NULL) {
		warn0("malloc");
		goto err2;
	}
	memset(B->ticks, 0, num_seconds * sizeof(uint64_t));
	B->tick_pos = 0;

	/* Get current time. */
	if (monoclock_get(&tv_now)) {
		warnp("monoclock_get");
		goto err3;
	}

	/* Prepare start benchmark time value. */
	B->tv_start.tv_sec = tv_now.tv_sec + (int)start;
	B->tv_start.tv_usec = tv_now.tv_usec;

	/* Success! */
	return (B);

err3:
	free(B->sorted);
err2:
	free(B->ticks);
err1:
	free(B);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
leaq (%rsi,%rdi), %rax
cmpq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
jae 0x4eaf
movq %rsi, %r13
testq %rsi, %rsi
je 0x4ec8
movq %rdi, %r15
pushq $0x48
popq %rdi
callq 0x2220
testq %rax, %rax
je 0x4e16
movq %rax, %rbx
movq %r13, (%rax)
andl $0x0, 0x40(%rax)
shlq $0x3, %r13
movq %r13, %rdi
callq 0x2220
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x4e30
movq %rax, %r14
movq %r13, %rdi
callq 0x2220
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x4e48
movq %rax, %r12
movq %r14, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x21a0
andq $0x0, 0x18(%rbx)
movq %rsp, %rdi
callq 0x3964
testl %eax, %eax
je 0x4e60
callq 0x2090
cmpl $0x0, (%rax)
je 0x4e76
movq %rax, %r15
leaq 0x4926(%rip), %rdi      # 0x972f
xorl %eax, %eax
callq 0x4a55
andl $0x0, (%r15)
jmp 0x4e84
leaq 0x490b(%rip), %rdi      # 0x9728
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4be4
callq 0x2090
andl $0x0, (%rax)
jmp 0x4e9e
leaq 0x48f1(%rip), %rdi      # 0x9728
xorl %eax, %eax
callq 0x4be4
callq 0x2090
andl $0x0, (%rax)
jmp 0x4e94
leaq 0x48d9(%rip), %rdi      # 0x9728
xorl %eax, %eax
callq 0x4be4
callq 0x2090
andl $0x0, (%rax)
jmp 0x4e8c
movslq %r15d, %rax
addq (%rsp), %rax
movq %rax, 0x20(%rbx)
movq 0x8(%rsp), %rax
movq %rax, 0x28(%rbx)
jmp 0x4e9e
leaq 0x48b2(%rip), %rdi      # 0x972f
xorl %eax, %eax
callq 0x4be4
movq %r12, %rdi
callq 0x2040
movq %r14, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x4814(%rip), %rdi      # 0x96ca
leaq 0x482d(%rip), %rsi      # 0x96ea
leaq 0x483b(%rip), %rcx      # 0x96ff
pushq $0x27
jmp 0x4edf
leaq 0x4871(%rip), %rdi      # 0x9740
leaq 0x4814(%rip), %rsi      # 0x96ea
leaq 0x4822(%rip), %rcx      # 0x96ff
pushq $0x28
popq %rdx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/bench/bench.c
// Function: bench_tick
int
bench_tick(struct bench * B, int * done)
{
	struct timeval tv_now;

	/* Get current time. */
	if (monoclock_get(&tv_now)) {
		warnp("monoclock_get");
		goto err0;
	}

	/* Are we still waiting to start recording ticks? */
	if (B->started == 0) {
		/* Bail if it's not time to start counting items. */
		if (tv_cmp(tv_now, B->tv_start) < 0)
			goto done;

		/* Start recording ticks. */
		B->started = 1;

		/* Start tracking seconds. */
		B->tv_end.tv_sec = tv_now.tv_sec + 1;
		B->tv_end.tv_usec = tv_now.tv_usec;
	}

	/* Have we finished a second? */
	if (tv_cmp(tv_now, B->tv_end) > 0) {
		/* Prepare to record in a new position. */
		B->tick_pos++;

		/* Have we run out of seconds to record? */
		if (B->tick_pos >= B->num_seconds) {
			*done = 1;
			goto done;
		}

		/* Set up the next second. */
		B->tv_end.tv_sec = tv_now.tv_sec + 1;
		B->tv_end.tv_usec = tv_now.tv_usec;
	}

	/* Record value in the current position. */
	B->ticks[B->tick_pos]++;

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

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

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3964
testl %eax, %eax
je 0x4f20
callq 0x2090
cmpl $0x0, (%rax)
je 0x4f5b
movq %rax, %rbx
leaq 0x481b(%rip), %rdi      # 0x972f
xorl %eax, %eax
callq 0x4a55
andl $0x0, (%rbx)
jmp 0x4f69
cmpl $0x0, 0x40(%rbx)
movq 0x8(%rsp), %rcx
je 0x4f6e
cmpq 0x30(%rbx), %rcx
jl 0x4f95
movq 0x10(%rsp), %rax
jg 0x4f3e
cmpq 0x38(%rbx), %rax
jle 0x4f95
movq 0x18(%rbx), %rdx
incq %rdx
movq %rdx, 0x18(%rbx)
cmpq (%rbx), %rdx
jae 0x4fab
incq %rcx
movq %rcx, 0x30(%rbx)
movq %rax, 0x38(%rbx)
jmp 0x4f95
leaq 0x47cd(%rip), %rdi      # 0x972f
xorl %eax, %eax
callq 0x4be4
pushq $-0x1
popq %rax
jmp 0x4fa3
xorl %eax, %eax
cmpq 0x20(%rbx), %rcx
jl 0x4fa3
movq 0x10(%rsp), %rdx
jg 0x4f83
cmpq 0x28(%rbx), %rdx
jl 0x4fa3
movl $0x1, 0x40(%rbx)
incq %rcx
movq %rcx, 0x30(%rbx)
movq %rdx, 0x38(%rbx)
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rcx
incq (%rax,%rcx,8)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movl $0x1, (%r14)
jmp 0x4fa1
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/bench/bench.c
// Function: bench_mean
uint64_t
bench_mean(struct bench * B)
{
	size_t i;
	uint64_t sum = 0;

	/* Sanity check. */
	assert(B->num_seconds > 0);

	/* Calculate sum. */
	for (i = 0; i < B->num_seconds; i++)
		sum += B->ticks[i];

	/* Return the mean. */
	return (sum / B->num_seconds);
}

// Assembly:
pushq %rax
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x4fdf
movq 0x8(%rdi), %rdx
xorl %esi, %esi
xorl %eax, %eax
cmpq %rsi, %rcx
je 0x4fd8
addq (%rdx,%rsi,8), %rax
incq %rsi
jmp 0x4fca
xorl %edx, %edx
divq %rcx
popq %rcx
retq
leaq 0x4757(%rip), %rdi      # 0x973d
leaq 0x46fd(%rip), %rsi      # 0x96ea
leaq 0x475c(%rip), %rcx      # 0x9750
movl $0xb8, %edx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
movq (%rbx), %rdx
movq 0x8(%rbx), %rsi
shlq $0x3, %rdx
callq 0x2200
movq (%rbx), %rsi
movq 0x10(%rbx), %rdi
leaq 0x2a(%rip), %rcx        # 0x504e
pushq $0x8
popq %rdx
callq 0x20b0
movq (%rbx), %rsi
movq 0x10(%rbx), %rcx
leaq -0x1(%rsi), %rdx
shrq %rdx
movq (%rcx,%rdx,8), %rax
testb $0x1, %sil
jne 0x504c
addq 0x8(%rcx,%rdx,8), %rax
shrq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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:
testq %rdi, %rdi
je 0x5089
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
callq 0x2040
movq 0x8(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
popq %rbx
jmp 0x2040
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
cmpq $0x100, %rsi            # imm = 0x100
jae 0x50ce
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1(%rsi), %rdi
callq 0x2220
movq %rax, %r15
testq %rax, %rax
je 0x50c5
movb %bl, (%r15)
movq %r15, %rdi
incq %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2200
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x469f(%rip), %rdi      # 0x9774
leaq 0x46a9(%rip), %rsi      # 0x9785
leaq 0x46bf(%rip), %rcx      # 0x97a2
pushq $0x13
popq %rdx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
testq %rdx, %rdx
je 0x5126
movq %rsi, %r14
movzbl (%rsi), %ebx
cmpq %rdx, %rbx
jae 0x5126
movq %rdi, %r15
incq %rbx
movq %rbx, %rdi
callq 0x2220
movq %rax, (%r15)
testq %rax, %rax
je 0x512e
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2200
jmp 0x5130
callq 0x2090
andl $0x0, (%rax)
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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:
movzbl (%rdi), %ecx
movzbl (%rsi), %r8d
cmpb %r8b, %cl
movl %r8d, %r9d
cmovbl %ecx, %r9d
cmpq %r9, %rdx
jae 0x516a
movzbl 0x1(%rdi,%rdx), %eax
movzbl 0x1(%rsi,%rdx), %r10d
incq %rdx
subl %r10d, %eax
je 0x5151
retq
subl %r8d, %ecx
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r15
pushq $0x10
popq %rdi
callq 0x2220
pushq $-0x1
popq %rbx
testq %rax, %rax
je 0x51fa
movq %rax, %r14
movq %r13, (%rax)
movq %r12, 0x8(%rax)
leaq 0x43(%rip), %rdx        # 0x5206
pushq $0x4
popq %rsi
movq %r15, %rdi
movq %rax, %rcx
callq 0x65b3
testq %rax, %rax
je 0x51ee
movl $0x10000, (%rax)        # imm = 0x10000
pushq $0x4
popq %rdx
movq %r15, %rdi
movq %rax, %rsi
callq 0x67d5
testl %eax, %eax
je 0x51f8
movq %r14, %rdi
callq 0x2040
jmp 0x51fa
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %rbp
testq %rsi, %rsi
je 0x523e
cmpq $0x8, %rdx
jne 0x5243
movq %rsi, %r15
movq %rsi, %rdi
callq 0x6104
movl %eax, %r14d
addq $0x4, %r15
movq %r15, %rdi
callq 0x6104
movl %eax, %ecx
xorl %ebp, %ebp
jmp 0x526c
xorl %r14d, %r14d
jmp 0x526a
leaq 0x4996(%rip), %rdi      # 0x9be0
leaq 0x49ac(%rip), %rsi      # 0x9bfd
leaq 0x49ac(%rip), %rdx      # 0x9c04
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x4be4
callq 0x2090
andl $0x0, (%rax)
xorl %ecx, %ecx
movq 0x8(%rbx), %rdi
movl %ebp, %esi
movq %r14, %rdx
callq *(%rbx)
movl %eax, %ebp
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_client.c
// Function: proto_kvlds_request_set
int
proto_kvlds_request_set(struct wire_requestqueue * Q,
    const struct kvldskey * key, const struct kvldskey * value,
    int (* callback)(void *, int), void * cookie)
{
	struct done_cookie * C;
	uint8_t * buf;
	size_t buflen;
	size_t bufpos;

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

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

	/* 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_SET);
	bufpos = 4;
	kvldskey_serialize(key, &buf[bufpos]);
	bufpos += kvldskey_serial_size(key);
	kvldskey_serialize(value, &buf[bufpos]);
	bufpos += kvldskey_serial_size(value);

	/* Sanity-check. */
	assert(bufpos == buflen);

	/* 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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r13
movq %rdx, %r12
movq %rsi, %rbp
movq %rdi, %r15
callq 0x538c
movq %rax, %r14
pushq $-0x1
popq %rax
testq %r14, %r14
je 0x535e
movq %r13, (%r14)
movq %rbx, 0x8(%r14)
leaq 0x4512(%rip), %rax      # 0x97dc
movq %rax, 0x10(%r14)
movzbl (%rbp), %eax
movzbl (%r12), %ecx
leaq 0x6(%rax,%rcx), %r13
leaq 0xb8(%rip), %rdx        # 0x539b
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rcx
callq 0x65b3
testq %rax, %rax
je 0x534f
movq %rax, %rbx
movl $0x10010000, (%rax)     # imm = 0x10010000
leaq 0x4(%rax), %rdi
movzbl (%rbp), %edx
incq %rdx
movq %rbp, %rsi
callq 0x2200
movzbl (%rbp), %ebp
leaq (%rbx,%rbp), %rdi
addq $0x5, %rdi
movzbl (%r12), %edx
incq %rdx
movq %r12, %rsi
callq 0x2200
movzbl (%r12), %eax
addl %ebp, %eax
addl $0x6, %eax
cmpl %r13d, %eax
jne 0x536d
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x67d5
testl %eax, %eax
je 0x535c
movq %r14, %rdi
callq 0x5404
pushq $-0x1
popq %rax
jmp 0x535e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x446c(%rip), %rdi      # 0x97e0
leaq 0x4476(%rip), %rsi      # 0x97f1
leaq 0x4497(%rip), %rcx      # 0x9819
movl $0x1d4, %edx            # imm = 0x1D4
callq 0x2180
// File: /workspace/github_c_makefile_star2_O2/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
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %rbp
testq %rsi, %rsi
je 0x53e5
cmpq $0x4, %rdx
jae 0x53b8
leaq 0x484e(%rip), %rdx      # 0x9c04
jmp 0x53cb
movq %rsi, %rdi
callq 0x6104
testl %eax, %eax
je 0x5400
leaq 0x4846(%rip), %rdx      # 0x9c11
movq 0x10(%rbx), %rsi
leaq 0x480a(%rip), %rdi      # 0x9be0
xorl %eax, %eax
callq 0x4be4
callq 0x2090
andl $0x0, (%rax)
movq 0x8(%rbx), %rdi
movl %ebp, %esi
callq *(%rbx)
movl %eax, %ebp
movq %rbx, %rdi
callq 0x5404
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
xorl %ebp, %ebp
jmp 0x53e5
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_client.c
// Function: proto_kvlds_request_cas
int
proto_kvlds_request_cas(struct wire_requestqueue * Q,
    const struct kvldskey * key, const struct kvldskey * oval,
    const struct kvldskey * value,
    int (* callback)(void *, int, int), void * cookie)
{
	struct donep_cookie * C;
	uint8_t * buf;
	size_t buflen;
	size_t bufpos;

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

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

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

	/* Construct request. */
	be32enc(&buf[0], PROTO_KVLDS_CAS);
	bufpos = 4;
	kvldskey_serialize(key, &buf[bufpos]);
	bufpos += kvldskey_serial_size(key);
	kvldskey_serialize(oval, &buf[bufpos]);
	bufpos += kvldskey_serial_size(oval);
	kvldskey_serialize(value, &buf[bufpos]);
	bufpos += kvldskey_serial_size(value);

	/* Sanity-check. */
	assert(bufpos == buflen);

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

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %rbx
movq %r8, %r13
movq %rcx, 0x8(%rsp)
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %r12
callq 0x555c
movq %rax, %r14
pushq $-0x1
popq %rax
testq %r14, %r14
je 0x552e
movq %r13, (%r14)
movq %rbx, 0x8(%r14)
leaq 0x444a(%rip), %rax      # 0x98a1
movq %rax, 0x10(%r14)
movzbl (%r15), %eax
movzbl (%rbp), %ecx
movq 0x8(%rsp), %rdx
movzbl (%rdx), %edx
addq %rax, %rcx
leaq (%rdx,%rcx), %r13
addq $0x7, %r13
leaq 0xee(%rip), %rdx        # 0x556b
movq %r12, 0x10(%rsp)
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rcx
callq 0x65b3
testq %rax, %rax
je 0x551f
movq %rax, %rbx
movl $0x11010000, (%rax)     # imm = 0x11010000
leaq 0x4(%rax), %rdi
movzbl (%r15), %edx
incq %rdx
movq %r15, %rsi
callq 0x2200
movzbl (%r15), %r15d
leaq (%rbx,%r15), %rdi
addq $0x5, %rdi
movzbl (%rbp), %edx
incq %rdx
movq %rbp, %rsi
callq 0x2200
movzbl (%rbp), %eax
leaq (%r15,%rax), %rcx
addq %rax, %r15
addq $0x6, %r15
leaq (%rbx,%rcx), %rdi
addq $0x6, %rdi
movq 0x8(%rsp), %r12
movzbl (%r12), %edx
incq %rdx
movq %r12, %rsi
callq 0x2200
movzbl (%r12), %eax
addl %r15d, %eax
incl %eax
cmpl %r13d, %eax
jne 0x553d
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x67d5
testl %eax, %eax
je 0x552c
movq %r14, %rdi
callq 0x55e2
pushq $-0x1
popq %rax
jmp 0x552e
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x429c(%rip), %rdi      # 0x97e0
leaq 0x42a6(%rip), %rsi      # 0x97f1
leaq 0x4353(%rip), %rcx      # 0x98a5
movl $0x214, %edx            # imm = 0x214
callq 0x2180
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rbp
testq %rsi, %rsi
je 0x5589
cmpq $0x4, %rdx
jae 0x558e
leaq 0x467d(%rip), %rdx      # 0x9c04
jmp 0x55a2
xorl %r14d, %r14d
jmp 0x55c6
movq %rsi, %rdi
callq 0x6104
cmpl $0x2, %eax
jb 0x55c1
leaq 0x466f(%rip), %rdx      # 0x9c11
movq 0x10(%rbx), %rsi
leaq 0x4633(%rip), %rdi      # 0x9be0
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x4be4
callq 0x2090
andl $0x0, (%rax)
jmp 0x55c6
movl %eax, %r14d
xorl %ebp, %ebp
movq 0x8(%rbx), %rdi
movl %ebp, %esi
movl %r14d, %edx
callq *(%rbx)
movl %eax, %ebp
movq %rbx, %rdi
callq 0x55e2
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_client.c
// Function: proto_kvlds_request_modify
int
proto_kvlds_request_modify(struct wire_requestqueue * Q,
    const struct kvldskey * key, const struct kvldskey * value,
    int (* callback)(void *, int, int), void * cookie)
{
	struct donep_cookie * C;
	uint8_t * buf;
	size_t buflen;
	size_t bufpos;

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

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

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

	/* Construct request. */
	be32enc(&buf[0], PROTO_KVLDS_MODIFY);
	bufpos = 4;
	kvldskey_serialize(key, &buf[bufpos]);
	bufpos += kvldskey_serial_size(key);
	kvldskey_serialize(value, &buf[bufpos]);
	bufpos += kvldskey_serial_size(value);

	/* Sanity-check. */
	assert(bufpos == buflen);

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

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r13
movq %rdx, %r12
movq %rsi, %rbp
movq %rdi, %r15
callq 0x555c
movq %rax, %r14
pushq $-0x1
popq %rax
testq %r14, %r14
je 0x57bf
movq %r13, (%r14)
movq %rbx, 0x8(%r14)
leaq 0x42b1(%rip), %rax      # 0x99dc
movq %rax, 0x10(%r14)
movzbl (%rbp), %eax
movzbl (%r12), %ecx
leaq 0x6(%rax,%rcx), %r13
leaq -0x1d9(%rip), %rdx      # 0x556b
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rcx
callq 0x65b3
testq %rax, %rax
je 0x57b0
movq %rax, %rbx
movl $0x13010000, (%rax)     # imm = 0x13010000
leaq 0x4(%rax), %rdi
movzbl (%rbp), %edx
incq %rdx
movq %rbp, %rsi
callq 0x2200
movzbl (%rbp), %ebp
leaq (%rbx,%rbp), %rdi
addq $0x5, %rdi
movzbl (%r12), %edx
incq %rdx
movq %r12, %rsi
callq 0x2200
movzbl (%r12), %eax
addl %ebp, %eax
addl $0x6, %eax
cmpl %r13d, %eax
jne 0x57ce
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x67d5
testl %eax, %eax
je 0x57bd
movq %r14, %rdi
callq 0x55e2
pushq $-0x1
popq %rax
jmp 0x57bf
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x400b(%rip), %rdi      # 0x97e0
leaq 0x4015(%rip), %rsi      # 0x97f1
leaq 0x4200(%rip), %rcx      # 0x99e3
movl $0x28c, %edx            # imm = 0x28C
callq 0x2180
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %r12
movq %rdi, %r15
callq 0x538c
pushq $-0x1
popq %rbx
testq %rax, %rax
je 0x5887
movq %rax, %r14
movq %rbp, (%rax)
movq %r13, 0x8(%rax)
leaq 0x4251(%rip), %rax      # 0x9a73
movq %rax, 0x10(%r14)
movzbl (%r12), %r13d
addq $0x5, %r13
leaq -0x49b(%rip), %rdx      # 0x539b
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rcx
callq 0x65b3
testq %rax, %rax
je 0x587b
movq %rax, %rbp
movl $0x20010000, (%rax)     # imm = 0x20010000
movq %rax, %rdi
addq $0x4, %rdi
movzbl (%r12), %edx
incq %rdx
movq %r12, %rsi
callq 0x2200
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x67d5
testl %eax, %eax
je 0x5885
movq %r14, %rdi
callq 0x5404
jmp 0x5887
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_client.c
// Function: proto_kvlds_request_cad
int
proto_kvlds_request_cad(struct wire_requestqueue * Q,
    const struct kvldskey * key, const struct kvldskey * oval,
    int (* callback)(void *, int, int), void * cookie)
{
	struct donep_cookie * C;
	uint8_t * buf;
	size_t buflen;
	size_t bufpos;

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

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

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

	/* Construct request. */
	be32enc(&buf[0], PROTO_KVLDS_CAD);
	bufpos = 4;
	kvldskey_serialize(key, &buf[bufpos]);
	bufpos += kvldskey_serial_size(key);
	kvldskey_serialize(oval, &buf[bufpos]);
	bufpos += kvldskey_serial_size(oval);

	/* Sanity-check. */
	assert(bufpos == buflen);

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

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r13
movq %rdx, %r12
movq %rsi, %rbp
movq %rdi, %r15
callq 0x555c
movq %rax, %r14
pushq $-0x1
popq %rax
testq %r14, %r14
je 0x5968
movq %r13, (%r14)
movq %rbx, 0x8(%r14)
leaq 0x41a6(%rip), %rax      # 0x9a7a
movq %rax, 0x10(%r14)
movzbl (%rbp), %eax
movzbl (%r12), %ecx
leaq 0x6(%rax,%rcx), %r13
leaq -0x382(%rip), %rdx      # 0x556b
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rcx
callq 0x65b3
testq %rax, %rax
je 0x5959
movq %rax, %rbx
movl $0x21010000, (%rax)     # imm = 0x21010000
leaq 0x4(%rax), %rdi
movzbl (%rbp), %edx
incq %rdx
movq %rbp, %rsi
callq 0x2200
movzbl (%rbp), %ebp
leaq (%rbx,%rbp), %rdi
addq $0x5, %rdi
movzbl (%r12), %edx
incq %rdx
movq %r12, %rsi
callq 0x2200
movzbl (%r12), %eax
addl %ebp, %eax
addl $0x6, %eax
cmpl %r13d, %eax
jne 0x5977
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x67d5
testl %eax, %eax
je 0x5966
movq %r14, %rdi
callq 0x55e2
pushq $-0x1
popq %rax
jmp 0x5968
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3e62(%rip), %rdi      # 0x97e0
leaq 0x3e6c(%rip), %rsi      # 0x97f1
leaq 0x40f2(%rip), %rcx      # 0x9a7e
movl $0x2fa, %edx            # imm = 0x2FA
callq 0x2180
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %r12
movq %rdi, %r15
leaq 0x9b1c(%rip), %rdi      # 0xf4d0
pushq $0x10
popq %rsi
callq 0x6109
pushq $-0x1
popq %rbx
testq %rax, %rax
je 0x5a2f
movq %rax, %r14
movq %rbp, (%rax)
movq %r13, 0x8(%rax)
movzbl (%r12), %r13d
addq $0x5, %r13
leaq 0x62(%rip), %rdx        # 0x5a40
movq %r15, %rdi
movq %r13, %rsi
movq %rax, %rcx
callq 0x65b3
testq %rax, %rax
je 0x5a23
movq %rax, %rbp
movl $0x30010000, (%rax)     # imm = 0x30010000
movq %rax, %rdi
addq $0x4, %rdi
movzbl (%r12), %edx
incq %rdx
movq %r12, %rsi
callq 0x2200
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x67d5
testl %eax, %eax
je 0x5a2d
movq %r14, %rdi
callq 0x5b55
jmp 0x5a2f
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
andq $0x0, 0x8(%rsp)
movq %rdi, %rbx
pushq $0x1
popq %rbp
testq %rsi, %rsi
je 0x5afa
movq %rdx, %r14
cmpq $0x3, %rdx
ja 0x5a81
leaq 0x416f(%rip), %rdi      # 0x9be0
leaq 0x41ab(%rip), %rsi      # 0x9c23
leaq 0x4185(%rip), %rdx      # 0x9c04
jmp 0x5aeb
movq %rsi, %r12
movq %rsi, %rdi
callq 0x6104
cmpl $0x2, %eax
jb 0x5aa8
leaq 0x4148(%rip), %rdi      # 0x9be0
leaq 0x4184(%rip), %rsi      # 0x9c23
leaq 0x416b(%rip), %rdx      # 0x9c11
jmp 0x5aeb
xorl %r15d, %r15d
testl %eax, %eax
je 0x5ab3
xorl %eax, %eax
jmp 0x5acd
addq $0x4, %r12
leaq -0x4(%r14), %rdx
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x50eb
testq %rax, %rax
je 0x5b24
addq $0x4, %rax
cmpq %r14, %rax
je 0x5afd
leaq 0x4103(%rip), %rdi      # 0x9be0
leaq 0x413f(%rip), %rsi      # 0x9c23
leaq 0x415d(%rip), %rdx      # 0x9c48
xorl %eax, %eax
callq 0x4be4
callq 0x2090
andl $0x0, (%rax)
movl %ebp, %r15d
movq 0x8(%rbx), %rdi
movq 0x8(%rsp), %rdx
movl %r15d, %esi
callq *(%rbx)
movl %eax, %ebp
movq %rbx, %rdi
callq 0x5b55
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x2090
cmpl $0x0, (%rax)
je 0x5b45
movq %rax, %r14
leaq 0x40ef(%rip), %rdi      # 0x9c27
xorl %eax, %eax
callq 0x4a55
andl $0x0, (%r14)
jmp 0x5afa
leaq 0x40db(%rip), %rdi      # 0x9c27
xorl %eax, %eax
callq 0x4be4
jmp 0x5afa
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_client.c
// Function: proto_kvlds_request_range
int
proto_kvlds_request_range(struct wire_requestqueue * Q,
    const struct kvldskey * start, const struct kvldskey * end, size_t max,
    int (* callback)(void *, int, size_t, struct kvldskey *,
	struct kvldskey **, struct kvldskey **),
    void * cookie)
{
	struct range_cookie * C;
	uint8_t * buf;
	size_t buflen;
	size_t bufpos;

	/* The request size must fit into a uint32_t. */
	if (max >= UINT32_MAX)
		max = UINT32_MAX;

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

	/* Compute request size. */
	buflen = 8;
	buflen += kvldskey_serial_size(start);
	buflen += kvldskey_serial_size(end);

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

	/* Construct request. */
	be32enc(&buf[0], PROTO_KVLDS_RANGE);
	be32enc(&buf[4], (uint32_t)max);
	bufpos = 8;
	kvldskey_serialize(start, &buf[bufpos]);
	bufpos += kvldskey_serial_size(start);
	kvldskey_serialize(end, &buf[bufpos]);
	bufpos += kvldskey_serial_size(end);

	/* Sanity-check. */
	assert(bufpos == buflen);

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

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %rbp
movq %r8, %r13
movq %rdx, 0x8(%rsp)
movq %rsi, %r15
movq %rdi, %r12
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpq %rbx, %rcx
cmovbq %rcx, %rbx
pushq $0x18
popq %rdi
callq 0x2220
movq %rax, %r14
pushq $-0x1
popq %rax
testq %r14, %r14
je 0x5c62
movq %r13, (%r14)
movq %rbp, 0x8(%r14)
movq %rbx, 0x10(%r14)
movzbl (%r15), %eax
movq 0x8(%rsp), %rcx
movzbl (%rcx), %ecx
leaq 0xa(%rax,%rcx), %r13
leaq 0xc7(%rip), %rdx        # 0x5c90
movq %r12, 0x10(%rsp)
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rcx
callq 0x65b3
testq %rax, %rax
je 0x5c53
movq %rax, %rbp
movl $0x31010000, (%rax)     # imm = 0x31010000
movb %bl, 0x7(%rax)
movb %bh, 0x6(%rax)
movl %ebx, %eax
shrl $0x10, %eax
movb %al, 0x5(%rbp)
shrl $0x18, %ebx
movb %bl, 0x4(%rbp)
leaq 0x8(%rbp), %rdi
movzbl (%r15), %edx
incq %rdx
movq %r15, %rsi
callq 0x2200
movzbl (%r15), %ebx
leaq (%rbx,%rbp), %rdi
addq $0x9, %rdi
movq 0x8(%rsp), %r15
movzbl (%r15), %edx
incq %rdx
movq %r15, %rsi
callq 0x2200
movzbl (%r15), %eax
addl %ebx, %eax
addl $0xa, %eax
cmpl %r13d, %eax
jne 0x5c71
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x67d5
testl %eax, %eax
je 0x5c60
movq %r14, %rdi
callq 0x2040
pushq $-0x1
popq %rax
jmp 0x5c62
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3b68(%rip), %rdi      # 0x97e0
leaq 0x3b72(%rip), %rsi      # 0x97f1
leaq 0x3e85(%rip), %rcx      # 0x9b0b
movl $0x375, %edx            # imm = 0x375
callq 0x2180
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, (%rsp)
movq %r8, %r13
movq %rcx, %rbp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
pushq $0x38
popq %rdi
callq 0x2220
movq %rax, %rbx
pushq $-0x1
popq %rax
testq %rbx, %rbx
je 0x605e
movq %r12, (%rbx)
movq %rbp, 0x8(%rbx)
movq %r13, 0x10(%rbx)
movq (%rsp), %rax
movq %rax, 0x18(%rbx)
andq $0x0, 0x20(%rbx)
movzbl (%r15), %esi
incq %r15
movq %r15, %rdi
callq 0x508c
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x6051
movq %rax, %r15
movzbl (%r14), %esi
incq %r14
movq %r14, %rdi
callq 0x508c
movq %rax, 0x30(%rbx)
testq %rax, %rax
je 0x6049
leaq 0x46(%rip), %rdi        # 0x6071
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2b2c
testq %rax, %rax
jne 0x6060
movq 0x30(%rbx), %rdi
callq 0x2040
movq 0x28(%rbx), %r15
movq %r15, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
pushq $-0x1
popq %rbp
jmp 0x6060
movl %eax, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/datastruct/mpool.h
// Function: mpool_malloc
static inline void *
mpool_malloc(struct mpool * M, size_t len)
{

	/* Count the total number of allocation requests. */
	M->nallocs++;

	/* If we have an object on the stack, use that. */
	if (M->stacklen)
		return (M->allocs[--(M->stacklen)]);

	/* Count allocation requests where the pool was already empty. */
	M->nempties++;

	/* Initialize the atexit function (the first time we reach here). */
	if (M->state == 0) {
		atexit(M->atexitfunc);
		M->state = 1;
	}

	/* Allocate a new object. */
	return (malloc(len));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
incq 0x18(%rdi)
movq (%rdi), %rax
testq %rax, %rax
je 0x6134
movq 0x10(%rbx), %rcx
leaq -0x1(%rax), %rdx
movq %rdx, (%rbx)
movq -0x8(%rcx,%rax,8), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rsi, %r14
incq 0x20(%rbx)
cmpl $0x0, 0x28(%rbx)
jne 0x6151
movq 0x38(%rbx), %rdi
callq 0x8fd0
movl $0x1, 0x28(%rbx)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2220
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/datastruct/mpool.h
// Function: mpool_atexit
static inline void
mpool_atexit(struct mpool * M)
{

	/* Free all items on the stack. */
	while (M->stacklen)
		free(M->allocs[--M->stacklen]);

	/* If we allocated a stack, free it. */
	if (M->allocs != M->allocs_static)
		free(M->allocs);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rbx), %rax
movq 0x10(%rbx), %rdi
testq %rax, %rax
je 0x618c
leaq -0x1(%rax), %rcx
movq %rcx, (%rbx)
movq -0x8(%rdi,%rax,8), %rdi
callq 0x2040
jmp 0x616d
cmpq 0x30(%rbx), %rdi
je 0x6198
popq %rbx
jmp 0x2040
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/datastruct/mpool.h
// Function: mpool_free
static inline void
mpool_free(struct mpool * M, void * p)
{
	void ** allocs_new;

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

	/* If we have space in the stack, cache the object. */
	if (M->stacklen < M->allocsize) {
		M->allocs[M->stacklen++] = p;
		return;
	}

	/*
	 * Autotuning: If more than 1/256 of mpool_malloc() calls resulted in
	 * a malloc(), double the stack.
	 */
	if (M->nempties > (M->nallocs >> 8)) {
		/* Sanity check. */
		assert(M->allocsize > 0);

		/* Allocate new stack and copy pointers into it. */
		allocs_new = (void **)malloc(M->allocsize * 2 * sizeof(void *));
		if (allocs_new) {
			memcpy(allocs_new, M->allocs,
			    M->allocsize * sizeof(void *));
			if (M->allocs != M->allocs_static)
				free(M->allocs);
			M->allocs = allocs_new;
			M->allocsize = M->allocsize * 2;
			M->allocs[M->stacklen++] = p;
		} else
			free(p);
	} else
		free(p);

	/* Reset statistics. */
	M->nempties = 0;
	M->nallocs = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x624e
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %r13
movq 0x8(%rdi), %rbp
cmpq %rbp, %r13
jae 0x61d1
movq 0x10(%rbx), %rax
leaq 0x1(%r13), %rcx
movq %rcx, (%rbx)
movq %r14, (%rax,%r13,8)
jmp 0x624e
movq 0x18(%rbx), %rax
shrq $0x8, %rax
cmpq %rax, 0x20(%rbx)
jbe 0x623c
testq %rbp, %rbp
je 0x625d
movq %rbp, %rdi
shlq $0x4, %rdi
callq 0x2220
testq %rax, %rax
je 0x623c
movq %rax, %r15
movq 0x10(%rbx), %r12
leaq (,%rbp,8), %rdx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2200
cmpq 0x30(%rbx), %r12
je 0x6224
movq %r12, %rdi
callq 0x2040
movq (%rbx), %r13
movq 0x8(%rbx), %rbp
movq %r15, 0x10(%rbx)
addq %rbp, %rbp
movq %rbp, 0x8(%rbx)
leaq 0x1(%r13), %rax
movq %rax, (%rbx)
movq %r14, (%r15,%r13,8)
jmp 0x6244
movq %r14, %rdi
callq 0x2040
addq $0x18, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2e6c(%rip), %rdi      # 0x90d0
leaq 0x2e76(%rip), %rsi      # 0x90e1
leaq 0x2e91(%rip), %rcx      # 0x9103
pushq $0x5a
popq %rdx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, 0x24(%rdi)
testl %esi, %esi
je 0x62c7
movl $0x1, 0x20(%rbx)
xorl %ebp, %ebp
jmp 0x6345
movq %r9, %r14
movq %r8, %r12
movq %rcx, %r13
movq %rdx, %r15
movq 0x28(%rbx), %rdi
callq 0x2040
movq %r13, 0x28(%rbx)
xorl %r13d, %r13d
xorl %ebp, %ebp
cmpq %r13, %r15
je 0x6309
movq 0x18(%rbx), %rdi
movq (%r12,%r13,8), %rsi
movq (%r14,%r13,8), %rdx
callq *0x8(%rbx)
negl %eax
movl $0x0, %eax
sbbl %eax, %eax
orl %eax, %ebp
incq %r13
jmp 0x62e5
xorl %r13d, %r13d
cmpq %r13, %r15
je 0x631f
movq (%r12,%r13,8), %rdi
callq 0x2040
incq %r13
jmp 0x630c
movq %r12, %rdi
callq 0x2040
xorl %r12d, %r12d
cmpq %r12, %r15
je 0x633d
movq (%r14,%r12,8), %rdi
callq 0x2040
incq %r12
jmp 0x632a
movq %r14, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x6071
xorl %ecx, %ecx
negl %eax
sbbl %ecx, %ecx
orl %ebp, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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
pushq %rbx
pushq %rax
movl %edi, %ebp
pushq $0x28
popq %rdi
callq 0x2220
testq %rax, %rax
je 0x63f6
movq %rax, %rbx
andq $0x0, 0x20(%rax)
leaq 0x79(%rip), %rsi        # 0x6402
movl %ebp, %edi
movq %rax, %rdx
callq 0x7888
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x63ee
movl %ebp, %edi
callq 0x750c
movq %rax, (%rbx)
testq %rax, %rax
je 0x63e5
callq 0x7218
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x63dd
movq (%rbx), %rdi
leaq 0x113(%rip), %rsi       # 0x64d6
movq %rbx, %rdx
callq 0x8629
movq %rax, 0x10(%rbx)
testq %rax, %rax
jne 0x63f8
movq 0x18(%rbx), %rdi
callq 0x736b
movq (%rbx), %rdi
callq 0x781f
movq 0x8(%rbx), %rdi
callq 0x7bd4
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq