// File: /workspace/github_cpp_makefile_star2_O1/AndreRenaud[P]simple_options/simple_options_test.c
// Function: simple_args
static void simple_args(void)
{
	const char *file = NULL;
	const char *filename = NULL;
	int64_t val = 5;
	float fval = 1.0;
	bool flag = false;
	struct option_entry entries[] = {
		{"filename", 'z', "Alternative filename", OPTION_FLAG_string, .string = &filename},
		{"file", 'f', "File to load", OPTION_FLAG_string, .string = &file},
		{"number", 'n', "Number", OPTION_FLAG_int, .integer = &val},
		{"bool", 'b', "Boolean", OPTION_FLAG_bool, .boolean = &flag},
		{"float", 'l', "Floating", OPTION_FLAG_float, .floating = &fval},
		{"missing", 'm', "Missing"},
		{NULL, 0},
	};
	const char *args[] = {"program", "--file", "fnord", "--number", "7", "--bool", "on", "--float", "0.57", "--filename", "wibble"};
	TEST_CHECK(opt_parse(11, args, entries) >= 0);
	TEST_CHECK(file && strcmp(file, "fnord") == 0);
	TEST_CHECK(filename && strcmp(filename, "wibble") == 0);
	TEST_CHECK(val == 7);
	TEST_CHECK(opt_parse_present('f', entries));
	TEST_CHECK(!opt_parse_present('m', entries));
	TEST_CHECK(opt_parse_present_long("bool", entries));
	TEST_CHECK(opt_parse_present_long("file", entries));
	TEST_CHECK(!opt_parse_present_long("unknown", entries));
	TEST_CHECK(opt_parse_present_long("float", entries));
	TEST_CHECK(fval > 0.56999 && fval < 0.57001);
	TEST_CHECK(flag == true);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
xorl %r15d, %r15d
leaq 0x18(%rsp), %rbx
movq %r15, (%rbx)
leaq 0x10(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x8(%rsp), %rsi
movq $0x5, (%rsi)
leaq 0x4(%rsp), %rax
movl $0x3f800000, (%rax)     # imm = 0x3F800000
leaq 0x3(%rsp), %rcx
movb %r15b, (%rcx)
leaq 0x2391(%rip), %r8       # 0x680f
leaq 0x80(%rsp), %rdx
movq %r8, (%rdx)
movb $0x7a, 0x8(%rdx)
leaq 0x236f(%rip), %r8       # 0x6803
movq %r8, 0x10(%rdx)
movl $0x4, %r8d
movl %r8d, 0x18(%rdx)
movq %rdi, 0x20(%rdx)
movb %r15b, 0x28(%rdx)
leaq 0x2b88(%rip), %rdi      # 0x7039
movq %rdi, 0x30(%rdx)
movb $0x66, 0x38(%rdx)
leaq 0x2358(%rip), %rdi      # 0x6818
movq %rdi, 0x40(%rdx)
movl %r8d, 0x48(%rdx)
movq %rbx, 0x50(%rdx)
movb %r15b, 0x58(%rdx)
leaq 0x238d(%rip), %rdi      # 0x6864
movq %rdi, 0x60(%rdx)
movb $0x6e, 0x68(%rdx)
leaq 0x233f(%rip), %rdi      # 0x6825
movq %rdi, 0x70(%rdx)
movl $0x2, 0x78(%rdx)
movq %rsi, 0x80(%rdx)
movb %r15b, 0x88(%rdx)
leaq 0x2367(%rip), %rsi      # 0x686d
movq %rsi, 0x90(%rdx)
movb $0x62, 0x98(%rdx)
leaq 0x2311(%rip), %rsi      # 0x682c
movq %rsi, 0xa0(%rdx)
movl $0x1, 0xa8(%rdx)
movq %rcx, 0xb0(%rdx)
movb %r15b, 0xb8(%rdx)
leaq 0x2333(%rip), %rcx      # 0x6874
movq %rcx, 0xc0(%rdx)
movb $0x6c, 0xc8(%rdx)
leaq 0x22de(%rip), %rcx      # 0x6834
movq %rcx, 0xd0(%rdx)
movl $0x8, 0xd8(%rdx)
movq %rax, 0xe0(%rdx)
movb %r15b, 0xe8(%rdx)
leaq 0x22c1(%rip), %rax      # 0x683d
movq %rax, 0xf0(%rdx)
movb $0x6d, 0xf8(%rdx)
leaq 0x22b4(%rip), %rax      # 0x6845
movq %rax, 0x100(%rdx)
movl $0x0, 0x108(%rdx)
movq %r15, 0x110(%rdx)
movb %r15b, 0x118(%rdx)
xorps %xmm0, %xmm0
movaps %xmm0, 0x140(%rdx)
movaps %xmm0, 0x130(%rdx)
movaps %xmm0, 0x120(%rdx)
leaq 0x56c1(%rip), %rsi      # 0x9c90
leaq 0x20(%rsp), %rax
movl $0xb, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl $0xb, %edi
movq %rax, %rsi
callq 0x276a
notl %eax
shrl $0x1f, %eax
leaq 0x2292(%rip), %rsi      # 0x688a
leaq 0x1a56(%rip), %rcx      # 0x6055
leaq 0x229a(%rip), %r8       # 0x68a0
movl %eax, %edi
movl $0x15, %edx
xorl %eax, %eax
callq 0x2c94
movq (%rbx), %rax
movl $0x0, %edi
testq %rax, %rax
je 0x4638
leaq 0x2234(%rip), %rsi      # 0x685c
movq %rax, %rdi
callq 0x2190
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0x224b(%rip), %rsi      # 0x688a
leaq 0x1a0f(%rip), %rcx      # 0x6055
leaq 0x2275(%rip), %r8       # 0x68c2
movl $0x16, %edx
xorl %eax, %eax
callq 0x2c94
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x4678
leaq 0x2608(%rip), %rsi      # 0x6c72
callq 0x2190
xorl %r15d, %r15d
testl %eax, %eax
sete %r15b
leaq 0x220b(%rip), %r14      # 0x688a
leaq 0x19cf(%rip), %rbx      # 0x6055
leaq 0x2258(%rip), %r8       # 0x68e5
movl %r15d, %edi
movq %r14, %rsi
movl $0x17, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c94
xorl %edi, %edi
cmpq $0x7, 0x8(%rsp)
sete %dil
leaq 0x225c(%rip), %r8       # 0x6911
movq %r14, %rsi
movl $0x18, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c94
leaq 0x80(%rsp), %r15
movl $0x66, %edi
movq %r15, %rsi
callq 0x2bae
movzbl %al, %edi
leaq 0x2234(%rip), %r8       # 0x691a
movq %r14, %rsi
movl $0x19, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c94
movl $0x6d, %edi
movq %r15, %rsi
callq 0x2bae
xorb $0x1, %al
movzbl %al, %edi
leaq 0x2229(%rip), %r8       # 0x693a
movq %r14, %rsi
movl $0x1a, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c94
leaq 0x2143(%rip), %rdi      # 0x686d
movq %r15, %rsi
callq 0x2bd2
movzbl %al, %edi
leaq 0x221f(%rip), %r8       # 0x695b
movq %r14, %rsi
movl $0x1b, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c94
leaq 0x28e4(%rip), %rdi      # 0x7039
movq %r15, %rsi
callq 0x2bd2
movzbl %al, %edi
leaq 0x221c(%rip), %r8       # 0x6983
movq %r14, %rsi
movl $0x1c, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c94
leaq 0x222b(%rip), %rdi      # 0x69ab
movq %r15, %rsi
callq 0x2bd2
xorb $0x1, %al
movzbl %al, %edi
leaq 0x221f(%rip), %r8       # 0x69b3
movq %r14, %rsi
movl $0x1d, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c94
leaq 0x20c7(%rip), %rdi      # 0x6874
movq %r15, %rsi
callq 0x2bd2
movzbl %al, %edi
leaq 0x2220(%rip), %r8       # 0x69df
movq %r14, %rsi
movl $0x1e, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c94
cvtss2sd 0x4(%rsp), %xmm0
movsd 0x18e9(%rip), %xmm1     # 0x60c8
movsd 0x18e9(%rip), %xmm2     # 0x60d0
cmpltpd %xmm0, %xmm2
cmpltpd %xmm1, %xmm0
andpd %xmm2, %xmm0
movd %xmm0, %edi
andl $0x1, %edi
leaq 0x2205(%rip), %r8       # 0x6a08
movq %r14, %rsi
movl $0x1f, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c94
movzbl 0x3(%rsp), %edi
leaq 0x2208(%rip), %r8       # 0x6a29
movq %r14, %rsi
movl $0x20, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c94
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
popq %r14
popq %r15
retq