// File: /workspace/github_c_makefile_star2_O3/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 0x118ac
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
je 0x108ba
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 0x109b1
movq (%rsp), %rax
movq %rax, (%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r12)
movq $0x0, 0x20(%r12)
movq 0x8(%rsp), %r15
leaq -0x305(%r15), %rax
cmpq $-0x301, %rax           # imm = 0xFCFF
jb 0x108a9
leaq 0x28(%r12), %r13
movq %r13, %rdi
movq %r15, %rdx
callq 0x2280
movl 0x28(%r12), %esi
bswapl %esi
movl %esi, 0x8(%r12)
cmpl $0x11f, %esi            # imm = 0x11F
jg 0x109c1
cmpl $0x111, %esi            # imm = 0x111
jg 0x10a53
cmpl $0x100, %esi            # imm = 0x100
je 0x10afb
cmpl $0x110, %esi            # imm = 0x110
je 0x10a62
cmpl $0x111, %esi            # imm = 0x111
jne 0x10b17
movl $0x111, %ebp            # imm = 0x111
cmpq $0x4, %r15
je 0x10b35
leaq 0x2c(%r12), %rax
movq %rax, 0x10(%r12)
movzbl 0x2c(%r12), %eax
leaq 0x5(%rax), %rcx
cmpq %r15, %rcx
jae 0x10b35
addq %r13, %rcx
movq %rcx, 0x20(%r12)
movzbl 0x2d(%r12,%rax), %ecx
addq %rcx, %rax
addq $0x6, %rax
cmpq %r15, %rax
jae 0x10b35
addq %rax, %r13
movq %r13, 0x18(%r12)
movzbl 0x28(%r12,%rax), %ecx
addq %rcx, %rax
incq %rax
jmp 0x10af4
movl $0xffffffff, 0x8(%r12)  # imm = 0xFFFFFFFF
xorl %ebx, %ebx
jmp 0x108a9
cmpl $0x12f, %esi            # imm = 0x12F
jg 0x10a23
cmpl $0x120, %esi            # imm = 0x120
je 0x10a37
cmpl $0x121, %esi            # imm = 0x121
jne 0x10b17
movl $0x121, %ebp            # imm = 0x121
cmpq $0x4, %r15
je 0x10b35
leaq 0x2c(%r12), %rax
movq %rax, 0x10(%r12)
movzbl 0x2c(%r12), %eax
leaq 0x5(%rax), %rcx
cmpq %r15, %rcx
jae 0x10b35
addq %rcx, %r13
movq %r13, 0x20(%r12)
movzbl 0x2d(%r12,%rax), %ecx
addq %rcx, %rax
addq $0x6, %rax
jmp 0x10af4
cmpl $0x131, %esi            # imm = 0x131
je 0x10aa2
cmpl $0x130, %esi            # imm = 0x130
jne 0x10b17
cmpq $0x4, %r15
je 0x10a9b
leaq 0x2c(%r12), %rax
movq %rax, 0x10(%r12)
movzbl 0x2c(%r12), %eax
addq $0x5, %rax
jmp 0x10a96
leal -0x112(%rsi), %eax
cmpl $0x2, %eax
jae 0x10b17
cmpq $0x4, %r15
je 0x10a9b
leaq 0x2c(%r12), %rax
movq %rax, 0x10(%r12)
movzbl 0x2c(%r12), %eax
leaq 0x5(%rax), %rcx
cmpq %r15, %rcx
jae 0x10a9b
addq %rcx, %r13
movq %r13, 0x18(%r12)
movzbl 0x2d(%r12,%rax), %ecx
addq %rcx, %rax
addq $0x6, %rax
cmpq %r15, %rax
jbe 0x10b00
movl %esi, %ebp
jmp 0x10b35
movl %r15d, %eax
andl $0x3fc, %eax            # imm = 0x3FC
cmpl $0x4, %eax
je 0x10b25
movl 0x2c(%r12), %eax
bswapl %eax
movl %eax, 0xc(%r12)
movl $0x131, %ebp            # imm = 0x131
cmpq $0x8, %r15
je 0x10b35
leaq 0x30(%r12), %rax
movq %rax, 0x10(%r12)
movzbl 0x30(%r12), %eax
leaq 0x9(%rax), %rcx
cmpq %r15, %rcx
jae 0x10b35
addq %rcx, %r13
movq %r13, 0x18(%r12)
movzbl 0x31(%r12,%rax), %ecx
addq %rcx, %rax
addq $0xa, %rax
cmpq %r15, %rax
jbe 0x10b00
jmp 0x10b35
movl $0x4, %eax
movl %esi, %ebp
cmpq %r15, %rax
jne 0x10b35
movq %rsp, %rsi
movq %r14, %rdi
callq 0x11d69
jmp 0x109ba
leaq 0x5e6f(%rip), %rdi      # 0x1698d
xorl %eax, %eax
callq 0x100ef
callq 0x20a0
movl $0x0, (%rax)
movl 0x8(%r12), %ebp
callq 0x20a0
cmpl $0x0, (%rax)
je 0x10b5e
movq %rax, %r14
leaq 0x5e6f(%rip), %rdi      # 0x169b8
movl %ebp, %esi
xorl %eax, %eax
callq 0xffd0
movl $0x0, (%r14)
jmp 0x108a9
leaq 0x5e53(%rip), %rdi      # 0x169b8
movl %ebp, %esi
xorl %eax, %eax
callq 0x100ef
jmp 0x108a9