// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movl -0x14(%rbp), %eax
imulq -0x28(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x1a72c
jmp 0x1a74b
leaq 0x6912(%rip), %rdi      # 0x21045
leaq 0x691c(%rip), %rsi      # 0x21056
movl $0x140, %edx            # imm = 0x140
leaq 0x6a8d(%rip), %rcx      # 0x211d3
callq 0x21d0
cmpl $0x0, -0x14(%rbp)
jbe 0x1a753
jmp 0x1a772
leaq 0x6b18(%rip), %rdi      # 0x21272
leaq 0x68f5(%rip), %rsi      # 0x21056
movl $0x141, %edx            # imm = 0x141
leaq 0x6a66(%rip), %rcx      # 0x211d3
callq 0x21d0
movl $0x10, %edi
callq 0x22a0
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0x1a78b
jmp 0x1a86d
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
movq 0x10(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rcx
leaq 0xcb(%rip), %rdx        # 0x1a880
callq 0x1b970
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
jne 0x1a7c9
jmp 0x1a864
movq -0x50(%rbp), %rdi
movl $0x2, %esi
callq 0x1a0a0
movq -0x50(%rbp), %rdi
addq $0x4, %rdi
movl -0x14(%rbp), %esi
callq 0x1a0a0
movq -0x50(%rbp), %rdi
addq $0x8, %rdi
movq -0x20(%rbp), %rsi
callq 0x1a620
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
movl -0x14(%rbp), %ecx
cmpq %rcx, %rax
jae 0x1a843
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rax
imulq -0x28(%rbp), %rax
addq $0x10, %rax
addq %rax, %rdi
movq -0x30(%rbp), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x28(%rbp), %rdx
callq 0x2280
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x1a800
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x1bb00
cmpl $0x0, %eax
je 0x1a85b
jmp 0x1a864
movl $0x0, -0x4(%rbp)
jmp 0x1a874
movq -0x40(%rbp), %rdi
callq 0x2040
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)