// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../lib/proto_lbs/proto_lbs_client.c
// Function: proto_lbs_request_append_blks
int
proto_lbs_request_append_blks(struct wire_requestqueue * Q,
    uint32_t nblks, uint64_t blkno, size_t blklen,
    const uint8_t * const * bufv,
    int (* callback)(void *, int, int, uint64_t), void * cookie)
{
	struct append_cookie * C;
	size_t len = 16 + nblks * blklen;
	uint8_t * buf;
	size_t i;

	/* Sanity check. */
	assert(callback != NULL);
	assert(nblks > 0);

	/* Bake a cookie. */
	if ((C = malloc(sizeof(struct append_cookie))) == NULL)
		goto err0;
	C->callback = callback;
	C->cookie = cookie;

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

	/* Construct request. */
	be32enc(&buf[0], PROTO_LBS_APPEND);
	be32enc(&buf[4], nblks);
	be64enc(&buf[8], blkno);
	for (i = 0; i < nblks; i++)
		memcpy(&buf[16 + i * blklen], bufv[i], blklen);

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

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x8(%rsp)
testq %r9, %r9
je 0x115a4
movl %esi, %ebx
movq %rdx, 0x20(%rsp)
testl %esi, %esi
je 0x115c3
movq %r9, %rbp
movq %r8, %r14
movq %rcx, %r15
movl $0x10, %edi
callq 0x22a0
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x11592
movq 0x60(%rsp), %rcx
movl %ebx, %r12d
movq %r12, %rsi
imulq %r15, %rsi
addq $0x10, %rsi
movq %rbp, (%rax)
movq %rcx, 0x8(%rax)
leaq 0x11c(%rip), %rdx       # 0x115e2
movq 0x8(%rsp), %rdi
movq %rsi, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movq %rax, %rcx
callq 0x121b1
testq %rax, %rax
je 0x11583
movq %rax, %rbp
movl $0x2000000, (%rax)      # imm = 0x2000000
movb %bl, 0x7(%rax)
movb %bh, 0x6(%rax)
movl %ebx, %eax
shrl $0x10, %eax
movb %al, 0x5(%rbp)
shrl $0x18, %ebx
movb %bl, 0x4(%rbp)
movq 0x20(%rsp), %rcx
movb %cl, 0xf(%rbp)
movb %ch, 0xe(%rbp)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, 0xd(%rbp)
movl %ecx, %eax
shrl $0x18, %eax
movb %al, 0xc(%rbp)
movq %rcx, %rax
shrq $0x20, %rax
movb %al, 0xb(%rbp)
movq %rcx, %rax
shrq $0x28, %rax
movb %al, 0xa(%rbp)
movq %rcx, %rax
shrq $0x30, %rax
movb %al, 0x9(%rbp)
shrq $0x38, %rcx
movb %cl, 0x8(%rbp)
movq %rbp, %rbx
addq $0x10, %rbx
xorl %r13d, %r13d
movq (%r14,%r13,8), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x2280
incq %r13
addq %r15, %rbx
cmpq %r13, %r12
jne 0x1154d
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq 0x10(%rsp), %rdx
callq 0x1248d
testl %eax, %eax
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
je 0x1158f
movq 0x18(%rsp), %rdi
callq 0x2040
jmp 0x11592
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5442(%rip), %rdi      # 0x169ed
leaq 0x544c(%rip), %rsi      # 0x169fe
leaq 0x55c2(%rip), %rcx      # 0x16b7b
movl $0x140, %edx            # imm = 0x140
callq 0x21c0
leaq 0x5650(%rip), %rdi      # 0x16c1a
leaq 0x542d(%rip), %rsi      # 0x169fe
leaq 0x55a3(%rip), %rcx      # 0x16b7b
movl $0x141, %edx            # imm = 0x141
callq 0x21c0