LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/kvlds/btree_mutate.c
// Function: btree_mutate_add
int
btree_mutate_add(struct node * N, struct kvpair_const * pos,
    const struct kvldskey * k, const struct kvldskey * v)
{
	size_t mlen;

	/* Update the all-keys-present-match-up-to value. */
	if (N->nkeys) {
		mlen = kvldskey_mlen(k, N->u.pairs[0].k);
		if (mlen < N->mlen_n)
			N->mlen_n = (uint8_t)mlen;
	} else {
		N->mlen_n = 0;
	}

	/* Record the pair. */
	pos->k = k;
	pos->v = v;

	/* Grow the hash table if necessary. */
	return (kvhash_postadd(N->v.H));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
cmpq $0x0, 0x38(%rdi)
je 0x73fa
movq 0x40(%r14), %rax
movq (%rax), %rsi
movq %r12, %rdi
callq 0xe34c
movzbl 0x1f(%r14), %ecx
cmpq %rcx, %rax
jae 0x73ff
movb %al, 0x1f(%r14)
jmp 0x73ff
movb $0x0, 0x1f(%r14)
movq %r12, (%r15)
movq %rbx, 0x8(%r15)
movq 0x48(%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xe4b7
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/kvlds/btree_node.c
// Function: btree_node_mknode
struct node *
btree_node_mknode(struct btree * T, unsigned int type, int height, size_t nkeys,
    const struct kvldskey ** keys, struct node ** children,
    struct kvpair_const * pairs)
{
	struct node * N;

	/* Sanity check. */
	assert((height <= INT8_MAX) && (height >= -1));

	/* Allocate node. */
	if ((N = node_alloc((uint64_t)(-1), (uint64_t)(-1), (uint32_t)(-1)))
	    == NULL)
		goto err0;

	/* Make the node present. */
	if (makepresent(T, N))
		goto err1;

	/* This is a DIRTY node of the indicated type and height. */
	N->state = NODE_STATE_DIRTY;
	N->type = type;
	N->height = (int8_t)height;

	/* Store node data. */
	N->nkeys = nkeys;
	if (type == NODE_TYPE_LEAF) {
		N->u.pairs = pairs;
		if ((N->nkeys > 0) && (pairs != NULL)) {
			N->mlen_n = (uint8_t)kvldskey_mlen(N->u.pairs[0].k,
			    N->u.pairs[N->nkeys - 1].k);
		} else {
			N->mlen_n = 255;
		}
	} else {
		N->u.keys = keys;
		N->v.children = children;
	}

	/* We don't know how far keys in this subtree match. */
	N->mlen_t = 0;

	/* Success! */
	return (N);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, (%rsp)
movl %edx, %r13d
leal 0x1(%r13), %eax
cmpl $0x81, %eax
jae 0x774f
movq %r8, %r12
movq %rcx, %r14
movl %esi, %ebp
movq %rdi, %r15
pushq $-0x1
popq %rdi
pushq $-0x1
popq %rdx
movq %rdi, %rsi
callq 0x934c
testq %rax, %rax
je 0x76d5
movq %rax, %rbx
movq %r15, %rdi
movq %rax, %rsi
callq 0x776e
testl %eax, %eax
je 0x76d9
movq %rbx, %rdi
callq 0x9388
xorl %ebx, %ebx
jmp 0x773d
movb 0x1c(%rbx), %al
andb $-0x10, %al
movl %ebp, %ecx
andb $0x3, %cl
orb %al, %cl
orb $0x8, %cl
movb %cl, 0x1c(%rbx)
movb %r13b, 0x1d(%rbx)
movq %r14, 0x38(%rbx)
cmpl $0x1, %ebp
jne 0x7727
movq 0x40(%rsp), %rax
movq %rax, 0x40(%rbx)
testq %r14, %r14
sete %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x7735
movq (%rax), %rdi
shlq $0x4, %r14
movq -0x10(%rax,%r14), %rsi
callq 0xe34c
movb %al, 0x1f(%rbx)
jmp 0x7739
movq %r12, 0x40(%rbx)
movq (%rsp), %rax
movq %rax, 0x48(%rbx)
jmp 0x7739
movb $-0x1, 0x1f(%rbx)
movb $0x0, 0x1e(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa8c4(%rip), %rdi      # 0x1201a
leaq 0xa8e4(%rip), %rsi      # 0x12041
leaq 0xa8ea(%rip), %rcx      # 0x1204e
movl $0x8e, %edx
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/kvlds/btree_node.c
// Function: makepresent
static int
makepresent(struct btree * T, struct node * N)
{
	void * evict;
	struct node * N_evict;

	/* Add the node to the pool. */
	if (pool_rec_add(T->P, N, &evict))
		goto err0;
	N_evict = evict;

	/* If a node was evicted, make it non-present. */
	if (N_evict != NULL) {
		/* Sanity-check: We can only evict clean nodes. */
		assert(N_evict->state == NODE_STATE_CLEAN);

		/* Delete the node's data and mark it as non-present. */
		freedata(T, N_evict);
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
movq %rsp, %rdx
callq 0xe6a6
testl %eax, %eax
je 0x7789
pushq $-0x1
popq %rbp
jmp 0x77a2
movq (%rsp), %rsi
xorl %ebp, %ebp
testq %rsi, %rsi
je 0x77a2
testb $0xc, 0x1c(%rsi)
jne 0x77ab
movq %rbx, %rdi
callq 0x7986
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0xaa02(%rip), %rdi      # 0x121b4
leaq 0xa888(%rip), %rsi      # 0x12041
leaq 0xaa17(%rip), %rcx      # 0x121d7
pushq $0x71
popq %rdx
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/kvlds/btree_node.c
// Function: btree_node_destroy
void
btree_node_destroy(struct btree * T, struct node * N)
{

	/* Sanity-check: We can't free a node we're fetching. */
	assert(N->type != NODE_TYPE_READ);

	/* Make the page non-present. */
	if (N->type != NODE_TYPE_NP) {
		/* Remove from the node pool. */
		pool_rec_free(T->P, N);
		N->pool_cookie = NULL;

		/* Free the node data. */
		freedata(T, N);
	}

	/* Free node. */
	node_free(N);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movzbl 0x1c(%rsi), %eax
andl $0x3, %eax
cmpl $0x2, %eax
je 0x7958
cmpl $0x3, %eax
je 0x7967
movq %rdi, %r14
movq 0x30(%rdi), %rdi
movq %rbx, %rsi
callq 0xe776
andq $0x0, 0x30(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7986
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x9388
leaq 0xa76b(%rip), %rdi      # 0x120d9
leaq 0xa6cc(%rip), %rsi      # 0x12041
leaq 0xa777(%rip), %rcx      # 0x120f3
movl $0x18b, %edx            # imm = 0x18B
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/kvlds/btree_node.c
// Function: freedata
static void
freedata(struct btree * T, struct node * N)
{
	size_t i;

	/* Sanity check. */
	assert(node_present(N));

	/* If the node has data, free it. */
	if (N->nkeys != (size_t)(-1)) {
		/* Leaf or parent? */
		if (N->type == NODE_TYPE_LEAF) {
			/* Free array of key-value pairs. */
			free(N->u.pairs);
		} else {
			/* Free array of keys. */
			free(N->u.keys);

			/* Free children and their array. */
			for (i = 0; i <= N->nkeys; i++)
				node_free(N->v.children[i]);
			free(N->v.children);
		}

		/* This node no longer has any data. */
		N->nkeys = (size_t)(-1);
	}

	/* If the node has a serialized buffer, free it. */
	if (N->pagebuf) {
		free(N->pagebuf);
		N->pagebuf = NULL;
	}

	/* We just removed a reason for keeping the parent(s) present. */
	btree_node_unlock(T, N->p_shadow);
	btree_node_unlock(T, N->p_dirty);

	/* This node now has indeterminate height. */
	N->height = -1;

	/* Mark the node as not present. */
	N->type = NODE_TYPE_NP;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movb 0x1c(%rsi), %bpl
testb $0x2, %bpl
jne 0x7a20
movq %rsi, %rbx
movq %rdi, %r14
cmpq $-0x1, 0x38(%rsi)
je 0x79dc
movq 0x40(%rbx), %rdi
callq 0x2040
testb $0x1, %bpl
jne 0x79d7
xorl %r15d, %r15d
movq 0x48(%rbx), %rdi
cmpq 0x38(%rbx), %r15
ja 0x79d2
movq (%rdi,%r15,8), %rdi
callq 0x9388
incq %r15
jmp 0x79ba
callq 0x2040
orq $-0x1, 0x38(%rbx)
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x79ef
callq 0x2040
andq $0x0, 0x50(%rbx)
movq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0x7dc2
movq 0x28(%rbx), %rsi
movq %r14, %rdi
callq 0x7dc2
movb $-0x1, 0x1d(%rbx)
movb 0x1c(%rbx), %al
andb $-0x4, %al
orb $0x2, %al
movb %al, 0x1c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa703(%rip), %rdi      # 0x1212a
leaq 0xa613(%rip), %rsi      # 0x12041
leaq 0xa8cb(%rip), %rcx      # 0x12300
pushq $0x3b
popq %rdx
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/kvlds/btree_node.c
// Function: btree_node_pageout_recursive
void
btree_node_pageout_recursive(struct btree * T, struct node * N)
{
	size_t i;

	/* If this node is not paged in, return immediately. */
	if ((N->type == NODE_TYPE_NP) || (N->type == NODE_TYPE_READ))
		return;

	/* Otherwise, pick up a lock in order to keep the node paged in. */
	btree_node_lock(T, N);

	/* Recurse down. */
	if (N->type == NODE_TYPE_PARENT) {
		for (i = 0; i <= N->nkeys; i++)
			btree_node_pageout_recursive(T, N->v.children[i]);
	}

	/* Evict this node from the pool. */
	pool_rec_free(T->P, N);
	N->pool_cookie = NULL;

	/* Free the node data. */
	freedata(T, N);
}

// Assembly:
testb $0x2, 0x1c(%rsi)
jne 0x7a7a
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x7a99
testb $0x3, 0x1c(%rbx)
je 0x7a7b
movq 0x30(%r14), %rdi
movq %rbx, %rsi
callq 0xe776
andq $0x0, 0x30(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x7986
retq
xorl %r15d, %r15d
cmpq 0x38(%rbx), %r15
ja 0x7a59
movq 0x48(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x7a3d
incq %r15
jmp 0x7a7e
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/kvlds/btree_node.c
// Function: btree_node_descend
int
btree_node_descend(struct btree * T, struct node * N,
    int (* callback)(void *, struct node *), void * cookie)
{
	struct descend * C;

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

	/* Fetch the node or schedule an immediate callback. */
	if (!node_present(N)) {
		if (btree_node_fetch(T, N, callback_descend, C))
			goto err1;
	} else {
		btree_node_lock(T, N);
		if (!events_immediate_register(callback_descend, C, 0))
			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
pushq %rax
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %r15
pushq $0x18
popq %rdi
callq 0x22a0
pushq $-0x1
popq %rbp
testq %rax, %rax
je 0x7e91
movq %rax, %rbx
movq %r13, (%rax)
movq %r12, 0x8(%rax)
movq %r14, 0x10(%rax)
testb $0x2, 0x1c(%r14)
jne 0x7e69
movq %r15, %rdi
movq %r14, %rsi
callq 0x7a99
leaq 0x4c(%rip), %rdi        # 0x7ea2
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %edx, %edx
callq 0x9f40
testq %rax, %rax
jne 0x7e91
jmp 0x7e82
leaq 0x32(%rip), %rdx        # 0x7ea2
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rcx
callq 0x77c8
testl %eax, %eax
je 0x7e8f
movq %rbx, %rdi
callq 0x2040
pushq $-0x1
popq %rbp
jmp 0x7e91
xorl %ebp, %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/kvlds/btree_node_split.c
// Function: btree_node_split_nparts
size_t
btree_node_split_nparts(struct btree * T, struct node * N)
{
	size_t breakat;

	/* We will split when we exceed 2/3 of a full node. */
	breakat = (T->pagelen * 2)/3;

	/* Handle leaves and parents separately. */
	if (N->type == NODE_TYPE_LEAF)
		return (nparts_leaf(N, breakat));
	else
		return (nparts_parent(N, breakat));
}

// Assembly:
pushq %rax
movq (%rdi), %rax
addq %rax, %rax
pushq $0x3
popq %rcx
xorl %edx, %edx
divq %rcx
movzbl 0x1c(%rsi), %ecx
andl $0x3, %ecx
je 0x80af
cmpl $0x1, %ecx
jne 0x80ef
movq 0x38(%rsi), %rdx
pushq $0xa
popq %r9
pushq $0x1
popq %rcx
pushq $0x8
popq %rdi
pushq $0xc
popq %r8
subq $0x1, %rdx
jb 0x80ea
leaq 0x2(%r9), %r10
xorl %r11d, %r11d
cmpq %rax, %r9
seta %r11b
cmovaq %r8, %r10
addq %r11, %rcx
movq 0x40(%rsi), %r9
movq -0x8(%r9,%rdi), %r11
movq (%r9,%rdi), %r9
movzbl (%r11), %r11d
addq %r10, %r11
movzbl (%r9), %r9d
addq %r11, %r9
addq $0x10, %rdi
jmp 0x8073
movq 0x38(%rsi), %rdx
pushq $0x1e
popq %rdi
pushq $0x1
popq %rcx
movq %rcx, %r8
movq %rdi, %r9
cmpq %rdx, %r8
ja 0x80ea
cmpq %rax, %r9
jbe 0x80d1
incq %rcx
movq %rdi, %r9
jmp 0x80e5
movq 0x40(%rsi), %r10
movq -0x8(%r10,%r8,8), %r10
movzbl (%r10), %r10d
addq %r10, %r9
addq $0x15, %r9
incq %r8
jmp 0x80bf
movq %rcx, %rax
popq %rcx
retq
leaq 0x9df5(%rip), %rdi      # 0x11eeb
leaq 0xa230(%rip), %rsi      # 0x1232d
leaq 0xa2a4(%rip), %rcx      # 0x123a8
pushq $0x38
popq %rdx
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/kvlds/btree_node_split.c
// Function: makeleaf
static struct node *
makeleaf(struct btree * T, size_t nkeys, struct kvpair_const * pairs)
{
	struct kvpair_const * new_pairs;
	struct node * N;

	/* Allocate new array of pairs and copy keys and values. */
	if (IMALLOC(new_pairs, nkeys, struct kvpair_const))
		goto err0;
	memcpy(new_pairs, pairs, nkeys * sizeof(struct kvpair_const));

	/* Construct a leaf node. */
	if ((N = btree_node_mkleaf(T, nkeys, new_pairs)) == NULL)
		goto err1;

	/* Success! */
	return (N);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0x8505
movq %rax, %rbx
testq %rax, %rax
sete %al
testq %r14, %r14
setne %cl
testb %al, %cl
jne 0x84f7
movq %r14, %rdx
shlq $0x4, %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2280
movq %rbx, (%rsp)
pushq $0x1
popq %rsi
movq %r15, %rdi
xorl %edx, %edx
movq %r14, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x767c
testq %rax, %rax
jne 0x84f9
movq %rbx, %rdi
callq 0x2040
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/kvlds/btree_node_split.c
// Function: makeparent
static struct node *
makeparent(struct btree * T, int height, size_t nkeys,
    const struct kvldskey ** keys, struct node ** children)
{
	const struct kvldskey ** new_keys;
	struct node ** new_children;
	struct node * N;

	/* Allocate new key array and copy pointers to keys. */
	if (IMALLOC(new_keys, nkeys, const struct kvldskey *))
		goto err0;
	memcpy(new_keys, keys, nkeys * sizeof(const struct kvldskey *));

	/* Allocate new child array and copy pointers to children. */
	if (IMALLOC(new_children, nkeys + 1, struct node *))
		goto err1;
	memcpy(new_children, children, (nkeys + 1) * sizeof(struct node *));

	/* Construct a parent node. */
	if ((N = btree_node_mkparent(T, height,
	    nkeys, new_keys, new_children)) == NULL)
		goto err2;

	/* Success! */
	return (N);

err2:
	free(new_children);
err1:
	free(new_keys);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r12
movq %rcx, %r14
movq %rdx, %rbp
movl %esi, %r15d
movq %rdi, %r13
pushq $0x8
popq %rsi
movq %rdx, %rdi
callq 0x8505
movq %rax, %rbx
testq %rax, %rax
sete %al
testq %rbp, %rbp
setne %cl
testb %al, %cl
jne 0x85f8
movq %r13, 0x10(%rsp)
movl %r15d, 0xc(%rsp)
leaq (,%rbp,8), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2280
movq %rbp, %r14
incq %r14
sete %r15b
notb %r15b
pushq $0x8
popq %rsi
movq %r14, %rdi
callq 0x8505
movq %rax, %r13
testq %rax, %rax
sete %al
testb %al, %r15b
jne 0x85f0
shlq $0x3, %r14
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x2280
andq $0x0, (%rsp)
movq 0x10(%rsp), %rdi
xorl %esi, %esi
movl 0xc(%rsp), %edx
movq %rbp, %rcx
movq %rbx, %r8
movq %r13, %r9
callq 0x767c
testq %rax, %rax
jne 0x85fa
movq %r13, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/kvlds/btree_node_split.c
// Function: destroy_parent_nokeys
static void
destroy_parent_nokeys(struct btree * T, struct node * N)
{

	/* Detach the keys from the node. */
	free(N->u.keys);

	/* Detach the children from the node. */
	free(N->v.children);

	/* This node has no data to free. */
	N->nkeys = (size_t)(-1);

	/* Free the node. */
	btree_node_destroy(T, N);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x40(%rsi), %rdi
callq 0x2040
movq 0x48(%rbx), %rdi
callq 0x2040
orq $-0x1, 0x38(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x7921
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/network/network_accept.c
// Function: network_accept
void *
network_accept(int fd, int (* callback)(void *, int), void * cookie)
{
	struct accept_cookie * C;

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

	/*
	 * Register a network event.  A connection arriving on a listening
	 * socket is treated by select(2) as the socket becoming readable.
	 */
	if (events_network_register(callback_accept, C, C->fd,
	    EVENTS_NETWORK_OP_READ))
		goto err1;

	/* Success! */
	return (C);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
pushq $0x18
popq %rdi
callq 0x22a0
testq %rax, %rax
je 0xb5ec
movq %rax, %rbx
movq %r15, (%rax)
movq %r14, 0x8(%rax)
movl %ebp, 0x10(%rax)
leaq 0x28(%rip), %rdi        # 0xb5fc
movq %rax, %rsi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0xa238
testl %eax, %eax
je 0xb5ee
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/network/network_accept.c
// Function: callback_accept
static int
callback_accept(void * cookie)
{
	struct accept_cookie * C = cookie;
	int s;
	int rc;

	/* Attempt to accept a new connection. */
	if ((s = accept(C->fd, NULL, NULL)) == -1) {
		/* If a connection isn't available, reset the callback. */
		if ((errno == EAGAIN) ||
#if EAGAIN != EWOULDBLOCK
		    (errno == EWOULDBLOCK) ||
#endif
		    (errno == ECONNABORTED) ||
		    (errno == EINTR))
			goto tryagain;
	}

	/* Call the upstream callback. */
	rc = (C->callback)(C->cookie, s);

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

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

tryagain:
	/* Reset the callback. */
	return (events_network_register(callback_accept, C, C->fd,
	    EVENTS_NETWORK_OP_READ));
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x10(%rdi), %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2350
movl %eax, %ebp
cmpl $-0x1, %eax
je 0xb630
movq 0x8(%rbx), %rdi
movl %ebp, %esi
callq *(%rbx)
movl %eax, %ebp
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
callq 0x20a0
movl (%rax), %eax
cmpl $0x4, %eax
je 0xb646
cmpl $0xb, %eax
je 0xb646
cmpl $0x67, %eax
jne 0xb615
movl 0x10(%rbx), %edx
leaq -0x54(%rip), %rdi       # 0xb5fc
movq %rbx, %rsi
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xa238
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/humansize.c
// Function: humansize
char *
humansize(uint64_t size)
{
	char * s;
	char prefix;
	int shiftcnt;
	int rc;

	/* Special-case for size < 1000. */
	if (size < 1000) {
		rc = asprintf(&s, "%d B", (int)size);
	} else {
		/* Keep 10 * size / 1000^(3n) in size. */
		for (size /= 100, shiftcnt = 1; size >= 10000; shiftcnt++)
			size /= 1000;

		/*
		 * Figure out what prefix to use.  Since 1 EB = 10^18 B and
		 * the maximum value of a uint64_t is 2^64 which is roughly
		 * 18.4 * 10^18, this cannot reference beyond the end of the
		 * string.
		 */
		prefix = " kMGTPE"[shiftcnt];

		/* Construct the string. */
		if (size < 100)
			rc = asprintf(&s, "%d.%d %cB", (int)size / 10,
			    (int)size % 10, prefix);
		else
			rc = asprintf(&s, "%d %cB", (int)size / 10, prefix);
	}

	if (rc == -1) {
		warnp("asprintf");
		goto err0;
	}

	/* Success! */
	return (s);

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rax
cmpq $0x3e7, %rdi            # imm = 0x3E7
ja 0xc8ed
leaq 0x68e9(%rip), %rsi      # 0x131c8
movq %rsp, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xbd44
jmp 0xc95d
pushq $0x64
popq %rcx
xorl %edx, %edx
divq %rcx
leaq 0x68d2(%rip), %rcx      # 0x131ce
movl $0x3e8, %esi            # imm = 0x3E8
cmpq $0x2710, %rax           # imm = 0x2710
jb 0xc913
xorl %edx, %edx
divq %rsi
incq %rcx
jmp 0xc901
movsbl (%rcx), %r8d
cmpq $0x63, %rax
ja 0xc93d
movzbl %al, %eax
movb $0xa, %cl
divb %cl
movzbl %ah, %ecx
movzbl %al, %edx
leaq 0x68a4(%rip), %rsi      # 0x131d5
movq %rsp, %rdi
xorl %eax, %eax
callq 0xbd44
jmp 0xc95d
movw $0xa, %cx
xorl %edx, %edx
divw %cx
movzwl %ax, %edx
leaq 0x6888(%rip), %rsi      # 0x131d8
movq %rsp, %rdi
movl %r8d, %ecx
xorl %eax, %eax
callq 0xbd44
cmpl $-0x1, %eax
je 0xc968
movq (%rsp), %rbx
jmp 0xc99b
callq 0x20a0
cmpl $0x0, (%rax)
je 0xc98b
movq %rax, %r14
leaq 0x4901(%rip), %rdi      # 0x1127d
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xdf55
andl $0x0, (%r14)
jmp 0xc99b
leaq 0x48eb(%rip), %rdi      # 0x1127d
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xe0e4
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/ipc_sync.c
// Function: ipc_sync_init
struct ipc_sync *
ipc_sync_init(void)
{
	struct ipc_sync * IS;

	/* Allocate the cookie. */
	if ((IS = malloc(sizeof(struct ipc_sync))) == NULL) {
		warnp("malloc");
		goto err0;
	}

	/* Set up synchronization. */
	if (pipe(IS->fd)) {
		warnp("pipe");
		goto err1;
	}

	/* Success! */
	return (IS);

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
pushq $0x8
popq %rdi
callq 0x22a0
testq %rax, %rax
je 0xcb75
movq %rax, %rbx
movq %rax, %rdi
callq 0x2200
testl %eax, %eax
je 0xcbc2
callq 0x20a0
cmpl $0x0, (%rax)
je 0xcb98
movq %rax, %r14
leaq 0x6690(%rip), %rdi      # 0x131f8
xorl %eax, %eax
callq 0xdf55
andl $0x0, (%r14)
jmp 0xcba6
callq 0x20a0
cmpl $0x0, (%rax)
je 0xcbb2
movq %rax, %r14
leaq 0x6656(%rip), %rdi      # 0x131df
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xdf55
andl $0x0, (%r14)
jmp 0xcbc2
leaq 0x6659(%rip), %rdi      # 0x131f8
xorl %eax, %eax
callq 0xe0e4
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
jmp 0xcbc2
leaq 0x6626(%rip), %rdi      # 0x131df
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xe0e4
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/ipc_sync.c
// Function: ipc_sync_wait
int
ipc_sync_wait(struct ipc_sync * IS)
{

	/* Ensure that we've closed the write end. */
	if (ipc_sync_prep(IS, W))
		return (-1);

	/* Read and discard a byte from the read end of the pipe. */
	return (readbyte(IS->fd[R]));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %rsi
callq 0xcc6e
testl %eax, %eax
je 0xcbf3
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl (%rbx), %ebx
leaq 0x7(%rsp), %r14
pushq $0x1
popq %r15
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2240
cmpq $-0x1, %rax
je 0xcc1e
testq %rax, %rax
je 0xcc45
cmpq $0x1, %rax
jne 0xcbfe
jmp 0xcc41
callq 0x20a0
movq %rax, %r12
movl (%rax), %eax
cmpl $0x4, %eax
je 0xcbfe
leaq 0x5ae7(%rip), %rdi      # 0x1271b
testl %eax, %eax
jne 0xcc5d
xorl %eax, %eax
callq 0xe0e4
jmp 0xcbe4
xorl %eax, %eax
jmp 0xcbe7
leaq 0x659a(%rip), %rdi      # 0x131e6
xorl %eax, %eax
callq 0xe0e4
callq 0x20a0
andl $0x0, (%rax)
jmp 0xcbe4
xorl %eax, %eax
callq 0xdf55
andl $0x0, (%r12)
jmp 0xcbe4
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/ipc_sync.c
// Function: ipc_sync_signal
int
ipc_sync_signal(struct ipc_sync * IS)
{

	/* Ensure that we've closed the read end. */
	if (ipc_sync_prep(IS, R))
		return (-1);

	/* Write a byte to the write end of the pipe. */
	return (writebyte(IS->fd[W]));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
xorl %ebx, %ebx
xorl %esi, %esi
callq 0xcc6e
testl %eax, %eax
je 0xccb8
pushq $-0x1
popq %rbx
jmp 0xccd2
movl 0x4(%r14), %edi
leaq 0x7(%rsp), %rsi
movb $0x0, (%rsi)
pushq $0x1
popq %rdx
callq 0xcfb0
cmpq $-0x1, %rax
je 0xccdc
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x20a0
cmpl $0x0, (%rax)
je 0xccfc
movq %rax, %rbx
leaq 0x650d(%rip), %rdi      # 0x131fd
xorl %eax, %eax
callq 0xdf55
andl $0x0, (%rbx)
jmp 0xccb3
leaq 0x64fa(%rip), %rdi      # 0x131fd
xorl %eax, %eax
callq 0xe0e4
jmp 0xccb3
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/ipc_sync.c
// Function: ipc_sync_done
int
ipc_sync_done(struct ipc_sync * IS)
{

	/* Close any open file descriptors. */
	if ((IS->fd[W] != -1) && ipc_sync_close(IS->fd[W]))
		goto err1;
	if ((IS->fd[R] != -1) && ipc_sync_close(IS->fd[R]))
		goto err2;

	/* Clean up. */
	free(IS);

	/* Success! */
	return (0);

err2:
	if (IS->fd[R] != -1)
		ipc_sync_close(IS->fd[R]);
err1:
	free(IS);

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x4(%rdi), %edi
pushq $-0x1
popq %r14
cmpl $-0x1, %edi
je 0xcd37
callq 0xcd67
testl %eax, %eax
jne 0xcd55
movl (%rbx), %edi
xorl %ebp, %ebp
cmpl $-0x1, %edi
je 0xcd58
callq 0xcd67
testl %eax, %eax
je 0xcd58
movl (%rbx), %edi
cmpl $-0x1, %edi
je 0xcd55
callq 0xcd67
movl %r14d, %ebp
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/ipc_sync.c
// Function: ipc_sync_close
static inline int
ipc_sync_close(int fd)
{

	/* Loop until closed. */
	while (close(fd)) {
		if (errno == EINTR)
			continue;
		warnp("close");
		goto err0;
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebp
movl %ebp, %edi
callq 0x21f0
testl %eax, %eax
je 0xcd9a
callq 0x20a0
movq %rax, %rbx
movl (%rax), %eax
cmpl $0x4, %eax
je 0xcd6c
leaq 0x61a5(%rip), %rdi      # 0x12f32
testl %eax, %eax
jne 0xcd9e
xorl %eax, %eax
callq 0xe0e4
jmp 0xcda8
xorl %eax, %eax
jmp 0xcdab
xorl %eax, %eax
callq 0xdf55
andl $0x0, (%rbx)
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/datastruct/kvhash.c
// Function: kvhash_init
struct kvhash *
kvhash_init(void)
{
	struct kvhash * H;

	/* Allocate a kvhash. */
	if ((H = malloc(sizeof(struct kvhash))) == NULL)
		goto err0;

	/* We start with 4 slots. */
	H->nslots = 4;
	if (IMALLOC(H->pairs, H->nslots, struct kvpair_const))
		goto err1;
	if (IMALLOC(H->hashes, H->nslots, uint32_t))
		goto err2;

	/* This table is empty. */
	H->nkeys = 0;
	memset(H->pairs, 0, H->nslots * sizeof(struct kvpair_const));

	/* Success! */
	return (H);

err2:
	free(H->pairs);
err1:
	free(H);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
pushq $0x20
popq %rdi
callq 0x22a0
testq %rax, %rax
je 0xe3dc
movq %rax, %rbx
movq $0x4, 0x18(%rax)
pushq $0x40
popq %rdi
callq 0x22a0
movq %rax, (%rbx)
testq %rax, %rax
je 0xe3d4
movq %rax, %r14
pushq $0x4
popq %rdi
movq %rdi, %rsi
callq 0xe3e9
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0xe3cc
andq $0x0, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x10(%r14)
movups %xmm0, (%r14)
jmp 0xe3de
movq %r14, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/datastruct/kvhash.c
// Function: kvhash_search
struct kvpair_const *
kvhash_search(struct kvhash * H, const struct kvldskey * k)
{
	size_t pos;
	uint32_t h;

	/* Compute the hash. */
	h = hash(k);

	/* Scan the table until we find an empty slot or the key. */
	pos = h & (H->nslots - 1);
	do {
		/* If this slot is empty, stop. */
		if (H->pairs[pos].k == NULL)
			break;

		/* If the hash and key match, stop. */
		if ((H->hashes[pos] == h) &&
		    (kvldskey_cmp(k, H->pairs[pos].k) == 0))
			break;

		/* Move on to the next slot. */
		pos = (pos + 1) & (H->nslots - 1);
	} while (1);

	/*
	 * Write the hash here.  If the key is already present, this has no
	 * effect; if the key is not present, this ensures that they hash is
	 * in place if/when the key is added.
	 */
	H->hashes[pos] = h;

	/* Return a pointer to the kvpair struct. */
	return (&H->pairs[pos]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xc(%rsp), %r15
movq %r15, %rdi
callq 0x103a8
leaq 0x1(%r14), %rsi
movzbl (%r14), %edx
movq %r15, %rdi
callq 0x105e1
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x106a9
movl (%r12), %ebp
movq 0x18(%rbx), %rcx
leal -0x1(%rcx), %r15d
andl %ebp, %r15d
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
movq %r15, %r12
shlq $0x4, %r12
movq (%rax,%r12), %rsi
testq %rsi, %rsi
je 0xe4a3
cmpl %ebp, (%rdx,%r15,4)
jne 0xe490
movq %r14, %rdi
callq 0xe315
testl %eax, %eax
je 0xe49c
movq 0x18(%rbx), %rcx
incq %r15
leaq -0x1(%rcx), %rax
andq %rax, %r15
jmp 0xe463
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
movl %ebp, (%rdx,%r15,4)
addq %r12, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/datastruct/kvhash.c
// Function: kvhash_postadd
int
kvhash_postadd(struct kvhash * H)
{

	/* We've added an entry to the hash table. */
	H->nkeys += 1;

	/* Rehash if the table is more than 3/4 full. */
	if (H->nkeys + H->nslots / 4 > H->nslots) {
		if (rehash(H))
			goto err0;
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x10(%rdi), %rax
movq 0x18(%rdi), %r13
leaq 0x1(%rax), %rcx
movq %rcx, 0x10(%rdi)
movq %r13, %rcx
shrq $0x2, %rcx
addq %rcx, %rax
incq %rax
xorl %ebp, %ebp
cmpq %r13, %rax
jbe 0xe5c3
testq %r13, %r13
jle 0xe5d4
movq %rdi, %rbx
leaq (,%r13,2), %r14
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0xe3e9
pushq $-0x1
popq %rbp
testq %rax, %rax
je 0xe5c3
movq %rax, %r15
pushq $0x4
popq %rsi
movq %r14, %rdi
callq 0xe3e9
testq %rax, %rax
je 0xe5bb
movq %rax, %r12
shlq $0x5, %r13
xorl %ebp, %ebp
movq %r15, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x21e0
movq (%rbx), %rdi
movq 0x18(%rbx), %rax
leaq -0x1(%r14), %rcx
cmpq %rax, %rbp
je 0xe59e
movq %rbp, %rdx
shlq $0x4, %rdx
movq (%rdi,%rdx), %rsi
testq %rsi, %rsi
je 0xe599
movq 0x8(%rbx), %r8
movl (%r8,%rbp,4), %r8d
movl %ecx, %r9d
andl %r8d, %r9d
movq %r9, %r10
shlq $0x4, %r10
cmpq $0x0, (%r15,%r10)
je 0xe586
incq %r9
andq %rcx, %r9
jmp 0xe570
addq %r15, %r10
movq %rsi, (%r10)
movq 0x8(%rdi,%rdx), %rdx
movq %rdx, 0x8(%r10)
movl %r8d, (%r12,%r9,4)
incq %rbp
jmp 0xe54d
callq 0x2040
movq 0x8(%rbx), %rdi
callq 0x2040
movq %r15, (%rbx)
movq %r12, 0x8(%rbx)
movq %r14, 0x18(%rbx)
xorl %ebp, %ebp
jmp 0xe5c3
movq %r15, %rdi
callq 0x2040
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x50a2(%rip), %rdi      # 0x1367d
leaq 0x50ca(%rip), %rsi      # 0x136ac
leaq 0x50de(%rip), %rcx      # 0x136c7
pushq $0x18
popq %rdx
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/datastruct/kvhash.c
// Function: kvhash_free
void
kvhash_free(struct kvhash * H)
{

	/* Be compatible with free(NULL). */
	if (H == NULL)
		return;

	/* Free the hash table. */
	free(H->hashes);
	free(H->pairs);
	free(H);
}

// Assembly:
testq %rdi, %rdi
je 0xe614
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x2040
movq (%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
popq %rbx
jmp 0x2040
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/datastruct/kvpair.c
// Function: kvpair_sort
void
kvpair_sort(struct kvpair * pairs, size_t npairs, size_t mlen)
{

	/* Sanity check. */
	assert(pairs != NULL);

	/* See above comments about cookie_mlen and non-threadsafety. */
	cookie_mlen = mlen;

	/* Do the sort. */
	qsort(pairs, npairs, sizeof(struct kvpair), compar);
}

// Assembly:
testq %rdi, %rdi
je 0xe644
movq %rdx, 0x352b3(%rip)     # 0x438e8
leaq 0x26(%rip), %rcx        # 0xe662
pushq $0x10
popq %rdx
jmp 0x20e0
pushq %rax
leaq 0x5097(%rip), %rdi      # 0x136e3
leaq 0x509e(%rip), %rsi      # 0x136f1
leaq 0x50b2(%rip), %rcx      # 0x1370c
pushq $0x32
popq %rdx
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/datastruct/pool.c
// Function: pool_rec_add
int
pool_rec_add(struct pool * P, void * rec, void ** evict)
{

	/* Create a pool_elem structure for this record. */
	if ((get_pool_elem(P, rec) =
	    malloc(sizeof(struct pool_elem))) == NULL)
		goto err0;
	get_pool_elem(P, rec)->wire_count = 1;

	/* Add the record to the pool. */
	P->used += 1;

	/* Evict a record if necessary and possible. */
	if ((P->used > P->size) && (P->evict_head != NULL)) {
		/* Grab the record at the head of the evict queue. */
		*evict = P->evict_head;

		/* Remove said record from the queue. */
		pool_delqueue(P, *evict);

		/* Remove the record from the pool. */
		free(get_pool_elem(P, *evict));
		P->used -= 1;
	} else {
		*evict = NULL;
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
pushq $0x18
popq %rdi
callq 0x22a0
movq 0x20(%rbx), %rcx
movq %rax, (%r15,%rcx)
testq %rax, %rax
je 0xe712
movq $0x1, (%rax)
movq 0x8(%rbx), %rax
incq %rax
movq %rax, 0x8(%rbx)
cmpq (%rbx), %rax
jbe 0xe70a
movq 0x10(%rbx), %rsi
testq %rsi, %rsi
je 0xe70a
movq %rsi, (%r14)
movq %rbx, %rdi
callq 0xe71b
movq (%r14), %rax
movq 0x20(%rbx), %rcx
movq (%rax,%rcx), %rdi
callq 0x2040
decq 0x8(%rbx)
jmp 0xe70e
andq $0x0, (%r14)
xorl %eax, %eax
jmp 0xe715
pushq $-0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/datastruct/pool.c
// Function: pool_delqueue
void
pool_delqueue(struct pool * P, void * rec)
{
	void * next = get_pool_elem(P, rec)->next;
	void * prev = get_pool_elem(P, rec)->prev;

	/* If this is the only record in the queue, it becomes empty. */
	if ((P->evict_head == rec) && (P->evict_tail == rec)) {
		P->evict_head = P->evict_tail = NULL;
	} else
	/* If this is the head, we have a new head. */
	    if (P->evict_head == rec) {
		P->evict_head = next;
		get_pool_elem(P, next)->prev = NULL;
	} else
	/* If this is the tail, we have a new tail. */
	    if (P->evict_tail == rec) {
		P->evict_tail = prev;
		get_pool_elem(P, prev)->next = NULL;
	} else
	/* This is in the middle; point prev and next to each other. */
	    {
		get_pool_elem(P, next)->prev = prev;
		get_pool_elem(P, prev)->next = next;
	}
}

// Assembly:
movq 0x20(%rdi), %rax
movq (%rsi,%rax), %rdx
movq 0x8(%rdx), %rcx
movq 0x18(%rdi), %r8
cmpq %rsi, 0x10(%rdi)
je 0xe74b
movq 0x10(%rdx), %rdx
cmpq %rsi, %r8
je 0xe761
movq (%rcx,%rax), %rsi
movq %rdx, 0x10(%rsi)
movq (%rdx,%rax), %rax
movq %rcx, 0x8(%rax)
retq
addq $0x10, %rdi
cmpq %rsi, %r8
je 0xe76f
movq %rcx, (%rdi)
movq (%rcx,%rax), %rax
andq $0x0, 0x10(%rax)
retq
movq %rdx, 0x18(%rdi)
movq (%rdx,%rax), %rax
andq $0x0, 0x8(%rax)
retq
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/datastruct/pool.c
// Function: pool_rec_free
void
pool_rec_free(struct pool * P, void * rec)
{

	/* Make sure that the lock count is 1. */
	assert(get_pool_elem(P, rec)->wire_count == 1);

	/* Remove the record from the pool. */
	free(get_pool_elem(P, rec));
	P->used -= 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rax
movq (%rsi,%rax), %rdi
cmpq $0x1, (%rdi)
jne 0xe793
callq 0x2040
decq 0x8(%rbx)
popq %rbx
retq
leaq 0x4fa4(%rip), %rdi      # 0x1373e
leaq 0x4fc4(%rip), %rsi      # 0x13765
leaq 0x4fd6(%rip), %rcx      # 0x1377e
pushq $0x5a
popq %rdx
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/datastruct/pool.c
// Function: pool_free
void
pool_free(struct pool * P)
{

	/* Be compatible with free(NULL). */
	if (P == NULL)
		return;

	/* Make sure the pool is empty. */
	assert(P->used == 0);

	/* Free the pool. */
	free(P);
}

// Assembly:
testq %rdi, %rdi
je 0xe7cd
cmpq $0x0, 0x8(%rdi)
jne 0xe7ce
jmp 0x2040
retq
pushq %rax
leaq 0x4fd2(%rip), %rdi      # 0x137a8
leaq 0x4f88(%rip), %rsi      # 0x13765
leaq 0x4fd1(%rip), %rcx      # 0x137b5
pushq $0x7a
popq %rdx
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_server.c
// Function: proto_kvlds_response_params
int
proto_kvlds_response_params(struct netbuf_write * Q, uint64_t ID,
    uint32_t kmax, uint32_t vmax)
{
	uint8_t * wbuf;

	/* Get a packet data buffer. */
	if ((wbuf = wire_writepacket_getbuf(Q, ID, 8)) == NULL)
		goto err0;

	/* Write the packet data. */
	be32enc(&wbuf[0], kmax);
	be32enc(&wbuf[4], vmax);

	/* Finish the packet. */
	if (wire_writepacket_done(Q, wbuf, 8))
		goto err0;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %ecx, %ebx
movl %edx, %ebp
movq %rdi, %r14
pushq $0x8
popq %rdx
callq 0x10218
testq %rax, %rax
je 0xecda
movl %ebp, %ecx
rolw $0x8, %cx
movw %cx, 0x2(%rax)
movl %ebp, %ecx
shrl $0x10, %ecx
movb %cl, 0x1(%rax)
shrl $0x18, %ebp
movb %bpl, (%rax)
movb %bl, 0x7(%rax)
movb %bh, 0x6(%rax)
movl %ebx, %ecx
shrl $0x10, %ecx
movb %cl, 0x5(%rax)
shrl $0x18, %ebx
movb %bl, 0x4(%rax)
pushq $0x8
popq %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x102e2
testl %eax, %eax
je 0xecdf
pushq $-0x1
popq %rax
jmp 0xece1
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_server.c
// Function: proto_kvlds_response_status
int
proto_kvlds_response_status(struct netbuf_write * Q, uint64_t ID,
    int status)
{
	uint8_t * wbuf;

	/* Sanity check. */
	assert((status == 0) || (status == 1));

	/* Get a packet data buffer. */
	if ((wbuf = wire_writepacket_getbuf(Q, ID, 4)) == NULL)
		goto err0;

	/* Write the packet data. */
	be32enc(&wbuf[0], (uint32_t)status);

	/* Finish the packet. */
	if (wire_writepacket_done(Q, wbuf, 4))
		goto err0;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
cmpl $0x2, %edx
jae 0xed2c
movl %edx, %ebp
movq %rdi, %rbx
pushq $0x4
popq %rdx
callq 0x10218
testq %rax, %rax
je 0xed1e
movb %bpl, 0x3(%rax)
movb $0x0, 0x2(%rax)
andw $0x0, (%rax)
pushq $0x4
popq %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x102e2
testl %eax, %eax
je 0xed23
pushq $-0x1
popq %rax
jmp 0xed25
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x4aa0(%rip), %rdi      # 0x137d3
leaq 0x4ab8(%rip), %rsi      # 0x137f2
leaq 0x4ad9(%rip), %rcx      # 0x1381a
movl $0xed, %edx
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_server.c
// Function: proto_kvlds_response_get
int
proto_kvlds_response_get(struct netbuf_write * Q, uint64_t ID,
    int status, const struct kvldskey * value)
{
	uint8_t * wbuf;
	size_t len;

	/* Sanity check. */
	assert((status == 0) || (status == 1));

	/* Compute the response length. */
	len = 4;
	if (status == 0)
		len += kvldskey_serial_size(value);

	/* Get a packet data buffer. */
	if ((wbuf = wire_writepacket_getbuf(Q, ID, len)) == NULL)
		goto err0;

	/* Write the packet data. */
	be32enc(&wbuf[0], (uint32_t)status);
	if (status == 0)
		kvldskey_serialize(value, &wbuf[4]);

	/* Finish the packet. */
	if (wire_writepacket_done(Q, wbuf, len))
		goto err0;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpl $0x2, %edx
jae 0xedcd
movq %rcx, %r14
movl %edx, %ebp
movq %rdi, %rbx
testl %edx, %edx
je 0xed6a
pushq $0x4
popq %r15
jmp 0xed72
movzbl (%r14), %r15d
addq $0x5, %r15
movq %rbx, %rdi
movq %r15, %rdx
callq 0x10218
testq %rax, %rax
je 0xedbd
movq %rax, %r12
andw $0x0, (%rax)
movb %bpl, 0x3(%rax)
movb $0x0, 0x2(%rax)
testl %ebp, %ebp
jne 0xedab
movq %r12, %rdi
addq $0x4, %rdi
movzbl (%r14), %edx
incq %rdx
movq %r14, %rsi
callq 0x2280
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x102e2
testl %eax, %eax
je 0xedc2
pushq $-0x1
popq %rax
jmp 0xedc4
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x49ff(%rip), %rdi      # 0x137d3
leaq 0x4a17(%rip), %rsi      # 0x137f2
leaq 0x4a7e(%rip), %rcx      # 0x13860
movl $0x110, %edx            # imm = 0x110
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_server.c
// Function: proto_kvlds_response_range
int
proto_kvlds_response_range(struct netbuf_write * Q, uint64_t ID,
    size_t nkeys, const struct kvldskey * next,
    struct kvldskey ** keys, struct kvldskey ** values)
{
	uint8_t * wbuf;
	size_t len;
	size_t i;
	size_t bufpos;

	/* Sanity check: We can't return more than 2^32-1 keys. */
	assert(nkeys <= UINT32_MAX);

	/* Figure out how long the packet will be. */
	len = 8;
	len += kvldskey_serial_size(next);
	for (i = 0; i < nkeys; i++) {
		len += kvldskey_serial_size(keys[i]);
		len += kvldskey_serial_size(values[i]);
	}

	/* Get a packet data buffer. */
	if ((wbuf = wire_writepacket_getbuf(Q, ID, len)) == NULL)
		goto err0;

	/* Write the packet data. */
	be32enc(&wbuf[0], 0);
	be32enc(&wbuf[4], (uint32_t)nkeys);
	bufpos = 8;
	kvldskey_serialize(next, &wbuf[bufpos]);
	bufpos += kvldskey_serial_size(next);
	for (i = 0; i < nkeys; i++) {
		kvldskey_serialize(keys[i], &wbuf[bufpos]);
		bufpos += kvldskey_serial_size(keys[i]);
		kvldskey_serialize(values[i], &wbuf[bufpos]);
		bufpos += kvldskey_serial_size(values[i]);
	}

	/* Finish the packet. */
	if (wire_writepacket_done(Q, wbuf, len))
		goto err0;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, 0x8(%rsp)
movq %rdx, %rax
shrq $0x20, %rax
jne 0xef29
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r13
movq %rdi, %r15
movzbl (%rcx), %r12d
addq $0x9, %r12
xorl %eax, %eax
cmpq %rax, 0x8(%rsp)
je 0xee46
movq (%r14,%rax,8), %rcx
movzbl (%rcx), %ecx
movq (%rbx,%rax,8), %rdx
movzbl (%rdx), %edx
addq %rcx, %r12
addq %rdx, %r12
addq $0x2, %r12
incq %rax
jmp 0xee22
movq %r15, %rdi
movq %r12, %rdx
callq 0x10218
testq %rax, %rax
je 0xef13
movq %rbx, 0x20(%rsp)
movq %r15, 0x18(%rsp)
andl $0x0, (%rax)
movq 0x8(%rsp), %rcx
movb %cl, 0x7(%rax)
movb %ch, 0x6(%rax)
movl %ecx, %edx
shrl $0x10, %edx
movb %dl, 0x5(%rax)
shrl $0x18, %ecx
movb %cl, 0x4(%rax)
movq %rax, 0x10(%rsp)
leaq 0x8(%rax), %rdi
movzbl (%r13), %edx
incq %rdx
movq %r13, %rsi
callq 0x2280
movzbl (%r13), %r15d
addq $0x9, %r15
xorl %r13d, %r13d
cmpq %r13, 0x8(%rsp)
je 0xeefd
movq 0x10(%rsp), %rbx
leaq (%rbx,%r15), %rdi
movq (%r14,%r13,8), %rsi
movzbl (%rsi), %edx
incq %rdx
callq 0x2280
movq (%r14,%r13,8), %rax
movzbl (%rax), %ebp
addq %r15, %rbp
leaq (%rbx,%rbp), %rdi
incq %rdi
movq 0x20(%rsp), %rbx
movq (%rbx,%r13,8), %rsi
movzbl (%rsi), %edx
incq %rdx
callq 0x2280
movq (%rbx,%r13,8), %rax
movzbl (%rax), %eax
leaq (%rax,%rbp), %r15
addq $0x2, %r15
incq %r13
jmp 0xeea5
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %r12, %rdx
callq 0x102e2
testl %eax, %eax
je 0xef18
pushq $-0x1
popq %rax
jmp 0xef1a
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x498c(%rip), %rdi      # 0x138bc
leaq 0x48bb(%rip), %rsi      # 0x137f2
leaq 0x4992(%rip), %rcx      # 0x138d0
movl $0x13d, %edx            # imm = 0x13D
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/proto_lbs/proto_lbs_client.c
// Function: proto_lbs_request_params
int
proto_lbs_request_params(struct wire_requestqueue * Q,
    int (* callback)(void *, int, size_t, uint64_t), void * cookie)
{
	struct params_cookie * C;
	uint8_t buf[4];

	/* Sanity check. */
	assert(callback != NULL);

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

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

	/* Send request. */
	if (wire_requestqueue_add(Q, buf, 4, callback_params, C))
		goto err1;

	/* Success! */
	return (0);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
testq %rsi, %rsi
je 0xf00e
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r15
pushq $0x10
popq %rdi
callq 0x22a0
pushq $-0x1
popq %rbx
testq %rax, %rax
je 0xeffe
movq %rax, %r14
movq %r13, (%rax)
movq %r12, 0x8(%rax)
leaq 0xc(%rsp), %rsi
andl $0x0, (%rsi)
leaq 0x4b(%rip), %rcx        # 0xf02b
pushq $0x4
popq %rdx
movq %r15, %rdi
movq %rax, %r8
callq 0x100e9
testl %eax, %eax
je 0xeffc
movq %r14, %rdi
callq 0x2040
jmp 0xeffe
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x499b(%rip), %rdi      # 0x139b0
leaq 0x49a5(%rip), %rsi      # 0x139c1
leaq 0x49c2(%rip), %rcx      # 0x139e5
pushq $0x41
popq %rdx
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/proto_lbs/proto_lbs_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 blklen = 0;
	uint64_t blkno = 0;
	int rc;

	/* If we have a packet, parse it. */
	if (buf != NULL) {
		/* Do we have the right packet length? */
		if (buflen != 12)
			BAD("PARAMS", "bogus length");

		/* Parse the packet. */
		blklen = be32dec(&buf[0]);
		blkno = be64dec(&buf[4]);

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

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

	/* 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 0xf064
cmpq $0xc, %rdx
jne 0xf069
movq %rsi, %r15
movq %rsi, %rdi
callq 0xf805
movl %eax, %r14d
addq $0x4, %r15
movq %r15, %rdi
callq 0xf80a
movq %rax, %rcx
xorl %ebp, %ebp
jmp 0xf092
xorl %r14d, %r14d
jmp 0xf090
leaq 0x4bd6(%rip), %rdi      # 0x13c46
leaq 0x4bec(%rip), %rsi      # 0x13c63
leaq 0x4bec(%rip), %rdx      # 0x13c6a
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xe0e4
callq 0x20a0
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_lbs/proto_lbs_client.c
// Function: proto_lbs_request_params2
int
proto_lbs_request_params2(struct wire_requestqueue * Q,
    int (* callback)(void *, int, size_t, uint64_t, uint64_t), void * cookie)
{
	struct params2_cookie * C;
	uint8_t buf[4];

	/* Sanity check. */
	assert(callback != NULL);

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

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

	/* Send request. */
	if (wire_requestqueue_add(Q, buf, 4, callback_params2, C))
		goto err1;

	/* Success! */
	return (0);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
testq %rsi, %rsi
je 0xf129
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r15
pushq $0x10
popq %rdi
callq 0x22a0
pushq $-0x1
popq %rbx
testq %rax, %rax
je 0xf119
movq %rax, %r14
movq %r13, (%rax)
movq %r12, 0x8(%rax)
leaq 0xc(%rsp), %rsi
movl $0x4000000, (%rsi)      # imm = 0x4000000
leaq 0x4d(%rip), %rcx        # 0xf148
pushq $0x4
popq %rdx
movq %r15, %rdi
movq %rax, %r8
callq 0x100e9
testl %eax, %eax
je 0xf117
movq %r14, %rdi
callq 0x2040
jmp 0xf119
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x4880(%rip), %rdi      # 0x139b0
leaq 0x488a(%rip), %rsi      # 0x139c1
leaq 0x4910(%rip), %rcx      # 0x13a4e
movl $0x8d, %edx
callq 0x21c0