// File: /workspace/github_c_makefile_star2_O3/tomka[P]cliaspora/cliaspora.c
// Function: new_session
static session_t *
new_session(const char *host, u_short port, const char *user, const char *pass)
{
	char	  account[256];
	session_t *sp;

	if ((sp = malloc(sizeof(session_t))) == NULL) {
		warn("malloc()"); return (NULL);
	}
	sp->cookie	 = sp->host = NULL;
	sp->port	 = port;
	sp->attr.name	 = sp->attr.did = NULL;
	sp->attr.aspects = NULL;

	if ((sp->host = strdup(host)) == NULL) {
		free_session(sp); return (NULL);
	}
	sp->cookie = diaspora_login(host, port, user, pass);
	if (sp->cookie == NULL)
		return (NULL);
	if (get_attributs(sp) == -1) {
		free_session(sp); return (NULL);
	}
	if ((cfg.cookie = strdup(sp->cookie)) == NULL) {
		warn("strdup()"); return (NULL);
	}
	if ((cfg.host = strdup(sp->host)) == NULL) {
		warn("strdup()"); return (NULL);
	}
	if ((cfg.user = strdup(user)) == NULL) {
		warn("strdup()"); return (NULL);
	}
	cfg.port = port;
	(void)snprintf(account, sizeof(account), "%s@%s", user, host);
	write_config(account);

	return (sp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbp
movl $0x60, %edi
callq 0x2420
testq %rax, %rax
je 0x3843
movq %rax, %rbx
xorl %eax, %eax
movq %rax, 0x8(%rbx)
movw $0x1bb, 0x10(%rbx)      # imm = 0x1BB
movq %rax, 0x58(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rbx)
movq %rbp, %rdi
callq 0x2570
movq %rax, (%rbx)
testq %rax, %rax
je 0x3b57
leaq 0x79c0(%rip), %rsi      # 0xb050
leaq 0x40(%rsp), %rdi
movl $0x81, %edx
callq 0x2200
callq 0x2060
movq %rax, %r15
movl $0x0, (%rax)
movq %rbp, %rdi
movl $0x1bb, %esi            # imm = 0x1BB
callq 0x7710
testq %rax, %rax
je 0x3ab6
movq %rax, %r13
leaq 0x6fd1(%rip), %rsi      # 0xa69e
leaq 0x6dc3(%rip), %rcx      # 0xa497
leaq 0x6d25(%rip), %r8       # 0xa400
movq %rax, %rdi
xorl %edx, %edx
callq 0x81ee
cmpl $0xc8, %eax
jne 0x3a82
movq %r12, 0x10(%rsp)
movq %r15, 0x38(%rsp)
movq %r14, 0x20(%rsp)
movq %r13, %rdi
callq 0x7ce0
testq %rax, %rax
je 0x3858
movq %rax, %r12
movq %r13, 0x8(%rsp)
movq %rbp, 0x18(%rsp)
xorl %r13d, %r13d
leaq 0x6fbc(%rip), %r15      # 0xa6e3
leaq 0x6fb8(%rip), %rbp      # 0xa6e6
movl $0xb, %edx
movq %r12, %rdi
leaq 0x6f9a(%rip), %rsi      # 0xa6d7
callq 0x2170
movq %r12, %rdi
testl %eax, %eax
je 0x377f
leaq 0x6fa9(%rip), %rsi      # 0xa6f9
callq 0x20d0
testq %rax, %rax
je 0x37d1
movq %rax, %rdi
leaq 0x6faf(%rip), %rsi      # 0xa713
callq 0x20d0
testq %rax, %rax
je 0x37d1
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0x37d6
cmpl $0x3d, %ecx
je 0x37d6
incq %rax
jmp 0x376e
movq %r15, %rsi
callq 0x2500
testq %rax, %rax
je 0x37d1
movq %rax, %r12
movl $0x12, %edx
movq %r12, %rdi
movq %rbp, %rsi
callq 0x2170
testl %eax, %eax
jne 0x37b7
movq %r12, %rdi
callq 0x2570
movq %rax, %r13
testq %rax, %rax
je 0x3a94
xorl %edi, %edi
movq %r15, %rsi
callq 0x2500
movq %rax, %r12
movl $0x0, %r14d
testq %rax, %rax
jne 0x378f
jmp 0x380f
xorl %r14d, %r14d
jmp 0x380f
xorl %edx, %edx
cmpb $0x3d, %cl
sete %dl
xorl %ecx, %ecx
cmpb $0x22, (%rax,%rdx)
sete %cl
addq %rdx, %rax
addq %rcx, %rax
movq %rax, %rcx
movzbl (%rcx), %edx
testl %edx, %edx
je 0x3801
cmpl $0x22, %edx
je 0x3801
incq %rcx
jmp 0x37f0
movb $0x0, (%rcx)
movq %rax, %rdi
callq 0x2570
movq %rax, %r14
movq 0x8(%rsp), %rdi
callq 0x7ce0
testq %rax, %rax
je 0x382a
movq %rax, %r12
testq %r14, %r14
je 0x372e
movq 0x8(%rsp), %rdi
callq 0x7921
movq %r14, %r15
testq %r14, %r14
movq 0x18(%rsp), %rbp
jne 0x387b
jmp 0x3863
leaq 0x6e3c(%rip), %rdi      # 0xa686
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x2110
jmp 0x3b61
movq %r13, %rdi
callq 0x7921
xorl %r13d, %r13d
leaq 0x6eb0(%rip), %rdi      # 0xa71a
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x22d0
leaq 0x82c6(%rip), %r14      # 0xbb41
movq %r15, 0x30(%rsp)
testq %r13, %r13
jne 0x3893
leaq 0x6eae(%rip), %rdi      # 0xa73a
xorl %eax, %eax
callq 0x22d0
movq 0x20(%rsp), %rdi
callq 0x807d
movq %rax, %r15
testq %rax, %rax
je 0x3aae
movq 0x10(%rsp), %rdi
callq 0x807d
testq %rax, %rax
je 0x3aae
movq %rax, %r12
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
movq %rax, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x9772
movq %rax, %r14
movq %r15, %rdi
callq 0x23c0
movq %r12, %rdi
callq 0x23c0
movq %r14, 0x10(%rsp)
testq %r14, %r14
je 0x3ab6
movq %rbp, 0x18(%rsp)
leaq 0x6de2(%rip), %r15      # 0xa6e3
xorl %r14d, %r14d
testl %r14d, %r14d
je 0x3913
movl $0x2, %edi
callq 0x21f0
movq 0x18(%rsp), %rdi
movl $0x1bb, %esi            # imm = 0x1BB
callq 0x7710
testq %rax, %rax
je 0x3ac3
movq %rax, %r12
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %r12, %rdi
leaq 0x6d5d(%rip), %rsi      # 0xa69e
movq %r13, %rdx
leaq 0x6b4c(%rip), %rcx      # 0xa497
leaq 0x6aae(%rip), %r8       # 0xa400
movl $0x3, %r9d
callq 0x8281
cmpl $0x190, %eax            # imm = 0x190
jge 0x3a82
movq %r14, 0x28(%rsp)
cmpl $-0x1, %eax
je 0x3ab6
movq %r12, 0x8(%rsp)
movq %r12, %rdi
callq 0x7ce0
testq %rax, %rax
je 0x3a21
movq %rax, %r14
movl $0xb, %edx
movq %r14, %rdi
leaq 0x6d39(%rip), %rsi      # 0xa6d7
callq 0x2170
testl %eax, %eax
je 0x39c9
xorl %ebp, %ebp
movq 0x8(%rsp), %rdi
callq 0x7ce0
testq %rbp, %rbp
sete %r12b
testq %rax, %rax
je 0x3a26
movq %rax, %r14
testq %rbp, %rbp
je 0x398f
jmp 0x3a26
movq %r14, %rdi
movq %r15, %rsi
callq 0x2500
testq %rax, %rax
leaq 0x6d78(%rip), %r12      # 0xa756
je 0x39a7
movq %rax, %r14
xorl %ebp, %ebp
movl $0x14, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x2170
testl %eax, %eax
jne 0x3a0d
movq %r14, %rdi
callq 0x2570
movq %rax, %rbp
testq %rax, %rax
je 0x3a94
xorl %edi, %edi
movq %r15, %rsi
callq 0x2500
movq %rax, %r14
testq %rax, %rax
jne 0x39e5
jmp 0x39a9
movb $0x1, %r12b
xorl %ebp, %ebp
movq 0x8(%rsp), %rdi
callq 0x7921
movq 0x28(%rsp), %r14
cmpl $0x8, %r14d
ja 0x3a47
incl %r14d
testb %r12b, %r12b
jne 0x3904
movq 0x10(%rsp), %rdi
callq 0x23c0
movq %r13, %rdi
callq 0x23c0
movq 0x30(%rsp), %rdi
callq 0x23c0
testb %r12b, %r12b
je 0x3aca
movq 0x38(%rsp), %rax
cmpl $0x0, (%rax)
jne 0x3ab6
leaq 0x6cf2(%rip), %rdi      # 0xa76b
xorl %eax, %eax
callq 0x22d0
jmp 0x3ab6
leaq 0x6c24(%rip), %rdi      # 0xa6ad
movl %eax, %esi
xorl %eax, %eax
callq 0x22d0
jmp 0x3ab6
leaq 0x6bf4(%rip), %rdi      # 0xa68f
xorl %eax, %eax
callq 0x2110
movq 0x8(%rsp), %rdi
callq 0x7921
jmp 0x3ab6
movq %r15, %rdi
callq 0x23c0
movq $0x0, 0x8(%rbx)
jmp 0x3b5f
movq 0x10(%rsp), %rdi
jmp 0x3ab1
movq %rbp, 0x8(%rbx)
testq %rbp, %rbp
je 0x3b5f
movq %rbx, %rdi
callq 0x6248
cmpl $-0x1, %eax
je 0x3b57
movq 0x8(%rbx), %rdi
callq 0x2570
leaq 0xb90c(%rip), %r14      # 0xf400
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x3b76
movq (%rbx), %rdi
callq 0x2570
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0x3b76
movq 0x20(%rsp), %rdi
callq 0x2570
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x3b76
movl $0x1bb, (%r14)          # imm = 0x1BB
leaq 0x6b69(%rip), %rdx      # 0xa698
leaq 0x40(%rsp), %r14
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdi
movq 0x20(%rsp), %rcx
movq 0x18(%rsp), %r8
xorl %eax, %eax
callq 0x2530
movq %r14, %rdi
callq 0x6ff8
jmp 0x3b61
movq %rbx, %rdi
callq 0x622a
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6b12(%rip), %rdi      # 0xa68f
jmp 0x384a