LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/info-telecom-strasbourg[P]code-generator/src/utils.cpp
// Function: s_execute[abi:cxx11](int&, char const*, char const*)
string s_execute (int & exit_code, const char * path, const char * s) {
	
	vector<char*> cmd;

	cmd.push_back (const_cast<char*>(s));

	cmd.push_back(NULL);

  	char **cmd_ptr = cmd.data();

	size_t len;

	string output = __execute__ (&exit_code, &len, path, cmd_ptr);

	output [len - 1] = '\0';

	return output;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x8(%rsp), %rsi
movq %rcx, (%rsi)
callq 0x3f9c
leaq 0x8(%rsp), %rsi
movq $0x0, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x3f9c
movq 0x10(%rsp), %r8
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0x5bc9
movq 0x8(%rsp), %rax
movq (%rbx), %rcx
movb $0x0, -0x1(%rcx,%rax)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x5f1e
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x5f2f
jmp 0x5f2f
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x5f49
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x2340
// File: /workspace/github_c_makefile_star2_O3/info-telecom-strasbourg[P]code-generator/src/utils.cpp
// Function: parse_extension(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
string parse_extension (string path, string & extension) {
	size_t path_len = path.length();
	string path_extension; 
	int break_point = 0;
	
	for (int i = path_len - 1; i >= 0; i--) {
		if (path[i] == '.') {
			break_point = i;
			break;
		}

		path_extension.push_back(path[i]);
	}

	reverse_str (path_extension);

	extension = path_extension;

	return path.substr(0, path_len - break_point - 1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x28(%rsp)
movq %rsi, %r14
movq %rdi, 0x30(%rsp)
movq 0x8(%rsi), %rbp
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl %ebp, %r12d
movq %rbp, %r15
shlq $0x20, %r15
negq %r15
decq %r12
movabsq $0x100000000, %rbx      # imm = 0x100000000
leaq 0x8(%rsp), %r13
testl %r12d, %r12d
js 0x6009
movl %r12d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq (%r14), %rcx
movb (%rcx,%rax), %al
cmpb $0x2e, %al
je 0x6012
addq %rbx, %r15
decq %r12
movsbl %al, %esi
movq %r13, %rdi
callq 0x2150
jmp 0x5fdf
movq $-0x1, %r15
jmp 0x6016
sarq $0x20, %r15
movq 0x10(%rsp), %rax
cmpl $0x2, %eax
movq 0x30(%rsp), %rbx
jl 0x6059
movl %eax, %ecx
shrl %ecx
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
decq %rax
xorl %edx, %edx
movq 0x8(%rsp), %rsi
movb (%rsi,%rdx), %dil
movb (%rsi,%rax), %r8b
movb %r8b, (%rsi,%rdx)
movb %dil, (%rsi,%rax)
incq %rdx
decq %rax
cmpq %rdx, %rcx
jne 0x6039
leaq 0x8(%rsp), %rsi
movq 0x28(%rsp), %rdi
callq 0x20e0
addq %rbp, %r15
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %r15, %rcx
callq 0x21f0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x6097
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x60ab
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x60ca
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x2340
// File: /workspace/github_c_makefile_star2_O3/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_01/getint.c
// Function: printbuf
void printbuf(void)
{
  if (bufp)
  {
    printf("Buffer: [ ");

    int i;
    for (i = bufp - 1; i >= 0; --i)
    {
      if (i)
      {
        printf("'%c', ", buf[i] != '\n' ? buf[i] : '.');
      }
      else
      {
        printf("'%c' ", buf[i] != '\n' ? buf[i] : '.');
      }
    }

    printf("]\n");
  }
}

// Assembly:
cmpl $0x0, 0x2cd3(%rip)      # 0x4060
je 0x141a
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0xc67(%rip), %rdi       # 0x2008
xorl %eax, %eax
callq 0x1040
movslq 0x2cb1(%rip), %r14      # 0x4060
testq %r14, %r14
jle 0x1404
decq %r14
je 0x13e5
leaq 0x2cb0(%rip), %r15      # 0x4070
movl $0x2e, %ebp
leaq 0xc47(%rip), %rbx       # 0x2013
movl (%r15,%r14,4), %esi
cmpl $0xa, %esi
cmovel %ebp, %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1040
decq %r14
jne 0x13cc
movl 0x2c85(%rip), %eax      # 0x4070
cmpl $0xa, %eax
movl $0x2e, %esi
cmovnel %eax, %esi
leaq 0xc1d(%rip), %rdi       # 0x201a
xorl %eax, %eax
callq 0x1040
leaq 0xc15(%rip), %rdi       # 0x2020
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1030
retq
// File: /workspace/github_c_makefile_star2_O3/robertdavidgraham[P]wc2/wc2o.c
// Function: main
int main(void)
{
    static const unsigned char table[4][3] = {
        {2,0,1}, {2,0,1}, {3,0,1}, {3,0,1}
    };
    static const unsigned char column[256] = {
        0,0,0,0,0,0,0,0,0,1,2,1,1,1,0,0,0, /* \t\n\v\f\r */
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, /* SPACE ' ' */
    };
    unsigned long counts[4] = {0,0,0,0};
    int state = 0;
    int c;

    while ((c = getchar()) != EOF) {
        state = table[state][column[c]];
        counts[state]++;
    }

    printf("%lu %lu %lu\n", counts[1], counts[2], 
                counts[0] + counts[1] + counts[2] + counts[3]);
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
callq 0x1040
cmpl $-0x1, %eax
je 0x11b1
xorl %r15d, %r15d
leaq 0xeab(%rip), %rbx       # 0x2020
leaq 0xe94(%rip), %r14       # 0x2010
cltq
movzbl (%rax,%rbx), %eax
leaq (%r15,%r15,2), %rcx
addq %r14, %rcx
movzbl (%rax,%rcx), %r15d
incq (%rsp,%r15,8)
callq 0x1040
cmpl $-0x1, %eax
jne 0x117c
movq (%rsp), %rax
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
jmp 0x11b9
xorl %ecx, %ecx
xorl %eax, %eax
xorl %edx, %edx
xorl %esi, %esi
addq %rax, %rcx
addq %rdx, %rcx
addq %rsi, %rcx
leaq 0xf57(%rip), %rdi       # 0x2120
xorl %eax, %eax
callq 0x1030
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs-dynamodb/dispatch.c
// Function: dispatch_accept
struct dispatch_state *
dispatch_accept(struct state * S, struct deleteto * deleteto, int s)
{
	struct dispatch_state * D;

	/* Allocate space for dispatcher state. */
	if ((D = malloc(sizeof(struct dispatch_state))) == NULL)
		goto err0;

	/* Initialize dispatcher. */
	D->S = S;
	D->D = deleteto;

	/* Accept a connection. */
	D->accepting = 1;
	if (network_accept(s, callback_accept, D) == NULL)
		goto err1;

	/* Success! */
	return (D);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movl $0x40, %edi
callq 0x2270
testq %rax, %rax
je 0x33c9
movq %rax, %rbx
movq %r15, (%rax)
movq %r14, 0x8(%rax)
movl $0x1, 0x10(%rax)
leaq 0x27(%rip), %rsi        # 0x33d9
movl %ebp, %edi
movq %rax, %rdx
callq 0x6658
testq %rax, %rax
jne 0x33cb
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_O3/Tarsnap[P]kivaloo/lbs-dynamodb/dispatch.c
// Function: dispatch_done
int
dispatch_done(struct dispatch_state * D)
{

	/* Sanity check. */
	assert(D->accepting == 0);
	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;
	}

	/* Free allocated memory. */
	free(D);

	/* Success! */
	return (0);

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x0, 0x10(%rdi)
jne 0x3673
movq %rdi, %rbx
cmpq $0x0, 0x28(%rdi)
jne 0x3692
cmpq $0x0, 0x30(%rbx)
jne 0x36b1
movq 0x20(%rbx), %rdi
callq 0x610e
movq 0x18(%rbx), %rdi
callq 0x64d7
movl 0x14(%rbx), %edi
callq 0x21c0
testl %eax, %eax
je 0x364c
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x361d
leaq 0xab5d(%rip), %rdi      # 0xe19c
testl %eax, %eax
jne 0x3658
xorl %eax, %eax
callq 0x96cf
jmp 0x3666
movq %rbx, %rdi
callq 0x2040
xorl %eax, %eax
jmp 0x366b
xorl %eax, %eax
callq 0x95b0
movl $0x0, (%r14)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x9c6a(%rip), %rdi      # 0xd2e4
leaq 0x9c75(%rip), %rsi      # 0xd2f6
leaq 0x9c79(%rip), %rcx      # 0xd301
movl $0x162, %edx            # imm = 0x162
callq 0x21a0
leaq 0x9c93(%rip), %rdi      # 0xd32c
leaq 0x9c56(%rip), %rsi      # 0xd2f6
leaq 0x9c5a(%rip), %rcx      # 0xd301
movl $0x163, %edx            # imm = 0x163
callq 0x21a0
leaq 0x9c8b(%rip), %rdi      # 0xd343
leaq 0x9c37(%rip), %rsi      # 0xd2f6
leaq 0x9c3b(%rip), %rcx      # 0xd301
movl $0x164, %edx            # imm = 0x164
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs-dynamodb/dispatch.c
// Function: callback_get
static int
callback_get(void * cookie, struct proto_lbs_request * R,
    const uint8_t * buf, size_t blklen)
{
	struct dispatch_state * D = cookie;
	int status;
	int rc;

	/* Does the block exist? */
	if (buf != NULL)
		status = 0;
	else
		status = 1;

	/* Sanity check. */
	assert(blklen <= UINT32_MAX);

	/* Send a response back. */
	rc = proto_lbs_response_get(D->writeq, R->ID, status, (uint32_t)blklen,
	    buf);

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

	/* This request is done. */
	D->npending -= 1;

	/* Return success/failure from response write. */
	return (rc);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rcx, %rax
shrq $0x20, %rax
jne 0x39e1
movq %rdx, %r8
movq %rsi, %r14
movq %rdi, %rbx
xorl %edx, %edx
testq %r8, %r8
sete %dl
movq 0x18(%rdi), %rdi
movq (%rsi), %rsi
callq 0xa46a
movl %eax, %ebp
movq %r14, %rdi
callq 0x2040
decq 0x30(%rbx)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x9a75(%rip), %rdi      # 0xd45d
leaq 0x9907(%rip), %rsi      # 0xd2f6
leaq 0x9a7c(%rip), %rcx      # 0xd472
movl $0xc5, %edx
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs-dynamodb/dispatch.c
// Function: callback_append
static int
callback_append(void * cookie, struct proto_lbs_request * R, uint64_t nextblk)
{
	struct dispatch_state * D = cookie;
	int rc;

	/* Send a response back. */
	rc = proto_lbs_response_append(D->writeq, R->ID, 0, nextblk);

	/* Free the request. */
	free(R->r.append.buf);
	free(R);

	/* This request is now done. */
	D->npending -= 1;
	D->appendip = 0;

	/* Return success/failure from response write. */
	return (rc);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rcx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movq (%rsi), %rsi
xorl %edx, %edx
callq 0xa512
movl %eax, %ebp
movq 0x20(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
decq 0x30(%r14)
movl $0x0, 0x38(%r14)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs-dynamodb/state.c
// Function: state_init
struct state *
state_init(struct wire_requestqueue * Q_DDBKV, size_t itemsz, uint8_t * tableid,
    struct metadata * M)
{
	struct state * S;
	struct readtableid RT;

	/* Sanity check. */
	assert(itemsz - KVOVERHEAD <= UINT32_MAX);

	/* Allocate a structure and initialize. */
	if ((S = malloc(sizeof(struct state))) == NULL)
		goto err0;
	S->Q = Q_DDBKV;
	S->M = M;
	S->blklen = (uint32_t)(itemsz - KVOVERHEAD);
	S->npending = 0;

	/* Read "nextblk" and "lastblk" values. */
	S->nextblk = metadata_nextblk_read(S->M);
	S->lastblk = metadata_lastblk_read(S->M);

	/* Read tableid from the table. */
	RT.done = 0;
	if (proto_dynamodb_kv_request_getc(S->Q, "tableid", callback_init, &RT))
		goto err1;
	if (events_spin(&RT.done)) {
		warnp("Error reading tableid");
		goto err1;
	}

	/* Verify that the table IDs match. */
	if (memcmp(RT.tableid, tableid, 32)) {
		warn0("Data table ID does not match metadata table ID!");
		goto err1;
	}

	/* Success! */
	return (S);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r13
addq $-0x12, %r13
movq %r13, %rax
shrq $0x20, %rax
jne 0x3b7c
movq %rcx, %r12
movq %rdx, %r14
movq %rdi, %r15
movl $0x30, %edi
callq 0x2270
testq %rax, %rax
je 0x3ad8
movq %rax, %rbx
movq %r15, 0x18(%rax)
movq %r12, 0x20(%rax)
movl %r13d, (%rax)
movq $0x0, 0x28(%rax)
movq %r12, %rdi
callq 0x459b
movq %rax, 0x10(%rbx)
movq %r12, %rdi
callq 0x4744
movq %rax, 0x8(%rbx)
leaq 0xc(%rsp), %rcx
movl $0x0, (%rcx)
leaq 0x9bd9(%rip), %rsi      # 0xd696
leaq 0xd7(%rip), %rdx        # 0x3b9b
movq %r15, %rdi
callq 0x9f84
testl %eax, %eax
je 0x3aeb
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0xc(%rsp), %rdi
callq 0x4c35
testl %eax, %eax
je 0x3b1d
callq 0x20a0
cmpl $0x0, (%rax)
je 0x3b69
movq %rax, %r14
leaq 0x9a38(%rip), %rdi      # 0xd545
xorl %eax, %eax
callq 0x95b0
movl $0x0, (%r14)
jmp 0x3ad0
movdqu 0x10(%rsp), %xmm0
movdqu 0x20(%rsp), %xmm1
movdqu (%r14), %xmm2
pcmpeqb %xmm0, %xmm2
movdqu 0x10(%r14), %xmm0
pcmpeqb %xmm1, %xmm0
pand %xmm2, %xmm0
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x3ada
leaq 0x9a09(%rip), %rdi      # 0xd55b
xorl %eax, %eax
callq 0x96cf
callq 0x20a0
movl $0x0, (%rax)
jmp 0x3ad0
leaq 0x99d5(%rip), %rdi      # 0xd545
xorl %eax, %eax
callq 0x96cf
jmp 0x3ad0
leaq 0x993d(%rip), %rdi      # 0xd4c0
leaq 0x9958(%rip), %rsi      # 0xd4e2
leaq 0x9959(%rip), %rcx      # 0xd4ea
movl $0x72, %edx
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs-dynamodb/state.c
// Function: state_get
int
state_get(struct state * S, struct proto_lbs_request * R,
    int (* callback)(void *, struct proto_lbs_request *,
        const uint8_t *, size_t), void * cookie)
{
	struct get_cookie * C;

	/* Bake a cookie. */
	if ((C = malloc(sizeof(struct get_cookie))) == NULL)
		goto err0;
	C->S = S;
	C->R = R;
	C->callback = callback;
	C->cookie = cookie;
	C->consistent = 0;

	/* Send the request. */
	if (proto_dynamodb_kv_request_get(S->Q, objmap(R->r.get.blkno),
	    callback_get, C))
		goto err1;

	/* We will be performing a callback later. */
	S->npending += 1;

	/* 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, %r13
movq %rdx, %rbp
movq %rsi, %r12
movq %rdi, %r14
movl $0x28, %edi
callq 0x2270
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x3ca9
movq %rax, %r15
movq %r14, (%rax)
movq %r12, 0x8(%rax)
movq %rbp, 0x10(%rax)
movq %r13, 0x18(%rax)
movl $0x0, 0x20(%rax)
movq 0x18(%r14), %r13
movq 0x10(%r12), %rdi
callq 0x4954
leaq 0x33(%rip), %rdx        # 0x3cba
movq %r13, %rdi
movq %rax, %rsi
movq %r15, %rcx
callq 0x9d60
testl %eax, %eax
je 0x3ca3
movq %r15, %rdi
callq 0x2040
jmp 0x3ca9
incq 0x28(%r14)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs-dynamodb/state.c
// Function: callback_get
static int
callback_get(void * cookie, int status, const uint8_t * buf, size_t buflen)
{
	struct get_cookie * C = cookie;
	struct proto_lbs_request * R = C->R;
	struct state * S = C->S;
	int rc;

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

	/*
	 * If an eventually-consistent read didn't find the block, try again
	 * with a strong-consistency read.
	 */
	if ((status == 2) && (C->consistent == 0)) {
		C->consistent = 1;
		return (proto_dynamodb_kv_request_getc(S->Q,
		    objmap(R->r.get.blkno), callback_get, C));
	}

	/* If we got data, verify the block size. */
	if ((status == 0) && (buflen != S->blklen)) {
		warn0("DynamoDB-KV GET returned wrong amount of data:"
		    " %zu (should be %" PRIu32 ")", buflen, S->blklen);
		goto err0;
	}

	/* Failures are bad. */
	if (status == 1) {
		warnp("Failure in DynamoDB-KV GET");
		goto err0;
	}

	/* If the block does not exist, we have no data. */
	if (status == 2)
		buf = NULL;

	/* Tell the dispatcher to send its response back. */
	rc = (C->callback)(C->cookie, C->R, buf, S->blklen);

	/* We've done a callback. */
	S->npending -= 1;

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

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

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x3, %esi
jae 0x3d98
movq %rcx, %rax
movl %esi, %ecx
movq %rdi, %rbx
movq (%rdi), %r14
movq 0x8(%rdi), %rsi
testl %ecx, %ecx
je 0x3cec
cmpl $0x2, %ecx
jne 0x3d10
cmpl $0x0, 0x20(%rbx)
je 0x3d53
movl (%r14), %ecx
xorl %edx, %edx
jmp 0x3cf4
movl (%r14), %ecx
cmpq %rax, %rcx
jne 0x3d33
movq 0x18(%rbx), %rdi
callq *0x10(%rbx)
movl %eax, %ebp
decq 0x28(%r14)
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
jmp 0x3d93
callq 0x20a0
cmpl $0x0, (%rax)
je 0x3d80
movq %rax, %rbx
leaq 0x9a23(%rip), %rdi      # 0xd747
xorl %eax, %eax
callq 0x95b0
movl $0x0, (%rbx)
jmp 0x3d8e
leaq 0x99cb(%rip), %rdi      # 0xd705
movq %rax, %rsi
movl %ecx, %edx
xorl %eax, %eax
callq 0x96cf
callq 0x20a0
movl $0x0, (%rax)
jmp 0x3d8e
movl $0x1, 0x20(%rbx)
movq 0x18(%r14), %r14
movq 0x10(%rsi), %rdi
callq 0x4954
leaq -0xb4(%rip), %rdx       # 0x3cba
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rcx
popq %rbx
popq %r14
popq %rbp
jmp 0x9f84
leaq 0x99c0(%rip), %rdi      # 0xd747
xorl %eax, %eax
callq 0x96cf
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x9880(%rip), %rdi      # 0xd61f
leaq 0x973c(%rip), %rsi      # 0xd4e2
leaq 0x9921(%rip), %rcx      # 0xd6ce
movl $0xdc, %edx
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs-dynamodb/state.c
// Function: state_append
int
state_append(struct state * S, struct proto_lbs_request * R,
    int (* callback)(void *, struct proto_lbs_request *, uint64_t),
    void * cookie)
{
	struct append_cookie * C;

	/* Bake a cookie. */
	if ((C = malloc(sizeof(struct append_cookie))) == NULL)
		goto err0;
	C->S = S;
	C->R = R;
	C->callback = callback;
	C->cookie = cookie;
	C->nblks_left = R->r.append.nblks;
	C->nextblk_old = S->nextblk;

	/* Update nextblk. */
	S->nextblk += R->r.append.nblks;
	if (metadata_nextblk_write(S->M, S->nextblk,
	    callback_append_put_nextblk, C))
		goto err1;

	/* We will be performing a callback later. */
	S->npending += 1;

	/* 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, %rbp
movq %rsi, %r13
movq %rdi, %r14
movl $0x30, %edi
callq 0x2270
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x3e32
movq %rax, %r15
movq %r14, (%rax)
movq %r13, 0x8(%rax)
movq %rbp, 0x10(%rax)
movq %r12, 0x18(%rax)
movl 0x10(%r13), %eax
movq %rax, 0x20(%r15)
movq 0x10(%r14), %rsi
movq %rsi, 0x28(%r15)
addq %rax, %rsi
movq %rsi, 0x10(%r14)
movq 0x20(%r14), %rdi
leaq 0x2d(%rip), %rdx        # 0x3e43
movq %r15, %rcx
callq 0x45a0
testl %eax, %eax
je 0x3e2c
movq %r15, %rdi
callq 0x2040
jmp 0x3e32
incq 0x28(%r14)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs-dynamodb/state.c
// Function: callback_append_put_nextblk
int
callback_append_put_nextblk(void * cookie)
{
	struct append_cookie * C = cookie;
	struct state * S = C->S;
	struct proto_lbs_request * R = C->R;
	size_t i;

	/* Store all the blocks. */
	for (i = 0; i < R->r.append.nblks; i++) {
		if (proto_dynamodb_kv_request_put(S->Q,
		    objmap(C->nextblk_old + i),
		    &R->r.append.buf[i * S->blklen], S->blklen,
		    callback_append_put_blks, C))
			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 0x8(%rdi), %r12
cmpl $0x0, 0x10(%r12)
je 0x3eab
movq %rdi, %rbx
movq (%rdi), %r13
xorl %ebp, %ebp
leaq 0x5a(%rip), %r14        # 0x3ec3
movq 0x18(%r13), %r15
movq 0x28(%rbx), %rdi
addq %rbp, %rdi
callq 0x4954
movl (%r13), %ecx
movq %rbp, %rdx
imulq %rcx, %rdx
addq 0x20(%r12), %rdx
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %r8
movq %rbx, %r9
callq 0x97f4
testl %eax, %eax
jne 0x3eaf
incq %rbp
movl 0x10(%r12), %eax
cmpq %rax, %rbp
jb 0x3e69
xorl %eax, %eax
jmp 0x3eb4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs-dynamodb/state.c
// Function: callback_append_put_blks
int
callback_append_put_blks(void * cookie, int status)
{
	struct append_cookie * C = cookie;
	struct state * S = C->S;

	/* Sanity-check: We should be storing blocks. */
	assert(C->nblks_left != 0);

	/* Failures are bad. */
	if (status) {
		warn0("DynamoDB-KV failed storing data block");
		goto err0;
	}

	/* We've stored a block. */
	C->nblks_left--;

	/* If we've stored all the blocks, record a new lastblk value. */
	if (C->nblks_left == 0) {
		S->lastblk = S->nextblk - 1;
		if (metadata_lastblk_write(S->M, S->lastblk,
		    callback_append_put_lastblk, C))
			goto err0;
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbx
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0x3f27
testl %esi, %esi
je 0x3ef1
leaq 0x96f0(%rip), %rdi      # 0xd5c8
xorl %eax, %eax
callq 0x96cf
callq 0x20a0
movl $0x0, (%rax)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x3f02
movq %rdi, %rcx
movq (%rdi), %rdx
xorl %ebx, %ebx
decq %rax
movq %rax, 0x20(%rdi)
je 0x3f06
movl %ebx, %eax
popq %rbx
retq
movq 0x10(%rdx), %rsi
movq 0x20(%rdx), %rdi
decq %rsi
movq %rsi, 0x8(%rdx)
leaq 0x2a(%rip), %rdx        # 0x3f46
callq 0x4749
testl %eax, %eax
jne 0x3eea
jmp 0x3f02
leaq 0x965d(%rip), %rdi      # 0xd58b
leaq 0x95ad(%rip), %rsi      # 0xd4e2
leaq 0x9662(%rip), %rcx      # 0xd59e
movl $0x155, %edx            # imm = 0x155
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs-dynamodb/deleteto.c
// Function: deleteto_init
struct deleteto *
deleteto_init(struct wire_requestqueue * Q_DDBKV, struct metadata * M)
{
	struct deleteto * D;

	/* Allocate and initialize a DeleteTo structure. */
	if ((D = malloc(sizeof(struct deleteto))) == NULL)
		goto err0;
	D->Q = Q_DDBKV;
	D->MD = M;
	D->N = 0;
	D->flushed = 0;
	D->npending = 0;
	D->shuttingdown = 0;
	D->shutdown = 0;
	D->ip_head = NULL;
	D->ip_tail = NULL;

	/* How far are we guaranteed was previously deleted? */
	D->M = metadata_deletedto_read(D->MD);

	/* We want to be poked every time a metadata write completes. */
	metadata_deletedto_register(D->MD, poke, D);

	/* Success! */
	return (D);

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x48, %edi
callq 0x2270
movq %rax, %rbx
testq %rax, %rax
je 0x3ff7
movq %r15, (%rbx)
movq %r14, 0x8(%rbx)
xorl %eax, %eax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x30(%rbx)
movq %rax, 0x40(%rbx)
movq %r14, %rdi
callq 0x4797
movq %rax, 0x18(%rbx)
leaq 0x14(%rip), %rsi        # 0x4000
movq %r14, %rdi
movq %rbx, %rdx
callq 0x47a1
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs-dynamodb/deleteto.c
// Function: callback_done
static int
callback_done(void * cookie, int status)
{
	struct delete * D1 = cookie;
	struct deleteto * D = D1->D;

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

	/* Failures are bad, m'kay? */
	if (status) {
		warn0("DynamoDB-KV DELETE operation failed!");
		goto err0;
	}

	/* Remove from linked list of in-progress deletes. */
	if (D1->prev != NULL)
		D1->prev->next = D1->next;
	else
		D->ip_head = D1->next;
	if (D1->next != NULL)
		D1->next->prev = D1->prev;
	else
		D->ip_tail = D1->prev;

	/* Free cookie. */
	free(D1);

	/* We've finished an operation. */
	D->npending -= 1;

	/* Check what we should do next. */
	if (poke(D))
		goto err0;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbx
movq (%rdi), %rbx
cmpq $0x0, 0x28(%rbx)
je 0x4268
testl %esi, %esi
je 0x421c
leaq 0x9594(%rip), %rdi      # 0xd79c
xorl %eax, %eax
callq 0x96cf
callq 0x20a0
movl $0x0, (%rax)
jmp 0x425d
movq 0x10(%rdi), %rax
leaq 0x38(%rbx), %rcx
leaq 0x18(%rax), %rdx
testq %rax, %rax
cmoveq %rcx, %rdx
movq 0x18(%rdi), %rcx
movq %rcx, (%rdx)
leaq 0x40(%rbx), %rdx
leaq 0x10(%rcx), %rsi
testq %rcx, %rcx
cmoveq %rdx, %rsi
movq %rax, (%rsi)
callq 0x2040
decq 0x28(%rbx)
movq %rbx, %rdi
callq 0x4000
testl %eax, %eax
je 0x4264
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
retq
xorl %eax, %eax
jmp 0x4262
leaq 0x94f3(%rip), %rdi      # 0xd762
leaq 0x94fc(%rip), %rsi      # 0xd772
leaq 0x9500(%rip), %rcx      # 0xd77d
movl $0xb1, %edx
callq 0x21a0
nop
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs-dynamodb/metadata.c
// Function: callback_readmetadata
static int
callback_readmetadata(void * cookie, int status,
    const uint8_t * buf, size_t len)
{
	struct metadata * M = cookie;
	uint8_t nbuf[104];

	/* Failures are bad. */
	if (status == 1)
		goto err0;

	/* Did the item exist? */
	if (status == 2) {
		warnp("metadata table is not initialized");
		goto err0;
	}

	/* We should have 104 bytes. */
	if (len != 104) {
		warn0("metadata has incorrect size: %zu", len);
		goto err0;
	}

	/* Parse it. */
	M->M_stored.nextblk = be64dec(&buf[0]);
	M->M_stored.deletedto = be64dec(&buf[8]);
	M->M_stored.generation = be64dec(&buf[16]);
	M->M_stored.lastblk = be64dec(&buf[24]);
	M->itemsz = be64dec(&buf[64]);
	memcpy(M->tableid, &buf[72], 32);

	/* Generate a random process ID. */
	if (entropy_read(M->process_id, 32)) {
		warn0("Failed to generate random process ID");
		goto err0;
	}

	/* Write new metadata back. */
	memcpy(nbuf, buf, 104);
	memcpy(&nbuf[32], M->process_id, 32);
	if (proto_dynamodb_kv_request_icas(M->Q, "metadata", buf, 104,
	    nbuf, 104, callback_claimmetadata, M))
		goto err0;

	/* Success! */
	return (0);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
cmpl $0x1, %esi
je 0x4586
cmpl $0x2, %esi
jne 0x447b
callq 0x20a0
cmpl $0x0, (%rax)
je 0x451c
movq %rax, %rbx
leaq 0x94dd(%rip), %rdi      # 0xd946
xorl %eax, %eax
callq 0x95b0
movl $0x0, (%rbx)
jmp 0x4586
cmpq $0x68, %rcx
jne 0x44fe
movq %rdx, %rbx
movq %rdi, %r14
movq (%rdx), %rax
bswapq %rax
movq %rax, 0x8(%rdi)
movq 0x8(%rdx), %rax
bswapq %rax
movq %rax, 0x10(%rdi)
movq 0x10(%rdx), %rax
bswapq %rax
movq %rax, 0x18(%rdi)
movq 0x18(%rdx), %rax
bswapq %rax
movq %rax, 0x20(%rdi)
movq 0x40(%rdx), %rax
bswapq %rax
movq %rax, 0xd8(%rdi)
movups 0x48(%rdx), %xmm0
movups 0x58(%rdx), %xmm1
movups %xmm0, 0xe0(%rdi)
movups %xmm1, 0xf0(%rdi)
leaq 0x98(%rdi), %r15
movl $0x20, %esi
movq %r15, %rdi
callq 0x76bb
testl %eax, %eax
je 0x452c
leaq 0x9494(%rip), %rdi      # 0xd989
xorl %eax, %eax
callq 0x96cf
jmp 0x450f
leaq 0x9463(%rip), %rdi      # 0xd968
movq %rcx, %rsi
xorl %eax, %eax
callq 0x96cf
callq 0x20a0
movl $0x0, (%rax)
jmp 0x4586
leaq 0x9423(%rip), %rdi      # 0xd946
xorl %eax, %eax
callq 0x96cf
jmp 0x4586
movq %rsp, %r12
movl $0x68, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2250
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movaps %xmm0, 0x20(%r12)
movaps %xmm1, 0x30(%r12)
movq (%r14), %rdi
leaq 0x2b7(%rip), %rax       # 0x4815
leaq 0x9297(%rip), %rsi      # 0xd7fc
movl $0x68, %ecx
movl $0x68, %r9d
movq %r12, %r8
movq %rbx, %rdx
pushq %r14
pushq %rax
callq 0x99f4
addq $0x10, %rsp
testl %eax, %eax
je 0x4597
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
xorl %eax, %eax
jmp 0x458b
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs-dynamodb/metadata.c
// Function: writemetadata
static int
writemetadata(struct metadata * M)
{
	uint8_t obuf[104];
	uint8_t buf[104];

	/* Is a write already in progress? */
	if (M->write_inprogress == 1) {
		M->write_wanted = 1;
		return (0);
	}

	/* We're going to start a write now. */
	M->write_inprogress = 1;
	M->write_wanted = 0;

	/* We're going to store the latest metadata values. */
	M->M_storing = M->M_latest;

	/* The requested callback will be performed when the store completes. */
	M->M_latest.callback_state = NULL;

	/* Increment metadata generation for the next metadata stored. */
	M->M_latest.generation++;

	/* Encode metadata. */
	be64enc(&obuf[0], M->M_stored.nextblk);
	be64enc(&obuf[8], M->M_stored.deletedto);
	be64enc(&obuf[16], M->M_stored.generation);
	be64enc(&obuf[24], M->M_stored.lastblk);
	memcpy(&obuf[32], M->process_id, 32);
	be64enc(&obuf[64], M->itemsz);
	memcpy(&obuf[72], M->tableid, 32);
	be64enc(&buf[0], M->M_storing.nextblk);
	be64enc(&buf[8], M->M_storing.deletedto);
	be64enc(&buf[16], M->M_storing.generation);
	be64enc(&buf[24], M->M_storing.lastblk);
	memcpy(&buf[32], M->process_id, 32);
	be64enc(&buf[64], M->itemsz);
	memcpy(&buf[72], M->tableid, 32);

	/* Write metadata. */
	if (proto_dynamodb_kv_request_icas(M->Q, "metadata", obuf, 104,
	    buf, 104, callback_writemetadata, M))
		goto err0;

	/* Success! */
	return (0);

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

// Assembly:
movq %rdi, %rax
cmpl $0x1, 0xc8(%rdi)
jne 0x4604
movl $0x1, 0xcc(%rax)
xorl %eax, %eax
retq
subq $0xd8, %rsp
movq $0x1, 0xc8(%rax)
movups 0x68(%rax), %xmm0
movups %xmm0, 0x38(%rax)
movups 0x78(%rax), %xmm0
movups %xmm0, 0x48(%rax)
movups 0x88(%rax), %xmm0
movups %xmm0, 0x58(%rax)
movq $0x0, 0x88(%rax)
incq 0x78(%rax)
movq 0x8(%rax), %rcx
bswapq %rcx
leaq 0x70(%rsp), %rdx
movq %rcx, (%rdx)
movq 0x10(%rax), %rcx
bswapq %rcx
movq %rcx, 0x8(%rdx)
movq 0x18(%rax), %rcx
bswapq %rcx
movq %rcx, 0x10(%rdx)
movq 0x20(%rax), %rcx
bswapq %rcx
movq %rcx, 0x18(%rdx)
movups 0x98(%rax), %xmm0
movups 0xa8(%rax), %xmm1
movaps %xmm0, 0x20(%rdx)
movaps %xmm1, 0x30(%rdx)
movq 0xd8(%rax), %rcx
bswapq %rcx
movq %rcx, 0x40(%rdx)
movups 0xe0(%rax), %xmm0
movups 0xf0(%rax), %xmm1
movups %xmm0, 0x48(%rdx)
movups %xmm1, 0x58(%rdx)
movq 0x38(%rax), %rsi
bswapq %rsi
movq %rsp, %r8
movq %rsi, (%r8)
movq 0x40(%rax), %rsi
bswapq %rsi
movq %rsi, 0x8(%r8)
movq 0x48(%rax), %rsi
bswapq %rsi
movq %rsi, 0x10(%r8)
movq 0x50(%rax), %rsi
bswapq %rsi
movq %rsi, 0x18(%r8)
movups 0x98(%rax), %xmm0
movups 0xa8(%rax), %xmm1
movaps %xmm0, 0x20(%r8)
movaps %xmm1, 0x30(%r8)
movq %rcx, 0x40(%r8)
movups 0xe0(%rax), %xmm0
movups 0xf0(%rax), %xmm1
movups %xmm0, 0x48(%r8)
movups %xmm1, 0x58(%r8)
movq (%rax), %rdi
leaq 0x149(%rip), %r10       # 0x485f
leaq 0x90df(%rip), %rsi      # 0xd7fc
movl $0x68, %ecx
movl $0x68, %r9d
pushq %rax
pushq %r10
callq 0x99f4
addq $0x10, %rsp
movl %eax, %ecx
xorl %eax, %eax
negl %ecx
sbbl %eax, %eax
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs-dynamodb/metadata.c
// Function: metadata_free
void
metadata_free(struct metadata * M)
{

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

	/* We shouldn't have any updates or callbacks in flight. */
	assert(M->M_latest.callback_state == NULL);
	assert(M->callback_deletedto == NULL);

	/* Free our structure. */
	free(M);
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x47d5
cmpq $0x0, 0x88(%rdi)
jne 0x47d7
cmpq $0x0, 0xb8(%rdi)
jne 0x47f6
popq %rax
jmp 0x2040
popq %rax
retq
leaq 0x9054(%rip), %rdi      # 0xd832
leaq 0x9070(%rip), %rsi      # 0xd855
leaq 0x9116(%rip), %rcx      # 0xd902
movl $0x1cd, %edx            # imm = 0x1CD
callq 0x21a0
leaq 0x912b(%rip), %rdi      # 0xd928
leaq 0x9051(%rip), %rsi      # 0xd855
leaq 0x90f7(%rip), %rcx      # 0xd902
movl $0x1ce, %edx            # imm = 0x1CE
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs-dynamodb/metadata.c
// Function: callback_writemetadata
static int
callback_writemetadata(void * _m, int status)
{
	struct metadata * M = _m;
	int (* callback)(void *);
	void * cookie;
	int rc = 0;
	int rc2;

	/* Sanity-check. */
	assert(M->write_inprogress);

	/* Did we succeed? */
	switch (status) {
	case 0:
		/* Request succeeded. */
		break;
	case 1:
		/* Request failed.  This is bad. */
		warn0("Failed to store metadata to DynamoDB!");
		goto err0;
	case 2:
		/* Another process stole the metadata from us. */
		warn0("Lost ownership of metadata in DynamoDB!");

		/*
		 * We could error out here, but it's safer to just abort;
		 * another process stealing our metadata tells us that we
		 * should not do anything else at all.
		 */
		_exit(0);
	}

	/* We're no longer storing metadata. */
	M->write_inprogress = 0;

	/* The values we were storing have now been stored. */
	M->M_stored = M->M_storing;

	/* Perform callbacks as appropriate. */
	if (M->M_stored.callback_state != NULL) {
		callback = M->M_stored.callback_state;
		cookie = M->M_stored.cookie_state;
		if ((rc2 = (callback)(cookie)) != 0)
			rc = rc2;
	}
	if (M->callback_deletedto != NULL) {
		callback = M->callback_deletedto;
		cookie = M->cookie_deletedto;
		if ((rc2 = (callback)(cookie)) != 0)
			rc = rc2;
	}

	/* Start another write if needed. */
	if (M->write_wanted) {
		if ((rc2 = writemetadata(M)) != 0)
			rc = rc2;
	}

	/* Return status from callbacks or writemetadata. */
	return (rc);

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

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
cmpl $0x0, 0xc8(%rdi)
je 0x4913
cmpl $0x1, %esi
je 0x48b5
cmpl $0x2, %esi
je 0x4932
movq %rdi, %rbx
movl $0x0, 0xc8(%rdi)
movups 0x38(%rdi), %xmm0
movups 0x48(%rdi), %xmm1
movups 0x58(%rdi), %xmm2
movups %xmm2, 0x28(%rdi)
movups %xmm0, 0x8(%rdi)
movups %xmm1, 0x18(%rdi)
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x48d5
movq 0x30(%rbx), %rdi
callq *%rax
movl %eax, %ebp
jmp 0x48d7
leaq 0x9155(%rip), %rdi      # 0xda11
xorl %eax, %eax
callq 0x96cf
callq 0x20a0
movl $0x0, (%rax)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x490a
xorl %ebp, %ebp
movq 0xb8(%rbx), %rax
testq %rax, %rax
je 0x48f1
movq 0xc0(%rbx), %rdi
callq *%rax
testl %eax, %eax
cmovnel %eax, %ebp
cmpl $0x0, 0xcc(%rbx)
je 0x490a
movq %rbx, %rdi
callq 0x45eb
xorl %ecx, %ecx
negl %eax
sbbl %ecx, %ecx
orl %ecx, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x90bb(%rip), %rdi      # 0xd9d5
leaq 0x8f34(%rip), %rsi      # 0xd855
leaq 0x90c1(%rip), %rcx      # 0xd9e9
movl $0xc2, %edx
callq 0x21a0
leaq 0x90fe(%rip), %rdi      # 0xda37
xorl %eax, %eax
callq 0x96cf
callq 0x20a0
movl $0x0, (%rax)
xorl %edi, %edi
callq 0x20c0
nop
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs-dynamodb/objmap.c
// Function: objmap
const char *
objmap(uint64_t N)
{
	uint8_t Nbuf[8];
	static char key[17]; /* 0123456789ABCDEF\0 */

	/* Serialize the value N. */
	be64enc(Nbuf, N);

	/* Hexify the 8-byte integer. */
	hexify(Nbuf, key, 8);

	/* Return the constructed string. */
	return (key);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
bswapq %rdi
leaq 0x8(%rsp), %rax
movq %rdi, (%rax)
leaq 0xfc75(%rip), %rbx      # 0x145e0
movl $0x8, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x7e08
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/util/entropy.c
// Function: entropy_read_init
struct entropy_read_cookie *
entropy_read_init(void)
{
	struct entropy_read_cookie * er;

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

	/* Open /dev/urandom. */
	if ((er->fd = open("/dev/urandom", O_RDONLY)) == -1) {
		warnp("open(/dev/urandom)");
		goto err1;
	}

	/* Success! */
	return (er);

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x4, %edi
callq 0x2270
testq %rax, %rax
je 0x74f5
movq %rax, %rbx
leaq 0x6ce8(%rip), %rdi      # 0xe1a9
xorl %esi, %esi
xorl %eax, %eax
callq 0x2300
movl %eax, (%rbx)
cmpl $-0x1, %eax
jne 0x7545
callq 0x20a0
cmpl $0x0, (%rax)
je 0x752d
movq %rax, %r14
leaq 0x6cd1(%rip), %rdi      # 0xe1b6
xorl %eax, %eax
callq 0x95b0
movl $0x0, (%r14)
jmp 0x753b
callq 0x20a0
cmpl $0x0, (%rax)
je 0x751b
movq %rax, %r14
leaq 0x6c99(%rip), %rdi      # 0xe1a2
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x95b0
movl $0x0, (%r14)
jmp 0x7545
leaq 0x6c80(%rip), %rdi      # 0xe1a2
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x96cf
jmp 0x7545
leaq 0x6c82(%rip), %rdi      # 0xe1b6
xorl %eax, %eax
callq 0x96cf
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_O3/Tarsnap[P]kivaloo/liball/../libcperciva/util/entropy.c
// Function: entropy_read_fill
int
entropy_read_fill(struct entropy_read_cookie * er, uint8_t * buf,
    size_t buflen)
{
	ssize_t lenread;

	/* Sanity checks. */
	assert(er != NULL);
	assert(buflen <= SSIZE_MAX);

	/* Read bytes until we have filled the buffer. */
	while (buflen > 0) {
		if ((lenread = read(er->fd, buf, buflen)) == -1) {
			warnp("read(/dev/urandom)");
			goto err0;
		}

		/* The random device should never EOF. */
		if (lenread == 0) {
			warn0("EOF on /dev/urandom?");
			goto err0;
		}

		/* We've filled a portion of the buffer. */
		buf += (size_t)lenread;
		buflen -= (size_t)lenread;
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x75fd
movq %rdx, %r14
testq %rdx, %rdx
js 0x761c
xorl %ebx, %ebx
testq %r14, %r14
je 0x75ef
movq %rsi, %r15
movq %rdi, %r12
movl (%r12), %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2210
testq %rax, %rax
je 0x75c1
cmpq $-0x1, %rax
je 0x759e
addq %rax, %r15
subq %rax, %r14
jne 0x757a
jmp 0x75ef
callq 0x20a0
cmpl $0x0, (%rax)
je 0x75dc
movq %rax, %rbx
leaq 0x6c87(%rip), %rdi      # 0xe239
xorl %eax, %eax
callq 0x95b0
movl $0x0, (%rbx)
jmp 0x75ea
leaq 0x6c84(%rip), %rdi      # 0xe24c
xorl %eax, %eax
callq 0x96cf
callq 0x20a0
movl $0x0, (%rax)
jmp 0x75ea
leaq 0x6c56(%rip), %rdi      # 0xe239
xorl %eax, %eax
callq 0x96cf
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x6bc5(%rip), %rdi      # 0xe1c9
leaq 0x6bc9(%rip), %rsi      # 0xe1d4
leaq 0x6be0(%rip), %rcx      # 0xe1f2
movl $0x4a, %edx
callq 0x21a0
leaq 0x6a8d(%rip), %rdi      # 0xe0b0
leaq 0x6baa(%rip), %rsi      # 0xe1d4
leaq 0x6bc1(%rip), %rcx      # 0xe1f2
movl $0x4b, %edx
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/util/entropy.c
// Function: entropy_read_done
int
entropy_read_done(struct entropy_read_cookie * er)
{

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

	/* Close the device. */
	while (close(er->fd) == -1) {
		if (errno != EINTR) {
			warnp("close(/dev/urandom)");
			goto err1;
		}
	}

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

	/* Success! */
	return (0);

err1:
	free(er);

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x769c
movq %rdi, %rbx
movl (%rbx), %edi
callq 0x21c0
cmpl $-0x1, %eax
jne 0x7676
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x7647
leaq 0x6c2c(%rip), %rdi      # 0xe295
testl %eax, %eax
jne 0x767a
xorl %eax, %eax
callq 0x96cf
jmp 0x7688
xorl %ebp, %ebp
jmp 0x768d
xorl %eax, %eax
callq 0x95b0
movl $0x0, (%r14)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x6b26(%rip), %rdi      # 0xe1c9
leaq 0x6b2a(%rip), %rsi      # 0xe1d4
leaq 0x6bb0(%rip), %rcx      # 0xe261
movl $0x70, %edx
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/util/entropy.c
// Function: entropy_read
int
entropy_read(uint8_t * buf, size_t buflen)
{
	struct entropy_read_cookie * er;

	/* Sanity-check the buffer size. */
	assert(buflen <= SSIZE_MAX);

	/* Open /dev/urandom. */
	if ((er = entropy_read_init()) == NULL) {
		warn0("entropy_read_init");
		goto err0;
	}

	/* Read bytes until we have filled the buffer. */
	if (entropy_read_fill(er, buf, buflen)) {
		warn0("entropy_read_fill");
		goto err1;
	}

	/* Close the device. */
	if (entropy_read_done(er)) {
		warn0("entropy_read_done");
		goto err0;
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rsi, %rsi
js 0x774e
movq %rsi, %r14
movq %rdi, %r15
callq 0x74a4
testq %rax, %rax
je 0x7711
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x7550
testl %eax, %eax
je 0x771a
leaq 0x6bea(%rip), %rdi      # 0xe2df
xorl %eax, %eax
callq 0x96cf
callq 0x20a0
movl $0x0, (%rax)
movq %rbx, %rdi
callq 0x763b
jmp 0x773f
leaq 0x6bb5(%rip), %rdi      # 0xe2cd
jmp 0x772d
movq %rbx, %rdi
callq 0x763b
testl %eax, %eax
je 0x774a
leaq 0x6bc4(%rip), %rdi      # 0xe2f1
xorl %eax, %eax
callq 0x96cf
callq 0x20a0
movl $0x0, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
jmp 0x7744
leaq 0x695b(%rip), %rdi      # 0xe0b0
leaq 0x6a78(%rip), %rsi      # 0xe1d4
leaq 0x6b46(%rip), %rcx      # 0xe2a9
movl $0x91, %edx
callq 0x21a0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/proto_lbs/proto_lbs_server.c
// Function: proto_lbs_request_read
int
proto_lbs_request_read(struct netbuf_read * R, struct proto_lbs_request * req)
{
	struct wire_packet P;

	/* Try to grab a packet from the buffered reader. */
	if (wire_readpacket_peek(R, &P))
		goto err0;

	/* Do we have a packet? */
	if (P.buf == NULL)
		goto nopacket;

	/* Parse this packet. */
	if (proto_lbs_request_parse(&P, req))
		goto err0;

	/* Consume the packet. */
	wire_readpacket_consume(R, &P);

	/* Success! */
	return (0);

nopacket:
	/* Record that no request was available. */
	req->type = PROTO_LBS_NONE;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rsi
callq 0xa5d8
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0xa277
movq 0x18(%rsp), %r15
testq %r15, %r15
je 0xa258
movq 0x10(%rsp), %r12
movq %r12, %rax
shrq $0x20, %rax
jne 0xa2dd
movq 0x8(%rsp), %rax
movq %rax, (%r14)
cmpq $0x4, %r12
jb 0xa277
movl (%r15), %eax
bswapl %eax
movl %eax, 0x8(%r14)
cmpl $0x4, %eax
ja 0xa277
leaq 0x4bd0(%rip), %rcx      # 0xee0c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpq $0xc, %r12
jne 0xa277
movq 0x4(%r15), %rax
bswapq %rax
movq %rax, 0x10(%r14)
jmp 0xa268
movl $0xffffffff, 0x8(%r14)  # imm = 0xFFFFFFFF
jmp 0xa275
cmpq $0x4, %r12
jne 0xa277
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xaa95
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x10, %r12
jb 0xa277
movl 0x4(%r15), %ecx
bswapl %ecx
movl %ecx, 0x10(%r14)
movq 0x8(%r15), %rax
bswapq %rax
movq %rax, 0x18(%r14)
testl %ecx, %ecx
je 0xa277
addq $-0x10, %r12
movl %r12d, %eax
xorl %edx, %edx
divl %ecx
testl %edx, %edx
jne 0xa277
movl %eax, 0x14(%r14)
movq %r12, %rdi
callq 0x2270
movq %rax, 0x20(%r14)
testq %rax, %rax
je 0xa277
addq $0x10, %r15
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2250
jmp 0xa268
leaq 0x4c29(%rip), %rdi      # 0xef0d
leaq 0x4b54(%rip), %rsi      # 0xee3f
leaq 0x4c30(%rip), %rcx      # 0xef22
movl $0x15, %edx
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/proto_lbs/proto_lbs_server.c
// Function: proto_lbs_response_params
int
proto_lbs_response_params(struct netbuf_write * Q, uint64_t ID,
    uint32_t blklen, uint64_t blkno)
{
	uint8_t * wbuf;

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

	/* Write the packet data. */
	be32enc(&wbuf[0], blklen);
	be64enc(&wbuf[4], blkno);

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

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rcx, %rbx
movl %edx, %ebp
movq %rdi, %r14
movl $0xc, %edx
callq 0xb2f4
testq %rax, %rax
je 0xa37e
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, 0xb(%rax)
movb %bh, 0xa(%rax)
movl %ebx, %ecx
shrl $0x10, %ecx
movb %cl, 0x9(%rax)
movl %ebx, %ecx
shrl $0x18, %ecx
movb %cl, 0x8(%rax)
movq %rbx, %rcx
shrq $0x20, %rcx
movb %cl, 0x7(%rax)
movq %rbx, %rcx
shrq $0x28, %rcx
movb %cl, 0x6(%rax)
movq %rbx, %rcx
shrq $0x30, %rcx
movb %cl, 0x5(%rax)
shrq $0x38, %rbx
movb %bl, 0x4(%rax)
movl $0xc, %edx
movq %r14, %rdi
movq %rax, %rsi
callq 0xb3c2
testl %eax, %eax
je 0xa385
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xa387
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/proto_lbs/proto_lbs_server.c
// Function: proto_lbs_response_get
int
proto_lbs_response_get(struct netbuf_write * Q, uint64_t ID,
    int status, uint32_t blklen, const uint8_t * buf)
{
	uint8_t * wbuf;
	size_t len;

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

	/* Compute the response length. */
	len = 4 + ((status == 0) ? blklen : 0);

	/* 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)
		memcpy(&wbuf[4], buf, blklen);

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

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x2, %edx
jae 0xa4f3
movq %r8, %r14
movl %ecx, %r12d
movl %edx, %ebp
movq %rdi, %rbx
leal 0x4(%r12), %eax
testl %edx, %edx
movl $0x4, %r15d
cmovel %eax, %r15d
movq %r15, %rdx
callq 0xb2f4
testq %rax, %rax
je 0xa4db
movq %rax, %r13
movb %bpl, 0x3(%rax)
movb $0x0, 0x2(%rax)
movw $0x0, (%rax)
testl %ebp, %ebp
jne 0xa4c9
movq %r13, %rdi
addq $0x4, %rdi
movl %r12d, %edx
movq %r14, %rsi
callq 0x2250
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0xb3c2
testl %eax, %eax
je 0xa4e2
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xa4e4
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4926(%rip), %rdi      # 0xee20
leaq 0x493e(%rip), %rsi      # 0xee3f
leaq 0x495b(%rip), %rcx      # 0xee63
movl $0xc5, %edx
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/proto_lbs/proto_lbs_server.c
// Function: proto_lbs_response_append
int
proto_lbs_response_append(struct netbuf_write * Q, uint64_t ID,
    int status, uint64_t blkno)
{
	uint8_t * wbuf;
	size_t len;

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

	/* Compute the response length. */
	len = (status == 0) ? 12 : 4;

	/* 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)
		be64enc(&wbuf[4], blkno);

	/* 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 %rbx
pushq %rax
cmpl $0x2, %edx
jae 0xa580
movq %rcx, %r14
movl %edx, %ebp
movq %rdi, %rbx
xorl %eax, %eax
testl %edx, %edx
sete %al
leaq 0x4(,%rax,8), %r15
movq %r15, %rdx
callq 0xb2f4
testq %rax, %rax
je 0xa56c
movb %bpl, 0x3(%rax)
movb $0x0, 0x2(%rax)
movw $0x0, (%rax)
testl %ebp, %ebp
jne 0xa55a
bswapq %r14
movq %r14, 0x4(%rax)
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0xb3c2
testl %eax, %eax
je 0xa573
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xa575
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4899(%rip), %rdi      # 0xee20
leaq 0x48b1(%rip), %rsi      # 0xee3f
leaq 0x492a(%rip), %rcx      # 0xeebf
movl $0xec, %edx
callq 0x21a0