// File: /workspace/github_c_makefile_star2_O1/tomka[P]cliaspora/cliaspora.c
// Function: reshare
static int
reshare(session_t *sp, int id)
{
	int	   status, ret;
	char	   *rq, *guid;
	ssl_conn_t *cp;
	const char tmpl[] = "{\"root_guid\":\"%s\"}";

	errno = 0;
	if ((guid = get_post_guid(sp, id)) == NULL)
		return (-1);
	if ((rq = strduprintf(tmpl, guid)) == NULL)
		return (-1);
	if ((cp = ssl_connect(sp->host, sp->port)) == NULL) {
		free(rq); return (-1);
	}
	status = http_post(cp, "/reshares", 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_CREATED)
		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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movaps 0x59d1(%rip), %xmm0     # 0xafe0
movaps %xmm0, 0x10(%rsp)
movl $0x7d2273, 0x1f(%rsp)   # imm = 0x7D2273
callq 0x2060
movq %rax, %r12
movl $0x0, (%rax)
leaq 0x4fb7(%rip), %rdi      # 0xa5e8
xorl %r14d, %r14d
movl %ebp, %esi
xorl %eax, %eax
callq 0x99a1
movq %rax, 0x9d74(%rip)      # 0xf3b8
movb $0x1, %r13b
testq %rax, %rax
je 0x57af
movq (%rbx), %rdi
movzwl 0x10(%rbx), %esi
callq 0x7828
testq %rax, %rax
je 0x57ac
movq %rax, %r15
movq 0x9d49(%rip), %rsi      # 0xf3b8
movq 0x8(%rbx), %rdx
leaq 0x4f03(%rip), %rcx      # 0xa57d
leaq 0x4d7f(%rip), %r8       # 0xa400
movq %rax, %rdi
callq 0x833e
movl %eax, %ebp
movq 0x9d26(%rip), %rdi      # 0xf3b8
callq 0x23c0
cmpl $-0x1, %ebp
je 0x57a4
cmpl $0x191, %ebp            # imm = 0x191
je 0x575f
cmpl $0xc8, %ebp
jne 0x5772
movq %r15, %rdi
callq 0x7e06
movq %rax, 0x9ce9(%rip)      # 0xf3b0
testq %rax, %rax
je 0x578f
cmpb $0x7b, (%rax)
jne 0x56b8
callq 0x87ec
testq %rax, %rax
je 0x587f
movq %rax, %r12
movq 0x9cc3(%rip), %rsi      # 0xf3b0
movq %rax, %rdi
callq 0x885e
movq %rax, %r14
movq %r15, %rdi
callq 0x7a3f
testq %r14, %r14
je 0x57ac
movq 0x10(%r12), %r15
testq %r15, %r15
sete %bpl
je 0x5744
leaq 0x4f45(%rip), %r14      # 0xa663
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0x5737
movq %r14, %rsi
callq 0x2450
testl %eax, %eax
je 0x5895
movq 0x18(%r15), %r15
testq %r15, %r15
sete %bpl
jne 0x571e
movq %r12, %rdi
callq 0x8814
leaq 0x4efb(%rip), %rdi      # 0xa64e
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x22d0
jmp 0x57af
leaq 0x4ca4(%rip), %rdi      # 0xa40a
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x22d0
jmp 0x5785
leaq 0x4f5e(%rip), %rdi      # 0xa6d7
xorl %r14d, %r14d
movl %ebp, %esi
xorl %eax, %eax
callq 0x22d0
movq %r15, %rdi
callq 0x7a3f
jmp 0x57af
cmpl $0x0, (%r12)
jne 0x57a4
leaq 0x4cbe(%rip), %rdi      # 0xa45b
xorl %eax, %eax
callq 0x22d0
movq %r15, %rdi
callq 0x7a3f
xorl %r14d, %r14d
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testb %r13b, %r13b
jne 0x586d
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x99a1
testq %rax, %rax
je 0x586d
movq %rax, %r12
movq (%rbx), %rdi
movzwl 0x10(%rbx), %esi
callq 0x7828
testq %rax, %rax
je 0x5845
movq %rax, %r14
movq 0x8(%rbx), %rdx
movq %r12, (%rsp)
leaq 0x4e38(%rip), %rsi      # 0xa634
leaq 0x4bfd(%rip), %r8       # 0xa400
xorl %r15d, %r15d
movq %rax, %rdi
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x83d9
movl %eax, %ebx
movq %r12, %rdi
callq 0x23c0
cmpl $-0x1, %ebx
je 0x585f
cmpl $0xc9, %ebx
je 0x5865
cmpl $0x191, %ebx            # imm = 0x191
jne 0x584f
leaq 0x4bce(%rip), %rdi      # 0xa40a
xorl %eax, %eax
callq 0x22d0
jmp 0x585f
movq %r12, %rdi
callq 0x23c0
jmp 0x586d
leaq 0x4e81(%rip), %rdi      # 0xa6d7
movl %ebx, %esi
xorl %eax, %eax
callq 0x22d0
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movq %r14, %rdi
callq 0x7a3f
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4db8(%rip), %rdi      # 0xa63e
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x2110
jmp 0x5785
movq 0x10(%r15), %rsi
leaq 0x9b20(%rip), %r14      # 0xf3c0
movl $0x40, %edx
movq %r14, %rdi
callq 0x21a0
movq %r12, %rdi
callq 0x8814
testb $0x1, %bpl
jne 0x574c
xorl %r13d, %r13d
jmp 0x57af