LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0x87f6
movq 0x40(%r14), %rax
movq (%rax), %rsi
movq %r12, %rdi
callq 0x103ab
movzbl 0x1f(%r14), %ecx
cmpq %rcx, %rax
jae 0x87fb
movb %al, 0x1f(%r14)
jmp 0x87fb
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 0x104f6
// File: /workspace/github_c_makefile_star2_O1/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 0x8ba5
movq %r8, %r12
movq %rcx, %r14
movl %esi, %ebp
movq %rdi, %r15
movq $-0x1, %rdi
movq $-0x1, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0xac7c
testq %rax, %rax
je 0x8b2b
movq %rax, %rbx
movq %r15, %rdi
movq %rax, %rsi
callq 0x8bc4
testl %eax, %eax
je 0x8b2f
movq %rbx, %rdi
callq 0xace6
xorl %ebx, %ebx
jmp 0x8b93
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 0x8b7d
movq 0x40(%rsp), %rax
movq %rax, 0x40(%rbx)
testq %r14, %r14
sete %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x8b8b
movq (%rax), %rdi
shlq $0x4, %r14
movq -0x10(%rax,%r14), %rsi
callq 0x103ab
movb %al, 0x1f(%rbx)
jmp 0x8b8f
movq %r12, 0x40(%rbx)
movq (%rsp), %rax
movq %rax, 0x48(%rbx)
jmp 0x8b8f
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 0xc493(%rip), %rdi      # 0x1503f
leaq 0xc4b3(%rip), %rsi      # 0x15066
leaq 0xc4b9(%rip), %rcx      # 0x15073
movl $0x8e, %edx
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O1/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 0x10727
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x8bf8
movq (%rsp), %rsi
xorl %ebp, %ebp
testq %rsi, %rsi
je 0x8bf8
testb $0xc, 0x1c(%rsi)
jne 0x8c01
movq %rbx, %rdi
callq 0x8e51
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0xc5d1(%rip), %rdi      # 0x151d9
leaq 0xc457(%rip), %rsi      # 0x15066
leaq 0xc5e6(%rip), %rcx      # 0x151fc
movl $0x71, %edx
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O1/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 0x8e23
cmpl $0x3, %eax
je 0x8e32
movq %rdi, %r14
movq 0x30(%rdi), %rdi
movq %rbx, %rsi
callq 0x1080b
movq $0x0, 0x30(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8e51
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xace6
leaq 0xc2c5(%rip), %rdi      # 0x150fe
leaq 0xc226(%rip), %rsi      # 0x15066
leaq 0xc2d1(%rip), %rcx      # 0x15118
movl $0x18b, %edx            # imm = 0x18B
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O1/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 0x8f4e
movq %rsi, %rbx
movq %rdi, %r14
cmpq $-0x1, 0x38(%rsi)
je 0x8eac
movq 0x40(%rbx), %rdi
callq 0x2040
testb $0x1, %bpl
jne 0x8ea4
xorl %r15d, %r15d
movq 0x48(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0xace6
incq %r15
cmpq 0x38(%rbx), %r15
jbe 0x8e85
movq 0x48(%rbx), %rdi
callq 0x2040
movq $-0x1, 0x38(%rbx)
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x8ec2
callq 0x2040
movq $0x0, 0x50(%rbx)
movq 0x20(%rbx), %rsi
testq %rsi, %rsi
je 0x8eec
movq 0x30(%r14), %rdi
movq 0x20(%rdi), %rax
movq (%rsi,%rax), %rax
movq (%rax), %rcx
testq %rcx, %rcx
je 0x8f2f
decq %rcx
movq %rcx, (%rax)
jne 0x8eec
callq 0x10885
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
je 0x8f16
movq 0x30(%r14), %rdi
movq 0x20(%rdi), %rax
movq (%rsi,%rax), %rax
movq (%rax), %rcx
testq %rcx, %rcx
je 0x8f2f
decq %rcx
movq %rcx, (%rax)
jne 0x8f16
callq 0x10885
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 0xb74a(%rip), %rdi      # 0x14680
leaq 0xb769(%rip), %rsi      # 0x146a6
leaq 0xb77b(%rip), %rcx      # 0x146bf
movl $0x88, %edx
callq 0x21c0
leaq 0xc1fa(%rip), %rdi      # 0x1514f
leaq 0xc10a(%rip), %rsi      # 0x15066
leaq 0xc3c2(%rip), %rcx      # 0x15325
movl $0x3b, %edx
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O1/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 0x8fec
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x8fa6
movq 0x30(%r14), %rdi
movq 0x20(%rdi), %rax
movq (%rbx,%rax), %rax
movq (%rax), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rax)
testq %rcx, %rcx
jne 0x8fa6
movq %rbx, %rsi
callq 0x107a3
testb $0x3, 0x1c(%rbx)
jne 0x8fc8
xorl %r15d, %r15d
movq 0x48(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x8f6d
incq %r15
cmpq 0x38(%rbx), %r15
jbe 0x8faf
movq 0x30(%r14), %rdi
movq %rbx, %rsi
callq 0x1080b
movq $0x0, 0x30(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x8e51
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x18, %edi
callq 0x22a0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x947e
movq %rax, %rbx
movq %r13, (%rax)
movq %r12, 0x8(%rax)
movq %r14, 0x10(%rax)
testb $0x2, 0x1c(%r14)
jne 0x9453
testq %r14, %r14
je 0x9439
movq 0x30(%r15), %rdi
movq 0x20(%rdi), %rax
movq (%r14,%rax), %rax
movq (%rax), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rax)
testq %rcx, %rcx
jne 0x9439
movq %r14, %rsi
callq 0x107a3
leaq 0x4f(%rip), %rdi        # 0x948f
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %edx, %edx
callq 0xba4c
testq %rax, %rax
jne 0x947e
jmp 0x9471
leaq 0x35(%rip), %rdx        # 0x948f
xorl %ebp, %ebp
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x8c25
testl %eax, %eax
je 0x947e
movq %rbx, %rdi
callq 0x2040
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
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_O1/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
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
shrq %rdx
movzbl 0x1c(%rsi), %eax
andl $0x3, %eax
je 0x97b3
cmpl $0x1, %eax
jne 0x9810
movq 0x38(%rsi), %rcx
testq %rcx, %rcx
je 0x9809
movq 0x40(%rsi), %rsi
addq $0x8, %rsi
movl $0x1, %eax
movl $0xa, %r8d
movl $0xc, %edi
leaq 0x2(%r8), %r9
xorl %r10d, %r10d
cmpq %rdx, %r8
seta %r10b
cmovaq %rdi, %r9
addq %r10, %rax
movq -0x8(%rsi), %r8
movq (%rsi), %r10
movzbl (%r8), %r11d
addq %r9, %r11
movzbl (%r10), %r8d
addq %r11, %r8
addq $0x10, %rsi
decq %rcx
jne 0x977e
jmp 0x980e
movq 0x38(%rsi), %rax
testq %rax, %rax
je 0x9809
incq %rax
cmpq $0x3, %rax
movl $0x2, %ecx
cmovaeq %rax, %rcx
decq %rcx
movl $0x1, %eax
movl $0x1e, %r8d
xorl %edi, %edi
cmpq %rdx, %r8
jbe 0x97ec
incq %rax
movl $0x1e, %r8d
jmp 0x97ff
movq 0x40(%rsi), %r9
movq (%r9,%rdi,8), %r9
movzbl (%r9), %r9d
addq %r9, %r8
addq $0x15, %r8
incq %rdi
cmpq %rdi, %rcx
jne 0x97dc
jmp 0x980e
movl $0x1, %eax
popq %rcx
retq
leaq 0xb6e4(%rip), %rdi      # 0x14efb
leaq 0xbb34(%rip), %rsi      # 0x15352
leaq 0xbba8(%rip), %rcx      # 0x153cd
movl $0x38, %edx
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O1/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, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x9c24
movq %rbx, %rax
shrq $0x3c, %rax
je 0x9c29
callq 0x20a0
movl $0xc, (%rax)
xorl %r15d, %r15d
jmp 0x9c38
movq %rbx, %rdi
shlq $0x4, %rdi
callq 0x22a0
movq %rax, %r15
testq %r15, %r15
sete %al
testq %rbx, %rbx
setne %cl
testb %al, %cl
jne 0x9c83
movq %rbx, %rdx
shlq $0x4, %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2280
movq %r15, (%rsp)
movq %r14, %rdi
movl $0x1, %esi
xorl %edx, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x8ac8
testq %rax, %rax
jne 0x9c85
movq %r15, %rdi
callq 0x2040
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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, %r13
movq %rdx, %rbp
movl %esi, %ebx
movq %rdi, %r14
testq %rdx, %rdx
je 0x9cc6
movq %rbp, %rax
shrq $0x3d, %rax
je 0x9ccb
callq 0x20a0
movl $0xc, (%rax)
xorl %r15d, %r15d
jmp 0x9cdb
leaq (,%rbp,8), %rdi
callq 0x22a0
movq %rax, %r15
testq %r15, %r15
sete %al
testq %rbp, %rbp
setne %cl
testb %al, %cl
jne 0x9d8d
movl %ebx, 0x14(%rsp)
leaq (,%rbp,8), %rdx
movq %r15, %rdi
movq %r13, %rsi
callq 0x2280
movq %rbp, %rbx
incq %rbx
je 0x9d22
movq %rbx, %rax
shrq $0x3d, %rax
je 0x9d27
callq 0x20a0
movl $0xc, (%rax)
xorl %r13d, %r13d
jmp 0x9d37
leaq (,%rbx,8), %rdi
callq 0x22a0
movq %rax, %r13
testq %rbx, %rbx
setne %al
testq %r13, %r13
sete %cl
testb %cl, %al
jne 0x9d85
shlq $0x3, %rbx
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x2280
movq $0x0, (%rsp)
movq %r14, %rdi
xorl %esi, %esi
movl 0x14(%rsp), %edx
movq %rbp, %rcx
movq %r15, %r8
movq %r13, %r9
callq 0x8ac8
testq %rax, %rax
jne 0x9d8f
movq %r13, %rdi
callq 0x2040
movq %r15, %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_O1/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
movq $-0x1, 0x38(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8de9
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/kvlds/node.c
// Function: node_alloc
struct node *
node_alloc(uint64_t pagenum, uint64_t oldestleaf, uint32_t pagesize)
{
	struct node * N;

	/* Allocate node. */
	if ((N = malloc(sizeof(struct node))) == NULL)
		goto err0;
	memset(N, 0, sizeof(struct node));

	/* Initialize values. */
	N->pagenum = pagenum;
	N->oldestleaf = oldestleaf;
	N->oldestncleaf = oldestleaf;
	N->pagesize = pagesize;
	N->type = NODE_TYPE_NP;
	N->state = NODE_STATE_CLEAN;
	N->needmerge = 1;
	N->height = -1;
	N->nkeys = (size_t)(-1);
	N->pagebuf = NULL;

	/* Success! */
	return (N);

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl $0x58, %edi
callq 0x22a0
testq %rax, %rax
je 0xacde
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x20(%rax)
movq $0x0, 0x50(%rax)
movq %r15, (%rax)
movq %r14, 0x8(%rax)
movq %r14, 0x10(%rax)
movl %ebx, 0x18(%rax)
movb 0x1c(%rax), %cl
andb $-0x50, %cl
orb $0x42, %cl
movb %cl, 0x1c(%rax)
movb $-0x1, 0x1d(%rax)
movq $-0x1, 0x38(%rax)
jmp 0xace0
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x18, %edi
callq 0x22a0
testq %rax, %rax
je 0xd302
movq %rax, %rbx
movq %r15, (%rax)
movq %r14, 0x8(%rax)
movl %ebp, 0x10(%rax)
leaq 0x28(%rip), %rdi        # 0xd312
movq %rax, %rsi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0xbe34
testl %eax, %eax
je 0xd304
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_O1/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 0xd346
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 0xd35c
cmpl $0xb, %eax
je 0xd35c
cmpl $0x67, %eax
jne 0xd32b
movl 0x10(%rbx), %edx
leaq -0x54(%rip), %rdi       # 0xd312
movq %rbx, %rsi
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xbe34
// File: /workspace/github_c_makefile_star2_O1/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, %rcx
cmpq $0x3e7, %rdi            # imm = 0x3E7
ja 0xe6dc
leaq 0x7af5(%rip), %rsi      # 0x161c0
movq %rsp, %rdi
movl %ecx, %edx
xorl %eax, %eax
callq 0xddcc
jmp 0xe784
movq %rcx, %rax
shrq $0x2, %rax
movabsq $0x28f5c28f5c28f5c3, %rdx # imm = 0x28F5C28F5C28F5C3
mulq %rdx
movq %rdx, %rsi
shrq $0x2, %rsi
movl $0x1, %edi
cmpq $0xf4240, %rcx          # imm = 0xF4240
jb 0xe731
movabsq $0x20c49ba5e353f7cf, %r8 # imm = 0x20C49BA5E353F7CF
movq %rsi, %rax
shrq $0x3, %rax
mulq %r8
movq %rdx, %rcx
shrq $0x4, %rcx
incq %rdi
cmpq $0x98967f, %rsi         # imm = 0x98967F
movq %rcx, %rsi
ja 0xe70f
jmp 0xe734
movq %rsi, %rcx
leaq 0x7a8a(%rip), %rax      # 0x161c5
movsbl (%rdi,%rax), %r8d
movl %ecx, %eax
movl $0xcccccccd, %edx       # imm = 0xCCCCCCCD
imulq %rax, %rdx
shrq $0x23, %rdx
cmpq $0x63, %rcx
ja 0xe770
leal (%rdx,%rdx), %eax
leal (%rax,%rax,4), %eax
subl %eax, %ecx
leaq 0x7a69(%rip), %rsi      # 0x161cd
movq %rsp, %rdi
xorl %eax, %eax
callq 0xddcc
jmp 0xe784
leaq 0x7a59(%rip), %rsi      # 0x161d0
movq %rsp, %rdi
movl %r8d, %ecx
xorl %eax, %eax
callq 0xddcc
cmpl $-0x1, %eax
je 0xe78f
movq (%rsp), %rbx
jmp 0xe7c5
callq 0x20a0
cmpl $0x0, (%rax)
je 0xe7b5
movq %rax, %r14
leaq 0x5ada(%rip), %rdi      # 0x1427d
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x10048
movl $0x0, (%r14)
jmp 0xe7c5
leaq 0x5ac1(%rip), %rdi      # 0x1427d
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x10167
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x8, %edi
callq 0x22a0
testq %rax, %rax
je 0xe97e
movq %rax, %rbx
movq %rax, %rdi
callq 0x2200
testl %eax, %eax
je 0xe9ce
callq 0x20a0
cmpl $0x0, (%rax)
je 0xe9a4
movq %rax, %r14
leaq 0x7882(%rip), %rdi      # 0x161f0
xorl %eax, %eax
callq 0x10048
movl $0x0, (%r14)
jmp 0xe9b2
callq 0x20a0
cmpl $0x0, (%rax)
je 0xe9be
movq %rax, %r14
leaq 0x7845(%rip), %rdi      # 0x161d7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x10048
movl $0x0, (%r14)
jmp 0xe9ce
leaq 0x7845(%rip), %rdi      # 0x161f0
xorl %eax, %eax
callq 0x10167
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
jmp 0xe9ce
leaq 0x7812(%rip), %rdi      # 0x161d7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x10167
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %esi
callq 0xea91
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0xea86
movl (%rbx), %ebx
xorl %ebp, %ebp
leaq 0x7(%rsp), %r14
movl $0x1, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x2240
cmpq $-0x1, %rax
je 0xea2c
cmpq $0x1, %rax
je 0xea27
testq %rax, %rax
jne 0xea3b
jmp 0xea58
movb $0x1, %bpl
jmp 0xea3b
callq 0x20a0
movq %rax, %r15
movl (%rax), %eax
cmpl $0x4, %eax
jne 0xea44
testb %bpl, %bpl
je 0xea05
xorl %eax, %eax
jmp 0xea86
leaq 0x6cf5(%rip), %rdi      # 0x15740
testl %eax, %eax
jne 0xea73
xorl %eax, %eax
callq 0x10167
jmp 0xea81
leaq 0x777f(%rip), %rdi      # 0x161de
xorl %eax, %eax
callq 0x10167
callq 0x20a0
movl $0x0, (%rax)
jmp 0xea81
xorl %eax, %eax
callq 0x10048
movl $0x0, (%r15)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/util/ipc_sync.c
// Function: ipc_sync_prep
static int
ipc_sync_prep(struct ipc_sync * IS, int num)
{

	/* Bail if there's nothing to do. */
	if (IS->fd[num] == -1)
		return (0);

	/*
	 * Close the indicated end of pipe so that if the other process dies,
	 * we will notice the pipe being reset.
	 */
	if (ipc_sync_close(IS->fd[num]))
		goto err0;
	IS->fd[num] = -1;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r12d
movl (%rdi,%r12,4), %r14d
xorl %eax, %eax
cmpl $-0x1, %r14d
je 0xeafd
movq %rdi, %rbx
movl %r14d, %edi
callq 0x21f0
testl %eax, %eax
je 0xeaf3
movl %eax, %ebp
callq 0x20a0
movq %rax, %r15
movl (%rax), %eax
cmpl $0x4, %eax
je 0xeaab
leaq 0x745b(%rip), %rdi      # 0x15f2a
testl %eax, %eax
jne 0xeadc
xorl %eax, %eax
callq 0x10167
jmp 0xeaea
xorl %eax, %eax
callq 0x10048
movl $0x0, (%r15)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ebp, %ebp
jne 0xeafd
movl $0xffffffff, (%rbx,%r12,4) # imm = 0xFFFFFFFF
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %ebp, %ebp
xorl %esi, %esi
callq 0xea91
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0xeb73
movl 0x4(%rbx), %edi
leaq 0x7(%rsp), %rsi
movb $0x0, (%rsi)
movl $0x1, %edx
callq 0xeee0
cmpq $-0x1, %rax
jne 0xeb71
callq 0x20a0
cmpl $0x0, (%rax)
je 0xeb5e
movq %rax, %rbx
leaq 0x76a6(%rip), %rdi      # 0x161f5
xorl %eax, %eax
callq 0x10048
movl $0x0, (%rbx)
jmp 0xeb6c
leaq 0x7690(%rip), %rdi      # 0x161f5
xorl %eax, %eax
callq 0x10167
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x4(%rdi), %ebp
cmpl $-0x1, %ebp
je 0xebeb
movl %ebp, %edi
callq 0x21f0
testl %eax, %eax
je 0xebeb
movl %eax, %r14d
callq 0x20a0
movq %rax, %r15
movl (%rax), %eax
cmpl $0x4, %eax
je 0xeb9e
leaq 0x7368(%rip), %rdi      # 0x15f2a
testl %eax, %eax
jne 0xebcf
xorl %eax, %eax
callq 0x10167
jmp 0xebdd
xorl %eax, %eax
callq 0x10048
movl $0x0, (%r15)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %r14d, %r14d
jne 0xec8f
movl (%rbx), %r15d
xorl %ebp, %ebp
cmpl $-0x1, %r15d
je 0xec8f
movl %r15d, %edi
callq 0x21f0
testl %eax, %eax
je 0xec8f
movl %eax, %r14d
callq 0x20a0
movq %rax, %r12
movl (%rax), %eax
cmpl $0x4, %eax
je 0xebfa
leaq 0x7307(%rip), %rdi      # 0x15f2a
testl %eax, %eax
jne 0xec30
xorl %eax, %eax
callq 0x10167
jmp 0xec3f
xorl %eax, %eax
callq 0x10048
movl $0x0, (%r12)
testl %r14d, %r14d
je 0xec8f
movl (%rbx), %r14d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $-0x1, %r14d
je 0xec8f
movl %r14d, %edi
callq 0x21f0
testl %eax, %eax
je 0xec8f
callq 0x20a0
movq %rax, %r15
movl (%rax), %eax
cmpl $0x4, %eax
je 0xec52
leaq 0x72b6(%rip), %rdi      # 0x15f2a
testl %eax, %eax
jne 0xec81
xorl %eax, %eax
callq 0x10167
jmp 0xec8f
xorl %eax, %eax
callq 0x10048
movl $0x0, (%r15)
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x20, %edi
callq 0x22a0
testq %rax, %rax
je 0x10442
movq %rax, %rbx
movq $0x4, 0x18(%rax)
movl $0x40, %edi
callq 0x22a0
movq %rax, (%rbx)
testq %rax, %rax
je 0x1043a
movq %rax, %r14
movl $0x10, %edi
callq 0x22a0
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x10432
movq $0x0, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x10(%r14)
movups %xmm0, (%r14)
jmp 0x10444
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_O1/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 0x12774
leaq 0x1(%r14), %rsi
movzbl (%r14), %edx
movq %r15, %rdi
callq 0x12a24
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x12b0c
movl (%r12), %ebp
movl 0x18(%rbx), %r15d
decl %r15d
andl %ebp, %r15d
movq (%rbx), %rax
movq %r15, %rcx
shlq $0x4, %rcx
movq (%rax,%rcx), %rsi
testq %rsi, %rsi
je 0x104d7
movq 0x8(%rbx), %rax
cmpl %ebp, (%rax,%r15,4)
jne 0x104c5
movq %r14, %rdi
callq 0x10342
testl %eax, %eax
je 0x104d7
incq %r15
movq (%rbx), %rax
movq 0x18(%rbx), %rcx
decq %rcx
andq %rcx, %r15
jmp 0x1049f
movq 0x8(%rbx), %rax
movl %ebp, (%rax,%r15,4)
shlq $0x4, %r15
addq (%rbx), %r15
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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), %r12
leaq 0x1(%rax), %rcx
movq %rcx, 0x10(%rdi)
movq %r12, %rcx
shrq $0x2, %rcx
addq %rcx, %rax
incq %rax
xorl %ebp, %ebp
cmpq %r12, %rax
jbe 0x10636
testq %r12, %r12
jle 0x10647
movq %rdi, %rbx
movq %r12, %rax
shrq $0x3b, %rax
je 0x1054e
callq 0x20a0
movl $0xc, (%rax)
xorl %r14d, %r14d
jmp 0x1055d
movq %r12, %rdi
shlq $0x5, %rdi
callq 0x22a0
movq %rax, %r14
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %r14, %r14
je 0x10636
movq %r12, %rax
shrq $0x3d, %rax
je 0x10584
callq 0x20a0
movl $0xc, (%rax)
xorl %r15d, %r15d
jmp 0x10594
leaq (,%r12,8), %rdi
callq 0x22a0
movq %rax, %r15
testq %r15, %r15
je 0x1062e
leaq (%r12,%r12), %r13
movq %r12, %rdx
shlq $0x5, %rdx
xorl %ebp, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x21e0
movq (%rbx), %rdi
leaq -0x1(%r13), %rax
cmpq $0x1, %r12
adcq $0x0, %r12
movq %rbp, %rcx
shlq $0x4, %rcx
movq (%rdi,%rcx), %rdx
testq %rdx, %rdx
je 0x10609
movq 0x8(%rbx), %rsi
movl (%rsi,%rbp,4), %esi
movl %eax, %r8d
andl %esi, %r8d
movq %r8, %r9
shlq $0x4, %r9
cmpq $0x0, (%r14,%r9)
je 0x105f6
incq %r8
andq %rax, %r8
jmp 0x105e0
addq %r14, %r9
movq %rdx, (%r9)
movq 0x8(%rdi,%rcx), %rcx
movq %rcx, 0x8(%r9)
movl %esi, (%r15,%r8,4)
incq %rbp
cmpq %r12, %rbp
jne 0x105c3
callq 0x2040
movq 0x8(%rbx), %rdi
callq 0x2040
movq %r14, (%rbx)
movq %r15, 0x8(%rbx)
movq %r13, 0x18(%rbx)
xorl %ebp, %ebp
jmp 0x10636
movq %r14, %rdi
callq 0x2040
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x606c(%rip), %rdi      # 0x166ba
leaq 0x6094(%rip), %rsi      # 0x166e9
leaq 0x60a8(%rip), %rcx      # 0x16704
movl $0x18, %edx
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O1/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 0x10689
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x2040
movq (%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
popq %rbx
jmp 0x2040
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x106ba
movq %rdx, 0x3523f(%rip)     # 0x458e8
leaq 0x2a(%rip), %rcx        # 0x106da
movl $0x10, %edx
jmp 0x20e0
pushq %rax
leaq 0x605e(%rip), %rdi      # 0x16720
leaq 0x6065(%rip), %rsi      # 0x1672e
leaq 0x6079(%rip), %rcx      # 0x16749
movl $0x32, %edx
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x18, %edi
callq 0x22a0
movq 0x20(%rbx), %rcx
movq %rax, (%r15,%rcx)
testq %rax, %rax
je 0x10798
movq $0x1, (%rax)
movq 0x8(%rbx), %rax
incq %rax
movq %rax, 0x8(%rbx)
cmpq (%rbx), %rax
jbe 0x1078d
movq 0x10(%rbx), %rsi
testq %rsi, %rsi
je 0x1078d
movq %rsi, (%r14)
movq %rbx, %rdi
callq 0x107a3
movq (%r14), %rax
movq 0x20(%rbx), %rcx
movq (%rax,%rcx), %rdi
callq 0x2040
decq 0x8(%rbx)
jmp 0x10794
movq $0x0, (%r14)
xorl %eax, %eax
jmp 0x1079d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x10(%rdi), %r8
movq 0x20(%rdi), %rax
movq (%rsi,%rax), %rdx
movq 0x8(%rdx), %rcx
movq 0x10(%rdx), %rdx
cmpq %rsi, %r8
je 0x107d3
cmpq %rsi, 0x18(%rdi)
je 0x107f2
movq (%rcx,%rax), %rsi
movq %rdx, 0x10(%rsi)
movq (%rdx,%rax), %rax
movq %rcx, 0x8(%rax)
retq
leaq 0x10(%rdi), %r9
cmpq %rsi, 0x18(%rdi)
je 0x10803
cmpq %rsi, %r8
jne 0x107bc
movq %rcx, (%r9)
movq (%rcx,%rax), %rax
movq $0x0, 0x10(%rax)
retq
movq %rdx, 0x18(%rdi)
movq (%rdx,%rax), %rax
movq $0x0, 0x8(%rax)
retq
xorps %xmm0, %xmm0
movups %xmm0, (%r9)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x10828
callq 0x2040
decq 0x8(%rbx)
popq %rbx
retq
leaq 0x5f4c(%rip), %rdi      # 0x1677b
leaq 0x5f6c(%rip), %rsi      # 0x167a2
leaq 0x5f7e(%rip), %rcx      # 0x167bb
movl $0x5a, %edx
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x8, %edx
callq 0x125e0
testq %rax, %rax
je 0x10d2c
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)
movl $0x8, %edx
movq %r14, %rdi
movq %rax, %rsi
callq 0x126ae
testl %eax, %eax
je 0x10d33
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x10d35
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x10d87
movl %edx, %ebp
movq %rdi, %rbx
movl $0x4, %edx
callq 0x125e0
testq %rax, %rax
je 0x10d77
movb %bpl, 0x3(%rax)
movb $0x0, 0x2(%rax)
movw $0x0, (%rax)
movl $0x4, %edx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x126ae
testl %eax, %eax
je 0x10d7e
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x10d80
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x5a82(%rip), %rdi      # 0x16810
leaq 0x5a9a(%rip), %rsi      # 0x1682f
leaq 0x5abb(%rip), %rcx      # 0x16857
movl $0xed, %edx
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O1/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 0x10e2b
movq %rcx, %r14
movl %edx, %ebp
movq %rdi, %rbx
movl $0x4, %r15d
testl %edx, %edx
jne 0x10dcd
movzbl (%r14), %r15d
addq $0x5, %r15
movq %rbx, %rdi
movq %r15, %rdx
callq 0x125e0
testq %rax, %rax
je 0x10e19
movq %rax, %r12
movb %bpl, 0x3(%rax)
movb $0x0, 0x2(%rax)
movw $0x0, (%rax)
testl %ebp, %ebp
jne 0x10e07
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 0x126ae
testl %eax, %eax
je 0x10e20
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x10e22
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x59de(%rip), %rdi      # 0x16810
leaq 0x59f6(%rip), %rsi      # 0x1682f
leaq 0x5a5d(%rip), %rcx      # 0x1689d
movl $0x110, %edx            # imm = 0x110
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O1/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 0x11087
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r15
movl $0x10, %edi
callq 0x22a0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x11077
movq %rax, %r14
movq %r13, (%rax)
movq %r12, 0x8(%rax)
leaq 0xc(%rsp), %rsi
movl $0x0, (%rsi)
leaq 0x4f(%rip), %rcx        # 0x110a6
movl $0x4, %edx
movq %r15, %rdi
movq %rax, %r8
callq 0x124a9
testl %eax, %eax
je 0x11075
movq %r14, %rdi
callq 0x2040
jmp 0x11077
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x595f(%rip), %rdi      # 0x169ed
leaq 0x5969(%rip), %rsi      # 0x169fe
leaq 0x5986(%rip), %rcx      # 0x16a22
movl $0x41, %edx
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
movq %rdi, %rbx
movl $0x1, %ebp
testq %rsi, %rsi
je 0x110ce
cmpq $0xc, %rdx
jne 0x110d3
movl (%rsi), %r14d
bswapl %r14d
movq 0x4(%rsi), %rcx
bswapq %rcx
xorl %ebp, %ebp
jmp 0x110ff
xorl %r14d, %r14d
jmp 0x110fd
leaq 0x5ba9(%rip), %rdi      # 0x16c83
leaq 0x5bbf(%rip), %rsi      # 0x16ca0
leaq 0x5bbf(%rip), %rdx      # 0x16ca7
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x10167
callq 0x20a0
movl $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
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x11196
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r15
movl $0x10, %edi
callq 0x22a0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x11186
movq %rax, %r14
movq %r13, (%rax)
movq %r12, 0x8(%rax)
leaq 0xc(%rsp), %rsi
movl $0x4000000, (%rsi)      # imm = 0x4000000
leaq 0x4f(%rip), %rcx        # 0x111b5
movl $0x4, %edx
movq %r15, %rdi
movq %rax, %r8
callq 0x124a9
testl %eax, %eax
je 0x11184
movq %r14, %rdi
callq 0x2040
jmp 0x11186
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x5850(%rip), %rdi      # 0x169ed
leaq 0x585a(%rip), %rsi      # 0x169fe
leaq 0x58e0(%rip), %rcx      # 0x16a8b
movl $0x8d, %edx
callq 0x21c0