// File: /workspace/github_c_makefile_star2_O1/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, %r14
movq %rsi, %r13
movq %rdi, %r12
movl $0x60, %edi
callq 0x2420
testq %rax, %rax
je 0x3775
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movw $0x1bb, 0x10(%rax)      # imm = 0x1BB
movq $0x0, 0x58(%rax)
movups %xmm0, 0x40(%rax)
movq %r12, %rdi
callq 0x2570
movq %rax, (%r15)
testq %rax, %rax
je 0x3a7f
leaq 0x7aa2(%rip), %rsi      # 0xb070
leaq 0x40(%rsp), %rdi
movl $0x81, %edx
callq 0x2200
callq 0x2060
movq %rax, %rbx
movl $0x0, (%rax)
movq %r12, %rdi
movl $0x1bb, %esi            # imm = 0x1BB
callq 0x7828
testq %rax, %rax
je 0x39c0
movq %rax, %rbp
leaq 0x70af(%rip), %rsi      # 0xa6ba
leaq 0x6e85(%rip), %rcx      # 0xa497
leaq 0x6de7(%rip), %r8       # 0xa400
movq %rax, %rdi
xorl %edx, %edx
callq 0x833e
cmpl $0xc8, %eax
jne 0x3781
movq %r14, 0x28(%rsp)
movq %rbx, 0x38(%rsp)
movq %r13, 0x10(%rsp)
movq %r12, 0x8(%rsp)
movq %r15, 0x18(%rsp)
movq %rbp, 0x20(%rsp)
movq %rbp, %rdi
callq 0x7e06
testq %rax, %rax
je 0x3798
movq %rax, %r15
xorl %r13d, %r13d
leaq 0x7095(%rip), %r14      # 0xa6ff
leaq 0x7091(%rip), %rbp      # 0xa702
movl $0xb, %edx
movq %r15, %rdi
leaq 0x7073(%rip), %rsi      # 0xa6f3
callq 0x2170
movq %r15, %rdi
testl %eax, %eax
je 0x36c2
leaq 0x7082(%rip), %rsi      # 0xa715
callq 0x20d0
testq %rax, %rax
je 0x3714
movq %rax, %rdi
leaq 0x7088(%rip), %rsi      # 0xa72f
callq 0x20d0
testq %rax, %rax
je 0x3714
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0x3719
cmpl $0x3d, %ecx
je 0x3719
incq %rax
jmp 0x36b1
movq %r14, %rsi
callq 0x2500
testq %rax, %rax
je 0x3714
movq %rax, %r15
movl $0x12, %edx
movq %r15, %rdi
movq %rbp, %rsi
callq 0x2170
testl %eax, %eax
jne 0x36fa
movq %r15, %rdi
callq 0x2570
movq %rax, %r13
testq %rax, %rax
je 0x39c4
xorl %edi, %edi
movq %r14, %rsi
callq 0x2500
movq %rax, %r15
movl $0x0, %r12d
testq %rax, %rax
jne 0x36d2
jmp 0x3752
xorl %r12d, %r12d
jmp 0x3752
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 0x3744
cmpl $0x22, %edx
je 0x3744
incq %rcx
jmp 0x3733
movb $0x0, (%rcx)
movq %rax, %rdi
callq 0x2570
movq %rax, %r12
movq 0x20(%rsp), %rdi
callq 0x7e06
testq %r12, %r12
sete %bl
testq %rax, %rax
je 0x37a0
movq %rax, %r15
testq %r12, %r12
je 0x3671
jmp 0x37a0
leaq 0x6f26(%rip), %rdi      # 0xa6a2
jmp 0x3a93
leaq 0x6f41(%rip), %rdi      # 0xa6c9
xorl %ebp, %ebp
movl %eax, %esi
xorl %eax, %eax
callq 0x22d0
jmp 0x39f9
movb $0x1, %bl
xorl %r13d, %r13d
xorl %r12d, %r12d
movq 0x20(%rsp), %rdi
callq 0x7a3f
testb %bl, %bl
je 0x37bc
leaq 0x6f81(%rip), %rdi      # 0xa736
xorl %eax, %eax
callq 0x22d0
testq %r13, %r13
jne 0x37cf
leaq 0x6f8e(%rip), %rdi      # 0xa756
xorl %eax, %eax
callq 0x22d0
movq 0x10(%rsp), %rdi
callq 0x81cd
movq %rax, %r14
testq %rax, %rax
je 0x39e0
movq 0x28(%rsp), %rdi
callq 0x81cd
testq %rax, %rax
je 0x39e0
movq %rax, %r15
leaq 0x832f(%rip), %rcx      # 0xbb31
testb %bl, %bl
cmoveq %r12, %rcx
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x99a1
movq %rax, %rbx
movq %r14, %rdi
callq 0x23c0
movq %r15, %rdi
callq 0x23c0
movq %rbx, 0x28(%rsp)
testq %rbx, %rbx
je 0x39e8
leaq 0x6e78(%rip), %r15      # 0xa6ba
leaq 0x6eb6(%rip), %r14      # 0xa6ff
xorl %eax, %eax
movl %eax, 0x34(%rsp)
testl %eax, %eax
je 0x385d
movl $0x2, %edi
callq 0x21f0
movq 0x8(%rsp), %rdi
movl $0x1bb, %esi            # imm = 0x1BB
callq 0x7828
testq %rax, %rax
je 0x3ab2
movq %rax, %rbx
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
leaq 0x6c06(%rip), %rcx      # 0xa497
leaq 0x6b68(%rip), %r8       # 0xa400
movl $0x3, %r9d
callq 0x83d9
cmpl $0x190, %eax            # imm = 0x190
jge 0x3abc
cmpl $-0x1, %eax
je 0x39e8
movq %rbx, 0x20(%rsp)
movq %rbx, %rdi
callq 0x7e06
testq %rax, %rax
je 0x395d
movq %rax, %r15
movl $0xb, %edx
movq %r15, %rdi
leaq 0x6e14(%rip), %rsi      # 0xa6f3
callq 0x2170
testl %eax, %eax
je 0x3909
xorl %ebp, %ebp
movq 0x20(%rsp), %rdi
callq 0x7e06
testq %rbp, %rbp
sete %bl
testq %rax, %rax
je 0x3961
movq %rax, %r15
testq %rbp, %rbp
je 0x38d0
jmp 0x3961
movq %r15, %rdi
movq %r14, %rsi
callq 0x2500
testq %rax, %rax
leaq 0x6e54(%rip), %rbx      # 0xa772
je 0x38e8
movq %rax, %r15
xorl %ebp, %ebp
movl $0x14, %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2170
testl %eax, %eax
jne 0x3949
movq %r15, %rdi
callq 0x2570
movq %rax, %rbp
testq %rax, %rax
je 0x39c4
xorl %edi, %edi
movq %r14, %rsi
callq 0x2500
movq %rax, %r15
testq %rax, %rax
jne 0x3925
jmp 0x38ea
movb $0x1, %bl
xorl %ebp, %ebp
movq 0x20(%rsp), %rdi
callq 0x7a3f
movl 0x34(%rsp), %eax
cmpl $0x8, %eax
leaq 0x6d41(%rip), %r15      # 0xa6ba
ja 0x3985
incl %eax
testb %bl, %bl
jne 0x384b
movq 0x28(%rsp), %rdi
callq 0x23c0
movq %r13, %rdi
callq 0x23c0
movq %r12, %rdi
callq 0x23c0
testb %bl, %bl
movq 0x18(%rsp), %r15
movq 0x8(%rsp), %r12
movq 0x10(%rsp), %r13
je 0x39f9
movq 0x38(%rsp), %rax
cmpl $0x0, (%rax)
je 0x3ad3
xorl %ebp, %ebp
jmp 0x39f9
leaq 0x6ce0(%rip), %rdi      # 0xa6ab
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x2110
movq 0x20(%rsp), %rdi
callq 0x7a3f
jmp 0x39ea
movq %r14, %rdi
callq 0x23c0
xorl %ebp, %ebp
movq 0x18(%rsp), %r15
movq 0x8(%rsp), %r12
movq 0x10(%rsp), %r13
movq %rbp, 0x8(%r15)
testq %rbp, %rbp
je 0x3a87
movq %r15, %rdi
callq 0x62f6
cmpl $-0x1, %eax
je 0x3a7f
movq 0x8(%r15), %rdi
callq 0x2570
leaq 0xb9dd(%rip), %rbx      # 0xf400
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x3a8c
movq (%r15), %rdi
callq 0x2570
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x3a8c
movq %r13, %rdi
callq 0x2570
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x3a8c
movl $0x1bb, (%rbx)          # imm = 0x1BB
leaq 0x6c59(%rip), %rdx      # 0xa6b4
leaq 0x40(%rsp), %r14
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdi
movq %r13, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x2530
movq %r14, %rdi
callq 0x70fc
jmp 0x3a9d
movq %r15, %rdi
callq 0x62d8
xorl %r15d, %r15d
jmp 0x3a9d
leaq 0x6c18(%rip), %rdi      # 0xa6ab
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x2110
movq %r15, %rax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x28(%rsp), %rdi
jmp 0x39e3
leaq 0x6c06(%rip), %rdi      # 0xa6c9
xorl %ebp, %ebp
movl %eax, %esi
xorl %eax, %eax
callq 0x22d0
jmp 0x39ea
leaq 0x6cad(%rip), %rdi      # 0xa787
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x22d0
jmp 0x39f9