// File: /workspace/github_c_makefile_star2_O2/tomka[P]cliaspora/cliaspora.c
// Function: read_stream
static int
read_stream(session_t *sp, const char *url)
{
	int	   status;
	char	   *p;
	ssl_conn_t *cp;
	json_node_t *node, *pstp;

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rdi
movzwl 0x10(%r15), %esi
callq 0x70dc
testq %rax, %rax
je 0x4fb6
movq %rax, %rbx
movq 0x8(%r15), %rdx
leaq 0x5508(%rip), %rcx      # 0xa485
leaq 0x547c(%rip), %r8       # 0xa400
movq %rax, %rdi
movq %r14, %rsi
callq 0x7b3c
cmpl $-0x1, %eax
je 0x55ac
cmpl $0xc8, %eax
je 0x4fc5
cmpl $0x191, %eax            # imm = 0x191
jne 0x5562
leaq 0x5459(%rip), %rdi      # 0xa40a
jmp 0x55a5
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x7fe3
testq %rax, %rax
je 0x5574
movq %rax, %r14
movq %rbx, %rdi
callq 0x764f
testq %rax, %rax
je 0x557d
cmpb $0x5b, (%rax)
jne 0x4fd6
movq %r14, %rdi
movq %rax, %rsi
callq 0x8047
testq %rax, %rax
je 0x559e
movq %rbx, %rdi
callq 0x72d8
movq %r14, 0x60(%rsp)
movq %r14, %r12
addq $0x10, %r12
leaq 0x5499(%rip), %rbp      # 0xa4b4
movq (%r12), %r12
testq %r12, %r12
je 0x5586
leaq 0x10(%r12), %r13
movq $0x0, 0x30(%rsp)
movl $0x0, 0x24(%rsp)
movl $0x0, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x48(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x28(%rsp)
xorl %r14d, %r14d
movq $0x0, 0x58(%rsp)
movq $0x0, 0x10(%rsp)
xorl %ebx, %ebx
movq %r12, 0x50(%rsp)
movq (%r13), %r13
testq %r13, %r13
je 0x535e
movq 0x8(%r13), %r15
cmpb $0x69, (%r15)
jne 0x50c8
cmpb $0x64, 0x1(%r15)
jne 0x50c8
cmpb $0x0, 0x2(%r15)
je 0x52f1
movq %r15, %rdi
leaq 0x5787(%rip), %rsi      # 0xa859
callq 0x2460
testl %eax, %eax
je 0x51da
movq %r15, %rdi
leaq 0x5799(%rip), %rsi      # 0xa882
callq 0x2460
testl %eax, %eax
je 0x52c2
movq %r15, %rdi
leaq 0x5787(%rip), %rsi      # 0xa887
callq 0x2460
testl %eax, %eax
movq %rbx, (%rsp)
jne 0x51e8
cmpb $0x4, (%r13)
jne 0x51e8
leaq 0x10(%r13), %r12
movq (%r12), %r12
testq %r12, %r12
je 0x5350
movq 0x8(%r12), %r15
movq %r15, %rdi
leaq 0x571d(%rip), %rsi      # 0xa859
callq 0x2460
testl %eax, %eax
je 0x51b4
cmpb $0x69, (%r15)
jne 0x5159
cmpb $0x64, 0x1(%r15)
jne 0x5159
cmpb $0x0, 0x2(%r15)
je 0x51c6
movq %r15, %rdi
leaq 0x5729(%rip), %rsi      # 0xa88c
callq 0x2460
testl %eax, %eax
jne 0x51d1
leaq 0x10(%r12), %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x51c0
movq 0x8(%rbx), %r15
movq %r15, %rdi
movq %rbp, %rsi
callq 0x2460
testl %eax, %eax
je 0x51aa
movq %r15, %rdi
leaq 0x564c(%rip), %rsi      # 0xa7e2
callq 0x2460
testl %eax, %eax
jne 0x51ae
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
jmp 0x51ae
movq 0x10(%rbx), %r14
addq $0x18, %rbx
jmp 0x5171
movq 0x10(%r12), %rax
movq %rax, 0x58(%rsp)
jmp 0x51d1
movq (%rsp), %rbx
jmp 0x51d1
movq 0x10(%r12), %rax
movl (%rax), %eax
movl %eax, 0x18(%rsp)
addq $0x18, %r12
jmp 0x5120
movq 0x10(%r13), %rax
movq %rax, 0x40(%rsp)
jmp 0x5355
movq %r15, %rdi
leaq 0x56a1(%rip), %rsi      # 0xa893
callq 0x2460
testl %eax, %eax
je 0x52d0
movq %r15, %rdi
leaq 0x5683(%rip), %rsi      # 0xa88c
callq 0x2460
testl %eax, %eax
je 0x52fe
movq %r15, %rdi
leaq 0x5685(%rip), %rsi      # 0xa8a5
callq 0x2460
testl %eax, %eax
jne 0x5355
leaq 0x10(%r13), %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x534a
movq 0x8(%rbx), %r15
movq %r15, %rdi
leaq 0x5667(%rip), %rsi      # 0xa8b2
callq 0x2460
testl %eax, %eax
je 0x5297
movq %r15, %rdi
leaq 0x5660(%rip), %rsi      # 0xa8be
callq 0x2460
testl %eax, %eax
je 0x52a3
movq %r15, %rdi
leaq 0x565c(%rip), %rsi      # 0xa8cd
callq 0x2460
testl %eax, %eax
je 0x52af
movq %r15, %rdi
leaq 0x532c(%rip), %rsi      # 0xa5b0
callq 0x2460
testl %eax, %eax
jne 0x52b9
movq 0x10(%rbx), %rax
movq %rax, (%rsp)
jmp 0x52b9
movq 0x10(%rbx), %rax
movl (%rax), %eax
movl %eax, 0x24(%rsp)
jmp 0x52b9
movq 0x10(%rbx), %rax
movl (%rax), %eax
movl %eax, 0x20(%rsp)
jmp 0x52b9
movq 0x10(%rbx), %rax
movl (%rax), %eax
movl %eax, 0x1c(%rsp)
addq $0x18, %rbx
jmp 0x5231
movq 0x10(%r13), %rax
movq %rax, 0x28(%rsp)
jmp 0x5355
movq 0x10(%r13), %rdi
leaq 0x55c2(%rip), %rsi      # 0xa89d
callq 0x2460
cmpl $0x1, %eax
movl $0x0, %eax
adcb $0x1, %al
movq %rax, 0x38(%rsp)
jmp 0x5355
movq 0x10(%r13), %rax
movl (%rax), %eax
movq %rax, 0x30(%rsp)
jmp 0x5355
leaq 0x10(%r13), %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x534a
movq 0x8(%rbx), %r15
movq %r15, %rdi
movq %rbp, %rsi
callq 0x2460
testl %eax, %eax
je 0x533b
movq %r15, %rdi
leaq 0x54bb(%rip), %rsi      # 0xa7e2
callq 0x2460
testl %eax, %eax
jne 0x5344
movq 0x10(%rbx), %rax
movq %rax, 0x48(%rsp)
jmp 0x5344
movq 0x10(%rbx), %rax
movq %rax, 0x8(%rsp)
addq $0x18, %rbx
jmp 0x5302
movq (%rsp), %rbx
jmp 0x5355
movq 0x50(%rsp), %r12
addq $0x18, %r13
jmp 0x509f
leaq 0x5577(%rip), %rdi      # 0xa8dc
callq 0x24f0
leaq 0x5577(%rip), %rdi      # 0xa8e8
movq 0x8(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq 0x40(%rsp), %rcx
movq 0x30(%rsp), %r8
xorl %eax, %eax
callq 0x61d1
cmpb $0x2, 0x38(%rsp)
jne 0x53d4
leaq 0x5548(%rip), %rdi      # 0xa8e2
movq %r14, %rsi
movq 0x10(%rsp), %rdx
movq 0x58(%rsp), %rcx
movl 0x18(%rsp), %r8d
xorl %eax, %eax
callq 0x61d1
leaq 0x6247(%rip), %rdi      # 0xb601
movq 0x28(%rsp), %rsi
xorl %eax, %eax
callq 0x61d1
leaq 0x5540(%rip), %rdi      # 0xa90d
callq 0x24f0
jmp 0x53e7
leaq 0x6226(%rip), %rdi      # 0xb601
movq 0x28(%rsp), %rsi
xorl %eax, %eax
callq 0x61d1
leaq 0x546b(%rip), %r13      # 0xa859
leaq 0x551c(%rip), %rdi      # 0xa911
movl 0x1c(%rsp), %r14d
movl %r14d, %esi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
xorl %eax, %eax
callq 0x2070
leaq 0x552e(%rip), %rdi      # 0xa941
testq %rbx, %rbx
je 0x5554
leaq 0x551e(%rip), %rdi      # 0xa941
testl %r14d, %r14d
je 0x5554
testq %rbx, %rbx
je 0x554d
movq %rbx, (%rsp)
addq $0x10, %rbx
xorl %r15d, %r15d
xorl %r12d, %r12d
movq $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x5503
movq 0x8(%rbx), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x2460
testl %eax, %eax
je 0x54dd
movq %r14, %rdi
leaq 0x5404(%rip), %rsi      # 0xa882
callq 0x2460
testl %eax, %eax
je 0x54e8
movq %r14, %rdi
leaq 0x53fb(%rip), %rsi      # 0xa88c
callq 0x2460
testl %eax, %eax
jne 0x54fa
leaq 0x10(%rbx), %r13
movq (%r13), %r13
testq %r13, %r13
je 0x54f3
movq 0x8(%r13), %r14
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2460
testl %eax, %eax
je 0x54d3
movq %r14, %rdi
leaq 0x531e(%rip), %rsi      # 0xa7e2
callq 0x2460
testl %eax, %eax
jne 0x54d7
movq 0x10(%r13), %r12
jmp 0x54d7
movq 0x10(%r13), %r15
addq $0x18, %r13
jmp 0x549e
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
jmp 0x54fa
movq 0x10(%rbx), %rax
movq %rax, 0x8(%rsp)
jmp 0x54fa
leaq 0x535f(%rip), %r13      # 0xa859
addq $0x18, %rbx
jmp 0x5455
leaq 0x544b(%rip), %rdi      # 0xa955
callq 0x24f0
leaq 0x5447(%rip), %rdi      # 0xa95d
movq %r15, %rsi
movq %r12, %rdx
movq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0x61d1
leaq 0x5447(%rip), %rdi      # 0xa976
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x61d1
movq (%rsp), %rbx
movq 0x18(%rbx), %rbx
movq 0x50(%rsp), %r12
jmp 0x542c
leaq 0x5fde(%rip), %rdi      # 0xb532
callq 0x24f0
addq $0x18, %r12
jmp 0x501b
leaq 0x5152(%rip), %rdi      # 0xa6bb
movl %eax, %esi
xorl %eax, %eax
callq 0x22e0
jmp 0x55ac
leaq 0x50a7(%rip), %rdi      # 0xa622
jmp 0x55a5
leaq 0x4ed7(%rip), %rdi      # 0xa45b
jmp 0x55a5
movq 0x60(%rsp), %rdi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8002
leaq 0x52c9(%rip), %rdi      # 0xa86e
xorl %eax, %eax
callq 0x22e0
movq %rbx, %rdi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x72d8