// File: /workspace/github_c_makefile_star2_O0/tomka[P]cliaspora/cliaspora.c
// Function: get_aspects
static aspect_t *
get_aspects(json_node_t *node)
{
	int	    saved_errno;
	aspect_t    *aspects, *ap;
	json_node_t *jp;

	errno = 0;
	aspects = ap = NULL;
	if ((node = find_json_node(node, "aspects")) == NULL)
		return (NULL);
	for (node = node->val; node != NULL; node = node->next) {
		if (aspects == NULL) {
			if ((aspects = malloc(sizeof(aspect_t))) == NULL)
				return (NULL);
			aspects->name = NULL; aspects->id = -1;
			aspects->next = NULL;
			ap = aspects;
		} else if (ap->name != NULL && ap->id != -1) {
			if ((ap->next = malloc(sizeof(aspect_t))) == NULL)
				return (NULL);
			ap = ap->next;
			ap->name = NULL; ap->id = -1;
			ap->next = NULL;
		}
		for (jp = node->val; jp != NULL; jp = jp->next) {
			if (jp->type == JSON_TYPE_STRING && jp->var != NULL &&
			    strcmp(jp->var, "name") == 0) {
				ap->name = strdup((char *)jp->val);
				if (ap->name == NULL) {
					saved_errno = errno;
					free_aspects(aspects);
					errno = saved_errno;
					return (NULL);
				}
			} else if (jp->type == JSON_TYPE_NUMBER &&
			    jp->var != NULL && strcmp(jp->var, "id") == 0) {
				ap->id = *(int *)jp->val;
			}
		}
	}
	if (aspects->name == NULL || aspects->id == -1) {
		free(aspects); return (NULL);
	}
	return (aspects);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
callq 0x2060
movl $0x0, (%rax)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x7053(%rip), %rsi      # 0xeba5
callq 0xc430
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
jne 0x7b6e
movq $0x0, -0x8(%rbp)
jmp 0x7d75
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x7d46
cmpq $0x0, -0x20(%rbp)
jne 0x7bd9
movl $0x18, %edi
callq 0x2430
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x7bad
movq $0x0, -0x8(%rbp)
jmp 0x7d75
movq -0x20(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x20(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq -0x20(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x7c42
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x7c40
movq -0x28(%rbp), %rax
cmpl $-0x1, (%rax)
je 0x7c40
movl $0x18, %edi
callq 0x2430
movq -0x28(%rbp), %rcx
movq %rax, 0x10(%rcx)
cmpq $0x0, %rax
jne 0x7c12
movq $0x0, -0x8(%rbp)
jmp 0x7d75
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x28(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq -0x28(%rbp), %rax
movq $0x0, 0x10(%rax)
jmp 0x7c42
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x7d33
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x1, %eax
jne 0x7cde
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x7cde
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x6d8d(%rip), %rsi      # 0xea0c
callq 0x2460
cmpl $0x0, %eax
jne 0x7cde
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2580
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x7cdc
callq 0x2060
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x20(%rbp), %rdi
callq 0x7ad0
movl -0x14(%rbp), %eax
movl %eax, -0x34(%rbp)
callq 0x2060
movl -0x34(%rbp), %ecx
movl %ecx, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x7d75
jmp 0x7d20
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2, %eax
jne 0x7d1e
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x7d1e
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x703f(%rip), %rsi      # 0xed43
callq 0x2460
cmpl $0x0, %eax
jne 0x7d1e
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl (%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
jmp 0x7d20
jmp 0x7d22
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x7c4e
jmp 0x7d35
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x7b7a
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x7d5a
movq -0x20(%rbp), %rax
cmpl $-0x1, (%rax)
jne 0x7d6d
movq -0x20(%rbp), %rdi
callq 0x23d0
movq $0x0, -0x8(%rbp)
jmp 0x7d75
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop