// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/proto_kvlds/proto_kvlds_client.c
// Function: proto_kvlds_request_modify
int
proto_kvlds_request_modify(struct wire_requestqueue * Q,
    const struct kvldskey * key, const struct kvldskey * value,
    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 = "MODIFY";

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

	/* 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_MODIFY);
	bufpos = 4;
	kvldskey_serialize(key, &buf[bufpos]);
	bufpos += kvldskey_serial_size(key);
	kvldskey_serialize(value, &buf[bufpos]);
	bufpos += kvldskey_serial_size(value);

	/* 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 0x7df0
jmp 0x7f38
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 0x7d20(%rip), %rcx      # 0xfb32
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 -0x347(%rip), %rdx      # 0x7b10
callq 0x9630
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0x7e6b
jmp 0x7f2f
movq -0x40(%rbp), %rdi
movl $0x113, %esi            # imm = 0x113
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 0x7eef
jmp 0x7f0e
leaq 0x7a40(%rip), %rdi      # 0xf936
leaq 0x7a4a(%rip), %rsi      # 0xf947
movl $0x28c, %edx            # imm = 0x28C
leaq 0x7c30(%rip), %rcx      # 0xfb39
callq 0x21a0
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x97c0
cmpl $0x0, %eax
je 0x7f26
jmp 0x7f2f
movl $0x0, -0x4(%rbp)
jmp 0x7f3f
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)