// File: /workspace/github_c_makefile_star2_O1/tomka[P]cliaspora/config.c
// Function: read_config
int
read_config(const char *label)
{
	int  lc;
	FILE *fp;
	char *ln, *path;
	
	(void)memset(&cfg, 0, sizeof(cfg));
	if ((path = cfgpath()) == NULL)
		return (-1);
	if ((fp = fopen(path, "r")) == NULL) {
		if (errno != ENOENT) {
			warn("fopen(%s)", path); free(path);
			return (-1);
		}
		free(path);
		return (ENOENT);
	}
	free(path);

	/*
	 * Get all global variables, that is, variables before the
	 * first labeled block.
	 */
	for (lc = 1; (ln = readln(fp)) != NULL && !is_label(ln); lc++) {
		(void)strtok(ln, "\n");
		if (parse_line(ln) == -1) {
			warnx("%s, line %d", path, lc); (void)fclose(fp);
			return (-1);
		}
	}
	if (label != NULL) {
		while (!cmp_label(ln, label) && (ln = readln(fp)) != NULL)
			lc++;
		if (ln == NULL || !is_label(ln)) {
			warnx("Profile '%s' not found", label);
			(void)fclose(fp); return (-1);
		}

	} else if (ln == NULL || !is_label(ln)) {
		warnx("No label found in config file");
		(void)fclose(fp); return (-1);
	}
	/* Read until the next label or EOF. */
	for (; (ln = readln(fp)) != NULL && !is_label(ln); lc++) {
		(void)strtok(ln, "\n");
		if (parse_line(ln) == -1) {
			warnx("%s, line %d", path, lc);
			(void)fclose(fp); return (-1);
		}
	}
	(void)fclose(fp);
	return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r13
xorps %xmm0, %xmm0
movups %xmm0, 0x8a1d(%rip)     # 0xf410
movups %xmm0, 0x8a06(%rip)     # 0xf400
movq $0x0, 0x8a1b(%rip) # 0xf420
callq 0x6950
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x6c32
movq %rax, %r15
leaq 0x3ab8(%rip), %rsi      # 0xa4da
movq %rax, %rdi
callq 0x23a0
testq %rax, %rax
je 0x6b15
movq %rax, %r14
movq %r15, %rdi
callq 0x23c0
leaq 0x89eb(%rip), %rdi      # 0xf430
movl $0x800, %esi            # imm = 0x800
movq %r14, %rdx
callq 0x2520
movq %rax, %rbp
movl $0x1, %r12d
testq %rax, %rax
sete %bl
je 0x6aca
movq %rbp, %rdi
callq 0x6c43
testl %eax, %eax
jne 0x6aca
movl $0x1, %ecx
movl %ecx, %r12d
movq %rbp, %rdi
leaq 0x4ad1(%rip), %rsi      # 0xb552
callq 0x2500
movq %rbp, %rdi
callq 0x6ca1
cmpl $-0x1, %eax
je 0x6c11
leaq 0x8992(%rip), %rdi      # 0xf430
movl $0x800, %esi            # imm = 0x800
movq %r14, %rdx
callq 0x2520
movq %rax, %rbp
testq %rax, %rax
sete %bl
je 0x6ac7
movq %rbp, %rdi
callq 0x6c43
leal 0x1(%r12), %ecx
testl %eax, %eax
je 0x6a74
incl %r12d
testq %r13, %r13
je 0x6b31
movq %rbp, %rdi
movq %r13, %rsi
callq 0x6ff6
testl %eax, %eax
jne 0x6b74
leaq 0x8947(%rip), %rbx      # 0xf430
movq %rbx, %rdi
movl $0x800, %esi            # imm = 0x800
movq %r14, %rdx
callq 0x2520
testq %rax, %rax
je 0x6b72
movq %rax, %rbp
incl %r12d
movq %rax, %rdi
movq %r13, %rsi
callq 0x6ff6
testl %eax, %eax
je 0x6ae9
jmp 0x6b74
callq 0x2060
cmpl $0x2, (%rax)
jne 0x6b54
movq %r15, %rdi
callq 0x23c0
movl $0x2, %ebx
jmp 0x6c32
testb %bl, %bl
jne 0x6b41
movq %rbp, %rdi
callq 0x6c43
testl %eax, %eax
jne 0x6b89
leaq 0x49a0(%rip), %rdi      # 0xb4e8
xorl %eax, %eax
callq 0x22d0
jmp 0x6c25
leaq 0x4960(%rip), %rdi      # 0xb4bb
movq %r15, %rsi
xorl %eax, %eax
callq 0x2110
movq %r15, %rdi
callq 0x23c0
jmp 0x6c32
xorl %ebp, %ebp
testq %rbp, %rbp
je 0x6bfe
movq %rbp, %rdi
callq 0x6c43
testl %eax, %eax
je 0x6bfe
leaq 0x88a0(%rip), %rdi      # 0xf430
movl $0x800, %esi            # imm = 0x800
movq %r14, %rdx
callq 0x2520
testq %rax, %rax
je 0x6bf2
movq %rax, %rbp
leaq 0x49a6(%rip), %rbx      # 0xb552
leaq 0x887d(%rip), %r13      # 0xf430
movq %rbp, %rdi
callq 0x6c43
testl %eax, %eax
jne 0x6bf2
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x2500
movq %rbp, %rdi
callq 0x6ca1
cmpl $-0x1, %eax
je 0x6c11
incl %r12d
movq %r13, %rdi
movl $0x800, %esi            # imm = 0x800
movq %r14, %rdx
callq 0x2520
movq %rax, %rbp
testq %rax, %rax
jne 0x6bb3
movq %r14, %rdi
callq 0x2280
xorl %ebx, %ebx
jmp 0x6c32
leaq 0x48cc(%rip), %rdi      # 0xb4d1
movq %r13, %rsi
xorl %eax, %eax
callq 0x22d0
jmp 0x6c25
leaq 0x48ad(%rip), %rdi      # 0xb4c5
movq %r15, %rsi
movl %r12d, %edx
xorl %eax, %eax
callq 0x22d0
movq %r14, %rdi
callq 0x2280
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq