// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../libcperciva/network_ssl/network_ssl.c
// Function: network_ssl_write
void *
network_ssl_write(struct network_ssl_ctx * ssl, const uint8_t * buf,
    size_t buflen, size_t minwrite,
    int (* callback)(void *, ssize_t), void * cookie)
{

	/* We must be initialized before we get here. */
	assert(ctx != NULL);

	/* Make sure buflen is non-zero. */
	assert(buflen != 0);

	/* Sanity-check: # bytes must fit into a ssize_t. */
	assert(buflen <= SSIZE_MAX);

	/* Sanity-check: Must not have a write already in progress. */
	assert(ssl->write_callback == NULL);

	/* Record details of the pending request. */
	ssl->write_callback = callback;
	ssl->write_cookie = cookie;
	ssl->write_buf = buf;
	ssl->write_buflen = buflen;
	ssl->write_minlen = minwrite;
	ssl->write_bufpos = 0;
	ssl->write_needs_r = 0;
	ssl->write_needs_w = 0;

	/* Poke the SSL stack. */
	if (ssl->immediate_cookie == NULL) {
		if ((ssl->immediate_cookie = events_immediate_register(
		    callback_immediate, ssl, 0)) == NULL)
			goto err0;
	}

	/* Success! */
	return (ssl);

err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
cmpq $0x0, 0x22398(%rip)     # 0x368e0
je 0x1454c
jmp 0x1456b
leaq 0xbeff(%rip), %rdi      # 0x20452
leaq 0xbf04(%rip), %rsi      # 0x2045e
movl $0x288, %edx            # imm = 0x288
leaq 0xbfaa(%rip), %rcx      # 0x20510
callq 0x3240
cmpq $0x0, -0x20(%rbp)
je 0x14574
jmp 0x14593
leaq 0xb24d(%rip), %rdi      # 0x1f7c8
leaq 0xbedc(%rip), %rsi      # 0x2045e
movl $0x28b, %edx            # imm = 0x28B
leaq 0xbf82(%rip), %rcx      # 0x20510
callq 0x3240
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rax, -0x20(%rbp)
ja 0x145a5
jmp 0x145c4
leaq 0xb2a3(%rip), %rdi      # 0x1f84f
leaq 0xbeab(%rip), %rsi      # 0x2045e
movl $0x28e, %edx            # imm = 0x28E
leaq 0xbf51(%rip), %rcx      # 0x20510
callq 0x3240
movq -0x10(%rbp), %rax
cmpq $0x0, 0x58(%rax)
jne 0x145d1
jmp 0x145f0
leaq 0xbfad(%rip), %rdi      # 0x20585
leaq 0xbe7f(%rip), %rsi      # 0x2045e
movl $0x291, %edx            # imm = 0x291
leaq 0xbf25(%rip), %rcx      # 0x20510
callq 0x3240
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x80(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x88(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x8c(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x14686
movq -0x10(%rbp), %rsi
leaq -0x31d(%rip), %rdi      # 0x14350
xorl %edx, %edx
callq 0x4a30
movq -0x10(%rbp), %rcx
movq %rax, 0x18(%rcx)
cmpq $0x0, %rax
jne 0x14684
jmp 0x14690
jmp 0x14686
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x14698
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)