// File: /workspace/github_cpp_makefile_star2_O3/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 0x24fe(%rip), %r8       # 0x680c
leaq 0x80(%rsp), %rdx
movq %r8, (%rdx)
movb $0x7a, 0x8(%rdx)
leaq 0x24dc(%rip), %r8       # 0x6800
movq %r8, 0x10(%rdx)
movl $0x4, %r8d
movl %r8d, 0x18(%rdx)
movq %rdi, 0x20(%rdx)
movb %r15b, 0x28(%rdx)
leaq 0x2cf5(%rip), %rdi      # 0x7036
movq %rdi, 0x30(%rdx)
movb $0x66, 0x38(%rdx)
leaq 0x24c5(%rip), %rdi      # 0x6815
movq %rdi, 0x40(%rdx)
movl %r8d, 0x48(%rdx)
movq %rbx, 0x50(%rdx)
movb %r15b, 0x58(%rdx)
leaq 0x24fa(%rip), %rdi      # 0x6861
movq %rdi, 0x60(%rdx)
movb $0x6e, 0x68(%rdx)
leaq 0x24ac(%rip), %rdi      # 0x6822
movq %rdi, 0x70(%rdx)
movl $0x2, 0x78(%rdx)
movq %rsi, 0x80(%rdx)
movb %r15b, 0x88(%rdx)
leaq 0x24d4(%rip), %rsi      # 0x686a
movq %rsi, 0x90(%rdx)
movb $0x62, 0x98(%rdx)
leaq 0x247e(%rip), %rsi      # 0x6829
movq %rsi, 0xa0(%rdx)
movl $0x1, 0xa8(%rdx)
movq %rcx, 0xb0(%rdx)
movb %r15b, 0xb8(%rdx)
leaq 0x24a0(%rip), %rcx      # 0x6871
movq %rcx, 0xc0(%rdx)
movb $0x6c, 0xc8(%rdx)
leaq 0x244b(%rip), %rcx      # 0x6831
movq %rcx, 0xd0(%rdx)
movl $0x8, 0xd8(%rdx)
movq %rax, 0xe0(%rdx)
movb %r15b, 0xe8(%rdx)
leaq 0x242e(%rip), %rax      # 0x683a
movq %rax, 0xf0(%rdx)
movb $0x6d, 0xf8(%rdx)
leaq 0x2421(%rip), %rax      # 0x6842
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 0x5831(%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 0x276e
notl %eax
shrl $0x1f, %eax
leaq 0x23ff(%rip), %rsi      # 0x6887
leaq 0x1bc6(%rip), %rcx      # 0x6055
leaq 0x2407(%rip), %r8       # 0x689d
movl %eax, %edi
movl $0x15, %edx
xorl %eax, %eax
callq 0x2c34
movq (%rbx), %rax
movl $0x0, %edi
testq %rax, %rax
je 0x44c8
leaq 0x23a1(%rip), %rsi      # 0x6859
movq %rax, %rdi
callq 0x2190
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0x23b8(%rip), %rsi      # 0x6887
leaq 0x1b7f(%rip), %rcx      # 0x6055
leaq 0x23e2(%rip), %r8       # 0x68bf
movl $0x16, %edx
xorl %eax, %eax
callq 0x2c34
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x4508
leaq 0x2775(%rip), %rsi      # 0x6c6f
callq 0x2190
xorl %r15d, %r15d
testl %eax, %eax
sete %r15b
leaq 0x2378(%rip), %r14      # 0x6887
leaq 0x1b3f(%rip), %rbx      # 0x6055
leaq 0x23c5(%rip), %r8       # 0x68e2
movl %r15d, %edi
movq %r14, %rsi
movl $0x17, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c34
xorl %edi, %edi
cmpq $0x7, 0x8(%rsp)
sete %dil
leaq 0x23c9(%rip), %r8       # 0x690e
movq %r14, %rsi
movl $0x18, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c34
leaq 0x80(%rsp), %r15
movl $0x66, %edi
movq %r15, %rsi
callq 0x2b28
movzbl %al, %edi
leaq 0x23a1(%rip), %r8       # 0x6917
movq %r14, %rsi
movl $0x19, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c34
movl $0x6d, %edi
movq %r15, %rsi
callq 0x2b28
xorb $0x1, %al
movzbl %al, %edi
leaq 0x2396(%rip), %r8       # 0x6937
movq %r14, %rsi
movl $0x1a, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c34
leaq 0x22b0(%rip), %rdi      # 0x686a
movq %r15, %rsi
callq 0x2b6a
movzbl %al, %edi
leaq 0x238c(%rip), %r8       # 0x6958
movq %r14, %rsi
movl $0x1b, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c34
leaq 0x2a51(%rip), %rdi      # 0x7036
movq %r15, %rsi
callq 0x2b6a
movzbl %al, %edi
leaq 0x2389(%rip), %r8       # 0x6980
movq %r14, %rsi
movl $0x1c, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c34
leaq 0x2398(%rip), %rdi      # 0x69a8
movq %r15, %rsi
callq 0x2b6a
xorb $0x1, %al
movzbl %al, %edi
leaq 0x238c(%rip), %r8       # 0x69b0
movq %r14, %rsi
movl $0x1d, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c34
leaq 0x2234(%rip), %rdi      # 0x6871
movq %r15, %rsi
callq 0x2b6a
movzbl %al, %edi
leaq 0x238d(%rip), %r8       # 0x69dc
movq %r14, %rsi
movl $0x1e, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c34
cvtss2sd 0x4(%rsp), %xmm0
movsd 0x1a59(%rip), %xmm1     # 0x60c8
movsd 0x1a59(%rip), %xmm2     # 0x60d0
cmpltpd %xmm0, %xmm2
cmpltpd %xmm1, %xmm0
andpd %xmm2, %xmm0
movd %xmm0, %edi
andl $0x1, %edi
leaq 0x2372(%rip), %r8       # 0x6a05
movq %r14, %rsi
movl $0x1f, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c34
movzbl 0x3(%rsp), %edi
leaq 0x2375(%rip), %r8       # 0x6a26
movq %r14, %rsi
movl $0x20, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c34
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
popq %r14
popq %r15
retq