// File: /workspace/github_c_makefile_star2_O2/DeforaOS[P]libSystem/tests/config.c
// Function: test2
static int _test2(char const * progname, size_t size, ...)
{
	int ret = 0;
	va_list ap;
	char tmpname[] = P_tmpdir "/config-test2-XXXXXX";
	int fd;
	Config * config;
	String const * section;
	String const * variable;
	String const * value;
	struct stat st;

	/* config_save */
	printf("%s: Testing config_save()\n", progname);
	fflush(stdout);
	if((fd = mkstemp(tmpname)) < 0)
		return -error_set_print(progname, -errno, "%s: %s", "mktemp",
				strerror(errno));
	if((config = config_new()) == NULL)
	{
		unlink(tmpname);
		close(fd);
		return -error_print(progname);
	}
	va_start(ap, size);
	while(ret == 0 && (section = va_arg(ap, String const *)) != NULL)
	{
		variable = va_arg(ap, String const *);
		value = va_arg(ap, String const *);
		ret = config_set(config, section, variable, value);
	}
	va_end(ap);
	if(ret == 0)
		ret = config_save(config, tmpname);
	if(ret != 0)
		error_print(progname);
	config_delete(config);
	if(stat(tmpname, &st) != 0)
		ret = -error_set_print(progname, -errno, "%s: %s", tmpname,
				strerror(errno));
	else if(st.st_size < 0 || (size_t)st.st_size != size)
		ret = -error_set_print(progname, 2, "%s: %lu: Size mismatch"
				" (expected: %lu)", tmpname, st.st_size, size);
	if(unlink(tmpname) != 0)
		ret = -error_set_print(progname, -errno, "%s: %s", tmpname,
				strerror(errno));
	close(fd);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x180, %rsp            # imm = 0x180
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, 0x50(%rsp)
movq %rcx, 0x58(%rsp)
movq %r8, 0x60(%rsp)
movq %r9, 0x68(%rsp)
testb %al, %al
je 0x17d8
movaps %xmm0, 0x70(%rsp)
movaps %xmm1, 0x80(%rsp)
movaps %xmm2, 0x90(%rsp)
movaps %xmm3, 0xa0(%rsp)
movaps %xmm4, 0xb0(%rsp)
movaps %xmm5, 0xc0(%rsp)
movaps %xmm6, 0xd0(%rsp)
movaps %xmm7, 0xe0(%rsp)
movups 0x9aa(%rip), %xmm0      # 0x2189
leaq 0x20(%rsp), %r15
movups %xmm0, 0x9(%r15)
movaps 0x990(%rip), %xmm0      # 0x2180
movaps %xmm0, (%r15)
leaq 0x92c(%rip), %rdi       # 0x2127
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1080
movq 0x27d4(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
callq 0x10e0
movq %r15, %rdi
callq 0x1100
testl %eax, %eax
js 0x18f7
movl %eax, %ebp
callq 0x1120
testq %rax, %rax
je 0x1926
movq %rax, %r15
leaq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x1b0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
xorl %r12d, %r12d
testl %r12d, %r12d
jne 0x1962
movl (%rsp), %eax
cmpq $0x28, %rax
ja 0x1881
movq %rax, %rcx
addq 0x10(%rsp), %rcx
addl $0x8, %eax
movl %eax, (%rsp)
jmp 0x188f
movq 0x8(%rsp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq (%rcx), %rsi
testq %rsi, %rsi
je 0x194a
cmpl $0x29, %eax
jae 0x18c5
movq 0x10(%rsp), %rdx
movl %eax, %edi
leal 0x8(%rax), %ecx
movl %ecx, (%rsp)
movq (%rdx,%rdi), %rdx
cmpl $0x20, %eax
ja 0x18d6
movl %ecx, %ecx
addq 0x10(%rsp), %rcx
addl $0x10, %eax
movl %eax, (%rsp)
jmp 0x18e4
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rdx
movq 0x8(%rsp), %rcx
leaq 0x8(%rcx), %rax
movq %rax, 0x8(%rsp)
movq (%rcx), %rcx
movq %r15, %rdi
callq 0x1140
movl %eax, %r12d
jmp 0x185f
callq 0x1030
movl (%rax), %edi
movl %edi, %ebp
negl %ebp
callq 0x1130
leaq 0x834(%rip), %rdx       # 0x2142
leaq 0x834(%rip), %rcx       # 0x2149
movq %rbx, %rdi
movl %ebp, %esi
movq %rax, %r8
xorl %eax, %eax
callq 0x1050
jmp 0x193f
leaq 0x20(%rsp), %rdi
callq 0x1040
movl %ebp, %edi
callq 0x10a0
movq %rbx, %rdi
callq 0x1110
movl %eax, %r12d
negl %r12d
jmp 0x1a3b
leaq 0x20(%rsp), %rsi
movq %r15, %rdi
callq 0x10f0
movl %eax, %r12d
testl %eax, %eax
je 0x1a4e
movq %rbx, %rdi
callq 0x1110
movq %r15, %rdi
callq 0x10b0
leaq 0x20(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x10d0
testl %eax, %eax
je 0x19b8
callq 0x1030
movl (%rax), %edi
movl %edi, %r14d
negl %r14d
callq 0x1130
leaq 0x7a1(%rip), %rdx       # 0x2142
leaq 0x20(%rsp), %rcx
movq %rbx, %rdi
movl %r14d, %esi
movq %rax, %r8
xorl %eax, %eax
callq 0x1050
jmp 0x19ec
movq 0x120(%rsp), %r8
testq %r8, %r8
setns %al
cmpq %r14, %r8
sete %cl
testb %cl, %al
jne 0x19f2
leaq 0x779(%rip), %rdx       # 0x2150
pushq $0x2
popq %rsi
leaq 0x20(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %r9
xorl %eax, %eax
callq 0x1050
movl %eax, %r12d
negl %r12d
leaq 0x20(%rsp), %rdi
callq 0x1040
testl %eax, %eax
je 0x1a34
callq 0x1030
movl (%rax), %edi
movl %edi, %r14d
negl %r14d
callq 0x1130
leaq 0x729(%rip), %rdx       # 0x2142
leaq 0x20(%rsp), %rcx
movq %rbx, %rdi
movl %r14d, %esi
movq %rax, %r8
xorl %eax, %eax
callq 0x1050
movl %eax, %r12d
negl %r12d
movl %ebp, %edi
callq 0x10a0
movl %r12d, %eax
addq $0x180, %rsp            # imm = 0x180
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %r12d, %r12d
jmp 0x196a