// File: /workspace/github_c_makefile_star2_O0/tomka[P]cliaspora/cliaspora.c
// Function: message
static int
message(session_t *sp, const char *subject, const char *msg, int id)
{
	int	   ret, status;
	char	   *rq, *m, *s;
	ssl_conn_t *cp;
	const char tmpl[] = "contact_ids=%d&conversation%%5bsubject" \
			    "%%5d=%s&conversation%%5btext%%5d=%s\n";

	errno = 0;
	if ((m = urlencode(msg)) == NULL)
		return (-1);
	if ((s = urlencode(subject)) == NULL) {
		free(m); return (-1);
	}
	if ((rq = strduprintf(tmpl, id, s, m)) == NULL) {
		free(m); free(s); return (-1);
	}
	free(m); free(s);
	if ((cp = ssl_connect(sp->host, sp->port)) == NULL)
		return (-1);
	status = http_post(cp, "/conversations", sp->cookie, NULL,
	    USER_AGENT, HTTP_POST_TYPE_FORM, rq);
	free(rq);
	if (status == HTTP_UNAUTHORIZED) {
		warnx("You're not logged in. Please create a new session");
		ret = -1;
	} else if (status == HTTP_FOUND)
		ret = 0;
	else if (status == -1)
		ret = -1;
	else {
		warnx("Server replied with code %d", status);
		ret = -1;
	}
	ssl_disconnect(cp);

	return (ret);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
leaq -0xa0(%rbp), %rdi
leaq 0x8a88(%rip), %rsi      # 0xf030
movl $0x4b, %edx
callq 0x2220
callq 0x2060
movl $0x0, (%rax)
movq -0x20(%rbp), %rdi
callq 0xaea0
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0x65dc
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x6728
movq -0x18(%rbp), %rdi
callq 0xaea0
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
jne 0x6604
movq -0x40(%rbp), %rdi
callq 0x23d0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x6728
leaq -0xa0(%rbp), %rdi
movl -0x24(%rbp), %esi
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rcx
movb $0x0, %al
callq 0xd570
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x6645
movq -0x40(%rbp), %rdi
callq 0x23d0
movq -0x48(%rbp), %rdi
callq 0x23d0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x6728
movq -0x40(%rbp), %rdi
callq 0x23d0
movq -0x48(%rbp), %rdi
callq 0x23d0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movzwl 0x10(%rax), %esi
callq 0x9f10
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
jne 0x6681
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x6728
movq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x38(%rbp), %rax
leaq 0x8496(%rip), %rsi      # 0xeb2e
xorl %ecx, %ecx
leaq 0x829b(%rip), %r8       # 0xe93c
movl $0x3, %r9d
movq %rax, (%rsp)
callq 0xb1a0
movl %eax, -0x2c(%rbp)
movq -0x38(%rbp), %rdi
callq 0x23d0
cmpl $0x191, -0x2c(%rbp)     # imm = 0x191
jne 0x66dc
leaq 0x827a(%rip), %rdi      # 0xe946
movb $0x0, %al
callq 0x22f0
movl $0xffffffff, -0x28(%rbp) # imm = 0xFFFFFFFF
jmp 0x6719
cmpl $0x12e, -0x2c(%rbp)     # imm = 0x12E
jne 0x66ee
movl $0x0, -0x28(%rbp)
jmp 0x6717
cmpl $-0x1, -0x2c(%rbp)
jne 0x66fd
movl $0xffffffff, -0x28(%rbp) # imm = 0xFFFFFFFF
jmp 0x6715
movl -0x2c(%rbp), %esi
leaq 0x850c(%rip), %rdi      # 0xec13
movb $0x0, %al
callq 0x22f0
movl $0xffffffff, -0x28(%rbp) # imm = 0xFFFFFFFF
jmp 0x6717
jmp 0x6719
movq -0x50(%rbp), %rdi
callq 0xa220
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)