// File: /workspace/github_c_makefile_star2_O1/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
testq %rdi, %rdi
je 0x7c1e
movq %rdi, %r12
callq 0x799f
jmp 0x7c68
leaq 0xe5db(%rip), %r14      # 0x16200
leaq 0x101b4(%rip), %r12     # 0x17de0
movq (%r14), %rdi
testq %rdi, %rdi
je 0x7c63
addq $0x8, %r14
callq 0x7adb
movq %r12, %rdi
callq 0x799f
testq %rax, %rax
je 0x7c2c
movq %rax, %rbx
leaq 0x9c41(%rip), %rdi      # 0x11895
movq %r12, %rsi
xorl %eax, %eax
callq 0x2100
movq %rbx, %rax
jmp 0x7c68
xorl %r12d, %r12d
xorl %eax, %eax
testq %rax, %rax
je 0x8038
movq %rax, 0x8(%rsp)
xorl %ebx, %ebx
leaq 0xe891(%rip), %r15      # 0x16510
movl $0xfffff37f, %ebp       # imm = 0xFFFFF37F
movq (%r15,%rbx,8), %r14
testq %r14, %r14
je 0x7cd1
movl 0x18(%r14), %eax
cmpl $0x6, %eax
je 0x7ccc
movl 0x44(%r14), %ecx
andl %ebp, %ecx
orl $0xc00, %ecx            # imm = 0xC00
movl %ecx, 0x44(%r14)
addl $-0x3, %eax
cmpl $0x2, %eax
ja 0x7cbc
movq 0x30(%r14), %rdi
testq %rdi, %rdi
je 0x7cbc
callq 0x2040
movq $0x0, 0x30(%r14)
movl $0x0, 0x38(%r14)
movq (%r14), %r14
jmp 0x7c88
incq %rbx
cmpq $0x101, %rbx            # imm = 0x101
jne 0x7c84
movq %r12, (%rsp)
leaq 0x10(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
movq 0x8(%rsp), %r14
movq %r14, %rdx
callq 0x2170
testq %rax, %rax
je 0x7f7c
leaq 0x10(%rsp), %r12
xorl %ebp, %ebp
incl %ebp
movzbl 0x10(%rsp), %eax
leal -0x41(%rax), %ecx
cmpl $0x1a, %ecx
jae 0x7e13
movq %r12, %rdi
movl $0x3d, %esi
callq 0x20f0
testq %rax, %rax
je 0x7df5
movq %rax, %rbx
leaq 0x1(%rax), %r15
movb $0x0, (%rax)
movq %r15, %rdi
movl $0xa, %esi
callq 0x20f0
testq %rax, %rax
je 0x7d50
movb $0x0, (%rax)
movq %r12, %rdi
callq 0x8089
testq %rax, %rax
je 0x7f35
movq %rax, %r13
movl 0x18(%rax), %eax
decl %eax
cmpl $0x4, %eax
ja 0x7da5
leaq 0x4797(%rip), %rcx      # 0xc50c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r15, %rbx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x8123
testb %al, %al
je 0x805a
movq %rbx, %rdi
callq 0x22f0
movq %rax, 0x30(%r13)
andb $-0x9, 0x45(%r13)
testq %r13, %r13
je 0x7df5
testb $0x20, 0x44(%r13)
je 0x7df5
leaq 0x48(%r13), %rax
movq (%rax), %rax
cmpl $0x5, 0x10(%rax)
jne 0x7db5
movq 0x30(%rax), %rax
testq %rax, %rax
je 0x7dd7
movl (%rax), %ecx
andl $-0x2, %ecx
cmpl $0x6, %ecx
jne 0x7dd7
movq 0x8(%rax), %rax
jmp 0x7dd9
xorl %eax, %eax
movl 0x38(%r13), %ecx
cmpl $0x2, %ecx
jne 0x7de6
movq %r13, 0x30(%rax)
movl 0x38(%rax), %edx
cmpl %ecx, %edx
cmoval %edx, %ecx
movl %ecx, 0x38(%rax)
andb $-0x9, 0x45(%rax)
movq %r12, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdx
callq 0x2170
testq %rax, %rax
jne 0x7d08
jmp 0x7f7c
cmpl $0xa, %eax
je 0x7f56
cmpl $0x23, %eax
jne 0x7df5
cmpb $0x20, 0x11(%rsp)
jne 0x7df5
leaq 0x12(%rsp), %rdi
movl $0x20, %esi
callq 0x20f0
testq %rax, %rax
je 0x7df5
movq %rax, %rdi
incq %rdi
movb $0x0, (%rax)
movl $0xa, %edx
leaq 0x9a66(%rip), %rsi      # 0x118b7
callq 0x2080
testl %eax, %eax
jne 0x7df5
leaq 0x12(%rsp), %rdi
callq 0x8089
testq %rax, %rax
je 0x7f5e
movq %rax, %r13
movl 0x18(%rax), %eax
decl %eax
cmpl $0x1, %eax
ja 0x7da5
jmp 0x7f1a
cmpb $0x22, 0x1(%rbx)
jne 0x7da5
addq $0x2, %rbx
movq %rbx, %rdi
leaq 0x9a56(%rip), %rsi      # 0x118f1
callq 0x2240
testq %rax, %rax
je 0x804f
movq %rax, %r15
cmpb $0x22, (%r15)
je 0x7f27
leaq 0x1(%r15), %r14
movq %r15, %rdi
callq 0x20e0
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2260
movq %r14, %rdi
leaq 0x9a1b(%rip), %rsi      # 0x118f1
callq 0x2240
movq %rax, %r15
testq %rax, %rax
jne 0x7eac
jmp 0x804f
cmpb $0x6d, (%r15)
jne 0x7efb
movl $0x1, 0x38(%r13)
jmp 0x7da0
movzbl (%r15), %eax
cmpl $0x6e, %eax
je 0x7f1a
cmpl $0x79, %eax
jne 0x7da5
movl $0x2, 0x38(%r13)
jmp 0x7da0
movl $0x0, 0x38(%r13)
jmp 0x7da0
movb $0x0, (%r15)
movq 0x8(%rsp), %r14
jmp 0x7d81
movq 0xe0bc(%rip), %rax      # 0x15ff8
movq (%rax), %rdi
leaq 0x997c(%rip), %rsi      # 0x118c2
movq (%rsp), %rdx
movl %ebp, %ecx
movq %r12, %r8
xorl %eax, %eax
callq 0x21a0
xorl %r13d, %r13d
jmp 0x7da5
movq 0xe093(%rip), %rax      # 0x15ff8
movq (%rax), %rdi
leaq 0x9953(%rip), %rsi      # 0x118c2
movq (%rsp), %rdx
movl %ebp, %ecx
leaq 0x12(%rsp), %r8
jmp 0x7f4f
movq %r14, %rdi
callq 0x20d0
xorl %r14d, %r14d
movl $0x800, %ebp            # imm = 0x800
leaq 0xe57d(%rip), %r15      # 0x16510
movq (%r15,%r14,8), %rbx
testq %rbx, %rbx
je 0x801a
cmpl $0x6, 0x18(%rbx)
je 0x7fe7
movq %rbx, %rdi
callq 0x8244
movl 0x44(%rbx), %eax
testl $0x820, %eax            # imm = 0x820
jne 0x7fe1
cmpl $0x0, 0x40(%rbx)
jne 0x7fc2
orl $0x800, %eax            # imm = 0x800
movl %eax, 0x44(%rbx)
movl 0x18(%rbx), %eax
addl $-0x3, %eax
cmpl $0x2, %eax
ja 0x7fe1
movq 0x30(%rbx), %rsi
movq %rbx, %rdi
callq 0x85b8
testb %al, %al
jne 0x7fe1
orb $0x8, 0x45(%rbx)
testb $0x10, 0x44(%rbx)
jne 0x7fec
movq (%rbx), %rbx
jmp 0x7f97
leaq 0x48(%rbx), %rax
movq (%rax), %rax
cmpl $0x5, 0x10(%rax)
jne 0x7ff0
movq 0x30(%rax), %rax
testq %rax, %rax
je 0x7fe7
movq 0x10(%rax), %rcx
cmpl $0x0, 0x40(%rcx)
je 0x8014
movl 0x44(%rcx), %ecx
andl %ebp, %ecx
orl %ecx, 0x44(%rbx)
movq 0x8(%rax), %rax
jmp 0x7ffd
incq %r14
cmpq $0x101, %r14            # imm = 0x101
jne 0x7f93
movl $0x1, 0xece4(%rip)      # 0x16d18
xorl %eax, %eax
jmp 0x803d
movl $0x1, %eax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rdi
movl %ebp, %esi
callq 0x2825
movq 0xdf97(%rip), %rax      # 0x15ff8
movq (%rax), %rdi
movq 0x8(%r13), %r9
leaq 0x98a2(%rip), %rsi      # 0x11911
movq (%rsp), %rdx
movl %ebp, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0x21a0
movl $0x1, %edi
callq 0x22d0