// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_server.c
// Function: proto_kvlds_response_range
int
proto_kvlds_response_range(struct netbuf_write * Q, uint64_t ID,
    size_t nkeys, const struct kvldskey * next,
    struct kvldskey ** keys, struct kvldskey ** values)
{
	uint8_t * wbuf;
	size_t len;
	size_t i;
	size_t bufpos;

	/* Sanity check: We can't return more than 2^32-1 keys. */
	assert(nkeys <= UINT32_MAX);

	/* Figure out how long the packet will be. */
	len = 8;
	len += kvldskey_serial_size(next);
	for (i = 0; i < nkeys; i++) {
		len += kvldskey_serial_size(keys[i]);
		len += kvldskey_serial_size(values[i]);
	}

	/* Get a packet data buffer. */
	if ((wbuf = wire_writepacket_getbuf(Q, ID, len)) == NULL)
		goto err0;

	/* Write the packet data. */
	be32enc(&wbuf[0], 0);
	be32enc(&wbuf[4], (uint32_t)nkeys);
	bufpos = 8;
	kvldskey_serialize(next, &wbuf[bufpos]);
	bufpos += kvldskey_serial_size(next);
	for (i = 0; i < nkeys; i++) {
		kvldskey_serialize(keys[i], &wbuf[bufpos]);
		bufpos += kvldskey_serial_size(keys[i]);
		kvldskey_serialize(values[i], &wbuf[bufpos]);
		bufpos += kvldskey_serial_size(values[i]);
	}

	/* Finish the packet. */
	if (wire_writepacket_done(Q, wbuf, len))
		goto err0;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, -0x20(%rbp)
ja 0x19b1d
jmp 0x19b3c
leaq 0x742d(%rip), %rdi      # 0x20f51
leaq 0x735c(%rip), %rsi      # 0x20e87
movl $0x13d, %edx            # imm = 0x13D
leaq 0x742e(%rip), %rcx      # 0x20f65
callq 0x21d0
movq $0x8, -0x48(%rbp)
movq -0x28(%rbp), %rax
movzbl (%rax), %eax
addq $0x1, %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x19bad
movq -0x30(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movzbl (%rax), %eax
addq $0x1, %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movzbl (%rax), %eax
addq $0x1, %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x19b5f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x1bf50
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0x19bcd
jmp 0x19cfe
movq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0x198f0
movq -0x40(%rbp), %rdi
addq $0x4, %rdi
movq -0x20(%rbp), %rax
movl %eax, %esi
callq 0x198f0
movq $0x8, -0x58(%rbp)
movq -0x40(%rbp), %rdi
addq -0x58(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x28(%rbp), %rax
movzbl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rdx
callq 0x2280
movq -0x28(%rbp), %rax
movzbl (%rax), %eax
addq $0x1, %rax
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x19cdd
movq -0x40(%rbp), %rdi
addq -0x58(%rbp), %rdi
movq -0x30(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x30(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movzbl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rdx
callq 0x2280
movq -0x30(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movzbl (%rax), %eax
addq $0x1, %rax
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rdi
addq -0x58(%rbp), %rdi
movq -0x38(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x38(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movzbl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rdx
callq 0x2280
movq -0x38(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movzbl (%rax), %eax
addq $0x1, %rax
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x19c2c
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x1c190
cmpl $0x0, %eax
je 0x19cf5
jmp 0x19cfe
movl $0x0, -0x4(%rbp)
jmp 0x19d05
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nop