// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/proto_dynamodb_kv/proto_dynamodb_kv_server.c
// Function: proto_dynamodb_kv_request_read
int
proto_dynamodb_kv_request_read(struct netbuf_read * R,
    struct proto_ddbkv_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_dynamodb_kv_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_DDBKV_NONE;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x20(%rsp), %rsi
callq 0xd6b4
pushq $-0x1
popq %rbx
testl %eax, %eax
je 0xcb16
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x30(%rsp), %r12
testq %r12, %r12
je 0xcb83
movq 0x20(%rsp), %rax
movq %rax, (%r14)
andq $0x0, 0x10(%r14)
andq $0x0, 0x20(%r14)
andq $0x0, 0x30(%r14)
movq 0x28(%rsp), %rbp
cmpq $0x4, %rbp
jb 0xcb05
movq %r12, %rdi
callq 0xce50
movl %eax, 0x8(%r14)
cmpq $0x4, %rbp
je 0xcb05
movzbl 0x4(%r12), %r13d
leaq 0x5(%r13), %rcx
cmpq %rcx, %rbp
jb 0xcb05
movl %eax, %edx
movq %rbp, 0x10(%rsp)
leaq 0x5(%r12), %rbp
xorl %eax, %eax
cmpq %rax, %r13
je 0xcb8f
cmpb $0x0, (%rbp,%rax)
leaq 0x1(%rax), %rax
jne 0xcb71
jmp 0xcb05
orl $-0x1, 0x8(%r14)
xorl %ebx, %ebx
jmp 0xcb05
movq %rdx, 0x18(%rsp)
movq %rcx, 0x8(%rsp)
leaq 0x1(%r13), %rdi
callq 0x34e0
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0xcb05
movq %rax, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %rax, %rbp
callq 0x32a0
movb $0x0, (%rbp,%r13)
xorl %edi, %edi
movq 0x18(%rsp), %rax
addl $0xfffeff00, %eax       # imm = 0xFFFEFF00
cmpl $0x20, %eax
ja 0xcce1
pushq $0x7
popq %rcx
btq %rax, %rcx
jb 0xcc1a
movabsq $0x100030000, %rcx      # imm = 0x100030000
btq %rax, %rcx
movq 0x10(%rsp), %rax
jae 0xcce1
cmpq 0x8(%rsp), %rax
jne 0xcce1
leaq 0x20(%rsp), %rsi
movq %r15, %rdi
callq 0xda74
jmp 0xcb88
addq $0x9, %r13
movq 0x10(%rsp), %rbp
cmpq %r13, %rbp
jb 0xccdf
movq 0x8(%rsp), %rdi
addq %r12, %rdi
callq 0xce50
movl %eax, 0x18(%r14)
movq %rbp, %rcx
movl %eax, %ebp
movq %r13, %rax
addq %rbp, %rax
cmpq %rax, %rcx
jb 0xccdf
movq %rax, 0x8(%rsp)
movq %rbp, %rdi
callq 0x34e0
movq %rax, 0x20(%r14)
testq %rax, %rax
je 0xccdf
addq %r12, %r13
movq %rax, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x32a0
cmpl $0x10101, 0x18(%rsp)    # imm = 0x10101
jne 0xccfd
movq 0x8(%rsp), %rdi
leaq 0x4(%rdi), %rbp
movq 0x10(%rsp), %r13
cmpq %rbp, %r13
jb 0xccdf
addq %r12, %rdi
callq 0xce50
movl %eax, 0x28(%r14)
movl %eax, %edi
leaq (%rdi,%rbp), %rax
movq %rax, 0x8(%rsp)
cmpq %rax, %r13
jb 0xccdf
movq %rdi, 0x18(%rsp)
callq 0x34e0
movq %rax, 0x30(%r14)
testq %rax, %rax
je 0xccdf
addq %rbp, %r12
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
movq 0x18(%rsp), %rdx
callq 0x32a0
movq %r13, %rdi
jmp 0xccff
xorl %edi, %edi
callq 0x3470
movq 0x20(%r14), %rdi
callq 0x3470
movq 0x10(%r14), %rdi
callq 0x3470
jmp 0xcb05
xorl %edi, %edi
movq 0x10(%rsp), %rax
jmp 0xcbfd