// File: /workspace/github_c_makefile_star2_O0/tomka[P]cliaspora/cliaspora.c
// Function: get_post_guid
static char *
get_post_guid(session_t *sp, int id)
{
	int	    status;
	ssl_conn_t  *cp;
	json_node_t *node, *jp;
	static char *p, *url, guid[64];

	errno = 0;
	if ((url = strduprintf("/posts/%d", id)) == NULL)
		return (NULL);
	if ((cp = ssl_connect(sp->host, sp->port)) == NULL)
		return (NULL);
	status = http_get(cp, url, sp->cookie, "application/json",
	    USER_AGENT);
	free(url);
	if (status == HTTP_UNAUTHORIZED) {
		warnx("You're not logged in. Please create a new session");
		ssl_disconnect(cp); return (NULL);
	} else if (status == -1) {
		ssl_disconnect(cp);
		return (NULL);
	} else if (status != HTTP_OK) {
		warnx("Server replied with code %d", status);
		ssl_disconnect(cp); return (NULL);
	}
	while ((p = ssl_readln(cp)) != NULL && *p != '{')
		;
	if (p == NULL) {
		if (errno == 0)
			warnx("Unexpected server reply");
		ssl_disconnect(cp); return (NULL);
	}
	if ((node = new_json_node()) == NULL) {
		warn("new_json_node()"); ssl_disconnect(cp);
		return (NULL);
	}
	if (parse_json(node, p) == NULL) {
		ssl_disconnect(cp); return (NULL);
	}
	ssl_disconnect(cp);

	for (jp = node->val; jp != NULL; jp = jp->next) {
		if (jp->var != NULL && strcmp(jp->var, "guid") == 0)
			break;
	}
	if (jp != NULL)
		(void)strncpy(guid, (char *)jp->val, sizeof(guid));
	free_json_node(node);
	if (jp == NULL) {
		warnx("Couldn't find post's guid"); return (NULL);
	}
	return (guid);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
callq 0x2060
movl $0x0, (%rax)
movl -0x14(%rbp), %esi
leaq 0x7d90(%rip), %rdi      # 0xeb24
movb $0x0, %al
callq 0xd570
movq %rax, 0xb626(%rip)      # 0x123c8
cmpq $0x0, %rax
jne 0x6db5
movq $0x0, -0x8(%rbp)
jmp 0x700c
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movzwl 0x10(%rax), %esi
callq 0x9f10
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x6de0
movq $0x0, -0x8(%rbp)
jmp 0x700c
movq -0x20(%rbp), %rdi
movq 0xb5dd(%rip), %rsi      # 0x123c8
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x7cbf(%rip), %rcx      # 0xeab9
leaq 0x7b3b(%rip), %r8       # 0xe93c
callq 0xb0a0
movl %eax, -0x18(%rbp)
movq 0xb5b8(%rip), %rdi      # 0x123c8
callq 0x23d0
cmpl $0x191, -0x18(%rbp)     # imm = 0x191
jne 0x6e42
leaq 0x7b21(%rip), %rdi      # 0xe946
movb $0x0, %al
callq 0x22f0
movq -0x20(%rbp), %rdi
callq 0xa220
movq $0x0, -0x8(%rbp)
jmp 0x700c
cmpl $-0x1, -0x18(%rbp)
jne 0x6e5e
movq -0x20(%rbp), %rdi
callq 0xa220
movq $0x0, -0x8(%rbp)
jmp 0x700c
cmpl $0xc8, -0x18(%rbp)
je 0x6e8e
movl -0x18(%rbp), %esi
leaq 0x7da2(%rip), %rdi      # 0xec13
movb $0x0, %al
callq 0x22f0
movq -0x20(%rbp), %rdi
callq 0xa220
movq $0x0, -0x8(%rbp)
jmp 0x700c
jmp 0x6e90
jmp 0x6e92
jmp 0x6e94
movq -0x20(%rbp), %rdi
callq 0xa790
movq %rax, %rcx
movq %rcx, 0xb519(%rip)      # 0x123c0
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x31(%rbp)
je 0x6ec5
movq 0xb507(%rip), %rax      # 0x123c0
movsbl (%rax), %eax
cmpl $0x7b, %eax
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x6ece
jmp 0x6ed0
jmp 0x6e94
cmpq $0x0, 0xb4e8(%rip)      # 0x123c0
jne 0x6f08
callq 0x2060
cmpl $0x0, (%rax)
jne 0x6ef2
leaq 0x7aac(%rip), %rdi      # 0xe997
movb $0x0, %al
callq 0x22f0
movq -0x20(%rbp), %rdi
callq 0xa220
movq $0x0, -0x8(%rbp)
jmp 0x700c
callq 0xb820
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x6f3b
leaq 0x7c5c(%rip), %rdi      # 0xeb7a
movb $0x0, %al
callq 0x2120
movq -0x20(%rbp), %rdi
callq 0xa220
movq $0x0, -0x8(%rbp)
jmp 0x700c
movq -0x28(%rbp), %rdi
movq 0xb47a(%rip), %rsi      # 0x123c0
callq 0xb910
cmpq $0x0, %rax
jne 0x6f67
movq -0x20(%rbp), %rdi
callq 0xa220
movq $0x0, -0x8(%rbp)
jmp 0x700c
movq -0x20(%rbp), %rdi
callq 0xa220
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x6fb9
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x6fa9
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x7c02(%rip), %rsi      # 0xeb9f
callq 0x2460
cmpl $0x0, %eax
jne 0x6fa9
jmp 0x6fb9
jmp 0x6fab
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x6f7c
cmpq $0x0, -0x30(%rbp)
je 0x6fd9
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0xb401(%rip), %rdi      # 0x123d0
movl $0x40, %edx
callq 0x21b0
movq -0x28(%rbp), %rdi
callq 0xb890
cmpq $0x0, -0x30(%rbp)
jne 0x7001
leaq 0x7b9a(%rip), %rdi      # 0xeb8a
movb $0x0, %al
callq 0x22f0
movq $0x0, -0x8(%rbp)
jmp 0x700c
leaq 0xb3c8(%rip), %rax      # 0x123d0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)