// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_client.c
// Function: proto_kvlds_request_cad
int
proto_kvlds_request_cad(struct wire_requestqueue * Q,
    const struct kvldskey * key, const struct kvldskey * oval,
    int (* callback)(void *, int, int), void * cookie)
{
	struct donep_cookie * C;
	uint8_t * buf;
	size_t buflen;
	size_t bufpos;

	/* Bake a cookie. */
	if ((C = mpool_donep_malloc()) == NULL)
		goto err0;
	C->callback = callback;
	C->cookie = cookie;
	C->type = "CAD";

	/* Compute request size. */
	buflen = 4;
	buflen += kvldskey_serial_size(key);
	buflen += kvldskey_serial_size(oval);

	/* Start writing a request. */
	if ((buf = wire_requestqueue_add_getbuf(Q, buflen,
	    callback_donep, C)) == NULL)
		goto err1;

	/* Construct request. */
	be32enc(&buf[0], PROTO_KVLDS_CAD);
	bufpos = 4;
	kvldskey_serialize(key, &buf[bufpos]);
	bufpos += kvldskey_serial_size(key);
	kvldskey_serialize(oval, &buf[bufpos]);
	bufpos += kvldskey_serial_size(oval);

	/* Sanity-check. */
	assert(bufpos == buflen);

	/* Finish writing request. */
	if (wire_requestqueue_add_done(Q, buf, buflen))
		goto err1;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
callq 0x7af0
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x8080
jmp 0x81c8
movq -0x28(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
leaq 0x7b2e(%rip), %rcx      # 0xfbd0
movq %rcx, 0x10(%rax)
movq $0x4, -0x48(%rbp)
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
addq $0x1, %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
addq $0x1, %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x38(%rbp), %rcx
leaq -0x5d7(%rip), %rdx      # 0x7b10
callq 0x9630
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0x80fb
jmp 0x81bf
movq -0x40(%rbp), %rdi
movl $0x121, %esi            # imm = 0x121
callq 0x7600
movq $0x4, -0x50(%rbp)
movq -0x40(%rbp), %rdi
addq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rdx
callq 0x2210
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
addq $0x1, %rax
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rdi
addq -0x50(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rdx
callq 0x2210
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
addq $0x1, %rax
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
jne 0x817f
jmp 0x819e
leaq 0x77b0(%rip), %rdi      # 0xf936
leaq 0x77ba(%rip), %rsi      # 0xf947
movl $0x2fa, %edx            # imm = 0x2FA
leaq 0x7a3b(%rip), %rcx      # 0xfbd4
callq 0x21a0
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x97c0
cmpl $0x0, %eax
je 0x81b6
jmp 0x81bf
movl $0x0, -0x4(%rbp)
jmp 0x81cf
movq -0x38(%rbp), %rdi
callq 0x7c00
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)