LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/lucvoo[P]sparse-dev/example.c
// Function: copy_reg
static struct hardreg *copy_reg(struct bb_state *state, struct hardreg *src, pseudo_t target)
{
	int i;
	struct hardreg *reg;

	/* If the container has been killed off, just re-use it */
	if (!src->contains)
		return src;

	/* If "src" only has one user, and the contents are dead, we can re-use it */
	if (src->busy == 1 && src->dead == 1)
		return src;

	reg = preferred_reg(state, target);
	if (reg && !reg->contains) {
		output_comment(state, "copying %s to preferred target %s", show_pseudo(target), reg->name);
		move_reg(state, src, reg);
		return reg;
	}

	for (i = 0; i < REGNO; i++) {
		reg = hardregs + i;
		if (!reg->contains) {
			output_comment(state, "copying %s to %s", show_pseudo(target), reg->name);
			output_insn(state, "movl %s,%s", src->name, reg->name);
			return reg;
		}
	}

	flush_reg(state, src);
	return src;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
cmpq $0x0, 0x8(%rsi)
je 0x12318
movl $0xffffff, %eax         # imm = 0xFFFFFF
andl 0x10(%rbx), %eax
cmpl $0x10001, %eax          # imm = 0x10001
je 0x12318
movq %rdx, %r12
movq %rdi, %r15
movq %rdx, %rsi
callq 0x11847
testq %rax, %rax
je 0x122ee
movq %rax, %r14
cmpq $0x0, 0x8(%rax)
je 0x1236c
xorl %r13d, %r13d
leaq 0x55eb8(%rip), %rbp     # 0x681b0
cmpq $0x0, 0x8(%r13,%rbp)
je 0x1232d
addq $0x18, %r13
cmpq $0x90, %r13
jne 0x122f8
movq %r15, %rdi
movq %rbx, %rsi
callq 0x11883
movq %rbx, %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0x18180
movq %rbp, %r14
addq %r13, %r14
movq (%r13,%rbp), %rcx
leaq 0x3424d(%rip), %rsi     # 0x46594
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x110fe
movq (%rbx), %rdx
movq (%r13,%rbp), %rcx
leaq 0x33fd2(%rip), %rsi     # 0x46335
leaq 0x3423b(%rip), %r8      # 0x465a5
jmp 0x1239f
movq %r12, %rdi
callq 0x18180
movq (%r14), %rcx
leaq 0x341f4(%rip), %rsi     # 0x46572
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x110fe
movq (%rbx), %rdx
movq (%r14), %rcx
leaq 0x33f9d(%rip), %rsi     # 0x46335
leaq 0x3420f(%rip), %r8      # 0x465ae
xorl %eax, %eax
callq 0x11334
jmp 0x1231b
// File: /workspace/github_c_makefile_star2_O1/lucvoo[P]sparse-dev/example.c
// Function: generic
static const char *generic(struct bb_state *state, pseudo_t pseudo)
{
	struct hardreg *reg;
	struct operand *op = get_generic_operand(state, pseudo);
	static char buf[100];
	const char *str;

	switch (op->type) {
	case OP_ADDR:
		if (!op->offset && op->base && !op->sym)
			return op->base->name;
		if (op->sym && !op->base) {
			int len = sprintf(buf, "$ %s", show_op(state, op));
			if (op->offset)
				sprintf(buf + len, " + %d", op->offset);
			return buf;
		}
		str = show_op(state, op);
		put_operand(state, op);
		reg = target_reg(state, pseudo, NULL);
		output_insn(state, "lea %s,%s", show_op(state, op), reg->name);
		return reg->name;		

	default:
		str = show_op(state, op);
	}
	put_operand(state, op);
	return str;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
callq 0x11ea9
movq %rax, %rbx
cmpl $0x4, (%rax)
jne 0x12429
movl 0x8(%rbx), %ebp
testl %ebp, %ebp
je 0x1244a
cmpq $0x0, 0x10(%rbx)
je 0x123de
cmpq $0x0, 0x18(%rbx)
je 0x12467
movq %rbx, %rdi
callq 0x11cfb
movq %rbx, %rdi
callq 0x11e7a
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x11595
movq %rax, %r14
movq %rbx, %rdi
callq 0x11cfb
movq (%r14), %rcx
leaq 0x341d6(%rip), %rsi     # 0x465e6
leaq 0x341df(%rip), %r8      # 0x465f6
movq %rax, %rdx
xorl %eax, %eax
callq 0x11334
movq (%r14), %rbx
movq %rbx, %rax
jmp 0x1243f
movq %rbx, %rdi
callq 0x11cfb
movq %rax, %r14
movq %rbx, %rdi
callq 0x11e7a
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x123cc
cmpq $0x0, 0x10(%rbx)
jne 0x123cc
movq (%rax), %rbx
jmp 0x12424
movq %rbx, %rdi
callq 0x11cfb
leaq 0x5bd5a(%rip), %rbx     # 0x6e1d0
leaq 0x3415e(%rip), %rsi     # 0x465db
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xf2e0
testl %ebp, %ebp
je 0x12424
movslq %eax, %rdi
leaq 0x5bd38(%rip), %rbx     # 0x6e1d0
addq %rbx, %rdi
leaq 0x3413e(%rip), %rsi     # 0x465e0
movl %ebp, %edx
xorl %eax, %eax
callq 0xf2e0
jmp 0x12424
// File: /workspace/github_c_makefile_star2_O1/lucvoo[P]sparse-dev/example.c
// Function: write_val_to_storage
static void write_val_to_storage(struct bb_state *state, pseudo_t src, struct storage *storage)
{
	struct hardreg *out;

	switch (storage->type) {
	case REG_UDEF:
		alloc_stack(state, storage);
	default:
		output_insn(state, "movl %s,%s", show_pseudo(src), show_memop(storage));
		break;
	case REG_REG:
		out = hardregs + storage->regno;
		output_insn(state, "movl %s,%s", show_pseudo(src), out->name);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %rdi
movl (%rdx), %eax
cmpl $0x1, %eax
je 0x12b75
testl %eax, %eax
jne 0x12b4f
movl $0x2, (%rbx)
movl 0x5aa81(%rip), %eax     # 0x6d5c4
leal 0x4(%rax), %ecx
movl %ecx, 0x5aa78(%rip)     # 0x6d5c4
movl %eax, 0x10(%rbx)
callq 0x18180
movq %rax, %r14
movq %rbx, %rdi
callq 0x11b19
leaq 0x337cf(%rip), %rsi     # 0x46335
leaq 0x33ba1(%rip), %r8      # 0x4670e
movq %r14, %rdx
movq %rax, %rcx
jmp 0x12b9e
movslq 0x10(%rbx), %rax
leaq (%rax,%rax,2), %rbx
leaq 0x5562c(%rip), %r14     # 0x681b0
callq 0x18180
movq (%r14,%rbx,8), %rcx
leaq 0x337a1(%rip), %rsi     # 0x46335
leaq 0x33b73(%rip), %r8      # 0x4670e
movq %rax, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x11334
// File: /workspace/github_c_makefile_star2_O1/lucvoo[P]sparse-dev/storage.c
// Function: gather_storage
struct storage_hash_list *gather_storage(struct basic_block *bb, enum inout_enum inout)
{
	int i;
	struct storage_hash *entry, *prev;
	struct storage_hash_list *list = NULL;

	for (i = 0; i < MAX_STORAGE_HASH; i++) {
		struct storage_hash *hash;
		FOR_EACH_PTR(storage_hash_table[i], hash) {
			if (hash->bb == bb && hash->inout == inout)
				add_ptr_list(&list, hash);
		} END_FOR_EACH_PTR(hash);
	}
	sort_hash_list(&list);

	prev = NULL;
	FOR_EACH_PTR(list, entry) {
		if (prev && entry->pseudo == prev->pseudo) {
			assert(entry == prev);
			DELETE_CURRENT_PTR(entry);
		}
		prev = entry;
	} END_FOR_EACH_PTR(entry);
	PACK_PTR_LIST(&list);
	return list;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x8(%rsp), %r15
movq $0x0, (%r15)
xorl %eax, %eax
movq %rax, 0x10(%rsp)
leaq 0x42f81(%rip), %rcx     # 0x74400
movq (%rcx,%rax,8), %r13
testq %r13, %r13
je 0x314d4
movq %r13, %rbp
movzwl (%rbp), %eax
testb %al, %al
jle 0x314cb
xorl %r12d, %r12d
movq 0x18(%rbp,%r12,8), %rsi
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x314aa
testq %rsi, %rsi
je 0x314bc
cmpq %r14, (%rsi)
jne 0x314bc
cmpl %ebx, 0x10(%rsi)
jne 0x314bc
movq %r15, %rdi
callq 0x2871f
incq %r12
movl (%rbp), %eax
movsbq %al, %rcx
cmpq %rcx, %r12
jl 0x31496
movq 0x10(%rbp), %rbp
cmpq %r13, %rbp
jne 0x3148b
movq 0x10(%rsp), %rax
incq %rax
cmpq $0x40, %rax
jne 0x31473
leaq 0x772(%rip), %rsi       # 0x31c5b
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x30248
movq (%rbx), %rax
testq %rax, %rax
je 0x315b3
xorl %r10d, %r10d
movl $0xf0f0f0f0, %ecx       # imm = 0xF0F0F0F0
movq %rax, %rdx
movzwl (%rdx), %ebx
movsbl %bl, %r11d
testw %r11w, %r11w
jle 0x315a0
leaq 0x18(%rdx), %rsi
leaq 0x10(%rdx), %rdi
xorl %r8d, %r8d
movslq %r8d, %r14
movq (%rsi,%r14,8), %r9
movzwl %bx, %ebx
cmpl $0x100, %ebx            # imm = 0x100
jb 0x31545
testq %r9, %r9
jne 0x31545
movq %r10, %r9
jmp 0x3158a
testq %r10, %r10
je 0x3158a
movq 0x8(%r9), %rbx
cmpq 0x8(%r10), %rbx
jne 0x3158a
cmpq %r10, %r9
jne 0x315d2
leaq (%rsi,%r14,8), %r10
movswq %r11w, %r11
leaq (%rdi,%r11,8), %r11
cmpq %r11, %r10
jae 0x3157f
leaq 0x8(%r10), %rbx
movq 0x8(%r10), %r14
movq %r14, (%r10)
movq %rbx, %r10
cmpq %r11, %rbx
jb 0x3156a
jmp 0x31582
movq %r10, %rbx
movq %rcx, (%rbx)
decb (%rdx)
decl %r8d
incl %r8d
movl (%rdx), %ebx
movsbl %bl, %r11d
movsbl %bl, %ebp
movq %r9, %r10
cmpl %ebp, %r8d
jl 0x31529
jmp 0x315a3
movq %r10, %r9
movq 0x10(%rdx), %rdx
movq %r9, %r10
cmpq %rax, %rdx
jne 0x3150d
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x285f5
movq (%rbx), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1ca13(%rip), %rdi     # 0x4dfec
leaq 0x1ca1a(%rip), %rsi     # 0x4dffa
leaq 0x1ca1d(%rip), %rcx     # 0x4e004
movl $0x3f, %edx
callq 0xf120
// File: /workspace/github_c_makefile_star2_O1/lucvoo[P]sparse-dev/storage.c
// Function: lookup_storage
struct storage *lookup_storage(struct basic_block *bb, pseudo_t pseudo, enum inout_enum inout)
{
	struct storage_hash_list *list = storage_hash_table[storage_hash(bb,pseudo,inout)];
	struct storage_hash *hash;

	FOR_EACH_PTR(list, hash) {
		if (hash->bb == bb && hash->pseudo == pseudo && hash->inout == inout)
			return hash->storage;
	} END_FOR_EACH_PTR(hash);
	return NULL;
}

// Assembly:
leal (%rsi,%rdi), %eax
addl %edx, %eax
movl %eax, %ecx
shrl $0x6, %ecx
addl %eax, %ecx
andl $0x3f, %ecx
leaq 0x42df9(%rip), %rax     # 0x74400
movq (%rax,%rcx,8), %rax
testq %rax, %rax
je 0x31665
movq %rax, %rcx
movzwl (%rcx), %r9d
movsbl %r9b, %r8d
testw %r8w, %r8w
jle 0x31658
movzwl %r8w, %r8d
movzwl %r9w, %r9d
xorl %r10d, %r10d
movq 0x18(%rcx,%r10,8), %r11
cmpl $0x100, %r9d            # imm = 0x100
jb 0x3163f
testq %r11, %r11
je 0x31650
cmpq %rdi, (%r11)
jne 0x31650
cmpq %rsi, 0x8(%r11)
jne 0x31650
cmpl %edx, 0x10(%r11)
je 0x3166c
incq %r10
cmpq %r10, %r8
jne 0x3162c
movq 0x10(%rcx), %rcx
cmpq %rax, %rcx
jne 0x31613
xorl %ecx, %ecx
jmp 0x3166a
movl $0x2, %ecx
jmp 0x31675
movq 0x18(%r11), %rax
movl $0x1, %ecx
testb $0x1, %cl
jne 0x3167c
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/lucvoo[P]sparse-dev/storage.c
// Function: add_storage
void add_storage(struct storage *storage, struct basic_block *bb, pseudo_t pseudo, enum inout_enum inout)
{
	struct storage_hash_list **listp = storage_hash_table + storage_hash(bb,pseudo,inout);
	struct storage_hash *hash = alloc_storage_hash(storage);

	hash->bb = bb;
	hash->pseudo = pseudo;
	hash->inout = inout;

	add_ptr_list(listp, hash);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leal (%rdx,%rsi), %eax
addl %ecx, %eax
movl %eax, %ecx
shrl $0x6, %ecx
addl %eax, %ecx
andl $0x3f, %ecx
leaq 0x42d57(%rip), %rax     # 0x74400
leaq (%rax,%rcx,8), %r13
leaq 0x3a7fc(%rip), %rdi     # 0x6beb0
movl $0x28, %esi
callq 0x368c8
movq %rax, %rbp
leaq 0x18(%rax), %rsi
movq %r12, 0x18(%rax)
addq $0x8, %r12
movq %r12, %rdi
callq 0x2871f
movq %r15, (%rbp)
movq %r14, 0x8(%rbp)
movl %ebx, 0x10(%rbp)
movq %r13, %rdi
movq %rbp, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2871f
// File: /workspace/github_c_makefile_star2_O1/lucvoo[P]sparse-dev/storage.c
// Function: free_storage
void free_storage(void)
{
	int i;

	for (i = 0; i < MAX_STORAGE_HASH; i++) {
		vrfy_storage(storage_hash_table + i);
		free_ptr_list(storage_hash_table + i);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
xorl %ecx, %ecx
leaq 0x42cf0(%rip), %rax     # 0x74400
movq %rcx, 0x10(%rsp)
leaq (%rax,%rcx,8), %rbx
movq %rbx, %rdi
leaq 0x556(%rip), %rsi       # 0x31c79
callq 0x30248
movq %rbx, 0x8(%rsp)
movq (%rbx), %rsi
testq %rsi, %rsi
je 0x31828
movq %rsi, %r15
xorl %ebx, %ebx
movq %rsi, 0x18(%rsp)
movzwl (%r15), %eax
testb %al, %al
jle 0x31815
xorl %ebp, %ebp
movq 0x18(%r15,%rbp,8), %r14
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x3176d
testq %r14, %r14
jne 0x3176d
movq %rbx, %r14
jmp 0x317fd
testq %rbx, %rbx
je 0x317fd
movq 0x18(%rbx), %rdi
movq 0x18(%r14), %rax
cmpq %rax, %rdi
je 0x31765
movq (%rbx), %r12
cmpq (%r14), %r12
jne 0x317fd
movl 0x10(%rbx), %ecx
cmpl 0x10(%r14), %ecx
jne 0x317fd
movl (%rdi), %edx
testl %edx, %edx
je 0x317fd
cmpl (%rax), %edx
jne 0x317fd
movl 0x10(%rdi), %edx
cmpl 0x10(%rax), %edx
jne 0x317fd
testl %ecx, %ecx
leaq 0x14f58(%rip), %r13     # 0x46707
leaq 0x1d7dd(%rip), %rax     # 0x4ef93
cmoveq %rax, %r13
callq 0x31853
movq %rax, 0x20(%rsp)
movq 0x8(%rbx), %rdi
callq 0x18180
movq %rax, %rbx
movq 0x8(%r14), %rdi
callq 0x18180
leaq 0x1c8b7(%rip), %rdi     # 0x4e097
movq %r13, %rsi
movq %r12, %rdx
movq 0x20(%rsp), %rcx
movq %rbx, %r8
movq %rax, %r9
xorl %eax, %eax
callq 0xf0f0
movq 0x18(%rsp), %rsi
incq %rbp
movl (%r15), %eax
movsbq %al, %rcx
movq %r14, %rbx
cmpq %rcx, %rbp
jl 0x31751
jmp 0x31818
movq %rbx, %r14
movq 0x10(%r15), %r15
movq %r14, %rbx
cmpq %rsi, %r15
jne 0x31743
movq 0x8(%rsp), %rdi
callq 0x28bb7
movq 0x10(%rsp), %rcx
incq %rcx
cmpq $0x40, %rcx
jne 0x31709
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lucvoo[P]sparse-dev/storage.c
// Function: show_storage
const char *show_storage(struct storage *s)
{
	static char buffer[1024];
	if (!s)
		return "none";
	switch (s->type) {
	case REG_REG:
		sprintf(buffer, "reg%d (%d)", s->regno, s->name);
		break;
	case REG_STACK:
		sprintf(buffer, "%d(SP) (%d)", s->offset, s->name);
		break;
	case REG_ARG:
		sprintf(buffer, "ARG%d (%d)", s->regno, s->name);
		break;
	default:
		sprintf(buffer, "%d:%d (%d)", s->type, s->regno, s->name);
		break;
	}
	return buffer;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x31881
movl (%rdi), %edx
movl 0x4(%rdi), %r8d
movl 0x10(%rdi), %ecx
leaq 0x42d97(%rip), %rbx     # 0x74600
cmpl $0x5, %edx
je 0x31893
cmpl $0x2, %edx
je 0x3188a
cmpl $0x1, %edx
jne 0x318ab
leaq 0x1c7d5(%rip), %rsi     # 0x4e054
jmp 0x3189a
leaq 0x1b94e(%rip), %rbx     # 0x4d1d6
jmp 0x318bc
leaq 0x1c7ce(%rip), %rsi     # 0x4e05f
jmp 0x3189a
leaq 0x1c7d1(%rip), %rsi     # 0x4e06b
movq %rbx, %rdi
movl %ecx, %edx
movl %r8d, %ecx
xorl %eax, %eax
callq 0xf2e0
jmp 0x318bc
leaq 0x1c7c4(%rip), %rsi     # 0x4e076
movq %rbx, %rdi
xorl %eax, %eax
callq 0xf2e0
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/lucvoo[P]sparse-dev/storage.c
// Function: storage_hash_cmp
static int storage_hash_cmp(const void *_a, const void *_b)
{
	const struct storage_hash *a = _a;
	const struct storage_hash *b = _b;
	struct storage *aa = a->storage;
	struct storage *bb = b->storage;

	if (a->bb != b->bb)
		return a->bb < b->bb ? -1 : 1;
	if (a->inout != b->inout)
		return a->inout < b->inout ? -1 : 1;
	if (aa->type != bb->type)
		return aa->type < bb->type ? -1 : 1;
	if (aa->regno != bb->regno)
		return aa->regno < bb->regno ? -1 : 1;
	return 0;
}

// Assembly:
movq (%rdi), %rcx
movq (%rsi), %rdx
cmpq %rdx, %rcx
je 0x31c8b
xorl %eax, %eax
cmpq %rdx, %rcx
jmp 0x31cc7
movl 0x10(%rdi), %ecx
movl 0x10(%rsi), %edx
cmpl %edx, %ecx
jne 0x31cbd
movq 0x18(%rdi), %rcx
movq 0x18(%rsi), %rax
movl (%rcx), %edx
movl (%rax), %esi
cmpl %esi, %edx
jne 0x31cc3
movl 0x10(%rax), %edx
xorl %eax, %eax
cmpl %edx, 0x10(%rcx)
je 0x31cbc
setge %al
movzbl %al, %eax
leal -0x1(,%rax,2), %eax
retq
xorl %eax, %eax
cmpl %edx, %ecx
jmp 0x31cc7
xorl %eax, %eax
cmpl %esi, %edx
sbbl %eax, %eax
orl $0x1, %eax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs/dispatch.c
// Function: workdone
static int
workdone(void * cookie, ssize_t lenread)
{
	struct dispatch_state * D = cookie;

	/* If we failed to read a thread ID, something is seriously wrong. */
	if (lenread != sizeof(size_t)) {
		warnp("workdone failed to read thread ID");
		goto err0;
	}

	/* Sanity-check the thread ID. */
	assert(D->wakeupID <= D->nreaders + 2);

	/* Send a response for whatever work was finished. */
	if (dispatch_response_send(D, D->workers[D->wakeupID]))
		goto err0;

	/* Mark the thread as available for more work. */
	if (D->wakeupID == D->nreaders + 1) {
		D->deleter_busy = 0;
	} else if (D->wakeupID == D->nreaders) {
		D->writer_busy = 0;
	} else {
		D->readers_idle[D->nreaders_idle++] = D->wakeupID;
	}

	/*
	 * If this was a read thread, check if there is pending work which
	 * should now be scheduled for this thread.
	 */
	if ((D-> wakeupID < D->nreaders) && dispatch_request_pokereadq(D))
		goto err0;

	/* Read the ID of another thread with completed work. */
	if ((D->wakeup_cookie = network_read(D->spair[0],
	    (uint8_t *)&D->wakeupID, sizeof(size_t), sizeof(size_t),
	    workdone, D)) == NULL) {
		warnp("Error reading thread ID from socket");
		goto err0;
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
cmpq $0x8, %rsi
jne 0x3a4f
movq %rdi, %rbx
movq 0x8(%rdi), %rcx
movq 0x40(%rdi), %rax
addq $0x2, %rcx
cmpq %rcx, %rax
ja 0x3b16
movq (%rbx), %rcx
movq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x443c
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x3a85
movq 0x8(%rbx), %rcx
movq 0x40(%rbx), %rax
leaq 0x1(%rcx), %rdx
cmpq %rdx, %rax
jne 0x3a8e
movl $0x0, 0x14(%rbx)
jmp 0x3ab0
callq 0x20a0
cmpl $0x0, (%rax)
je 0x3a72
movq %rax, %rbx
leaq 0x9a66(%rip), %rdi      # 0xd4c9
xorl %eax, %eax
callq 0xac18
movl $0x0, (%rbx)
jmp 0x3a80
leaq 0x9a50(%rip), %rdi      # 0xd4c9
xorl %eax, %eax
callq 0xad37
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
cmpq %rcx, %rax
jne 0x3a9c
movl $0x0, 0x10(%rbx)
jmp 0x3ab0
movq 0x18(%rbx), %rcx
movq 0x20(%rbx), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, 0x18(%rbx)
movq %rax, (%rdx,%rcx,8)
movq 0x40(%rbx), %rax
cmpq 0x8(%rbx), %rax
jae 0x3ac6
movq %rbx, %rdi
callq 0x4294
testl %eax, %eax
jne 0x3a85
leaq 0x40(%rbx), %rsi
movl 0x38(%rbx), %edi
leaq -0xd8(%rip), %r8        # 0x39fc
movl $0x8, %edx
movl $0x8, %ecx
movq %rbx, %r9
callq 0x80f0
movq %rax, 0x48(%rbx)
xorl %ebp, %ebp
testq %rax, %rax
jne 0x3a85
callq 0x20a0
cmpl $0x0, (%rax)
je 0x3b0a
movq %rax, %rbx
leaq 0x9901(%rip), %rdi      # 0xd406
jmp 0x3a63
leaq 0x98f5(%rip), %rdi      # 0xd406
jmp 0x3a79
leaq 0x99ce(%rip), %rdi      # 0xd4eb
leaq 0x9940(%rip), %rsi      # 0xd464
leaq 0x99df(%rip), %rcx      # 0xd50a
movl $0x27, %edx
callq 0x2220
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs/dispatch.c
// Function: dispatch_close
int
dispatch_close(struct dispatch_state * D)
{

	/* Sanity check. */
	assert(D->read_cookie == NULL);
	assert(D->npending == 0);

	/* Free the buffered reader for the connection. */
	netbuf_read_free(D->readq);

	/* Free the buffered writer for the connection. */
	netbuf_write_free(D->writeq);

	/* Close the connection. */
	while (close(D->sconn)) {
		if (errno == EINTR)
			continue;
		warnp("close");
		goto err0;
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x0, 0x68(%rdi)
jne 0x3ddc
movq %rdi, %rbx
cmpq $0x0, 0x70(%rdi)
jne 0x3dfb
movq 0x60(%rbx), %rdi
callq 0x7aac
movq 0x58(%rbx), %rdi
callq 0x7e97
movl 0x54(%rbx), %edi
callq 0x2240
testl %eax, %eax
je 0x3dbd
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x3d8e
leaq 0xa6ec(%rip), %rdi      # 0xe49c
testl %eax, %eax
jne 0x3dc1
xorl %eax, %eax
callq 0xad37
jmp 0x3dcf
xorl %eax, %eax
jmp 0x3dd4
xorl %eax, %eax
callq 0xac18
movl $0x0, (%r14)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x966a(%rip), %rdi      # 0xd44d
leaq 0x967a(%rip), %rsi      # 0xd464
leaq 0x967e(%rip), %rcx      # 0xd46f
movl $0x18c, %edx            # imm = 0x18C
callq 0x2220
leaq 0x9699(%rip), %rdi      # 0xd49b
leaq 0x965b(%rip), %rsi      # 0xd464
leaq 0x965f(%rip), %rcx      # 0xd46f
movl $0x18d, %edx            # imm = 0x18D
callq 0x2220
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs/dispatch.c
// Function: dispatch_done
int
dispatch_done(struct dispatch_state * D)
{
	size_t i;
	int rc = 0;	/* No errors yet. */

	/* Shut down the worker threads. */
	for (i = 0; i < D->nreaders + 2; i++) {
		if (worker_kill(D->workers[i])) {
			warnp("Cannot destroy worker thread");
			rc = -1;
		}
	}
	free(D->workers);

	/* Stop reading work completion messages. */
	network_read_cancel(D->wakeup_cookie);

	/* Close the work completion message conduit. */
	while (close(D->spair[1])) {
		if (errno == EINTR)
			continue;
		warnp("close");
		rc = -1;
	}
	while (close(D->spair[0])) {
		if (errno == EINTR)
			continue;
		warnp("close");
		rc = -1;
	}

	/* Free allocated memory. */
	free(D->readers_idle);
	free(D);

	/* Return success, or failure if anything went wrong. */
	return (rc);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
xorl %ebp, %ebp
cmpq $-0x2, 0x8(%rdi)
je 0x3e89
leaq 0x9677(%rip), %r14      # 0xd4ac
xorl %ebp, %ebp
xorl %r12d, %r12d
movq (%rbx), %rax
movq (%rax,%r12,8), %rdi
callq 0x4b08
testl %eax, %eax
je 0x3e79
callq 0x20a0
cmpl $0x0, (%rax)
je 0x3e6a
movq %rax, %r15
movq %r14, %rdi
xorl %eax, %eax
callq 0xac18
movl $0x0, (%r15)
jmp 0x3e74
movq %r14, %rdi
xorl %eax, %eax
callq 0xad37
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
incq %r12
movq 0x8(%rbx), %rax
addq $0x2, %rax
cmpq %rax, %r12
jb 0x3e3a
movq (%rbx), %rdi
callq 0x2040
movq 0x48(%rbx), %rdi
callq 0x839b
leaq 0xa5fb(%rip), %r14      # 0xe49c
movl 0x3c(%rbx), %edi
callq 0x2240
testl %eax, %eax
je 0x3ee6
callq 0x20a0
movq %rax, %r15
movl (%rax), %eax
cmpl $0x4, %eax
je 0x3ea1
movq %r14, %rdi
testl %eax, %eax
jne 0x3ed1
xorl %eax, %eax
callq 0xad37
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x3ea1
xorl %eax, %eax
callq 0xac18
movl $0x0, (%r15)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x3ea1
leaq 0xa5af(%rip), %r14      # 0xe49c
movl 0x38(%rbx), %edi
callq 0x2240
testl %eax, %eax
je 0x3f2d
callq 0x20a0
movq %rax, %r15
movl (%rax), %eax
cmpl $0x4, %eax
je 0x3eed
movq %r14, %rdi
testl %eax, %eax
jne 0x3f18
xorl %eax, %eax
callq 0xad37
jmp 0x3f26
xorl %eax, %eax
callq 0xac18
movl $0x0, (%r15)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x3eed
movq 0x20(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs/dispatch_request.c
// Function: dispatch_request_params
int
dispatch_request_params(struct dispatch_state * dstate,
    struct proto_lbs_request * R)
{
	uint64_t blkno;

	/* Sanity check. */
	assert(dstate->blocklen <= UINT32_MAX);

	/* Figure out what the first available block number is. */
	if ((blkno = storage_nextblock(dstate->sstate)) == (uint64_t)(-1))
		goto err1;

	/* Send the response packet back. */
	dstate->npending--;
	if (proto_lbs_response_params(dstate->writeq, R->ID,
	    (uint32_t)dstate->blocklen, blkno))
		goto err1;

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

	/* Success! */
	return (0);

err1:
	free(R);

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x0, 0x2c(%rdi)
jne 0x4176
movq %rsi, %rbx
movq %rdi, %r14
movq 0x30(%rdi), %rdi
callq 0x4e7e
cmpq $-0x1, %rax
je 0x415e
decq 0x70(%r14)
movq 0x58(%r14), %rdi
movq (%rbx), %rsi
movl 0x28(%r14), %edx
movq %rax, %rcx
callq 0xaf84
testl %eax, %eax
je 0x4165
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x4167
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x946d(%rip), %rdi      # 0xd5ea
leaq 0x9485(%rip), %rsi      # 0xd609
leaq 0x9491(%rip), %rcx      # 0xd61c
movl $0x19, %edx
callq 0x2220
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs/dispatch_request.c
// Function: dispatch_request_get
int
dispatch_request_get(struct dispatch_state * dstate,
    struct proto_lbs_request * R)
{
	struct readq * rq;

	/* Add the read request to the pending read queue. */
	if ((rq = malloc(sizeof(struct readq))) == NULL)
		goto err1;
	rq->next = NULL;
	rq->reqID = R->ID;
	rq->blkno = R->r.get.blkno;
	if (dstate->readq_head == NULL)
		dstate->readq_head = rq;
	else
		*(dstate->readq_tail) = rq;
	dstate->readq_tail = &rq->next;

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

	/* Poke the queue. */
	if (dispatch_request_pokereadq(dstate))
		goto err0;

	/* Success! */
	return (0);

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x18, %edi
callq 0x2380
testq %rax, %rax
je 0x4257
movq $0x0, (%rax)
movq (%r14), %rcx
movq %rcx, 0x8(%rax)
movq 0x10(%r14), %rcx
movq %rcx, 0x10(%rax)
cmpq $0x0, 0x78(%rbx)
je 0x4261
movq 0x80(%rbx), %rcx
jmp 0x4265
movq %r14, %rdi
callq 0x2040
jmp 0x4283
leaq 0x78(%rbx), %rcx
movq %rax, (%rcx)
movq %rax, 0x80(%rbx)
movq %r14, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x4294
testl %eax, %eax
je 0x428a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x428c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs/dispatch_request.c
// Function: dispatch_request_pokereadq
int
dispatch_request_pokereadq(struct dispatch_state * dstate)
{
	struct readq * R;
	struct workctl * reader;
	uint8_t * buf;

	/* Loop as long as we can launch a read. */
	while ((dstate->nreaders_idle > 0) && (dstate->readq_head != NULL)) {
		/* Grab the first read from the queue. */
		R = dstate->readq_head;

		/* Allocate a buffer to read the block into. */
		if ((buf = malloc(dstate->blocklen)) == NULL)
			goto err0;

		/* Grab an idle reader. */
		reader = dstate->workers[
		    dstate->readers_idle[dstate->nreaders_idle - 1]];
		dstate->nreaders_idle -= 1;

		/* Give the reader the work. */
		if (worker_assign(reader, 0, R->blkno, 0, buf, R->reqID))
			goto err1;

		/* Remove the work from the queue. */
		dstate->readq_head = R->next;

		/* Free the dequeued read queue entry. */
		free(R);
	}

	/* Success! */
	return (0);

err1:
	dstate->nreaders_idle += 1;
	free(buf);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x18(%rdi), %r12
testq %r12, %r12
je 0x430e
movq %rdi, %rbx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x78(%rbx), %r14
testq %r14, %r14
je 0x430e
movq 0x28(%rbx), %rdi
callq 0x2380
testq %rax, %rax
je 0x4310
movq %rax, %r15
movq (%rbx), %rax
movq 0x20(%rbx), %rcx
movq -0x8(%rcx,%r12,8), %rcx
decq %r12
movq (%rax,%rcx,8), %rdi
movq %r12, 0x18(%rbx)
movq 0x8(%r14), %r9
movq 0x10(%r14), %rdx
xorl %esi, %esi
xorl %ecx, %ecx
movq %r15, %r8
callq 0x48f3
testl %eax, %eax
jne 0x431b
movq (%r14), %rax
movq %rax, 0x78(%rbx)
movq %r14, %rdi
callq 0x2040
movq 0x18(%rbx), %r12
testq %r12, %r12
jne 0x42ad
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
incq 0x18(%rbx)
movq %r15, %rdi
callq 0x2040
jmp 0x4310
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs/dispatch_request.c
// Function: dispatch_request_append
int
dispatch_request_append(struct dispatch_state * dstate,
    struct proto_lbs_request * R)
{
	struct workctl * writer = dstate->workers[dstate->nreaders];
	uint64_t blkno;

	/* Figure out what the first available block number is. */
	if ((blkno = storage_nextblock(dstate->sstate)) == (uint64_t)(-1))
		goto err1;

	/*
	 * If the block number provided is wrong, or there's a write in
	 * progress (in which case the requestor can't possibly know what
	 * the correct next block number is), send a failure response.
	 */
	if ((R->r.append.blkno != blkno) || (dstate->writer_busy != 0)) {
		dstate->npending--;
		if (proto_lbs_response_append(dstate->writeq, R->ID, 1,
		    (uint64_t)(-1)))
			goto err1;
		goto badblkno;
	}

	/* Give the writer the work. */
	dstate->writer_busy = 1;
	if (worker_assign(writer, 1, R->r.append.blkno, R->r.append.nblks,
	    R->r.append.buf, R->ID))
		goto err1;

	/* Free the request but NOT the buffer, since the thread owns that. */
	free(R);

	/* Success! */
	return (0);

badblkno:
	/* Free request AND included buffer. */
	free(R->r.append.buf);
	free(R);

	/* Success! */
	return (0);

err1:
	/* Free request AND included buffer. */
	free(R->r.append.buf);
	free(R);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
movq (%rax,%rcx,8), %r14
movq 0x30(%rdi), %rdi
callq 0x4e7e
cmpq $-0x1, %rax
je 0x437d
cmpq %rax, 0x18(%rbx)
jne 0x435d
cmpl $0x0, 0x10(%r15)
je 0x43a4
decq 0x70(%r15)
movq 0x58(%r15), %rdi
movq (%rbx), %rsi
movl $0x1, %edx
movq $-0x1, %rcx
callq 0xb19a
testl %eax, %eax
je 0x43a0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x20(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
jmp 0x4382
movl $0x1, 0x10(%r15)
movq 0x18(%rbx), %rdx
movl 0x10(%rbx), %ecx
movq 0x20(%rbx), %r8
movq (%rbx), %r9
movq %r14, %rdi
movl $0x1, %esi
callq 0x48f3
testl %eax, %eax
jne 0x437d
xorl %ebp, %ebp
jmp 0x438b
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs/dispatch_request.c
// Function: dispatch_request_free
int
dispatch_request_free(struct dispatch_state * dstate,
    struct proto_lbs_request * R)
{
	struct workctl * deleter = dstate->workers[dstate->nreaders + 1];

	/* If the deleter is not busy, tell it to do something. */
	if (dstate->deleter_busy == 0) {
		/* Give the deleter the work. */
		dstate->deleter_busy = 1;
		if (worker_assign(deleter,
		    2, R->r.free.blkno, 0, NULL, R->ID))
			goto err1;
	}

	/*
	 * Send an ACK to the request.  FREEs are advisory, so we don't need
	 * to wait until we succeed before responding.
	 */
	dstate->npending--;
	if (proto_lbs_response_free(dstate->writeq, R->ID))
		goto err1;

	/* Free the request. */
	free(R);

	/* Success! */
	return (0);

err1:
	free(R);

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x0, 0x14(%rdi)
je 0x43f7
decq 0x70(%r14)
movq 0x58(%r14), %rdi
movq (%rbx), %rsi
callq 0xb227
testl %eax, %eax
jne 0x4425
xorl %ebp, %ebp
jmp 0x442a
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq 0x8(%rax,%rcx,8), %rdi
movl $0x1, 0x14(%r14)
movq (%rbx), %r9
movq 0x10(%rbx), %rdx
movl $0x2, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x48f3
testl %eax, %eax
je 0x43df
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs/worker.c
// Function: worker_assign
int
worker_assign(struct workctl * ctl, int op, uint64_t blkno, size_t nblks,
    uint8_t * buf, uint64_t reqID)
{
	int rc;

	/* Lock the control structure. */
	if ((rc = pthread_mutex_lock(&ctl->mtx)) != 0) {
		warn0("pthread_mutex_lock: %s", strerror(rc));
		goto err0;
	}

	/* Sanity check: The thread shouldn't be busy. */
	assert(ctl->haswork == 0);

	/* Record the work to be done. */
	ctl->op = op;
	ctl->blkno = blkno;
	ctl->nblks = nblks;
	ctl->buf = buf;
	ctl->reqID = reqID;

	/* The work isn't finished yet. */
	ctl->workdone = 0;

	/* Wake up the thread and unlock the control structure. */
	ctl->haswork = 1;
	if ((rc = pthread_cond_signal(&ctl->cv)) != 0) {
		warn0("pthread_cond_signal: %s", strerror(rc));
		goto err1;
	}
	if ((rc = pthread_mutex_unlock(&ctl->mtx)) != 0) {
		warn0("pthread_mutex_unlock: %s", strerror(rc));
		goto err0;
	}

	/* Success! */
	return (0);

err1:
	pthread_mutex_unlock(&ctl->mtx);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r14
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
movl %esi, %ebp
movq %rdi, %rbx
callq 0x2550
testl %eax, %eax
je 0x493d
movl %eax, %edi
callq 0x2520
leaq 0x8e20(%rip), %rdi      # 0xd746
movq %rax, %rsi
xorl %eax, %eax
callq 0xad37
callq 0x20a0
movl $0x0, (%rax)
jmp 0x49a9
cmpl $0x0, 0x60(%rbx)
jne 0x49e0
movl %ebp, 0x88(%rbx)
movq %r13, 0x90(%rbx)
movq %r12, 0x98(%rbx)
movq %r15, 0xa0(%rbx)
movq %r14, 0xa8(%rbx)
movq $0x1, 0x60(%rbx)
leaq 0x30(%rbx), %rdi
callq 0x22d0
testl %eax, %eax
je 0x49bd
movl %eax, %edi
callq 0x2520
leaq 0x8e7e(%rip), %rdi      # 0xd80a
movq %rax, %rsi
xorl %eax, %eax
callq 0xad37
callq 0x20a0
movl $0x0, (%rax)
movq %rbx, %rdi
callq 0x2370
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x2370
testl %eax, %eax
je 0x49dc
movl %eax, %edi
callq 0x2520
leaq 0x8daf(%rip), %rdi      # 0xd786
jmp 0x4926
xorl %eax, %eax
jmp 0x49ae
leaq 0x8db8(%rip), %rdi      # 0xd79f
leaq 0x8dc3(%rip), %rsi      # 0xd7b1
leaq 0x8dc5(%rip), %rcx      # 0xd7ba
movl $0xd1, %edx
callq 0x2220
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs/worker.c
// Function: worker_getdone
int
worker_getdone(struct workctl * ctl, int * op, uint64_t * blkno,
    size_t * nblks, uint8_t ** buf, uint64_t * reqID)
{
	int rc;

	/* Lock the control structure. */
	if ((rc = pthread_mutex_lock(&ctl->mtx)) != 0) {
		warn0("pthread_mutex_lock: %s", strerror(rc));
		goto err0;
	}

	/* Sanity check: This thread should have finished some work. */
	assert(ctl->haswork != 0);
	assert(ctl->workdone != 0);

	/* Copy out the work tuple. */
	*op = ctl->op;
	*blkno = ctl->blkno;
	*nblks = ctl->nblks;
	*buf = ctl->buf;
	*reqID = ctl->reqID;

	/* This thread no longer has work assigned to it. */
	ctl->haswork = 0;

	/* Unlock the thread control structure. */
	if ((rc = pthread_mutex_unlock(&ctl->mtx)) != 0) {
		warn0("pthread_mutex_unlock: %s", strerror(rc));
		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 %r9, %rbx
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r14
callq 0x2550
testl %eax, %eax
je 0x4a2e
leaq 0x8d1a(%rip), %rbx      # 0xd746
jmp 0x4a93
cmpl $0x0, 0x60(%r14)
je 0x4aca
cmpl $0x0, 0x64(%r14)
je 0x4ae9
movl 0x88(%r14), %eax
movl %eax, (%rbp)
movq 0x90(%r14), %rax
movq %rax, (%r13)
movq 0x98(%r14), %rax
movq %rax, (%r12)
movq 0xa0(%r14), %rax
movq %rax, (%r15)
movq 0xa8(%r14), %rax
movq %rax, (%rbx)
movl $0x0, 0x60(%r14)
movq %r14, %rdi
callq 0x2370
testl %eax, %eax
je 0x4ac6
leaq 0x8cf3(%rip), %rbx      # 0xd786
movl %eax, %edi
callq 0x2520
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xad37
callq 0x20a0
movl $0x0, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x4ab7
leaq 0x8d51(%rip), %rdi      # 0xd822
leaq 0x8cd9(%rip), %rsi      # 0xd7b1
leaq 0x8d55(%rip), %rcx      # 0xd834
movl $0x105, %edx            # imm = 0x105
callq 0x2220
leaq 0x8d9e(%rip), %rdi      # 0xd88e
leaq 0x8cba(%rip), %rsi      # 0xd7b1
leaq 0x8d36(%rip), %rcx      # 0xd834
movl $0x106, %edx            # imm = 0x106
callq 0x2220
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs/worker.c
// Function: worker_kill
int
worker_kill(struct workctl * ctl)
{
	int rc;

	/* Lock the control structure. */
	if ((rc = pthread_mutex_lock(&ctl->mtx)) != 0) {
		warn0("pthread_mutex_lock: %s", strerror(rc));
		goto err0;
	}

	/* Tell the thread to die, and wake it up. */
	ctl->suicide = 1;
	if ((rc = pthread_cond_signal(&ctl->cv)) != 0) {
		warn0("pthread_cond_signal: %s", strerror(rc));
		goto err1;
	}

	/* Unlock the control structure. */
	if ((rc = pthread_mutex_unlock(&ctl->mtx)) != 0) {
		warn0("pthread_mutex_unlock: %s", strerror(rc));
		goto err0;
	}

	/* Wait for the thread to die. */
	if ((rc = pthread_join(ctl->thr, NULL)) != 0) {
		warn0("pthread_join: %s", strerror(rc));
		goto err0;
	}

	/* Destroy condition variable. */
	if ((rc = pthread_cond_destroy(&ctl->cv)) != 0) {
		warn0("pthread_cond_destroy: %s", strerror(rc));
		goto err0;
	}

	/* Destroy mutex. */
	if ((rc = pthread_mutex_destroy(&ctl->mtx)) != 0) {
		warn0("pthread_mutex_destroy: %s", strerror(rc));
		goto err0;
	}

	/* Free the control structure. */
	free(ctl);

	/* Success! */
	return (0);

err1:
	pthread_mutex_unlock(&ctl->mtx);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2550
testl %eax, %eax
je 0x4b3d
movl %eax, %edi
callq 0x2520
leaq 0x8c20(%rip), %rdi      # 0xd746
movq %rax, %rsi
xorl %eax, %eax
callq 0xad37
callq 0x20a0
movl $0x0, (%rax)
jmp 0x4b7f
movl $0x1, 0x68(%rbx)
leaq 0x30(%rbx), %r14
movq %r14, %rdi
callq 0x22d0
testl %eax, %eax
je 0x4b8c
movl %eax, %edi
callq 0x2520
leaq 0x8ca8(%rip), %rdi      # 0xd80a
movq %rax, %rsi
xorl %eax, %eax
callq 0xad37
callq 0x20a0
movl $0x0, (%rax)
movq %rbx, %rdi
callq 0x2370
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0x2370
testl %eax, %eax
je 0x4bab
movl %eax, %edi
callq 0x2520
leaq 0x8be0(%rip), %rdi      # 0xd786
jmp 0x4b26
movq 0x28(%rbx), %rdi
xorl %esi, %esi
callq 0x2500
testl %eax, %eax
je 0x4bcd
movl %eax, %edi
callq 0x2520
leaq 0x8cd9(%rip), %rdi      # 0xd8a1
jmp 0x4b26
movq %r14, %rdi
callq 0x2450
testl %eax, %eax
je 0x4bec
movl %eax, %edi
callq 0x2520
leaq 0x8ccb(%rip), %rdi      # 0xd8b2
jmp 0x4b26
movq %rbx, %rdi
callq 0x21d0
testl %eax, %eax
je 0x4c0b
movl %eax, %edi
callq 0x2520
leaq 0x8cc5(%rip), %rdi      # 0xd8cb
jmp 0x4b26
movq %rbx, %rdi
callq 0x2040
xorl %eax, %eax
jmp 0x4b84
nop
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs/storage.c
// Function: storage_delete
int
storage_delete(struct storage_state * S, uint64_t blkno)
{
	struct file_state * fs;
	uint64_t fileno;
	char * s;

	/* Loop until we don't need to delete anything. */
	do {
		/*
		 * First, figure out if we need to delete a file; if we do,
		 * remove it from the file queue.
		 */

		/* Grab a write lock. */
		if (storage_util_writelock(S))
			goto err0;

		/* If we have less than 2 files, don't delete anything. */
		if (elasticqueue_getlen(S->files) < 2)
			break;

		/* If the first file has blocks we need, don't delete. */
		fs = elasticqueue_get(S->files, 0);
		if (fs->start + fs->len > blkno)
			break;

		/* We want to delete the first file. */
		fileno = fs->start;

		/* Remove the file from the file queue. */
		elasticqueue_delete(S->files);

		/* Adjust our first-block-held value. */
		fs = elasticqueue_get(S->files, 0);
		S->minblk = fs->start;

		/* Release the lock. */
		if (storage_util_unlock(S))
			goto err0;

		/*
		 * Delete the file.  We don't need to worry about racing
		 * against the writer, since we will never delete the last
		 * file; and racing against readers is handled by readers
		 * treating ENOENT properly.
		 */
		if ((s = storage_util_mkpath(S, fileno)) == NULL)
			goto err0;
		if (unlink(s)) {
			warnp("unlink(%s)", s);
			goto err1;
		}
		free(s);

		/* Make sure the file deletion is flushed to disk. */
		if (disk_syncdir(S->storagedir))
			goto err0;
	} while (1);

	/* Release the write lock. */
	if (storage_util_unlock(S))
		goto err0;

	/* Success! */
	return (0);

err1:
	free(s);
err0:

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rbx, %rdi
callq 0x56e0
testl %eax, %eax
jne 0x5317
movq 0x60(%rbx), %rdi
callq 0x5d7a
cmpq $0x2, %rax
jb 0x52c8
movq 0x60(%rbx), %rdi
xorl %esi, %esi
callq 0x5d7f
movq (%rax), %r15
movq 0x8(%rax), %rax
addq %r15, %rax
cmpq %r14, %rax
ja 0x52c8
movq 0x60(%rbx), %rdi
callq 0x5ce9
movq 0x60(%rbx), %rdi
xorl %esi, %esi
callq 0x5d7f
movq (%rax), %rax
movq %rax, 0x68(%rbx)
movq %rbx, %rdi
callq 0x571c
testl %eax, %eax
jne 0x5317
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5758
testq %rax, %rax
je 0x5317
movq %rax, %r15
movq %rax, %rdi
callq 0x20b0
testl %eax, %eax
jne 0x52d8
movq %r15, %rdi
callq 0x2040
movq (%rbx), %rdi
callq 0x57c0
testl %eax, %eax
je 0x522b
jmp 0x5317
movq %rbx, %rdi
callq 0x571c
testl %eax, %eax
jne 0x5317
xorl %eax, %eax
jmp 0x531c
callq 0x20a0
cmpl $0x0, (%rax)
je 0x52fe
movq %rax, %rbx
leaq 0x88ba(%rip), %rdi      # 0xdba6
movq %r15, %rsi
xorl %eax, %eax
callq 0xac18
movl $0x0, (%rbx)
jmp 0x530f
leaq 0x88a1(%rip), %rdi      # 0xdba6
movq %r15, %rsi
xorl %eax, %eax
callq 0xad37
movq %r15, %rdi
callq 0x2040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs/storage.c
// Function: storage_done
int
storage_done(struct storage_state * S)
{
	int rc;

	/* Destroy the lock on the storage state. */
	if ((rc = pthread_rwlock_destroy(&S->lck)) != 0) {
		warn0("pthread_rwlock_destroy: %s", strerror(rc));
		goto err0;
	}

	/* Free the queue of file state structures. */
	elasticqueue_free(S->files);

	/* Free the storage state. */
	free(S);

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x28, %rdi
callq 0x2130
testl %eax, %eax
je 0x535d
movl %eax, %edi
callq 0x2520
leaq 0x8870(%rip), %rdi      # 0xdbb1
movq %rax, %rsi
xorl %eax, %eax
callq 0xad37
callq 0x20a0
movl $0x0, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x5370
movq 0x60(%rbx), %rdi
callq 0x5d9b
movq %rbx, %rdi
callq 0x2040
xorl %eax, %eax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs/storage_util.c
// Function: storage_util_mkpath
char *
storage_util_mkpath(struct storage_state * S, uint64_t fileno)
{
	char * s;

	/* Construct path. */
	if (asprintf(&s, "%s/blks_%016" PRIx64,
	    S->storagedir, fileno) == -1) {
		warnp("asprintf");
		goto err0;
	}

	/* Success! */
	return (s);

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rcx
movq (%rdi), %rdx
leaq 0x8530(%rip), %rsi      # 0xdc99
movq %rsp, %rdi
xorl %eax, %eax
callq 0x8b2c
cmpl $-0x1, %eax
je 0x577e
movq (%rsp), %rbx
jmp 0x57b4
callq 0x20a0
cmpl $0x0, (%rax)
je 0x57a4
movq %rax, %r14
leaq 0x7a33(%rip), %rdi      # 0xd1c5
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xac18
movl $0x0, (%r14)
jmp 0x57b4
leaq 0x7a1a(%rip), %rdi      # 0xd1c5
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xad37
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs/disk.c
// Function: disk_syncdir
int
disk_syncdir(const char * path)
{
	int fd;

	while ((fd = open(path, O_RDONLY)) == -1) {
		if (errno != EINTR) {
			warnp("open(%s)", path);
			goto err0;
		}
	}
	while (fsync(fd)) {
		if (errno != EINTR) {
			warnp("fsync(%s)", path);
			goto err1;
		}
	}
	while (close(fd)) {
		if (errno != EINTR) {
			warnp("close(%s)", path);
			goto err0;
		}
	}

	/* Success! */
	return (0);

err1:
	if (close(fd))
		warnp("close");
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq %rbx, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2460
cmpl $-0x1, %eax
jne 0x5818
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x57c7
leaq 0x8c98(%rip), %rdi      # 0xe486
movq %rbx, %rsi
testl %eax, %eax
jne 0x57fe
xorl %eax, %eax
callq 0xad37
jmp 0x580c
xorl %eax, %eax
callq 0xac18
movl $0x0, (%r14)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl %eax, %ebp
movl %ebp, %edi
callq 0x2440
testl %eax, %eax
je 0x584b
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x581a
leaq 0x846d(%rip), %rdi      # 0xdca8
movq %rbx, %rsi
testl %eax, %eax
jne 0x586e
xorl %eax, %eax
callq 0xad37
jmp 0x587c
movl %ebp, %edi
callq 0x2240
testl %eax, %eax
je 0x58bf
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x584b
leaq 0x8446(%rip), %rdi      # 0xdcb2
jmp 0x57ee
xorl %eax, %eax
callq 0xac18
movl $0x0, (%r14)
movl %ebp, %edi
callq 0x2240
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
je 0x5811
cmpl $0x0, (%r14)
je 0x58ac
leaq 0x8c03(%rip), %rdi      # 0xe49c
xorl %eax, %eax
callq 0xac18
movl $0x0, (%r14)
jmp 0x5811
leaq 0x8be9(%rip), %rdi      # 0xe49c
xorl %eax, %eax
callq 0xad37
jmp 0x5811
xorl %ebx, %ebx
jmp 0x5811
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs/disk.c
// Function: disk_write
int
disk_write(const char * path, int create, size_t nbytes, const uint8_t * buf,
    int nosync)
{
	int fd;

	/* Open or create the file, depending on ${creat}. */
	do {
		/* Attempt to open/create. */
		if (create) {
			fd = open(path, O_WRONLY | O_BINARY | O_APPEND |
			    O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
		} else {
			fd = open(path, O_WRONLY | O_BINARY | O_APPEND);
		}

		/* If we hit EINTR, try again. */
	} while ((fd == -1) && (errno == EINTR));

	/* If we failed to open the file, error out. */
	if (fd == -1) {
		warnp("open(%s)", path);
		goto err0;
	}

	/* Write from the buffer. */
	if (noeintr_write(fd, buf, nbytes) != (ssize_t)nbytes)
		goto err1;

	/* Ask to have the write flushed to disk. */
	if (nosync == 0) {
		while (fsync(fd)) {
			if (errno != EINTR) {
				warnp("fsync(%s)", path);
				goto err1;
			}
		}
	}

	/* Close the file. */
	while (close(fd)) {
		if (errno != EINTR) {
			warnp("close(%s)", path);
			goto err0;
		}
	}

	/* Success! */
	return (0);

err1:
	if (close(fd))
		warnp("close");
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %r14d
movq %rcx, %r12
movq %rdx, %r15
movl %esi, %r13d
movq %rdi, %rbx
movq %rbx, %rdi
testl %r13d, %r13d
je 0x5b0b
movl $0x4c1, %esi            # imm = 0x4C1
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x2460
jmp 0x5b17
movl $0x401, %esi            # imm = 0x401
xorl %eax, %eax
callq 0x2460
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x5b4b
callq 0x20a0
movq %rax, %rbp
movl (%rax), %eax
cmpl $0x4, %eax
je 0x5af0
leaq 0x8952(%rip), %rdi      # 0xe486
testl %eax, %eax
jne 0x5bd3
movq %rbx, %rsi
xorl %eax, %eax
callq 0xad37
jmp 0x5be4
movl %ebp, %edi
movq %r12, %rsi
movq %r15, %rdx
callq 0x9ab0
cmpq %r15, %rax
jne 0x5c0c
testl %r14d, %r14d
je 0x5ba2
movl %ebp, %edi
callq 0x2240
testl %eax, %eax
je 0x5bfa
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x5b66
leaq 0x8127(%rip), %rdi      # 0xdcb2
testl %eax, %eax
je 0x5b3c
movq %rbx, %rsi
xorl %eax, %eax
callq 0xac18
movl $0x0, (%r14)
jmp 0x5be4
movl %ebp, %edi
callq 0x2440
testl %eax, %eax
je 0x5b66
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x5ba2
leaq 0x80e5(%rip), %rdi      # 0xdca8
movq %rbx, %rsi
testl %eax, %eax
jne 0x5bfe
xorl %eax, %eax
callq 0xad37
jmp 0x5c0c
movq %rbx, %rsi
xorl %eax, %eax
callq 0xac18
movl $0x0, (%rbp)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0x5be9
xorl %eax, %eax
callq 0xac18
movl $0x0, (%r14)
movl %ebp, %edi
callq 0x2240
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
je 0x5be9
callq 0x20a0
cmpl $0x0, (%rax)
je 0x5c40
movq %rax, %r14
leaq 0x886c(%rip), %rdi      # 0xe49c
xorl %eax, %eax
callq 0xac18
movl $0x0, (%r14)
jmp 0x5be9
leaq 0x8855(%rip), %rdi      # 0xe49c
xorl %eax, %eax
callq 0xad37
jmp 0x5be9