// File: /workspace/github_c_makefile_star2_O0/DeforaOS[P]libSystem/src/config.c
// Function: config_load
int config_load(Config * config, String const * filename)
{
	int ret = 0;
	size_t line;
	FILE * fp;
	String * section = NULL;
	String * variable = NULL;
	String * value = NULL;
	int c;
	String * str;

	if((fp = fopen(filename, "r")) == NULL)
		return error_set_code(-errno, "%s: %s", filename,
				strerror(errno));
	for(line = 0; (c = fgetc(fp)) != EOF; line++)
		if(c == CONFIG_COMMENT)
			/* skip the comment */
			while((c = fgetc(fp)) != EOF && c != '\n');
		else if(c == '[')
		{
			if((str = _load_section(fp)) == NULL)
				break;
			string_delete(section);
			section = str;
		}
		else if(_load_isprint(c))
		{
			if((str = _load_variable(fp, c)) == NULL)
				break;
			string_delete(variable);
			variable = str;
			if((str = _load_value(fp)) == NULL)
				break;
			string_delete(value);
			value = str;
			if(config_set(config, section, variable, value) != 0)
				break;
		}
		else if(c != '\n')
			break;
	string_delete(section);
	string_delete(variable);
	string_delete(value);
	if(c != EOF)
		ret = error_set_code(1, "%s: %s%ld", filename, "Syntax error"
				" at line ", line);
	if(fclose(fp) != 0)
		ret = error_set_code(-errno, "%s: %s", filename,
				strerror(errno));
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x18(%rbp), %rdi
leaq 0xa5a5(%rip), %rsi      # 0x100d2
callq 0x4740
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x5b7f
callq 0x40d0
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x64(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
callq 0x40d0
movl (%rax), %edi
callq 0x4840
movl -0x64(%rbp), %edi
movq -0x60(%rbp), %rdx
movq %rax, %rcx
leaq 0xa4f1(%rip), %rsi      # 0x10061
movb $0x0, %al
callq 0x4630
movl %eax, -0x4(%rbp)
jmp 0x5d3d
movq $0x0, -0x28(%rbp)
movq -0x30(%rbp), %rdi
callq 0x4380
movl %eax, -0x4c(%rbp)
cmpl $-0x1, %eax
je 0x5ca5
cmpl $0x23, -0x4c(%rbp)
jne 0x5bd6
jmp 0x5ba4
movq -0x30(%rbp), %rdi
callq 0x4380
movl %eax, %ecx
movl %ecx, -0x4c(%rbp)
xorl %eax, %eax
cmpl $-0x1, %ecx
movb %al, -0x65(%rbp)
je 0x5bc6
cmpl $0xa, -0x4c(%rbp)
setne %al
movb %al, -0x65(%rbp)
movb -0x65(%rbp), %al
testb $0x1, %al
jne 0x5bcf
jmp 0x5bd1
jmp 0x5ba4
jmp 0x5c92
cmpl $0x5b, -0x4c(%rbp)
jne 0x5c0a
movq -0x30(%rbp), %rdi
callq 0x6140
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
jne 0x5bf4
jmp 0x5ca5
movq -0x38(%rbp), %rdi
callq 0x4260
movq -0x58(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x5c90
movl -0x4c(%rbp), %edi
callq 0x6210
cmpl $0x0, %eax
je 0x5c84
movq -0x30(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0x6240
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
jne 0x5c2f
jmp 0x5ca5
movq -0x40(%rbp), %rdi
callq 0x4260
movq -0x58(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rdi
callq 0x6310
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
jne 0x5c55
jmp 0x5ca5
movq -0x48(%rbp), %rdi
callq 0x4260
movq -0x58(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x48(%rbp), %rcx
callq 0x48c0
cmpl $0x0, %eax
je 0x5c82
jmp 0x5ca5
jmp 0x5c8e
cmpl $0xa, -0x4c(%rbp)
je 0x5c8c
jmp 0x5ca5
jmp 0x5c8e
jmp 0x5c90
jmp 0x5c92
jmp 0x5c94
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x5b87
movq -0x38(%rbp), %rdi
callq 0x4260
movq -0x40(%rbp), %rdi
callq 0x4260
movq -0x48(%rbp), %rdi
callq 0x4260
cmpl $-0x1, -0x4c(%rbp)
je 0x5ceb
movq -0x18(%rbp), %rdx
movq -0x28(%rbp), %r8
movl $0x1, %edi
leaq 0xa38e(%rip), %rsi      # 0x10068
leaq 0xa391(%rip), %rcx      # 0x10072
movb $0x0, %al
callq 0x4630
movl %eax, -0x1c(%rbp)
movq -0x30(%rbp), %rdi
callq 0x4240
cmpl $0x0, %eax
je 0x5d37
callq 0x40d0
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x74(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x70(%rbp)
callq 0x40d0
movl (%rax), %edi
callq 0x4840
movl -0x74(%rbp), %edi
movq -0x70(%rbp), %rdx
movq %rax, %rcx
leaq 0xa334(%rip), %rsi      # 0x10061
movb $0x0, %al
callq 0x4630
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)