// File: /workspace/github_c_makefile_star2_O1/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 0xe8f4
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
je 0xdc98
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 0xdd8a
movq 0x20(%rsp), %rax
movq %rax, (%r14)
xorl %eax, %eax
movq %rax, 0x10(%r14)
movq %rax, 0x20(%r14)
movq %rax, 0x30(%r14)
movq 0x28(%rsp), %rcx
cmpq $0x4, %rcx
jb 0xdc87
movl (%r12), %esi
bswapl %esi
movl %esi, 0x8(%r14)
je 0xdc87
movzbl 0x4(%r12), %r13d
leaq 0x5(%r13), %rdx
cmpq %rdx, %rcx
jb 0xdc87
leaq 0x5(%r12), %rbp
testq %r13, %r13
je 0xdcfd
xorl %eax, %eax
cmpb $0x0, (%rbp,%rax)
je 0xdc87
incq %rax
cmpq %rax, %r13
jne 0xdcee
movq %rsi, 0x18(%rsp)
movq %rdx, 0x8(%rsp)
movq %rcx, 0x10(%rsp)
leaq 0x1(%r13), %rdi
callq 0x34d0
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0xdc87
movq %rax, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %rax, %rbp
callq 0x3290
movb $0x0, (%rbp,%r13)
movq 0x18(%rsp), %rax
addl $0xfffeff00, %eax       # imm = 0xFFFEFF00
cmpl $0x20, %eax
movq 0x10(%rsp), %rdx
ja 0xde54
movl $0x7, %ecx
btq %rax, %rcx
jb 0xdd99
movabsq $0x100030000, %rcx      # imm = 0x100030000
btq %rax, %rcx
jae 0xde54
cmpq 0x8(%rsp), %rdx
jne 0xde54
leaq 0x20(%rsp), %rsi
movq %r15, %rdi
callq 0xed9c
jmp 0xdd92
movl $0xffffffff, 0x8(%r14)  # imm = 0xFFFFFFFF
xorl %ebx, %ebx
jmp 0xdc87
addq $0x9, %r13
cmpq %r13, %rdx
jb 0xde54
movq 0x8(%rsp), %rax
movl (%r12,%rax), %ebp
bswapl %ebp
movl %ebp, 0x18(%r14)
movq %r13, %rcx
addq %rbp, %rcx
movq %rcx, 0x8(%rsp)
cmpq %rcx, %rdx
jb 0xde54
movq %rbp, %rdi
callq 0x34d0
movq %rax, 0x20(%r14)
testq %rax, %rax
je 0xde54
addq %r12, %r13
movq %rax, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x3290
cmpl $0x10101, 0x18(%rsp)    # imm = 0x10101
jne 0xde4a
movq 0x8(%rsp), %rax
leaq 0x4(%rax), %rbp
movq 0x10(%rsp), %rax
cmpq %rbp, %rax
jb 0xde54
movq 0x8(%rsp), %rcx
movl (%r12,%rcx), %r13d
bswapl %r13d
movl %r13d, 0x28(%r14)
movq %rbp, %rdx
addq %r13, %rdx
movq %rdx, 0x8(%rsp)
cmpq %rdx, %rax
jb 0xde54
movq %r13, %rdi
callq 0x34d0
movq %rax, 0x30(%r14)
testq %rax, %rax
je 0xde54
addq %rbp, %r12
movq %rax, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3290
movq 0x10(%rsp), %rdx
jmp 0xdd70
movq 0x30(%r14), %rdi
callq 0x3460
movq 0x20(%r14), %rdi
callq 0x3460
movq 0x10(%r14), %rdi
callq 0x3460
jmp 0xdc87