// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]libcperciva/liball/../util/getopt.c
// Function: libcperciva_getopt
const char *
getopt(int argc, char * const argv[])
{
	const char * os = NULL;
	const char * canonical_os = NULL;

	/* No argument yet. */
	optarg = NULL;

	/* Reset the getopt state if needed. */
	if (optreset)
		reset(argc, argv);

	/* If not initialized, return dummy option. */
	if (!getopt_initialized)
		return (GETOPT_DUMMY);

	/* If we've run out of arguments, we're done. */
	if (optind >= argc)
		return (NULL);

	/*
	 * If we're not already in the middle of a packed single-character
	 * options, see if we should start.
	 */
	if ((packedopts == NULL) && (argv[optind][0] == '-') &&
	    (argv[optind][1] != '-') && (argv[optind][1] != '\0')) {
		/* We have one or more single-character options. */
		packedopts = &argv[optind][1];
	}

	/* If we're processing single-character options, fish one out. */
	if (packedopts != NULL) {
		/* Construct the option string. */
		popt[0] = '-';
		popt[1] = *packedopts;
		popt[2] = '\0';
		os = popt;

		/* We've done this character. */
		packedopts++;

		/* Are we done with this string? */
		if (*packedopts == '\0') {
			packedopts = NULL;
			optind++;
		}
	}

	/* If we don't have an option yet, do we have dash-dash? */
	if ((os == NULL) && (argv[optind][0] == '-') &&
	    (argv[optind][1] == '-')) {
		/* If this is not "--\0", it's an option. */
		if (argv[optind][2] != '\0')
			os = argv[optind];

		/* Either way, we want to eat the string. */
		optind++;
	}

	/* If we have found nothing which looks like an option, we're done. */
	if (os == NULL)
		return (NULL);

	/* Search for the potential option. */
	opt_found = searchopt(os);

	/* If the option is not registered, give up now. */
	if (opt_found == opt_default) {
		WARN("unknown option: %s", os);
		return (os);
	}

	/* The canonical option string is the one registered. */
	canonical_os = opts[opt_found].os;

	/* Does the option take an argument? */
	if (opts[opt_found].hasarg) {
		/*
		 * If we're processing packed single-character options, the
		 * rest of the string is the argument to this option.
		 */
		if (packedopts != NULL) {
			optarg = packedopts;
			packedopts = NULL;
			optind++;
		}

		/*
		 * If the option string is <option>=<value>, extract that
		 * value as the option argument.
		 */
		if (os[opts[opt_found].olen] == '=')
			optarg = &os[opts[opt_found].olen + 1];

		/*
		 * If we don't have an argument yet, take one from the
		 * remaining command line.
		 */
		if ((optarg == NULL) && (optind < argc))
			optarg = argv[optind++];

		/* If we still have no option, declare it MIA. */
		if (optarg == NULL) {
			WARN("option requires an argument: %s",
			    opts[opt_found].os);
			opt_found = opt_missing;
		}
	} else {
		/* If we have --foo=bar, something went wrong. */
		if (os[opts[opt_found].olen] == '=') {
			WARN("option doesn't take an argument: %s",
			    opts[opt_found].os);
			opt_found = opt_default;
		}
	}

	/* Return the canonical option string. */
	return (canonical_os);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, 0x37ae(%rip) # 0x5098
cmpl $0x0, 0x378f(%rip)      # 0x5080
je 0x18ff
movl -0xc(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x1dc0
cmpl $0x0, 0x379a(%rip)      # 0x50a0
jne 0x1918
movq 0x3779(%rip), %rax      # 0x5088
movq %rax, -0x8(%rbp)
jmp 0x1db1
movl 0x375a(%rip), %eax      # 0x5078
cmpl -0xc(%rbp), %eax
jl 0x1930
movq $0x0, -0x8(%rbp)
jmp 0x1db1
cmpq $0x0, 0x3770(%rip)      # 0x50a8
jne 0x199b
movq -0x18(%rbp), %rax
movslq 0x3733(%rip), %rcx      # 0x5078
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x199b
movq -0x18(%rbp), %rax
movslq 0x371c(%rip), %rcx      # 0x5078
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %eax
cmpl $0x2d, %eax
je 0x199b
movq -0x18(%rbp), %rax
movslq 0x3704(%rip), %rcx      # 0x5078
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
je 0x199b
movq -0x18(%rbp), %rax
movslq 0x36ec(%rip), %rcx      # 0x5078
movq (%rax,%rcx,8), %rax
addq $0x1, %rax
movq %rax, 0x370d(%rip)      # 0x50a8
cmpq $0x0, 0x3705(%rip)      # 0x50a8
je 0x1a0a
movb $0x2d, 0x3704(%rip)     # 0x50b0
movq 0x36f5(%rip), %rax      # 0x50a8
movb (%rax), %al
movb %al, 0x36f6(%rip)       # 0x50b1
movb $0x0, 0x36f0(%rip)      # 0x50b2
leaq 0x36e7(%rip), %rax      # 0x50b0
movq %rax, -0x20(%rbp)
movq 0x36d4(%rip), %rax      # 0x50a8
addq $0x1, %rax
movq %rax, 0x36c9(%rip)      # 0x50a8
movq 0x36c2(%rip), %rax      # 0x50a8
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x1a08
movq $0x0, 0x36af(%rip) # 0x50a8
movl 0x3679(%rip), %eax      # 0x5078
addl $0x1, %eax
movl %eax, 0x3670(%rip)      # 0x5078
jmp 0x1a0a
cmpq $0x0, -0x20(%rbp)
jne 0x1a7a
movq -0x18(%rbp), %rax
movslq 0x365c(%rip), %rcx      # 0x5078
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x1a7a
movq -0x18(%rbp), %rax
movslq 0x3645(%rip), %rcx      # 0x5078
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %eax
cmpl $0x2d, %eax
jne 0x1a7a
movq -0x18(%rbp), %rax
movslq 0x362d(%rip), %rcx      # 0x5078
movq (%rax,%rcx,8), %rax
movsbl 0x2(%rax), %eax
cmpl $0x0, %eax
je 0x1a6b
movq -0x18(%rbp), %rax
movslq 0x3615(%rip), %rcx      # 0x5078
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movl 0x3607(%rip), %eax      # 0x5078
addl $0x1, %eax
movl %eax, 0x35fe(%rip)      # 0x5078
cmpq $0x0, -0x20(%rbp)
jne 0x1a8e
movq $0x0, -0x8(%rbp)
jmp 0x1db1
movq -0x20(%rbp), %rdi
callq 0x1e90
movq %rax, 0x361a(%rip)      # 0x50b8
movq 0x3613(%rip), %rax      # 0x50b8
cmpq 0x3614(%rip), %rax      # 0x50c0
jne 0x1b3f
jmp 0x1ab4
cmpl $0x0, 0x35c1(%rip)      # 0x507c
jne 0x1abf
jmp 0x1b32
movq 0x3602(%rip), %rax      # 0x50c8
cmpq 0x35f3(%rip), %rax      # 0x50c0
je 0x1ad1
jmp 0x1b32
jmp 0x1ad3
cmpq $0x0, 0x35f5(%rip)      # 0x50d0
je 0x1afc
movq 0x3514(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
movq 0x35e2(%rip), %rdx      # 0x50d0
leaq 0x1657(%rip), %rsi      # 0x314c
movb $0x0, %al
callq 0x1090
movq 0x34f5(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
movq -0x20(%rbp), %rdx
leaq 0x1640(%rip), %rsi      # 0x3151
movb $0x0, %al
callq 0x1090
movq 0x34d9(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1619(%rip), %rsi      # 0x3142
movb $0x0, %al
callq 0x1090
jmp 0x1b32
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1db1
movq 0x3592(%rip), %rax      # 0x50d8
imulq $0x18, 0x356a(%rip), %rcx # 0x50b8
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq 0x3579(%rip), %rax      # 0x50d8
imulq $0x18, 0x3551(%rip), %rcx # 0x50b8
addq %rcx, %rax
cmpl $0x0, 0x10(%rax)
je 0x1cde
cmpq $0x0, 0x352c(%rip)      # 0x50a8
je 0x1ba6
movq 0x3523(%rip), %rax      # 0x50a8
movq %rax, 0x350c(%rip)      # 0x5098
movq $0x0, 0x3511(%rip) # 0x50a8
movl 0x34db(%rip), %eax      # 0x5078
addl $0x1, %eax
movl %eax, 0x34d2(%rip)      # 0x5078
movq -0x20(%rbp), %rax
movq 0x3527(%rip), %rcx      # 0x50d8
imulq $0x18, 0x34ff(%rip), %rdx # 0x50b8
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3d, %eax
jne 0x1bf1
movq -0x20(%rbp), %rax
movq 0x3504(%rip), %rcx      # 0x50d8
imulq $0x18, 0x34dc(%rip), %rdx # 0x50b8
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
addq $0x1, %rcx
addq %rcx, %rax
movq %rax, 0x34a7(%rip)      # 0x5098
cmpq $0x0, 0x349f(%rip)      # 0x5098
jne 0x1c29
movl 0x3477(%rip), %eax      # 0x5078
cmpl -0xc(%rbp), %eax
jge 0x1c29
movq -0x18(%rbp), %rax
movl 0x3468(%rip), %ecx      # 0x5078
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x345d(%rip)      # 0x5078
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x346f(%rip)      # 0x5098
cmpq $0x0, 0x3467(%rip)      # 0x5098
jne 0x1cd9
jmp 0x1c39
cmpl $0x0, 0x343c(%rip)      # 0x507c
jne 0x1c47
jmp 0x1ccb
movq 0x347a(%rip), %rax      # 0x50c8
cmpq 0x346b(%rip), %rax      # 0x50c0
je 0x1c59
jmp 0x1ccb
jmp 0x1c5b
cmpq $0x0, 0x346d(%rip)      # 0x50d0
je 0x1c84
movq 0x338c(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
movq 0x345a(%rip), %rdx      # 0x50d0
leaq 0x14cf(%rip), %rsi      # 0x314c
movb $0x0, %al
callq 0x1090
movq 0x336d(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
movq 0x3443(%rip), %rax      # 0x50d8
imulq $0x18, 0x341b(%rip), %rcx # 0x50b8
addq %rcx, %rax
movq (%rax), %rdx
leaq 0x14ba(%rip), %rsi      # 0x3164
movb $0x0, %al
callq 0x1090
movq 0x3340(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1480(%rip), %rsi      # 0x3142
movb $0x0, %al
callq 0x1090
jmp 0x1ccb
movq 0x33f6(%rip), %rax      # 0x50c8
movq %rax, 0x33df(%rip)      # 0x50b8
jmp 0x1da9
movq -0x20(%rbp), %rax
movq 0x33ef(%rip), %rcx      # 0x50d8
imulq $0x18, 0x33c7(%rip), %rdx # 0x50b8
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3d, %eax
jne 0x1da7
jmp 0x1d07
cmpl $0x0, 0x336e(%rip)      # 0x507c
jne 0x1d15
jmp 0x1d99
movq 0x33ac(%rip), %rax      # 0x50c8
cmpq 0x339d(%rip), %rax      # 0x50c0
je 0x1d27
jmp 0x1d99
jmp 0x1d29
cmpq $0x0, 0x339f(%rip)      # 0x50d0
je 0x1d52
movq 0x32be(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
movq 0x338c(%rip), %rdx      # 0x50d0
leaq 0x1401(%rip), %rsi      # 0x314c
movb $0x0, %al
callq 0x1090
movq 0x329f(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
movq 0x3375(%rip), %rax      # 0x50d8
imulq $0x18, 0x334d(%rip), %rcx # 0x50b8
addq %rcx, %rax
movq (%rax), %rdx
leaq 0x140c(%rip), %rsi      # 0x3184
movb $0x0, %al
callq 0x1090
movq 0x3272(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x13b2(%rip), %rsi      # 0x3142
movb $0x0, %al
callq 0x1090
jmp 0x1d99
movq 0x3320(%rip), %rax      # 0x50c0
movq %rax, 0x3311(%rip)      # 0x50b8
jmp 0x1da9
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)