// File: /workspace/github_c_makefile_star2_O0/DeforaOS[P]libSystem/tests/config.c
// Function: test
static int _test(char const * progname, String const * filename,
		String const * variable, String const * expected)
{
	int ret = 0;
	Config * config;
	String const * value;

	if((config = config_new()) == NULL)
		return -error_print(progname);
	/* config_load */
	printf("%s: Testing %s \"%s\"\n", progname, "config_load()", filename);
	fflush(stdout);
	if(config_load(config, filename) != 0)
	{
		config_delete(config);
		return -error_print(progname);
	}
	/* config_get */
	printf("%s: Testing %s\n", progname, "config_get()");
	fflush(stdout);
	if(config_get(config, NULL, "nonexistent") != NULL)
		ret = -error_set_print(progname, 1, "%s",
				"Unknown variable returned");
	if((value = config_get(config, NULL, variable)) == NULL)
		ret = -error_print(progname);
	else if(string_compare(expected, value) != 0)
		ret = -error_set_print(progname, 1, "%s: %s (\"%s\")", expected,
				"Invalid variable returned", value);
	/* config_set */
	printf("%s: Testing %s\n", progname, "config_set()");
	/* config_set: remove the variable */
	if(config_set(config, NULL, variable, NULL) != 0)
		ret = -error_print(progname);
	if((value = config_get(config, NULL, variable)) != NULL)
		ret = -error_set_print(progname, 1, "%s: %s (\"%s\")", "NULL",
				"Invalid variable returned", value);
	/* config_set: restore the variable */
	if(config_set(config, NULL, variable, expected) != 0)
		ret = -error_print(progname);
	if((value = config_get(config, NULL, variable)) == NULL)
		ret = -error_print(progname);
	else if(string_compare(expected, value) != 0)
		ret = -error_set_print(progname, 1, "%s: %s (\"%s\")", expected,
				"Invalid variable returned", value);
	/* config_set: empty the variable */
	if(config_set(config, NULL, variable, "") != 0)
		ret = -error_print(progname);
	if((value = config_get(config, NULL, variable)) == NULL
			|| string_get_length(value) != 0)
		ret = -error_set_print(progname, 1, "%s (\"%s\")",
				"Invalid variable returned", value);
	/* config_set: restore the variable */
	if(config_set(config, NULL, variable, expected) != 0)
		ret = -error_print(progname);
	if((value = config_get(config, NULL, variable)) == NULL)
		ret = -error_print(progname);
	else if(string_compare(expected, value) != 0)
		ret = -error_set_print(progname, 1, "%s: %s (\"%s\")", expected,
				"Invalid variable returned", value);
	config_delete(config);
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
callq 0x1120
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x1545
movq -0x10(%rbp), %rdi
callq 0x1110
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x18de
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rcx
leaq 0xb33(%rip), %rdi       # 0x2087
leaq 0xb41(%rip), %rdx       # 0x209c
movb $0x0, %al
callq 0x1080
movq 0x2a77(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
callq 0x10e0
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1060
cmpl $0x0, %eax
je 0x15a3
movq -0x38(%rbp), %rdi
callq 0x10b0
movq -0x10(%rbp), %rdi
callq 0x1110
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x18de
movq -0x10(%rbp), %rsi
leaq 0xafc(%rip), %rdi       # 0x20aa
leaq 0xb05(%rip), %rdx       # 0x20ba
movb $0x0, %al
callq 0x1080
movq 0x2a1d(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
callq 0x10e0
movq -0x38(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xaed(%rip), %rdx       # 0x20c7
callq 0x10c0
cmpq $0x0, %rax
je 0x160c
movq -0x10(%rbp), %rdi
movl $0x1, %esi
leaq 0xb51(%rip), %rdx       # 0x2146
leaq 0xad7(%rip), %rcx       # 0x20d3
movb $0x0, %al
callq 0x1050
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x10c0
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0x163b
movq -0x10(%rbp), %rdi
callq 0x1110
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
jmp 0x167e
movq -0x28(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x1070
cmpl $0x0, %eax
je 0x167c
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rcx
movq -0x40(%rbp), %r9
movl $0x1, %esi
leaq 0xa88(%rip), %rdx       # 0x20ed
leaq 0xa8f(%rip), %r8        # 0x20fb
movb $0x0, %al
callq 0x1050
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
jmp 0x167e
movq -0x10(%rbp), %rsi
leaq 0xa21(%rip), %rdi       # 0x20aa
leaq 0xa85(%rip), %rdx       # 0x2115
movb $0x0, %al
callq 0x1080
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rsi
callq 0x1140
cmpl $0x0, %eax
je 0x16c2
movq -0x10(%rbp), %rdi
callq 0x1110
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x10c0
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
je 0x170f
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %r9
movl $0x1, %esi
leaq 0x9fc(%rip), %rdx       # 0x20ed
leaq 0xa2a(%rip), %rcx       # 0x2122
leaq 0x9fc(%rip), %r8        # 0x20fb
movb $0x0, %al
callq 0x1050
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
callq 0x1140
cmpl $0x0, %eax
je 0x173b
movq -0x10(%rbp), %rdi
callq 0x1110
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x10c0
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0x176a
movq -0x10(%rbp), %rdi
callq 0x1110
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
jmp 0x17ad
movq -0x28(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x1070
cmpl $0x0, %eax
je 0x17ab
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rcx
movq -0x40(%rbp), %r9
movl $0x1, %esi
leaq 0x959(%rip), %rdx       # 0x20ed
leaq 0x960(%rip), %r8        # 0x20fb
movb $0x0, %al
callq 0x1050
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
jmp 0x17ad
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
leaq 0x8db(%rip), %rcx       # 0x209b
callq 0x1140
cmpl $0x0, %eax
je 0x17dc
movq -0x10(%rbp), %rdi
callq 0x1110
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x10c0
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
je 0x1806
movq -0x40(%rbp), %rdi
callq 0x1090
cmpq $0x0, %rax
je 0x1831
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %r8
movl $0x1, %esi
leaq 0x8d7(%rip), %rdx       # 0x20f1
leaq 0x8da(%rip), %rcx       # 0x20fb
movb $0x0, %al
callq 0x1050
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
callq 0x1140
cmpl $0x0, %eax
je 0x185d
movq -0x10(%rbp), %rdi
callq 0x1110
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x10c0
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0x188c
movq -0x10(%rbp), %rdi
callq 0x1110
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
jmp 0x18cf
movq -0x28(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x1070
cmpl $0x0, %eax
je 0x18cd
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rcx
movq -0x40(%rbp), %r9
movl $0x1, %esi
leaq 0x837(%rip), %rdx       # 0x20ed
leaq 0x83e(%rip), %r8        # 0x20fb
movb $0x0, %al
callq 0x1050
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
jmp 0x18cf
movq -0x38(%rbp), %rdi
callq 0x10b0
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)