// File: /workspace/github_c_makefile_star2_O2/saltyJeff[P]uClibcpp/extra/config/./confdata.c
// Function: conf_read
int conf_read(const char *name)
{
	FILE *in = NULL;
	char line[1024];
	char *p, *p2;
	int lineno = 0;
	struct symbol *sym;
	struct property *prop;
	struct expr *e;
	int i;

	if (name) {
		in = zconf_fopen(name);
	} else {
		const char **names = conf_confnames;
		while ((name = *names++)) {
			name = conf_expand_value(name);
			in = zconf_fopen(name);
			if (in) {
				printf("#\n"
				       "# using defaults found in %s\n"
				       "#\n", name);
				break;
			}
		}
	}

	if (!in)
		return 1;

	for_all_symbols(i, sym) {
		sym->flags |= SYMBOL_NEW | SYMBOL_CHANGED;
		sym->flags &= ~SYMBOL_VALID;
		switch (sym->type) {
		case S_INT:
		case S_HEX:
		case S_STRING:
			if (sym->user.val)
				free(sym->user.val);
		default:
			sym->user.val = NULL;
			sym->user.tri = no;
		}
	}

	while (fgets(line, sizeof(line), in)) {
		lineno++;
		sym = NULL;
		switch (line[0]) {
		case '#':
			if (line[1]!=' ')
				continue;
			p = strchr(line + 2, ' ');
			if (!p)
				continue;
			*p++ = 0;
			if (strncmp(p, "is not set", 10))
				continue;
			sym = sym_find(line + 2);
			if (!sym) {
				fprintf(stderr, "%s:%d: trying to assign nonexistent symbol %s\n", name, lineno, line + 2);
				break;
			}
			switch (sym->type) {
			case S_BOOLEAN:
			case S_TRISTATE:
				sym->user.tri = no;
				sym->flags &= ~SYMBOL_NEW;
				break;
			default:
				;
			}
			break;

		case 'A' ... 'Z':
			p = strchr(line, '=');
			if (!p)
				continue;
			*p++ = 0;
			p2 = strchr(p, '\n');
			if (p2)
				*p2 = 0;
			sym = sym_find(line);
			if (!sym) {
				fprintf(stderr, "%s:%d: trying to assign nonexistent symbol %s\n", name, lineno, line);
				break;
			}
			switch (sym->type) {
			case S_TRISTATE:
				if (p[0] == 'm') {
					sym->user.tri = mod;
					sym->flags &= ~SYMBOL_NEW;
					break;
				}
			case S_BOOLEAN:
				if (p[0] == 'y') {
					sym->user.tri = yes;
					sym->flags &= ~SYMBOL_NEW;
					break;
				}
				if (p[0] == 'n') {
					sym->user.tri = no;
					sym->flags &= ~SYMBOL_NEW;
					break;
				}
				break;
			case S_STRING:
				if (*p++ != '"')
					break;
				for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) {
					if (*p2 == '"') {
						*p2 = 0;
						break;
					}
					memmove(p2, p2 + 1, strlen(p2));
				}
				if (!p2) {
					fprintf(stderr, "%s:%d: invalid string found\n", name, lineno);
					exit(1);
				}
			case S_INT:
			case S_HEX:
				if (sym_string_valid(sym, p)) {
					sym->user.val = strdup(p);
					sym->flags &= ~SYMBOL_NEW;
				} else {
					fprintf(stderr, "%s:%d: symbol value '%s' invalid for %s\n", name, lineno, p, sym->name);
					exit(1);
				}
				break;
			default:
				;
			}
			break;
		case '\n':
			break;
		default:
			continue;
		}
		if (sym && sym_is_choice_value(sym)) {
			struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym));
			switch (sym->user.tri) {
			case no:
				break;
			case mod:
				if (cs->user.tri == yes)
					/* warn? */;
				break;
			case yes:
				if (cs->user.tri != no)
					/* warn? */;
				cs->user.val = sym;
				break;
			}
			cs->user.tri = E_OR(cs->user.tri, sym->user.tri);
			cs->flags &= ~SYMBOL_NEW;
		}
	}
	fclose(in);

	for_all_symbols(i, sym) {
		sym_calc_value(sym);
		if (sym_has_value(sym) && !sym_is_choice_value(sym)) {
			if (sym->visible == no)
				sym->flags |= SYMBOL_NEW;
			switch (sym->type) {
			case S_STRING:
			case S_INT:
			case S_HEX:
				if (!sym_string_within_range(sym, sym->user.val))
					sym->flags |= SYMBOL_NEW;
			default:
				break;
			}
		}
		if (!sym_is_choice(sym))
			continue;
		prop = sym_get_choice_prop(sym);
		for (e = prop->expr; e; e = e->left.expr)
			if (e->right.sym->visible != no)
				sym->flags |= e->right.sym->flags & SYMBOL_NEW;
	}

	sym_change_count = 1;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
pushq $0x1
popq %rbx
testq %rdi, %rdi
je 0x6b94
movq %rdi, %r13
callq 0x696b
movq %rax, %r14
testq %rax, %rax
jne 0x6bd8
jmp 0x6f8f
leaq 0xd675(%rip), %r15      # 0x14210
leaq 0xf24e(%rip), %r13      # 0x15df0
movq (%r15), %rdi
testq %rdi, %rdi
je 0x6f8f
addq $0x8, %r15
callq 0x6a9e
movq %r13, %rdi
callq 0x696b
testq %rax, %rax
je 0x6ba2
movq %rax, %r14
leaq 0x8cdb(%rip), %rdi      # 0xf8a9
movq %r13, %rsi
xorl %eax, %eax
callq 0x2100
xorl %ebx, %ebx
leaq 0xd93f(%rip), %r12      # 0x14520
movl $0xfffff37f, %ebp       # imm = 0xFFFFF37F
cmpq $0x101, %rbx            # imm = 0x101
je 0x6c36
leaq (%r12,%rbx,8), %r15
movq (%r15), %r15
testq %r15, %r15
je 0x6c31
movl 0x18(%r15), %eax
cmpl $0x6, %eax
je 0x6bf3
movl 0x44(%r15), %ecx
andl %ebp, %ecx
orl $0xc00, %ecx            # imm = 0xC00
movl %ecx, 0x44(%r15)
addl $-0x3, %eax
cmpl $0x2, %eax
ja 0x6c25
movq 0x30(%r15), %rdi
callq 0x2040
andq $0x0, 0x30(%r15)
andl $0x0, 0x38(%r15)
jmp 0x6bf3
incq %rbx
jmp 0x6be6
leaq 0x10(%rsp), %r15
movl $0x0, 0x4(%rsp)
movq %r13, 0x8(%rsp)
movq %r15, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdx
callq 0x2170
testq %rax, %rax
je 0x6ebc
incl 0x4(%rsp)
movzbl 0x10(%rsp), %eax
leal -0x41(%rax), %ecx
cmpl $0x1a, %ecx
jae 0x6da2
movq %r15, %rdi
pushq $0x3d
popq %rsi
callq 0x20f0
testq %rax, %rax
je 0x6c48
movq %rax, %r12
movq %r14, %rbp
movq %r15, %r14
leaq 0x1(%rax), %r15
movb $0x0, (%rax)
movq %r15, %rdi
pushq $0xa
popq %rsi
callq 0x20f0
testq %rax, %rax
je 0x6ca9
movb $0x0, (%rax)
movq %r14, %rdi
callq 0x6ff4
testq %rax, %rax
je 0x6e66
movq %rax, %rbx
movl 0x18(%rax), %eax
decl %eax
cmpl $0x4, %eax
ja 0x6d5d
leaq 0x381a(%rip), %rcx      # 0xa4ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r15, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x708a
testb %al, %al
je 0x6fcc
movq %r14, %r15
movq %r12, %rdi
callq 0x2310
movq %rax, 0x30(%rbx)
movq %rbp, %r14
andb $-0x9, 0x45(%rbx)
jmp 0x6e15
cmpb $0x22, 0x1(%r12)
jne 0x6d5d
addq $0x2, %r12
movq %r12, %r13
movq %r13, %rdi
leaq 0x8be0(%rip), %rsi      # 0xf905
callq 0x2260
testq %rax, %rax
je 0x6fa3
movq %rax, %r15
cmpb $0x22, (%rax)
je 0x6e58
movq %r15, %r13
incq %r13
movq %r15, %rdi
callq 0x20e0
movq %r15, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x2280
jmp 0x6d1b
movq %r14, %r15
movq %rbp, %r14
jmp 0x6e15
movb (%r15), %al
jmp 0x6d80
movb (%r15), %al
cmpb $0x6d, %al
jne 0x6d80
movl $0x1, 0x38(%rbx)
movq %r14, %r15
jmp 0x6d00
cmpb $0x6e, %al
movq %r14, %r15
je 0x6e4f
movzbl %al, %eax
cmpl $0x79, %eax
movq %rbp, %r14
jne 0x6e15
movl $0x2, 0x38(%rbx)
jmp 0x6d03
cmpl $0x23, %eax
jne 0x6c48
cmpb $0x20, 0x11(%rsp)
jne 0x6c48
leaq 0x12(%rsp), %rdi
pushq $0x20
popq %rsi
callq 0x20f0
testq %rax, %rax
je 0x6c48
movq %rax, %rdi
incq %rdi
movb $0x0, (%rax)
leaq 0x8aef(%rip), %rsi      # 0xf8cb
pushq $0xa
popq %rdx
callq 0x2080
testl %eax, %eax
jne 0x6c48
leaq 0x12(%rsp), %rdi
callq 0x6ff4
testq %rax, %rax
je 0x6e93
movq %rax, %rbx
movl 0x18(%rax), %eax
decl %eax
cmpl $0x1, %eax
ja 0x6e15
andl $0x0, 0x38(%rbx)
jmp 0x6d03
testb $0x20, 0x44(%rbx)
je 0x6c48
movq %rbx, %rdi
callq 0x7194
movq %rax, %rdi
callq 0x7179
movl 0x38(%rbx), %ecx
cmpl $0x2, %ecx
jne 0x6e3b
movq %rbx, 0x30(%rax)
movl 0x38(%rax), %edx
cmpl %ecx, %edx
cmoval %edx, %ecx
movl %ecx, 0x38(%rax)
andb $-0x9, 0x45(%rax)
jmp 0x6c48
andl $0x0, 0x38(%rbx)
jmp 0x6d00
movb $0x0, (%r15)
movq 0x8(%rsp), %r13
jmp 0x6cde
movq 0xd18b(%rip), %rax      # 0x13ff8
movq (%rax), %rdi
leaq 0x8a5f(%rip), %rsi      # 0xf8d6
movq %r13, %rdx
movl 0x4(%rsp), %ecx
movq %r14, %r15
movq %r14, %r8
xorl %eax, %eax
callq 0x21b0
movq %rbp, %r14
jmp 0x6c48
movq 0xd15e(%rip), %rax      # 0x13ff8
movq (%rax), %rdi
leaq 0x8a32(%rip), %rsi      # 0xf8d6
movq %r13, %rdx
movl 0x4(%rsp), %ecx
leaq 0x12(%rsp), %r8
xorl %eax, %eax
callq 0x21b0
jmp 0x6c48
movq %r14, %rdi
callq 0x20d0
xorl %r14d, %r14d
movl $0x800, %ebp            # imm = 0x800
leaq 0xd64d(%rip), %r12      # 0x14520
cmpq $0x101, %r14            # imm = 0x101
je 0x6f83
leaq (%r12,%r14,8), %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x6f7b
cmpl $0x6, 0x18(%rbx)
je 0x6ee4
movq %rbx, %rdi
callq 0x71aa
movl 0x44(%rbx), %r15d
testw $0x820, %r15w           # imm = 0x820
jne 0x6f45
cmpl $0x0, 0x40(%rbx)
jne 0x6f1b
orl $0x800, %r15d           # imm = 0x800
movl %r15d, 0x44(%rbx)
movl 0x18(%rbx), %eax
addl $-0x3, %eax
cmpl $0x2, %eax
ja 0x6f45
movq 0x30(%rbx), %rsi
movq %rbx, %rdi
callq 0x74c4
movl 0x44(%rbx), %r15d
testb %al, %al
jne 0x6f45
orl $0x800, %r15d           # imm = 0x800
movl %r15d, 0x44(%rbx)
testb $0x10, %r15b
je 0x6ee4
movq %rbx, %rdi
callq 0x7194
addq $0x30, %rax
movq (%rax), %rax
testq %rax, %rax
je 0x6ee4
movq 0x10(%rax), %rcx
cmpl $0x0, 0x40(%rcx)
je 0x6f75
movl 0x44(%rcx), %ecx
andl %ebp, %ecx
orl %ecx, %r15d
movl %r15d, 0x44(%rbx)
addq $0x8, %rax
jmp 0x6f57
incq %r14
jmp 0x6ed3
movl $0x1, 0xdd9b(%rip)      # 0x14d28
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xd04e(%rip), %rax      # 0x13ff8
movq (%rax), %rdi
leaq 0x8954(%rip), %rsi      # 0xf908
movq 0x8(%rsp), %rdx
movl 0x4(%rsp), %ecx
xorl %eax, %eax
callq 0x21b0
pushq $0x1
popq %rdi
callq 0x22f0
movq 0xd025(%rip), %rax      # 0x13ff8
movq (%rax), %rdi
movq 0x8(%rbx), %r9
leaq 0x8944(%rip), %rsi      # 0xf925
movq %r13, %rdx
movl 0x4(%rsp), %ecx
movq %r12, %r8
xorl %eax, %eax
callq 0x21b0
jmp 0x6fc4