// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x40d8
cmpl $0x1, -0x14(%rbp)
je 0x40d8
cmpl $0x2, -0x14(%rbp)
jne 0x40da
jmp 0x40f9
leaq 0xf5ca(%rip), %rdi      # 0x136ab
leaq 0xf486(%rip), %rsi      # 0x1356e
movl $0xdc, %edx
leaq 0xf666(%rip), %rcx      # 0x1375a
callq 0x21b0
cmpl $0x2, -0x14(%rbp)
jne 0x414c
movq -0x30(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jne 0x414c
movq -0x30(%rbp), %rax
movl $0x1, 0x20(%rax)
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x5810
movq -0x50(%rbp), %rdi
movq %rax, %rsi
movq -0x30(%rbp), %rcx
leaq -0xaf(%rip), %rdx       # 0x4090
callq 0xe010
movl %eax, -0x4(%rbp)
jmp 0x4227
cmpl $0x0, -0x14(%rbp)
jne 0x418b
movq -0x28(%rbp), %rax
movq -0x40(%rbp), %rcx
movl (%rcx), %ecx
cmpq %rcx, %rax
je 0x418b
jmp 0x4163
movq -0x28(%rbp), %rsi
movq -0x40(%rbp), %rax
movl (%rax), %edx
leaq 0xf61d(%rip), %rdi      # 0x13791
movb $0x0, %al
callq 0xd260
callq 0x20a0
movl $0x0, (%rax)
jmp 0x4220
cmpl $0x1, -0x14(%rbp)
jne 0x41ca
jmp 0x4193
callq 0x20a0
cmpl $0x0, (%rax)
je 0x41b8
leaq 0xf62f(%rip), %rdi      # 0x137d3
movb $0x0, %al
callq 0xd010
callq 0x20a0
movl $0x0, (%rax)
jmp 0x41c6
leaq 0xf614(%rip), %rdi      # 0x137d3
movb $0x0, %al
callq 0xd260
jmp 0x41c8
jmp 0x4220
cmpl $0x2, -0x14(%rbp)
jne 0x41d8
movq $0x0, -0x20(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
movq 0x18(%rcx), %rdi
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rsi
movq -0x20(%rbp), %rdx
movq -0x40(%rbp), %rcx
movl (%rcx), %ecx
callq *%rax
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rcx
subq $0x1, %rcx
movq %rcx, 0x28(%rax)
movq -0x30(%rbp), %rdi
callq 0x2040
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x4227
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq