// File: AndreRenaud[P]simple_options/simple_options_test.c
// Function: combined
static void combined(void)
{
	const char *file = NULL;
	int64_t val = 5;
	bool flag = false;
	struct option_entry entries[] = {
		{"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},
		{NULL, 0},
	};
	char input[] = {"program -f fnord --number=4 --bool=on -n7"};
	const char *argv[10];
	int argc;
	argc = opt_parse_split_string(input, argv, 10);
	TEST_CHECK(argc == 6);
	TEST_CHECK(opt_parse(argc, argv, entries) >= 0);
	TEST_CHECK(file && strcmp(file, "fnord") == 0);
	TEST_CHECK(val == 7);
	TEST_CHECK(entries[0].present);
	TEST_CHECK(flag == true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq $0x0, -0x8(%rbp)
movq $0x5, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
leaq 0x25d5(%rip), %rax      # 0x7e5b
movq %rax, -0xe0(%rbp)
movb $0x66, -0xd8(%rbp)
leaq 0x2581(%rip), %rax      # 0x7e1c
movq %rax, -0xd0(%rbp)
movl $0x4, -0xc8(%rbp)
leaq -0x8(%rbp), %rax
movq %rax, -0xc0(%rbp)
movb $0x0, -0xb8(%rbp)
leaq 0x25a3(%rip), %rax      # 0x7e68
movq %rax, -0xb0(%rbp)
movb $0x6e, -0xa8(%rbp)
leaq 0x254f(%rip), %rax      # 0x7e29
movq %rax, -0xa0(%rbp)
movl $0x2, -0x98(%rbp)
leaq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
movb $0x0, -0x88(%rbp)
leaq 0x256d(%rip), %rax      # 0x7e71
movq %rax, -0x80(%rbp)
movb $0x62, -0x78(%rbp)
leaq 0x251d(%rip), %rax      # 0x7e30
movq %rax, -0x70(%rbp)
movl $0x1, -0x68(%rbp)
leaq -0x11(%rbp), %rax
movq %rax, -0x60(%rbp)
movb $0x0, -0x58(%rbp)
leaq -0xe0(%rbp), %rdi
addq $0x90, %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x2120
leaq -0x110(%rbp), %rdi
leaq 0x29ce(%rip), %rsi      # 0x8320
movl $0x2a, %edx
callq 0x21a0
leaq -0x110(%rbp), %rdi
leaq -0x160(%rbp), %rsi
movl $0xa, %edx
callq 0x2f00
movl %eax, -0x164(%rbp)
cmpl $0x6, -0x164(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x24fe(%rip), %rsi      # 0x7e8e
movl $0x57, %edx
leaq 0x16b5(%rip), %rcx      # 0x7051
leaq 0x2799(%rip), %r8       # 0x813c
movb $0x0, %al
callq 0x3080
movl -0x164(%rbp), %edi
leaq -0x160(%rbp), %rsi
leaq -0xe0(%rbp), %rdx
callq 0x2660
cmpl $0x0, %eax
setge %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x24b9(%rip), %rsi      # 0x7e8e
movl $0x58, %edx
leaq 0x1670(%rip), %rcx      # 0x7051
leaq 0x275e(%rip), %r8       # 0x8146
movb $0x0, %al
callq 0x3080
xorl %eax, %eax
cmpq $0x0, -0x8(%rbp)
movb %al, -0x165(%rbp)
je 0x5a1a
movq -0x8(%rbp), %rdi
leaq 0x2457(%rip), %rsi      # 0x7e60
callq 0x2170
cmpl $0x0, %eax
sete %al
movb %al, -0x165(%rbp)
movb -0x165(%rbp), %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x2462(%rip), %rsi      # 0x7e8e
movl $0x59, %edx
leaq 0x1619(%rip), %rcx      # 0x7051
leaq 0x2487(%rip), %r8       # 0x7ec6
movb $0x0, %al
callq 0x3080
cmpq $0x7, -0x10(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x2434(%rip), %rsi      # 0x7e8e
movl $0x5a, %edx
leaq 0x15eb(%rip), %rcx      # 0x7051
leaq 0x24a8(%rip), %r8       # 0x7f15
movb $0x0, %al
callq 0x3080
movb -0xb8(%rbp), %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x2408(%rip), %rsi      # 0x7e8e
movl $0x5b, %edx
leaq 0x15bf(%rip), %rcx      # 0x7051
leaq 0x26d1(%rip), %r8       # 0x816a
movb $0x0, %al
callq 0x3080
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
sete %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x23d4(%rip), %rsi      # 0x7e8e
movl $0x5c, %edx
leaq 0x158b(%rip), %rcx      # 0x7051
leaq 0x2560(%rip), %r8       # 0x802d
movb $0x0, %al
callq 0x3080
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopl (%rax)