// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
leaq 0x9add(%rip), %rdi      # 0x12410
xorl %esi, %esi
movl $0x28, %edx
callq 0x21d0
callq 0x8860
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x895a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8bc2
movq -0x30(%rbp), %rdi
leaq 0x60b1(%rip), %rsi      # 0xea16
callq 0x23b0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x89ba
callq 0x2060
cmpl $0x2, (%rax)
je 0x89a5
movq -0x30(%rbp), %rsi
leaq 0x6bb6(%rip), %rdi      # 0xf53f
movb $0x0, %al
callq 0x2120
movq -0x30(%rbp), %rdi
callq 0x23d0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8bc2
movq -0x30(%rbp), %rdi
callq 0x23d0
movl $0x2, -0x4(%rbp)
jmp 0x8bc2
movq -0x30(%rbp), %rdi
callq 0x23d0
movl $0x1, -0x14(%rbp)
movq -0x20(%rbp), %rdi
callq 0x8bd0
movq %rax, %rcx
movq %rcx, -0x28(%rbp)
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x31(%rbp)
je 0x89f9
movq -0x28(%rbp), %rdi
callq 0x8c00
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x8a02
jmp 0x8a5a
movq -0x28(%rbp), %rdi
leaq 0x6bc9(%rip), %rsi      # 0xf5d6
callq 0x2510
movq -0x28(%rbp), %rdi
callq 0x8cb0
cmpl $-0x1, %eax
jne 0x8a4a
movq -0x30(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq 0x6b1b(%rip), %rdi      # 0xf549
movb $0x0, %al
callq 0x22f0
movq -0x20(%rbp), %rdi
callq 0x22a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8bc2
jmp 0x8a4c
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x89ca
cmpq $0x0, -0x10(%rbp)
je 0x8ae9
jmp 0x8a67
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x9170
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x32(%rbp)
jne 0x8a97
movq -0x20(%rbp), %rdi
callq 0x8bd0
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
setne %al
movb %al, -0x32(%rbp)
movb -0x32(%rbp), %al
testb $0x1, %al
jne 0x8aa0
jmp 0x8aab
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x8a67
cmpq $0x0, -0x28(%rbp)
je 0x8ac0
movq -0x28(%rbp), %rdi
callq 0x8c00
cmpl $0x0, %eax
jne 0x8ae7
movq -0x10(%rbp), %rsi
leaq 0x6a8a(%rip), %rdi      # 0xf555
movb $0x0, %al
callq 0x22f0
movq -0x20(%rbp), %rdi
callq 0x22a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8bc2
jmp 0x8b23
cmpq $0x0, -0x28(%rbp)
je 0x8afe
movq -0x28(%rbp), %rdi
callq 0x8c00
cmpl $0x0, %eax
jne 0x8b21
leaq 0x6a67(%rip), %rdi      # 0xf56c
movb $0x0, %al
callq 0x22f0
movq -0x20(%rbp), %rdi
callq 0x22a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8bc2
jmp 0x8b23
jmp 0x8b25
movq -0x20(%rbp), %rdi
callq 0x8bd0
movq %rax, %rcx
movq %rcx, -0x28(%rbp)
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x33(%rbp)
je 0x8b54
movq -0x28(%rbp), %rdi
callq 0x8c00
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x33(%rbp)
movb -0x33(%rbp), %al
testb $0x1, %al
jne 0x8b5d
jmp 0x8bb2
movq -0x28(%rbp), %rdi
leaq 0x6a6e(%rip), %rsi      # 0xf5d6
callq 0x2510
movq -0x28(%rbp), %rdi
callq 0x8cb0
cmpl $-0x1, %eax
jne 0x8ba2
movq -0x30(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq 0x69c0(%rip), %rdi      # 0xf549
movb $0x0, %al
callq 0x22f0
movq -0x20(%rbp), %rdi
callq 0x22a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8bc2
jmp 0x8ba4
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x8b25
movq -0x20(%rbp), %rdi
callq 0x22a0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)