// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../libcperciva/netbuf/netbuf_write.c
// Function: poke
static int
poke(struct netbuf_write * W)
{
	struct writebuf * WB;

	/* If a write is in progress or we have nothing to write, return. */
	if ((W->write_cookie != NULL) || (STAILQ_EMPTY(&W->buffers)))
		return (0);

	/* If we've failed, don't try to do anything more. */
	if (W->failed)
		return (0);

	/* Sanity-check: We don't have a buffer in progress. */
	assert(W->curr == NULL);

	/* Start writing a buffer. */
	WB = STAILQ_FIRST(&W->buffers);
	if (W->ssl) {
		if ((W->write_cookie = (netbuf_write_ssl_func)(W->ssl,
		    WB->buf, WB->datalen, WB->datalen, writbuf, W)) == NULL)
			goto err0;
	} else {
		if ((W->write_cookie = network_write(W->s, WB->buf,
		    WB->datalen, WB->datalen, writbuf, W)) == NULL)
			goto err0;
	}
	W->curr = WB;

	/* Remove the buffer from the queue. */
	STAILQ_REMOVE(&W->buffers, WB, writebuf, entries);

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0xc0b2
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0xc0be
movl $0x0, -0x4(%rbp)
jmp 0xc251
movq -0x10(%rbp), %rax
cmpl $0x0, 0x14(%rax)
je 0xc0d4
movl $0x0, -0x4(%rbp)
jmp 0xc251
movq -0x10(%rbp), %rax
cmpq $0x0, 0x40(%rax)
jne 0xc0e1
jmp 0xc100
leaq 0x4463(%rip), %rdi      # 0x1054b
leaq 0x4315(%rip), %rsi      # 0x10404
movl $0x72, %edx
leaq 0x4460(%rip), %rcx      # 0x1055b
callq 0x21a0
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xc15f
movq 0x3a5da(%rip), %rax     # 0x466f8
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rdi
movq -0x18(%rbp), %rcx
movq (%rcx), %rsi
movq -0x18(%rbp), %rcx
movq 0x10(%rcx), %rdx
movq -0x18(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x10(%rbp), %r9
leaq 0x278(%rip), %r8        # 0xc3c0
callq *%rax
movq -0x10(%rbp), %rcx
movq %rax, 0x38(%rcx)
cmpq $0x0, %rax
jne 0xc15d
jmp 0xc24a
jmp 0xc1a1
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x10(%rbp), %r9
leaq 0x239(%rip), %r8        # 0xc3c0
callq 0xcaf0
movq -0x10(%rbp), %rcx
movq %rax, 0x38(%rcx)
cmpq $0x0, %rax
jne 0xc19f
jmp 0xc24a
jmp 0xc1a1
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0xc1eb
jmp 0xc1bd
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq %rax, 0x28(%rcx)
cmpq $0x0, %rax
jne 0xc1e7
movq -0x10(%rbp), %rcx
addq $0x28, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xc1e9
jmp 0xc23f
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
cmpq -0x18(%rbp), %rax
je 0xc213
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0xc1f7
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movq %rax, 0x18(%rcx)
cmpq $0x0, %rax
jne 0xc23d
movq -0x20(%rbp), %rcx
addq $0x18, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xc23f
jmp 0xc241
movl $0x0, -0x4(%rbp)
jmp 0xc251
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)