// File: /workspace/github_cpp_makefile_star2_O1/AndreRenaud[P]simple_options/simple_options_test.c
// Function: extra_params
static void extra_params(void)
{
	int extra;
	const char *foo = NULL;
	struct option_entry entries[] = {
		{"foo", 'f', NULL, OPTION_FLAG_string, .string = &foo},
		{NULL},
	};

	const char *args[] = {"prorgram", "extra"};
	extra = opt_parse(2, args, entries);
	TEST_CHECK(extra == 1);
	TEST_CHECK(strcmp(args[extra], "extra") == 0);

	const char *args2[] = {"program", "extra", "-f", "foo"};
	extra = opt_parse(4, args2, entries);
	TEST_CHECK(extra == 3);
	TEST_CHECK(strcmp(args2[extra], "extra") == 0);

	const char *args3[] = {"program", "extra1", "extra2", "extra3", "-f", "foo", "extra4"};
	extra = opt_parse(7, args3, entries);
	TEST_CHECK(extra == 3);
	TEST_CHECK(strcmp(args3[extra], "extra1") == 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
leaq 0x18(%rsp), %rax
movq $0x0, (%rax)
xorps %xmm0, %xmm0
leaq 0x80(%rsp), %r15
movaps %xmm0, (%r15)
movaps %xmm0, 0x10(%r15)
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x50(%r15)
movaps %xmm0, 0x40(%r15)
movaps %xmm0, 0x30(%r15)
leaq 0x1d42(%rip), %rcx      # 0x6b79
movq %rcx, (%r15)
movb $0x66, 0x8(%r15)
movl $0x4, 0x18(%r15)
movq %rax, 0x20(%r15)
movaps 0x4f0e(%rip), %xmm0     # 0x9d60
movq %rsp, %rsi
movaps %xmm0, (%rsi)
movl $0x2, %edi
movq %r15, %rdx
callq 0x276a
movl %eax, %ebp
xorl %edi, %edi
cmpl $0x1, %eax
sete %dil
leaq 0x1a13(%rip), %r14      # 0x688a
leaq 0x11d7(%rip), %rbx      # 0x6055
leaq 0x1d4f(%rip), %r8       # 0x6bd4
movq %r14, %rsi
movl $0x76, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c94
movslq %ebp, %rax
movq (%rsp,%rax,8), %rdi
leaq 0x1d29(%rip), %r13      # 0x6bce
movq %r13, %rsi
callq 0x2190
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0x1d23(%rip), %r8       # 0x6bdf
movq %r14, %rsi
movl $0x77, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c94
movaps 0x4eab(%rip), %xmm0     # 0x9d80
leaq 0x20(%rsp), %rsi
movaps %xmm0, 0x10(%rsi)
movaps 0x4e8b(%rip), %xmm0     # 0x9d70
movaps %xmm0, (%rsi)
movl $0x4, %edi
movq %r15, %rdx
callq 0x276a
movl %eax, %ebp
xorl %edi, %edi
cmpl $0x3, %eax
sete %dil
leaq 0x1cfa(%rip), %r12      # 0x6c01
movq %r14, %rsi
movl $0x7b, %edx
movq %rbx, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x2c94
movslq %ebp, %rax
movq 0x20(%rsp,%rax,8), %rdi
movq %r13, %rsi
callq 0x2190
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0x1cd1(%rip), %r8       # 0x6c0c
movq %r14, %rsi
movl $0x7c, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c94
movq 0x4e6c(%rip), %rax      # 0x9dc0
leaq 0x40(%rsp), %rsi
movq %rax, 0x30(%rsi)
movaps 0x4e4c(%rip), %xmm0     # 0x9db0
movaps %xmm0, 0x20(%rsi)
movaps 0x4e31(%rip), %xmm0     # 0x9da0
movaps %xmm0, 0x10(%rsi)
movaps 0x4e16(%rip), %xmm0     # 0x9d90
movaps %xmm0, (%rsi)
movl $0x7, %edi
movq %r15, %rdx
callq 0x276a
movl %eax, %ebp
xorl %edi, %edi
cmpl $0x3, %eax
sete %dil
movq %r14, %rsi
movl $0x80, %edx
movq %rbx, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x2c94
movslq %ebp, %rax
movq 0x40(%rsp,%rax,8), %rdi
leaq 0x1c76(%rip), %rsi      # 0x6c2f
callq 0x2190
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0x1c7e(%rip), %r8       # 0x6c4b
movq %r14, %rsi
movl $0x81, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c94
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq