// File: /workspace/github_cpp_makefile_star2_O3/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 $0x0, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
movl (%rdi), %eax
movl $0x1, %ebx
cmpl $0x2, %eax
jl 0x985c
movl $0x1, %edi
xorl %r15d, %r15d
xorl %ebp, %ebp
movq %rsi, 0x28(%rsp)
movslq %edi, %rcx
movq (%rsi,%rcx,8), %rdx
cmpb $0x2d, (%rdx)
jne 0x97e9
movb 0x1(%rdx), %r12b
testb %r12b, %r12b
je 0x9815
movq %rdi, 0x18(%rsp)
movl %ebx, 0x24(%rsp)
leaq 0x1(%rdx), %rax
movq %rax, 0x30(%rsp)
movl $0x1, %ebx
movl $0x1, %r14d
movq %rdx, 0x38(%rsp)
movsbl %r12b, %esi
movq 0x40(%rsp), %rdi
callq 0x2110
testq %rax, %rax
je 0x96f8
movq 0x30(%rsp), %rax
cmpb $0x0, (%rax,%r14)
je 0x9717
addq %rax, %r14
movq %r14, %rdi
callq 0x2100
addl %eax, %ebx
jmp 0x9741
movl $0x2, %edi
callq 0x2250
testq %rax, %rax
je 0x9811
movq %rax, %r13
movb %r12b, (%rax)
movb $0x0, 0x1(%rax)
jmp 0x9771
movq 0x8(%rsp), %rax
movl (%rax), %eax
decl %eax
movq 0x18(%rsp), %rcx
cmpl %eax, %ecx
je 0x97fe
movslq %ecx, %rax
incl %ecx
movq %rcx, 0x18(%rsp)
movq 0x28(%rsp), %rcx
movq 0x8(%rcx,%rax,8), %r14
movq %r14, %rdi
callq 0x2100
addl $0x2, %eax
movslq %eax, %rdi
callq 0x2250
testq %rax, %rax
je 0x9811
movq %rax, %r13
movb %r12b, (%rax)
movq %rax, %rdi
incq %rdi
movq %r14, %rsi
callq 0x2080
testq %rbp, %rbp
je 0x9785
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x9785
incl %eax
movl %eax, -0x10(%rbp)
jmp 0x979e
leaq 0x10(%rsp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x56ce
movq 0x10(%rsp), %r15
testq %r15, %r15
je 0x97a9
movslq -0x10(%r15), %rax
jmp 0x97ab
xorl %eax, %eax
movq %r13, -0x8(%r15,%rax,8)
movslq %ebx, %r14
movq 0x38(%rsp), %rax
movb 0x1(%rax,%r14), %r12b
incq %r14
movq %r15, %rbp
movl %r14d, %ebx
testb %r12b, %r12b
jne 0x96ca
movq 0x8(%rsp), %rax
movl (%rax), %eax
movq %r15, %rbp
movl 0x24(%rsp), %ebx
movq 0x18(%rsp), %rdi
movq 0x28(%rsp), %rsi
jmp 0x97f2
movslq %ebx, %rcx
incl %ebx
movq %rdx, (%rsi,%rcx,8)
incl %edi
cmpl %eax, %edi
jl 0x968b
jmp 0x9843
movq 0x8(%rsp), %rax
movl $0x0, (%rax)
movq %rbp, %rdi
callq 0x9601
xorl %ecx, %ecx
jmp 0x988a
leal 0x1(%rdi), %ecx
cmpl %eax, %ecx
jge 0x9843
movslq %ecx, %rdx
movslq %ebx, %rcx
addl %eax, %ebx
notl %edi
addl %edi, %ebx
leaq (%rsi,%rcx,8), %rcx
addl %eax, %edi
leaq (%rsi,%rdx,8), %rax
xorl %edx, %edx
movq (%rax,%rdx,8), %rsi
movq %rsi, (%rcx,%rdx,8)
incq %rdx
cmpl %edx, %edi
jne 0x9834
movq 0x10(%rsp), %rcx
testq %rcx, %rcx
je 0x985c
movl -0x10(%rcx), %eax
cmpl -0xc(%rcx), %eax
jge 0x985c
incl %eax
movl %eax, -0x10(%rcx)
jmp 0x9876
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x56ce
movq (%r14), %rcx
movslq -0x10(%rcx), %rax
movq $0x0, -0x8(%rcx,%rax,8)
movq 0x8(%rsp), %rax
movl %ebx, (%rax)
movq %rcx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq