// File: /workspace/github_c_makefile_star2_O2/rakitzis[P]rc/getopt.c
// Function: rc_getopt
extern int rc_getopt(int argc, char **argv, char *opts) {
	static int sp = 1;
	int c;
	char *cp;
	if (rc_optind == 0) /* reset rc_getopt() */
		rc_optind = sp = 1;
	if (sp == 1) {
		if (rc_optind >= argc || argv[rc_optind][0] != '-' || argv[rc_optind][1] == '\0') {
			return -1;
		} else if (strcmp(argv[rc_optind], "--") == 0) {
			rc_optind++;
			return -1;
		}
	}
	rc_optopt = c = argv[rc_optind][sp];
	if (c == ':' || (cp=strchr(opts, c)) == 0) {
		fprint(2, "%s: bad option: -%c\n", argv[0], c);
		if (argv[rc_optind][++sp] == '\0') {
			rc_optind++;
			sp = 1;
		}
		return '?';
	}
	if (*++cp == ':') {
		if (argv[rc_optind][sp+1] != '\0') {
			rc_optarg = &argv[rc_optind++][sp+1];
		} else if (++rc_optind >= argc) {
			fprint(2, "%s: option requires an argument -- %c\n", argv[0], c);
			sp = 1;
			return '?';
		} else
			rc_optarg = argv[rc_optind++];
		sp = 1;
	} else {
		if (argv[rc_optind][++sp] == '\0') {
			sp = 1;
			rc_optind++;
		}
		rc_optarg = NULL;
	}
	return c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebp
movslq 0x136e1(%rip), %r15     # 0x192f8
testq %r15, %r15
je 0x5c84
movslq 0x136d9(%rip), %r13     # 0x192fc
cmpq $0x1, %r13
je 0x5c96
movq (%r14,%r15,8), %r12
movb (%r12,%r13), %al
movsbl %al, %ebx
movl %ebx, 0x13d96(%rip)     # 0x199d0
cmpb $0x3a, %bl
je 0x5cec
movq %rdx, %rdi
movl %ebx, %esi
callq 0x3120
testq %rax, %rax
je 0x5cec
movslq %r13d, %rcx
cmpb $0x3a, 0x1(%rax)
jne 0x5d32
addq %rcx, %r12
leal 0x1(%r15), %eax
cmpb $0x0, 0x1(%r12)
movl %eax, 0x13682(%rip)     # 0x192f8
je 0x5d62
incq %r12
jmp 0x5d77
pushq $0x1
popq %r15
movl %r15d, 0x1366d(%rip)    # 0x192fc
movl %r15d, 0x13662(%rip)    # 0x192f8
pushq $-0x1
popq %rbx
cmpl %ebp, %r15d
jge 0x5d88
movslq %r15d, %rax
movq (%r14,%rax,8), %r12
cmpb $0x2d, (%r12)
jne 0x5d88
movzbl 0x1(%r12), %eax
testl %eax, %eax
je 0x5d88
pushq $0x1
popq %r13
cmpl $0x2d, %eax
jne 0x5c31
movb $0x2d, %al
cmpb $0x0, 0x2(%r12)
jne 0x5c31
incl %r15d
movl %r15d, 0x13611(%rip)    # 0x192f8
jmp 0x5d88
movq (%r14), %rdx
leaq 0x8994(%rip), %rsi      # 0xe68a
pushq $0x2
popq %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0xa8f6
movslq 0x135ef(%rip), %rax     # 0x192f8
movq (%r14,%rax,8), %rcx
movslq 0x135e8(%rip), %rdx     # 0x192fc
leaq 0x1(%rdx), %rsi
movl %esi, 0x135de(%rip)     # 0x192fc
pushq $0x3f
popq %rbx
cmpb $0x0, 0x1(%rcx,%rdx)
jne 0x5d88
incl %eax
movl %eax, 0x135c8(%rip)     # 0x192f8
jmp 0x5d7e
leaq 0x1(%rcx), %rax
movl %eax, 0x135c0(%rip)     # 0x192fc
cmpb $0x0, 0x1(%r12,%rcx)
jne 0x5d58
movl $0x1, 0x135ae(%rip)     # 0x192fc
incl %r15d
movl %r15d, 0x135a0(%rip)    # 0x192f8
andq $0x0, 0x13c78(%rip)     # 0x199d8
jmp 0x5d88
cmpl %ebp, %eax
jge 0x5d99
addl $0x2, %r15d
movl %r15d, 0x13587(%rip)    # 0x192f8
cltq
movq (%r14,%rax,8), %r12
movq %r12, 0x13c5a(%rip)     # 0x199d8
movl $0x1, 0x13574(%rip)     # 0x192fc
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rdx
leaq 0x88fc(%rip), %rsi      # 0xe69f
pushq $0x2
popq %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0xa8f6
movl $0x1, 0x13543(%rip)     # 0x192fc
pushq $0x3f
popq %rbx
jmp 0x5d88
nop