// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/./ketopt.h
// Function: ketopt
static int ketopt(ketopt_t *s, int argc, char *argv[], int permute, const char *ostr, const ko_longopt_t *longopts)
{
	int opt = -1, i0, j;
	if (permute) {
		while (s->i < argc && (argv[s->i][0] != '-' || argv[s->i][1] == '\0'))
			++s->i, ++s->n_args;
	}
	s->arg = 0, s->longidx = -1, i0 = s->i;
	if (s->i >= argc || argv[s->i][0] != '-' || argv[s->i][1] == '\0') {
		s->ind = s->i - s->n_args;
		return -1;
	}
	if (argv[s->i][0] == '-' && argv[s->i][1] == '-') { /* "--" or a long option */
		if (argv[s->i][2] == '\0') { /* a bare "--" */
			ketopt_permute(argv, s->i, s->n_args);
			++s->i, s->ind = s->i - s->n_args;
			return -1;
		}
		s->opt = 0, opt = '?', s->pos = -1;
		if (longopts) { /* parse long options */
			int k, n_matches = 0;
			const ko_longopt_t *o = 0;
			for (j = 2; argv[s->i][j] != '\0' && argv[s->i][j] != '='; ++j) {} /* find the end of the option name */
			for (k = 0; longopts[k].name != 0; ++k)
				if (strncmp(&argv[s->i][2], longopts[k].name, j - 2) == 0)
					++n_matches, o = &longopts[k];
			if (n_matches == 1) {
				s->opt = opt = o->val, s->longidx = o - longopts;
				if (argv[s->i][j] == '=') s->arg = &argv[s->i][j + 1];
				if (o->has_arg == 1 && argv[s->i][j] == '\0') {
					if (s->i < argc - 1) s->arg = argv[++s->i];
					else opt = ':'; /* missing option argument */
				}
			}
		}
	} else { /* a short option */
		char *p;
		if (s->pos == 0) s->pos = 1;
		opt = s->opt = argv[s->i][s->pos++];
		p = strchr((char*)ostr, opt);
		if (p == 0) {
			opt = '?'; /* unknown option */
		} else if (p[1] == ':') {
			if (argv[s->i][s->pos] == 0) {
				if (s->i < argc - 1) s->arg = argv[++s->i];
				else opt = ':'; /* missing option argument */
			} else s->arg = &argv[s->i][s->pos];
			s->pos = -1;
		}
	}
	if (s->pos < 0 || argv[s->i][s->pos] == 0) {
		++s->i, s->pos = 0;
		if (s->n_args > 0) /* permute */
			for (j = i0; j < s->i; ++j)
				ketopt_permute(argv, j, s->n_args);
	}
	s->ind = s->i - s->n_args;
	return opt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movl $0xffffffff, -0x3c(%rbp) # imm = 0xFFFFFFFF
cmpl $0x0, -0x24(%rbp)
je 0x3b0b5
jmp 0x3b03d
movq -0x10(%rbp), %rax
movl 0x14(%rax), %ecx
xorl %eax, %eax
cmpl -0x14(%rbp), %ecx
movb %al, -0x61(%rbp)
jge 0x3b08e
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x14(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x2d, %ecx
movb %al, -0x62(%rbp)
jne 0x3b088
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x14(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
sete %al
movb %al, -0x62(%rbp)
movb -0x62(%rbp), %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x3b097
jmp 0x3b0b3
movq -0x10(%rbp), %rax
movl 0x14(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x1c(%rax)
jmp 0x3b03d
jmp 0x3b0b5
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
cmpl -0x14(%rbp), %eax
jge 0x3b113
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x14(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x3b113
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x14(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x3b133
movq -0x10(%rbp), %rax
movl 0x14(%rax), %ecx
movq -0x10(%rbp), %rax
subl 0x1c(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3b560
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x14(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x3b3bd
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x14(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %eax
cmpl $0x2d, %eax
jne 0x3b3bd
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x14(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x2(%rax), %eax
cmpl $0x0, %eax
jne 0x3b1c9
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x14(%rax), %esi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %edx
callq 0x3b820
movq -0x10(%rbp), %rax
movl 0x14(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rax
movl 0x14(%rax), %ecx
movq -0x10(%rbp), %rax
subl 0x1c(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3b560
movq -0x10(%rbp), %rax
movl $0x0, 0x4(%rax)
movl $0x3f, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x18(%rax) # imm = 0xFFFFFFFF
cmpq $0x0, -0x38(%rbp)
je 0x3b3b8
movl $0x0, -0x4c(%rbp)
movq $0x0, -0x58(%rbp)
movl $0x2, -0x44(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x14(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x44(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x63(%rbp)
je 0x3b24a
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x14(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x44(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3d, %eax
setne %al
movb %al, -0x63(%rbp)
movb -0x63(%rbp), %al
testb $0x1, %al
jne 0x3b253
jmp 0x3b260
jmp 0x3b255
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x3b207
movl $0x0, -0x48(%rbp)
movq -0x38(%rbp), %rax
movslq -0x48(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0x3b2de
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x14(%rcx), %rcx
movq (%rax,%rcx,8), %rdi
addq $0x2, %rdi
movq -0x38(%rbp), %rax
movslq -0x48(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movl -0x44(%rbp), %eax
subl $0x2, %eax
movslq %eax, %rdx
callq 0x2070
cmpl $0x0, %eax
jne 0x3b2d1
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movslq -0x48(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
jmp 0x3b2d3
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x3b267
cmpl $0x1, -0x4c(%rbp)
jne 0x3b3b6
movq -0x58(%rbp), %rax
movl 0xc(%rax), %ecx
movl %ecx, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x58(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
sarq $0x4, %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x14(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x44(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3d, %eax
jne 0x3b351
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x14(%rcx), %rcx
movq (%rax,%rcx,8), %rcx
movl -0x44(%rbp), %eax
addl $0x1, %eax
cltq
addq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x58(%rbp), %rax
cmpl $0x1, 0x8(%rax)
jne 0x3b3b4
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x14(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x44(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x3b3b4
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x3b3ab
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rdx
movl 0x14(%rdx), %ecx
addl $0x1, %ecx
movl %ecx, 0x14(%rdx)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x3b3b2
movl $0x3a, -0x3c(%rbp)
jmp 0x3b3b4
jmp 0x3b3b6
jmp 0x3b3b8
jmp 0x3b4c5
movq -0x10(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jne 0x3b3d2
movq -0x10(%rbp), %rax
movl $0x1, 0x18(%rax)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x14(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq -0x10(%rbp), %rdx
movl 0x18(%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x18(%rdx)
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
movq -0x10(%rbp), %rcx
movl %eax, 0x4(%rcx)
movl %eax, -0x3c(%rbp)
movq -0x30(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x2120
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x3b425
movl $0x3f, -0x3c(%rbp)
jmp 0x3b4c3
movq -0x60(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x3a, %eax
jne 0x3b4c1
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x14(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq -0x10(%rbp), %rcx
movslq 0x18(%rcx), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x3b493
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x3b48a
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rdx
movl 0x14(%rdx), %ecx
addl $0x1, %ecx
movl %ecx, 0x14(%rdx)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x3b491
movl $0x3a, -0x3c(%rbp)
jmp 0x3b4b6
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x14(%rcx), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x10(%rbp), %rax
movslq 0x18(%rax), %rax
addq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x18(%rax) # imm = 0xFFFFFFFF
jmp 0x3b4c3
jmp 0x3b4c5
movq -0x10(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jl 0x3b4f0
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x14(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq -0x10(%rbp), %rcx
movslq 0x18(%rcx), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x3b546
movq -0x10(%rbp), %rax
movl 0x14(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x18(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
jle 0x3b544
movl -0x40(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jge 0x3b542
movq -0x20(%rbp), %rdi
movl -0x44(%rbp), %esi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %edx
callq 0x3b820
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x3b518
jmp 0x3b544
jmp 0x3b546
movq -0x10(%rbp), %rax
movl 0x14(%rax), %ecx
movq -0x10(%rbp), %rax
subl 0x1c(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)