// File: /workspace/github_c_makefile_star2_O3/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 0x1154a
movl %esi, %ebx
movq %rdx, 0x20(%rsp)
testl %esi, %esi
je 0x11569
movq %r9, %rbp
movq %r8, %r14
movq %rcx, %r15
movl $0x10, %edi
callq 0x22a0
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x11538
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       # 0x11588
movq 0x8(%rsp), %rdi
movq %rsi, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movq %rax, %rcx
callq 0x1217a
testq %rax, %rax
je 0x11529
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 0x114f3
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq 0x10(%rsp), %rdx
callq 0x12475
testl %eax, %eax
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
je 0x11535
movq 0x18(%rsp), %rdi
callq 0x2040
jmp 0x11538
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5493(%rip), %rdi      # 0x169e4
leaq 0x549d(%rip), %rsi      # 0x169f5
leaq 0x5613(%rip), %rcx      # 0x16b72
movl $0x140, %edx            # imm = 0x140
callq 0x21c0
leaq 0x56a1(%rip), %rdi      # 0x16c11
leaq 0x547e(%rip), %rsi      # 0x169f5
leaq 0x55f4(%rip), %rcx      # 0x16b72
movl $0x141, %edx            # imm = 0x141
callq 0x21c0