// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_server.c
// Function: proto_kvlds_request_read
int
proto_kvlds_request_read(struct netbuf_read * R,
    struct proto_kvlds_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_kvlds_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_KVLDS_NONE;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r12
movq %rdi, %r14
movq %rsp, %rsi
callq 0xf814
pushq $-0x1
popq %rbx
testl %eax, %eax
je 0xe8b8
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rsi
testq %rsi, %rsi
je 0xe988
movq (%rsp), %rax
movq %rax, (%r12)
xorps %xmm0, %xmm0
andq $0x0, 0x20(%r12)
movups %xmm0, 0x10(%r12)
movq 0x8(%rsp), %r15
leaq -0x305(%r15), %rax
cmpq $-0x301, %rax           # imm = 0xFCFF
jb 0xe8a7
leaq 0x28(%r12), %rbp
movq %rbp, %rdi
movq %r15, %rdx
callq 0x2280
movq %rbp, %rdi
callq 0xef95
movl %eax, %r13d
movl %eax, 0x8(%r12)
leal -0x112(%r13), %eax
cmpl $0x2, %eax
jb 0xe995
cmpl $0x100, %r13d           # imm = 0x100
je 0xeaf1
cmpl $0x110, %r13d           # imm = 0x110
je 0xe995
cmpl $0x111, %r13d           # imm = 0x111
je 0xea49
cmpl $0x120, %r13d           # imm = 0x120
je 0xe96c
cmpl $0x121, %r13d           # imm = 0x121
je 0xeab1
cmpl $0x131, %r13d           # imm = 0x131
je 0xe9da
cmpl $0x130, %r13d           # imm = 0x130
jne 0xeb0c
cmpq $0x4, %r15
je 0xe9d2
leaq 0x2c(%r12), %rax
movq %rax, 0x10(%r12)
movzbl 0x2c(%r12), %eax
addq $0x5, %rax
jmp 0xe9c9
orl $-0x1, 0x8(%r12)
xorl %ebx, %ebx
jmp 0xe8a7
cmpq $0x4, %r15
je 0xe9d2
leaq 0x2c(%r12), %rax
movq %rax, 0x10(%r12)
movzbl 0x2c(%r12), %eax
leaq 0x5(%rax), %rcx
cmpq %r15, %rcx
jae 0xe9d2
addq %rcx, %rbp
movq %rbp, 0x18(%r12)
movzbl 0x2d(%r12,%rax), %ecx
addq %rcx, %rax
addq $0x6, %rax
cmpq %r15, %rax
jbe 0xeaf4
movl %r13d, %ebp
jmp 0xeb3f
movl %r15d, %eax
andl $0x3fc, %eax            # imm = 0x3FC
cmpl $0x4, %eax
je 0xeb1d
leaq 0x2c(%r12), %rdi
callq 0xef95
movl %eax, 0xc(%r12)
cmpq $0x8, %r15
je 0xeb3a
leaq 0x30(%r12), %rax
movq %rax, 0x10(%r12)
movzbl 0x30(%r12), %eax
leaq 0x9(%rax), %rcx
cmpq %r15, %rcx
jae 0xeb3a
addq %rcx, %rbp
movq %rbp, 0x18(%r12)
movzbl 0x31(%r12,%rax), %ecx
addq %rcx, %rax
addq $0xa, %rax
cmpq %r15, %rax
movl $0x131, %ebp            # imm = 0x131
jbe 0xeaf4
jmp 0xeb3f
cmpq $0x4, %r15
je 0xeb2c
leaq 0x2c(%r12), %rax
movq %rax, 0x10(%r12)
movzbl 0x2c(%r12), %eax
leaq 0x5(%rax), %rcx
cmpq %r15, %rcx
jae 0xeb2c
addq %rbp, %rcx
movq %rcx, 0x20(%r12)
movzbl 0x2d(%r12,%rax), %ecx
addq %rcx, %rax
addq $0x6, %rax
cmpq %r15, %rax
jae 0xeb2c
addq %rax, %rbp
movq %rbp, 0x18(%r12)
movzbl 0x28(%r12,%rax), %ecx
addq %rcx, %rax
incq %rax
cmpq %r15, %rax
movl $0x111, %ebp            # imm = 0x111
jbe 0xeaf4
jmp 0xeb3f
cmpq $0x4, %r15
je 0xeb33
leaq 0x2c(%r12), %rax
movq %rax, 0x10(%r12)
movzbl 0x2c(%r12), %eax
leaq 0x5(%rax), %rcx
cmpq %r15, %rcx
jae 0xeb33
addq %rcx, %rbp
movq %rbp, 0x20(%r12)
movzbl 0x2d(%r12,%rax), %ecx
addq %rcx, %rax
addq $0x6, %rax
cmpq %r15, %rax
movl $0x121, %ebp            # imm = 0x121
jbe 0xeaf4
jmp 0xeb3f
pushq $0x4
popq %rax
movl %r13d, %ebp
cmpq %r15, %rax
jne 0xeb3f
movq %rsp, %rsi
movq %r14, %rdi
callq 0xfbd4
jmp 0xe98e
leaq 0x4e46(%rip), %rdi      # 0x13959
movl %r13d, %esi
xorl %eax, %eax
callq 0xe0e4
callq 0x20a0
andl $0x0, (%rax)
movl 0x8(%r12), %ebp
jmp 0xeb3f
movl $0x111, %ebp            # imm = 0x111
jmp 0xeb3f
movl $0x121, %ebp            # imm = 0x121
jmp 0xeb3f
movl $0x131, %ebp            # imm = 0x131
callq 0x20a0
cmpl $0x0, (%rax)
je 0xeb65
movq %rax, %r14
leaq 0x4e31(%rip), %rdi      # 0x13984
movl %ebp, %esi
xorl %eax, %eax
callq 0xdf55
andl $0x0, (%r14)
jmp 0xe8a7
leaq 0x4e18(%rip), %rdi      # 0x13984
movl %ebp, %esi
xorl %eax, %eax
callq 0xe0e4
jmp 0xe8a7