// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
leaq 0x18(%rsp), %rbx
andq $0x0, (%rbx)
leaq 0x10(%rsp), %rdi
andq $0x0, (%rdi)
leaq 0x8(%rsp), %rsi
movq $0x5, (%rsi)
leaq 0x4(%rsp), %rcx
movl $0x3f800000, (%rcx)     # imm = 0x3F800000
xorl %ebp, %ebp
leaq 0x3(%rsp), %rax
leaq 0x2786(%rip), %r8       # 0x680c
leaq 0x80(%rsp), %rdx
movq %r8, (%rdx)
movb $0x7a, 0x8(%rdx)
leaq 0x2764(%rip), %r8       # 0x6800
movq %r8, 0x10(%rdx)
pushq $0x4
popq %r8
movl %r8d, 0x18(%rdx)
movq %rdi, 0x20(%rdx)
movb %bpl, 0x28(%rdx)
leaq 0x2f7f(%rip), %rdi      # 0x7036
movq %rdi, 0x30(%rdx)
movb $0x66, 0x38(%rdx)
leaq 0x274f(%rip), %rdi      # 0x6815
movq %rdi, 0x40(%rdx)
movl %r8d, 0x48(%rdx)
movq %rbx, 0x50(%rdx)
movb %bpl, 0x58(%rdx)
leaq 0x2784(%rip), %rdi      # 0x6861
movq %rdi, 0x60(%rdx)
movb $0x6e, 0x68(%rdx)
leaq 0x2736(%rip), %rdi      # 0x6822
movq %rdi, 0x70(%rdx)
movl $0x2, 0x78(%rdx)
movq %rsi, 0x80(%rdx)
movb %bpl, 0x88(%rdx)
leaq 0x275e(%rip), %rsi      # 0x686a
movq %rsi, 0x90(%rdx)
movb $0x62, 0x98(%rdx)
leaq 0x2708(%rip), %rsi      # 0x6829
movq %rsi, 0xa0(%rdx)
movl $0x1, 0xa8(%rdx)
movq %rax, 0xb0(%rdx)
movb %bpl, 0xb8(%rdx)
leaq 0x272a(%rip), %rsi      # 0x6871
movq %rsi, 0xc0(%rdx)
movb $0x6c, 0xc8(%rdx)
leaq 0x26d5(%rip), %rsi      # 0x6831
movq %rsi, 0xd0(%rdx)
movl $0x8, 0xd8(%rdx)
movq %rcx, 0xe0(%rdx)
movb %bpl, 0xe8(%rdx)
leaq 0x26b8(%rip), %rcx      # 0x683a
movq %rcx, 0xf0(%rdx)
movb $0x6d, 0xf8(%rdx)
leaq 0x26ab(%rip), %rcx      # 0x6842
movq %rcx, 0x100(%rdx)
andl $0x0, 0x108(%rdx)
movb %bpl, (%rax)
andq $0x0, 0x110(%rdx)
movb %bpl, 0x118(%rdx)
xorps %xmm0, %xmm0
movaps %xmm0, 0x140(%rdx)
movaps %xmm0, 0x130(%rdx)
movaps %xmm0, 0x120(%rdx)
leaq 0x5aba(%rip), %rsi      # 0x9c90
pushq $0xb
popq %rcx
leaq 0x20(%rsp), %rax
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
pushq $0xb
popq %rdi
movq %rax, %rsi
callq 0x253c
notl %eax
shrl $0x1f, %eax
leaq 0x268c(%rip), %rsi      # 0x6887
leaq 0x1e53(%rip), %rcx      # 0x6055
leaq 0x2694(%rip), %r8       # 0x689d
pushq $0x15
popq %rdx
movl %eax, %edi
xorl %eax, %eax
callq 0x29b8
movq (%rbx), %rax
movl $0x0, %edi
testq %rax, %rax
je 0x4239
leaq 0x2630(%rip), %rsi      # 0x6859
movq %rax, %rdi
callq 0x2190
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0x2647(%rip), %rsi      # 0x6887
leaq 0x1e0e(%rip), %rcx      # 0x6055
leaq 0x2671(%rip), %r8       # 0x68bf
pushq $0x16
popq %rdx
xorl %eax, %eax
callq 0x29b8
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x4276
leaq 0x2a06(%rip), %rsi      # 0x6c6f
callq 0x2190
xorl %ebp, %ebp
testl %eax, %eax
sete %bpl
leaq 0x260a(%rip), %r14      # 0x6887
leaq 0x1dd1(%rip), %rbx      # 0x6055
leaq 0x2657(%rip), %r8       # 0x68e2
pushq $0x17
popq %rdx
movl %ebp, %edi
movq %r14, %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x29b8
xorl %edi, %edi
cmpq $0x7, 0x8(%rsp)
sete %dil
leaq 0x265e(%rip), %r8       # 0x690e
pushq $0x18
popq %rdx
movq %r14, %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x29b8
pushq $0x66
popq %rdi
leaq 0x80(%rsp), %r15
movq %r15, %rsi
callq 0x28da
movzbl %al, %edi
leaq 0x263a(%rip), %r8       # 0x6917
pushq $0x19
popq %rdx
movq %r14, %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x29b8
pushq $0x6d
popq %rdi
movq %r15, %rsi
callq 0x28da
xorb $0x1, %al
movzbl %al, %edi
leaq 0x2633(%rip), %r8       # 0x6937
pushq $0x1a
popq %rdx
movq %r14, %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x29b8
leaq 0x254f(%rip), %rdi      # 0x686a
movq %r15, %rsi
callq 0x2904
movzbl %al, %edi
leaq 0x262b(%rip), %r8       # 0x6958
pushq $0x1b
popq %rdx
movq %r14, %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x29b8
leaq 0x2cf2(%rip), %rdi      # 0x7036
movq %r15, %rsi
callq 0x2904
movzbl %al, %edi
leaq 0x262a(%rip), %r8       # 0x6980
pushq $0x1c
popq %rdx
movq %r14, %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x29b8
leaq 0x263b(%rip), %rdi      # 0x69a8
movq %r15, %rsi
callq 0x2904
xorb $0x1, %al
movzbl %al, %edi
leaq 0x262f(%rip), %r8       # 0x69b0
pushq $0x1d
popq %rdx
movq %r14, %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x29b8
leaq 0x24d9(%rip), %rdi      # 0x6871
movq %r15, %rsi
callq 0x2904
movzbl %al, %edi
leaq 0x2632(%rip), %r8       # 0x69dc
pushq $0x1e
popq %rdx
movq %r14, %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x29b8
cvtss2sd 0x4(%rsp), %xmm0
movsd 0x1d00(%rip), %xmm1     # 0x60c8
movsd 0x1d00(%rip), %xmm2     # 0x60d0
cmpltpd %xmm0, %xmm2
cmpltpd %xmm1, %xmm0
andpd %xmm2, %xmm0
movd %xmm0, %edi
andl $0x1, %edi
leaq 0x2619(%rip), %r8       # 0x6a05
pushq $0x1f
popq %rdx
movq %r14, %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x29b8
movzbl 0x3(%rsp), %edi
leaq 0x261e(%rip), %r8       # 0x6a26
pushq $0x20
popq %rdx
movq %r14, %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x29b8
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq