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

	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 (msg != NULL) {
		if ((mp = json_escape_str(msg)) == NULL)
			return (-1);
	} else
		mp = NULL;
	if ((qp = json_escape_str(question)) == NULL) {
		free(mp); return (-1);
	}
	rq = strduprintf(tmpl, msg != NULL ? mp : "", idstr, qp, ansl);
	free(mp); free(qp);
	if (rq == NULL)
		return (-1);
	if ((cp = ssl_connect(sp->host, sp->port)) == NULL) {
		free(rq); 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 $0x120, %rsp            # imm = 0x120
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
leaq -0x100(%rbp), %rdi
leaq 0x97f3(%rip), %rsi      # 0xef40
movl $0x80, %edx
callq 0x2220
callq 0x2060
movl $0x0, (%rax)
movq -0x18(%rbp), %rdi
leaq 0x8b42(%rip), %rsi      # 0xe2af
callq 0x2460
cmpl $0x0, %eax
jne 0x578e
leaq -0x70(%rbp), %rdi
leaq 0x8b2d(%rip), %rsi      # 0xe2af
movl $0x18, %edx
callq 0x21b0
jmp 0x57dd
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5320
movl %eax, -0x34(%rbp)
cmpl $-0x1, %eax
jne 0x57c1
movq -0x18(%rbp), %rsi
leaq 0x8b08(%rip), %rdi      # 0xe2b6
movb $0x0, %al
callq 0x22f0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x598b
leaq -0x70(%rbp), %rdi
movl -0x34(%rbp), %ecx
movl $0x18, %esi
leaq 0xa033(%rip), %rdx      # 0xf807
movb $0x0, %al
callq 0x2540
jmp 0x57dd
cmpq $0x0, -0x20(%rbp)
je 0x5805
movq -0x20(%rbp), %rdi
callq 0xc550
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
jne 0x5803
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x598b
jmp 0x580d
movq $0x0, -0x50(%rbp)
movq -0x28(%rbp), %rdi
callq 0xc550
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
jne 0x5835
movq -0x50(%rbp), %rdi
callq 0x23d0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x598b
leaq -0x100(%rbp), %rax
movq %rax, -0x108(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x5857
movq -0x50(%rbp), %rax
movq %rax, -0x110(%rbp)
jmp 0x5867
leaq 0xa4a4(%rip), %rax      # 0xfd02
movq %rax, -0x110(%rbp)
jmp 0x5867
movq -0x108(%rbp), %rdi
movq -0x110(%rbp), %rsi
leaq -0x70(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq -0x30(%rbp), %r8
movb $0x0, %al
callq 0xd570
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rdi
callq 0x23d0
movq -0x58(%rbp), %rdi
callq 0x23d0
cmpq $0x0, -0x48(%rbp)
jne 0x58b1
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x598b
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movzwl 0x10(%rax), %esi
callq 0x9f10
movq %rax, -0x78(%rbp)
cmpq $0x0, %rax
jne 0x58e4
movq -0x48(%rbp), %rdi
callq 0x23d0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x598b
movq -0x78(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x48(%rbp), %rax
leaq 0x9147(%rip), %rsi      # 0xea42
xorl %ecx, %ecx
leaq 0x9038(%rip), %r8       # 0xe93c
movl $0x1, %r9d
movq %rax, (%rsp)
callq 0xb1a0
movl %eax, -0x3c(%rbp)
movq -0x48(%rbp), %rdi
callq 0x23d0
cmpl $0x191, -0x3c(%rbp)     # imm = 0x191
jne 0x593f
leaq 0x9017(%rip), %rdi      # 0xe946
movb $0x0, %al
callq 0x22f0
movl $0xffffffff, -0x38(%rbp) # imm = 0xFFFFFFFF
jmp 0x597c
cmpl $0x12e, -0x3c(%rbp)     # imm = 0x12E
jne 0x5951
movl $0x0, -0x38(%rbp)
jmp 0x597a
cmpl $-0x1, -0x3c(%rbp)
jne 0x5960
movl $0xffffffff, -0x38(%rbp) # imm = 0xFFFFFFFF
jmp 0x5978
movl -0x3c(%rbp), %esi
leaq 0x92a9(%rip), %rdi      # 0xec13
movb $0x0, %al
callq 0x22f0
movl $0xffffffff, -0x38(%rbp) # imm = 0xFFFFFFFF
jmp 0x597a
jmp 0x597c
movq -0x78(%rbp), %rdi
callq 0xa220
movl -0x38(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopw (%rax,%rax)