// File: /workspace/github_c_makefile_star2_O0/tomka[P]cliaspora/cliaspora.c
// Function: post
static int
post(session_t *sp, const char *msg, const char *aspect)
{
	int	   aid, ret, status;
	char	   *rq, *p, idstr[24];
	ssl_conn_t *cp;
	const char tmpl[] = "{\"status_message\":{\"text\":\"%s\", "	  \
			     "\"provider_display_name\":\"cliaspora\"},"  \
			     "\"aspect_ids\":\"%s\"}\n\n";

	errno = 0;
	if (strcmp(aspect, "public") == 0)
		(void)strncpy(idstr, "public", sizeof(idstr));
	else if ((aid = get_aspect_id(sp, aspect)) == -1) {
		warnx("Unknown aspect '%s'", aspect); return (-1);
	} else
		(void)snprintf(idstr, sizeof(idstr), "%d", aid);
	if ((p = json_escape_str(msg)) == NULL)
		return (-1);
	if ((rq = strduprintf(tmpl, p, idstr)) == NULL) {
		free(p); return (-1);
	}
	free(p);
	if ((cp = ssl_connect(sp->host, sp->port)) == NULL)
		return (-1);
	status = http_post(cp, "/status_messages", sp->cookie, NULL,
	    USER_AGENT, HTTP_POST_TYPE_JSON, 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 $0xe0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
leaq -0xd0(%rbp), %rdi
leaq 0x8f1b(%rip), %rsi      # 0xeee0
movl $0x5a, %edx
callq 0x2220
callq 0x2060
movl $0x0, (%rax)
movq -0x20(%rbp), %rdi
leaq 0x82ca(%rip), %rsi      # 0xe2af
callq 0x2460
cmpl $0x0, %eax
jne 0x6006
leaq -0x60(%rbp), %rdi
leaq 0x82b5(%rip), %rsi      # 0xe2af
movl $0x18, %edx
callq 0x21b0
jmp 0x6055
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x5320
movl %eax, -0x24(%rbp)
cmpl $-0x1, %eax
jne 0x6039
movq -0x20(%rbp), %rsi
leaq 0x8290(%rip), %rdi      # 0xe2b6
movb $0x0, %al
callq 0x22f0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x6183
leaq -0x60(%rbp), %rdi
movl -0x24(%rbp), %ecx
movl $0x18, %esi
leaq 0x97bb(%rip), %rdx      # 0xf807
movb $0x0, %al
callq 0x2540
jmp 0x6055
movq -0x18(%rbp), %rdi
callq 0xc550
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0x6074
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x6183
leaq -0xd0(%rbp), %rdi
movq -0x40(%rbp), %rsi
leaq -0x60(%rbp), %rdx
movb $0x0, %al
callq 0xd570
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x60a9
movq -0x40(%rbp), %rdi
callq 0x23d0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x6183
movq -0x40(%rbp), %rdi
callq 0x23d0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movzwl 0x10(%rax), %esi
callq 0x9f10
movq %rax, -0x68(%rbp)
cmpq $0x0, %rax
jne 0x60dc
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x6183
movq -0x68(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x38(%rbp), %rax
leaq 0x894f(%rip), %rsi      # 0xea42
xorl %ecx, %ecx
leaq 0x8840(%rip), %r8       # 0xe93c
movl $0x1, %r9d
movq %rax, (%rsp)
callq 0xb1a0
movl %eax, -0x2c(%rbp)
movq -0x38(%rbp), %rdi
callq 0x23d0
cmpl $0x191, -0x2c(%rbp)     # imm = 0x191
jne 0x6137
leaq 0x881f(%rip), %rdi      # 0xe946
movb $0x0, %al
callq 0x22f0
movl $0xffffffff, -0x28(%rbp) # imm = 0xFFFFFFFF
jmp 0x6174
cmpl $0x12e, -0x2c(%rbp)     # imm = 0x12E
jne 0x6149
movl $0x0, -0x28(%rbp)
jmp 0x6172
cmpl $-0x1, -0x2c(%rbp)
jne 0x6158
movl $0xffffffff, -0x28(%rbp) # imm = 0xFFFFFFFF
jmp 0x6170
movl -0x2c(%rbp), %esi
leaq 0x8ab1(%rip), %rdi      # 0xec13
movb $0x0, %al
callq 0x22f0
movl $0xffffffff, -0x28(%rbp) # imm = 0xFFFFFFFF
jmp 0x6172
jmp 0x6174
movq -0x68(%rbp), %rdi
callq 0xa220
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
nop