// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/lbs-dynamodb-init/main.c
// Function: createmetadata
static int
createmetadata(const char * key_id, const char * key_secret,
    const char * region, struct sock_addr * const * sas_ddb,
    const char * tablename, size_t itemsz, uint8_t * tableid)
{
	uint8_t metadata[104];
	char * ddbreq;
	char * body;

	/* Tell the user what we're doing. */
	fprintf(stderr, "Storing initial metadata");

	/* Construct the metadata. */
	be64enc(&metadata[0], 0);		/* nextblk */
	be64enc(&metadata[8], 0);		/* deletedto */
	be64enc(&metadata[16], 0);		/* generation */
	be64enc(&metadata[24], (uint64_t)(-1));	/* lastblk */
	memset(&metadata[32], 0, 32);		/* process_id */
	be64enc(&metadata[64], (uint64_t)(itemsz));	/* itemsz */
	memcpy(&metadata[72], tableid, 32);	/* table ID */

	/* Construct a request to store metadata. */
	if ((ddbreq = dynamodb_kv_create(tablename, "metadata",
	    metadata, 104)) == NULL) {
		warnp("dynamodb_kv_create");
		goto err0;
	}

	/* Send the request. */
	if ((body = request(key_id, key_secret, region, sas_ddb,
	    "PutItem", ddbreq)) == NULL) {
		warnp("Metadata PutItem failed: %s", ddbreq);
		goto err1;
	}

	/* Free request and response. */
	free(body);
	free(ddbreq);

	/* Print delayed EOL. */
	fprintf(stderr, "\n");

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq 0x20592(%rip), %rax     # 0x23fe0
movq (%rax), %rdi
leaq 0x18c10(%rip), %rsi     # 0x1c668
movb $0x0, %al
callq 0x24a0
leaq -0xa0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3f40
leaq -0xa0(%rbp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3f40
leaq -0xa0(%rbp), %rdi
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3f40
leaq -0xa0(%rbp), %rdi
addq $0x18, %rdi
movq $-0x1, %rsi
callq 0x3f40
leaq -0xa0(%rbp), %rdi
addq $0x20, %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x21a0
leaq -0xa0(%rbp), %rdi
addq $0x40, %rdi
movq -0x38(%rbp), %rsi
callq 0x3f40
movq 0x10(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x58(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x50(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0x48(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
leaq 0x1875c(%rip), %rsi     # 0x1c26a
movl $0x68, %ecx
callq 0xaab0
movq %rax, -0xa8(%rbp)
cmpq $0x0, %rax
jne 0x3b61
jmp 0x3b27
callq 0x2040
cmpl $0x0, (%rax)
je 0x3b4c
leaq 0x18af9(%rip), %rdi     # 0x1c631
movb $0x0, %al
callq 0x9d30
callq 0x2040
movl $0x0, (%rax)
jmp 0x3b5a
leaq 0x18ade(%rip), %rdi     # 0x1c631
movb $0x0, %al
callq 0x9f80
jmp 0x3b5c
jmp 0x3c1d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0xa8(%rbp), %r9
leaq 0x18ac5(%rip), %r8      # 0x1c644
callq 0x3c60
movq %rax, -0xb0(%rbp)
cmpq $0x0, %rax
jne 0x3bd8
jmp 0x3b93
callq 0x2040
cmpl $0x0, (%rax)
je 0x3bbf
movq -0xa8(%rbp), %rsi
leaq 0x18ad6(%rip), %rdi     # 0x1c681
movb $0x0, %al
callq 0x9d30
callq 0x2040
movl $0x0, (%rax)
jmp 0x3bd4
movq -0xa8(%rbp), %rsi
leaq 0x18ab4(%rip), %rdi     # 0x1c681
movb $0x0, %al
callq 0x9f80
jmp 0x3bd6
jmp 0x3c11
movq -0xb0(%rbp), %rdi
callq 0x23e0
movq -0xa8(%rbp), %rdi
callq 0x23e0
movq 0x203e9(%rip), %rax     # 0x23fe0
movq (%rax), %rdi
leaq 0x1ad0f(%rip), %rsi     # 0x1e910
movb $0x0, %al
callq 0x24a0
movl $0x0, -0x4(%rbp)
jmp 0x3c24
movq -0xa8(%rbp), %rdi
callq 0x23e0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq