// File: /workspace/github_cpp_makefile_star2_O3/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 0x1eaf(%rip), %rcx      # 0x6b76
movq %rcx, (%r15)
movb $0x66, 0x8(%r15)
movl $0x4, 0x18(%r15)
movq %rax, 0x20(%r15)
movaps 0x507e(%rip), %xmm0     # 0x9d60
movq %rsp, %rsi
movaps %xmm0, (%rsi)
movl $0x2, %edi
movq %r15, %rdx
callq 0x276e
movl %eax, %ebp
xorl %edi, %edi
cmpl $0x1, %eax
sete %dil
leaq 0x1b80(%rip), %r14      # 0x6887
leaq 0x1347(%rip), %rbx      # 0x6055
leaq 0x1ebc(%rip), %r8       # 0x6bd1
movq %r14, %rsi
movl $0x76, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c34
movslq %ebp, %rax
movq (%rsp,%rax,8), %rdi
leaq 0x1e96(%rip), %r13      # 0x6bcb
movq %r13, %rsi
callq 0x2190
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0x1e90(%rip), %r8       # 0x6bdc
movq %r14, %rsi
movl $0x77, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c34
movaps 0x501b(%rip), %xmm0     # 0x9d80
leaq 0x20(%rsp), %rsi
movaps %xmm0, 0x10(%rsi)
movaps 0x4ffb(%rip), %xmm0     # 0x9d70
movaps %xmm0, (%rsi)
movl $0x4, %edi
movq %r15, %rdx
callq 0x276e
movl %eax, %ebp
xorl %edi, %edi
cmpl $0x3, %eax
sete %dil
leaq 0x1e67(%rip), %r12      # 0x6bfe
movq %r14, %rsi
movl $0x7b, %edx
movq %rbx, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x2c34
movslq %ebp, %rax
movq 0x20(%rsp,%rax,8), %rdi
movq %r13, %rsi
callq 0x2190
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0x1e3e(%rip), %r8       # 0x6c09
movq %r14, %rsi
movl $0x7c, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c34
movq 0x4fdc(%rip), %rax      # 0x9dc0
leaq 0x40(%rsp), %rsi
movq %rax, 0x30(%rsi)
movaps 0x4fbc(%rip), %xmm0     # 0x9db0
movaps %xmm0, 0x20(%rsi)
movaps 0x4fa1(%rip), %xmm0     # 0x9da0
movaps %xmm0, 0x10(%rsi)
movaps 0x4f86(%rip), %xmm0     # 0x9d90
movaps %xmm0, (%rsi)
movl $0x7, %edi
movq %r15, %rdx
callq 0x276e
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 0x2c34
movslq %ebp, %rax
movq 0x40(%rsp,%rax,8), %rdi
leaq 0x1de3(%rip), %rsi      # 0x6c2c
callq 0x2190
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0x1deb(%rip), %r8       # 0x6c48
movq %r14, %rsi
movl $0x81, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2c34
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq