// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/proto_dynamodb_kv/proto_dynamodb_kv_client.c
// Function: callback_data
static int
callback_data(void * cookie, uint8_t * buf, size_t buflen)
{
	struct data_cookie * C = cookie;
	int failed = 1;
	uint32_t status;
	uint32_t len = 0;
	uint8_t * dbuf = NULL;
	int rc;

	/* If we have a packet, parse it. */
	if (buf != NULL) {
		/* Do we have the right packet length? */
		if (buflen < 4)
			BAD("GET", "bogus length");

		/* Parse the status. */
		status = be32dec(&buf[0]);

		/* Non-zero status is a failure. */
		switch (status) {
		case 0:
			break;
		case 1:
		case 2:
			if (buflen != 4)
				BAD("GET", "bogus length");
			failed = (int)status;
			goto failed;
		default:
			BAD("GET", "invalid status");
		}

		/* Parse the data length. */
		if (buflen < 8)
			BAD("GET", "bogus length");
		len = be32dec(&buf[4]);

		/* Do we have the right packet length? */
		if (buflen != 8 + len)
			BAD("GET", "bogus length");

		/* Success!  Point at the data. */
		failed = 0;
		dbuf = &buf[8];
	}

failed:
	/* Invoke the upstream callback. */
	rc = (C->callback)(C->cookie, failed, dbuf, len);

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x1, -0x24(%rbp)
movl $0x0, -0x2c(%rbp)
movq $0x0, -0x38(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x84e1
cmpq $0x4, -0x18(%rbp)
jae 0x83b4
jmp 0x8386
jmp 0x8388
leaq 0x6a0a(%rip), %rdi      # 0xed99
leaq 0x6a3c(%rip), %rsi      # 0xedd2
leaq 0x6a19(%rip), %rdx      # 0xedb6
movb $0x0, %al
callq 0x7770
callq 0x20a0
movl $0x0, (%rax)
jmp 0x84e3
movq -0x10(%rbp), %rdi
callq 0x8860
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x40(%rbp)
testl %eax, %eax
je 0x83d8
jmp 0x83cc
movl -0x40(%rbp), %eax
decl %eax
subl $0x2, %eax
jb 0x83da
jmp 0x841c
jmp 0x844c
cmpq $0x4, -0x18(%rbp)
je 0x8411
jmp 0x83e3
jmp 0x83e5
leaq 0x69ad(%rip), %rdi      # 0xed99
leaq 0x69df(%rip), %rsi      # 0xedd2
leaq 0x69bc(%rip), %rdx      # 0xedb6
movb $0x0, %al
callq 0x7770
callq 0x20a0
movl $0x0, (%rax)
jmp 0x84e3
movl -0x28(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x84e3
jmp 0x841e
jmp 0x8420
leaq 0x6972(%rip), %rdi      # 0xed99
leaq 0x69a4(%rip), %rsi      # 0xedd2
leaq 0x698e(%rip), %rdx      # 0xedc3
movb $0x0, %al
callq 0x7770
callq 0x20a0
movl $0x0, (%rax)
jmp 0x84e3
cmpq $0x8, -0x18(%rbp)
jae 0x8480
jmp 0x8455
jmp 0x8457
leaq 0x693b(%rip), %rdi      # 0xed99
leaq 0x696d(%rip), %rsi      # 0xedd2
leaq 0x694a(%rip), %rdx      # 0xedb6
movb $0x0, %al
callq 0x7770
callq 0x20a0
movl $0x0, (%rax)
jmp 0x84e3
movq -0x10(%rbp), %rdi
addq $0x4, %rdi
callq 0x8860
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x8, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
je 0x84ce
jmp 0x84a3
jmp 0x84a5
leaq 0x68ed(%rip), %rdi      # 0xed99
leaq 0x691f(%rip), %rsi      # 0xedd2
leaq 0x68fc(%rip), %rdx      # 0xedb6
movb $0x0, %al
callq 0x7770
callq 0x20a0
movl $0x0, (%rax)
jmp 0x84e3
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
jmp 0x84e3
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x8(%rcx), %rdi
movl -0x24(%rbp), %esi
movq -0x38(%rbp), %rdx
movl -0x2c(%rbp), %ecx
callq *%rax
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rdi
callq 0x2040
movl -0x3c(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)