// File: /workspace/github_cpp_makefile_star2_O2/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
andq $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 0x2196(%rip), %rcx      # 0x6b76
movq %rcx, (%r15)
movb $0x66, 0x8(%r15)
movl $0x4, 0x18(%r15)
movq %rax, 0x20(%r15)
movaps 0x5365(%rip), %xmm0     # 0x9d60
movq %rsp, %rsi
movaps %xmm0, (%rsi)
pushq $0x2
popq %rdi
movq %r15, %rdx
callq 0x253c
movl %eax, %ebp
xorl %edi, %edi
cmpl $0x1, %eax
sete %dil
leaq 0x1e69(%rip), %r14      # 0x6887
leaq 0x1630(%rip), %rbx      # 0x6055
leaq 0x21a5(%rip), %r8       # 0x6bd1
pushq $0x76
popq %rdx
movq %r14, %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x29b8
movslq %ebp, %rax
movq (%rsp,%rax,8), %rdi
leaq 0x2181(%rip), %r13      # 0x6bcb
movq %r13, %rsi
callq 0x2190
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0x217b(%rip), %r8       # 0x6bdc
pushq $0x77
popq %rdx
movq %r14, %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x29b8
movaps 0x5308(%rip), %xmm0     # 0x9d80
leaq 0x20(%rsp), %rsi
movaps %xmm0, 0x10(%rsi)
movaps 0x52e8(%rip), %xmm0     # 0x9d70
movaps %xmm0, (%rsi)
pushq $0x4
popq %rdi
movq %r15, %rdx
callq 0x253c
movl %eax, %ebp
xorl %edi, %edi
cmpl $0x3, %eax
sete %dil
leaq 0x2156(%rip), %r12      # 0x6bfe
pushq $0x7b
popq %rdx
movq %r14, %rsi
movq %rbx, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x29b8
movslq %ebp, %rax
movq 0x20(%rsp,%rax,8), %rdi
movq %r13, %rsi
callq 0x2190
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0x212f(%rip), %r8       # 0x6c09
pushq $0x7c
popq %rdx
movq %r14, %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x29b8
movq 0x52cf(%rip), %rax      # 0x9dc0
leaq 0x40(%rsp), %rsi
movq %rax, 0x30(%rsi)
movaps 0x52af(%rip), %xmm0     # 0x9db0
movaps %xmm0, 0x20(%rsi)
movaps 0x5294(%rip), %xmm0     # 0x9da0
movaps %xmm0, 0x10(%rsi)
movaps 0x5279(%rip), %xmm0     # 0x9d90
movaps %xmm0, (%rsi)
pushq $0x7
popq %rdi
movq %r15, %rdx
callq 0x253c
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 0x29b8
movslq %ebp, %rax
movq 0x40(%rsp,%rax,8), %rdi
leaq 0x20d8(%rip), %rsi      # 0x6c2c
callq 0x2190
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0x20e0(%rip), %r8       # 0x6c48
movq %r14, %rsi
movl $0x81, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x29b8
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq