// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/stb/./stb.h
// Function: stb_getopt_param
char **stb_getopt_param(int *argc, char **argv, char *param)
{
   char ** opts=NULL;
   int i,j=1;
   for (i=1; i < *argc; ++i) {
      if (argv[i][0] != '-') {
         argv[j++] = argv[i];
      } else {
         if (argv[i][1] == 0) { // plain - == don't parse further options
            ++i;
            while (i < *argc)
               argv[j++] = argv[i++];
            break;
         } else {
            int k;
            char *q = argv[i];  // traverse options list
            for (k=1; q[k]; ++k) {
               char *s;
               if (strchr(param, q[k])) {  // does it take a parameter?
                  char *t = &q[k+1], z = q[k];
                  int len=0;
                  if (*t == 0) {
                     if (i == *argc-1) { // takes a parameter, but none found
                        *argc = 0;
                        stb_getopt_free(opts);
                        return NULL;
                     }
                     t = argv[++i];
                  } else
                     k += strlen(t);
                  len = strlen(t);
                  s = (char *) malloc(len+2);
                  if (!s) return NULL;
                  s[0] = z;
                  strcpy(s+1, t);
               } else {
                  // no parameter
                  s = (char *) malloc(2);
                  if (!s) return NULL;
                  s[0] = q[k];
                  s[1] = 0;
               }
               stb_arr_push(opts, s);
            }
         }
      }
   }
   stb_arr_push(opts, NULL);
   *argc = j;
   return opts;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, 0x40(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0x18(%rsp), %rax
andq $0x0, (%rax)
pushq $0x1
popq %rax
xorl %ebx, %ebx
xorl %r15d, %r15d
movl %eax, %ebp
movl %eax, %edi
movq %rsi, 0x20(%rsp)
movq 0x10(%rsp), %rax
movslq (%rax), %rax
cmpl %eax, %edi
jge 0x89fd
movslq %edi, %rcx
movq (%rsi,%rcx,8), %r13
cmpb $0x2d, (%r13)
movslq %ebp, %rdx
jne 0x8999
movl %edi, 0xc(%rsp)
movb 0x1(%r13), %r12b
testb %r12b, %r12b
je 0x89da
movl %ebp, 0x2c(%rsp)
leaq 0x1(%r13), %rax
movq %rax, 0x38(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebp
movq %r13, 0x30(%rsp)
testb %r12b, %r12b
je 0x89a2
movsbl %r12b, %esi
movq 0x40(%rsp), %rdi
callq 0x2110
testq %rax, %rax
je 0x88ce
movslq %ebp, %r14
movq 0x38(%rsp), %rax
cmpb $0x0, (%rax,%r14)
je 0x88eb
leaq (%rax,%r14), %r13
movq %r13, %rdi
callq 0x2100
addl %eax, %r14d
movl %r14d, %ebp
jmp 0x8913
pushq $0x2
popq %rdi
callq 0x2250
testq %rax, %rax
je 0x89c6
movq %rax, %r14
movb %r12b, (%rax)
movb $0x0, 0x1(%rax)
jmp 0x8948
movq 0x10(%rsp), %rax
movl (%rax), %eax
decl %eax
movl 0xc(%rsp), %ecx
cmpl %eax, %ecx
je 0x89b6
movslq %ecx, %rax
incl %ecx
movl %ecx, 0xc(%rsp)
movq 0x20(%rsp), %rcx
movq 0x8(%rcx,%rax,8), %r13
movq %r13, %rdi
callq 0x2100
addl $0x2, %eax
movslq %eax, %rdi
callq 0x2250
testq %rax, %rax
je 0x89c6
movq %rax, %r14
movb %r12b, (%rax)
movq %rax, %rdi
incq %rdi
movq %r13, %rsi
callq 0x2080
movq 0x30(%rsp), %r13
testq %r15, %r15
je 0x895f
movl -0x10(%r15), %eax
cmpl -0xc(%r15), %eax
jge 0x895f
incl %eax
movl %eax, -0x10(%r15)
jmp 0x8974
leaq 0x18(%rsp), %rdi
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
callq 0x521e
movq 0x18(%rsp), %rbx
testq %rbx, %rbx
je 0x897f
movslq -0x10(%rbx), %rax
jmp 0x8981
xorl %eax, %eax
movq %r14, -0x8(%rbx,%rax,8)
movslq %ebp, %rbp
movb 0x1(%r13,%rbp), %r12b
incq %rbp
movq %rbx, %r15
jmp 0x888f
leal 0x1(%rdx), %ebp
movq %r13, (%rsi,%rdx,8)
jmp 0x89af
movl 0x2c(%rsp), %ebp
movq 0x20(%rsp), %rsi
movl 0xc(%rsp), %edi
incl %edi
jmp 0x8842
movq 0x10(%rsp), %rax
andl $0x0, (%rax)
movq %r15, %rdi
callq 0x87c6
xorl %ecx, %ecx
movq %rcx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incq %rcx
movq 0x20(%rsp), %rdi
leaq (%rdi,%rdx,8), %rdx
cmpq %rax, %rcx
jge 0x89fd
movq (%rdi,%rcx,8), %rsi
movq %rsi, (%rdx)
incq %rcx
incl %ebp
addq $0x8, %rdx
jmp 0x89e6
movq 0x18(%rsp), %rcx
testq %rcx, %rcx
je 0x8a16
movl -0x10(%rcx), %eax
cmpl -0xc(%rcx), %eax
jge 0x8a16
incl %eax
movl %eax, -0x10(%rcx)
jmp 0x8a2c
leaq 0x18(%rsp), %rbx
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x521e
movq (%rbx), %rcx
movslq -0x10(%rcx), %rax
andq $0x0, -0x8(%rcx,%rax,8)
movq 0x10(%rsp), %rax
movl %ebp, (%rax)
jmp 0x89c8