// File: /workspace/github_cpp_makefile_star2_O1/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 $0x38, %rsp
movq %rdx, 0x28(%rsp)
movq %rdi, %rbx
movq $0x0, (%rsp)
movl (%rdi), %eax
movl $0x1, %r14d
cmpl $0x2, %eax
jl 0x996e
movl $0x1, %r13d
movq %rbx, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movslq %r13d, %rcx
movq (%rsi,%rcx,8), %rcx
cmpb $0x2d, (%rcx)
jne 0x9923
cmpb $0x0, 0x1(%rcx)
je 0x993d
movl %r14d, 0xc(%rsp)
movb 0x1(%rcx), %r14b
testb %r14b, %r14b
sete %bl
je 0x990a
movq %rcx, 0x30(%rsp)
leaq 0x1(%rcx), %rax
movq %rax, 0x20(%rsp)
movl $0x1, %r12d
movl $0x1, %r15d
movsbl %r14b, %esi
movq 0x28(%rsp), %rdi
callq 0x2110
testq %rax, %rax
je 0x9809
movq 0x20(%rsp), %rax
cmpb $0x0, (%rax,%r15)
je 0x9824
addq %rax, %r15
movq %r15, %rdi
callq 0x2100
addl %eax, %r12d
jmp 0x9857
movl $0x2, %edi
callq 0x2250
testq %rax, %rax
je 0x9843
movq %rax, %rbp
movb %r14b, (%rax)
movb $0x0, 0x1(%rax)
jmp 0x988f
movq 0x18(%rsp), %rcx
movl (%rcx), %eax
decl %eax
cmpl %eax, %r13d
jne 0x9847
movl $0x0, (%rcx)
movq (%rsp), %rdi
callq 0x9708
jmp 0x9889
xorl %ebp, %ebp
jmp 0x989f
movslq %r13d, %rax
incl %r13d
movq 0x10(%rsp), %rcx
movq 0x8(%rcx,%rax,8), %r15
movq %r15, %rdi
callq 0x2100
addl $0x2, %eax
movslq %eax, %rdi
callq 0x2250
testq %rax, %rax
je 0x9887
movq %rax, %rbp
movb %r14b, (%rax)
movq %rax, %rdi
incq %rdi
movq %r15, %rsi
callq 0x2080
movb $0x1, %al
jmp 0x988b
xorl %ebp, %ebp
xorl %eax, %eax
testb %al, %al
je 0x989f
movq (%rsp), %rax
testq %rax, %rax
je 0x98a3
movl -0x10(%rax), %ecx
incl %ecx
jmp 0x98a8
xorl %eax, %eax
jmp 0x98e7
movl $0x1, %ecx
testq %rax, %rax
je 0x98b2
movl -0xc(%rax), %edx
jmp 0x98b4
xorl %edx, %edx
cmpl %edx, %ecx
jle 0x98cc
movq %rsp, %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x57e0
jmp 0x98cf
incl -0x10(%rax)
movq (%rsp), %rax
testq %rax, %rax
je 0x98de
movslq -0x10(%rax), %rcx
jmp 0x98e0
xorl %ecx, %ecx
movq %rbp, -0x8(%rax,%rcx,8)
movb $0x1, %al
testb %al, %al
je 0x990a
movslq %r12d, %r15
movq 0x30(%rsp), %rax
movb 0x1(%rax,%r15), %r14b
incq %r15
movl %r15d, %r12d
testb %r14b, %r14b
sete %bl
jne 0x97da
testb $0x1, %bl
movq 0x18(%rsp), %rbx
movl 0xc(%rsp), %r14d
movq 0x10(%rsp), %rsi
jne 0x992d
jmp 0x99d4
movslq %r14d, %rax
incl %r14d
movq %rcx, (%rsi,%rax,8)
incl %r13d
movl (%rbx), %eax
cmpl %eax, %r13d
jl 0x9791
jmp 0x996e
leal 0x1(%r13), %ecx
cmpl %eax, %ecx
jge 0x996e
movslq %ecx, %rdx
movslq %r14d, %rcx
leaq (%rsi,%rcx,8), %rcx
notl %r13d
addl %eax, %r13d
leaq (%rsi,%rdx,8), %rdx
xorl %eax, %eax
movq (%rdx,%rax,8), %rsi
movq %rsi, (%rcx,%rax,8)
incq %rax
cmpl %eax, %r13d
jne 0x995b
addl %eax, %r14d
movq (%rsp), %rax
testq %rax, %rax
movl $0x1, %edx
je 0x9981
movl -0x10(%rax), %edx
incl %edx
testq %rax, %rax
je 0x998b
movl -0xc(%rax), %ecx
jmp 0x998d
xorl %ecx, %ecx
cmpl %ecx, %edx
jle 0x99a5
movq %rsp, %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x57e0
jmp 0x99a8
incl -0x10(%rax)
movq (%rsp), %rax
testq %rax, %rax
je 0x99b7
movslq -0x10(%rax), %rcx
jmp 0x99b9
xorl %ecx, %ecx
movq $0x0, -0x8(%rax,%rcx,8)
movl %r14d, (%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x99c5