// File: 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:
subq $0x98, %rsp
movq %rdi, 0x88(%rsp)
movq %rsi, 0x80(%rsp)
movq %rdx, 0x78(%rsp)
movq $0x0, 0x70(%rsp)
movl $0x1, 0x68(%rsp)
movl $0x1, 0x6c(%rsp)
movl 0x6c(%rsp), %eax
movq 0x88(%rsp), %rcx
cmpl (%rcx), %eax
jge 0xf4d6
movq 0x80(%rsp), %rax
movslq 0x6c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0xf1d4
movq 0x80(%rsp), %rax
movslq 0x6c(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x80(%rsp), %rax
movl 0x68(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x68(%rsp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0xf4c4
movq 0x80(%rsp), %rax
movslq 0x6c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0xf248
movl 0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
movl 0x6c(%rsp), %eax
movq 0x88(%rsp), %rcx
cmpl (%rcx), %eax
jge 0xf243
movq 0x80(%rsp), %rax
movl 0x6c(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x6c(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq 0x80(%rsp), %rax
movl 0x68(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x68(%rsp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0xf1f9
jmp 0xf4d6
movq 0x80(%rsp), %rax
movslq 0x6c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x58(%rsp)
movl $0x1, 0x64(%rsp)
movq 0x58(%rsp), %rax
movslq 0x64(%rsp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0xf4c0
movq 0x78(%rsp), %rdi
movq 0x58(%rsp), %rax
movslq 0x64(%rsp), %rcx
movsbl (%rax,%rcx), %esi
callq 0x2110
cmpq $0x0, %rax
je 0xf3ac
movq 0x58(%rsp), %rax
movl 0x64(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x48(%rsp)
movq 0x58(%rsp), %rax
movslq 0x64(%rsp), %rcx
movb (%rax,%rcx), %al
movb %al, 0x47(%rsp)
movl $0x0, 0x40(%rsp)
movq 0x48(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xf338
movl 0x6c(%rsp), %eax
movq 0x88(%rsp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0xf317
movq 0x88(%rsp), %rax
movl $0x0, (%rax)
movq 0x70(%rsp), %rdi
callq 0xf090
movq $0x0, 0x90(%rsp)
jmp 0xf5a5
movq 0x80(%rsp), %rax
movl 0x6c(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, 0x6c(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x48(%rsp)
jmp 0xf351
movq 0x48(%rsp), %rdi
callq 0x2100
movq %rax, %rcx
movslq 0x64(%rsp), %rax
addq %rcx, %rax
movl %eax, 0x64(%rsp)
movq 0x48(%rsp), %rdi
callq 0x2100
movl %eax, 0x40(%rsp)
movl 0x40(%rsp), %eax
addl $0x2, %eax
movslq %eax, %rdi
callq 0x2260
movq %rax, 0x50(%rsp)
cmpq $0x0, 0x50(%rsp)
jne 0xf38c
movq $0x0, 0x90(%rsp)
jmp 0xf5a5
movb 0x47(%rsp), %cl
movq 0x50(%rsp), %rax
movb %cl, (%rax)
movq 0x50(%rsp), %rdi
addq $0x1, %rdi
movq 0x48(%rsp), %rsi
callq 0x2070
jmp 0xf3f1
movl $0x2, %edi
callq 0x2260
movq %rax, 0x50(%rsp)
cmpq $0x0, 0x50(%rsp)
jne 0xf3d4
movq $0x0, 0x90(%rsp)
jmp 0xf5a5
movq 0x58(%rsp), %rax
movslq 0x64(%rsp), %rcx
movb (%rax,%rcx), %cl
movq 0x50(%rsp), %rax
movb %cl, (%rax)
movq 0x50(%rsp), %rax
movb $0x0, 0x1(%rax)
movq 0x50(%rsp), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x70(%rsp)
je 0xf411
movq 0x70(%rsp), %rax
movl -0x10(%rax), %eax
movl %eax, 0x34(%rsp)
jmp 0xf419
xorl %eax, %eax
movl %eax, 0x34(%rsp)
jmp 0xf419
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
cmpq $0x0, 0x70(%rsp)
je 0xf43a
movq 0x70(%rsp), %rax
movl -0xc(%rax), %eax
movl %eax, 0x2c(%rsp)
jmp 0xf442
xorl %eax, %eax
movl %eax, 0x2c(%rsp)
jmp 0xf442
movl 0x30(%rsp), %eax
movl 0x2c(%rsp), %ecx
cmpl %ecx, %eax
jle 0xf464
leaq 0x70(%rsp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x8030
jmp 0xf472
movq 0x70(%rsp), %rax
movl -0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, -0x10(%rax)
movq 0x70(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x70(%rsp)
je 0xf492
movq 0x70(%rsp), %rax
movl -0x10(%rax), %eax
movl %eax, 0x1c(%rsp)
jmp 0xf49a
xorl %eax, %eax
movl %eax, 0x1c(%rsp)
jmp 0xf49a
movq 0x20(%rsp), %rax
movq 0x38(%rsp), %rdx
movl 0x1c(%rsp), %ecx
movslq %ecx, %rcx
movq %rdx, -0x8(%rax,%rcx,8)
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0xf266
jmp 0xf4c2
jmp 0xf4c4
jmp 0xf4c6
movl 0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
jmp 0xf175
cmpq $0x0, 0x70(%rsp)
je 0xf4ec
movq 0x70(%rsp), %rax
movl -0x10(%rax), %eax
movl %eax, 0x18(%rsp)
jmp 0xf4f4
xorl %eax, %eax
movl %eax, 0x18(%rsp)
jmp 0xf4f4
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
cmpq $0x0, 0x70(%rsp)
je 0xf515
movq 0x70(%rsp), %rax
movl -0xc(%rax), %eax
movl %eax, 0x10(%rsp)
jmp 0xf51d
xorl %eax, %eax
movl %eax, 0x10(%rsp)
jmp 0xf51d
movl 0x14(%rsp), %eax
movl 0x10(%rsp), %ecx
cmpl %ecx, %eax
jle 0xf53f
leaq 0x70(%rsp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x8030
jmp 0xf54d
movq 0x70(%rsp), %rax
movl -0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, -0x10(%rax)
movq 0x70(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x70(%rsp)
je 0xf56d
movq 0x70(%rsp), %rax
movl -0x10(%rax), %eax
movl %eax, 0x4(%rsp)
jmp 0xf575
xorl %eax, %eax
movl %eax, 0x4(%rsp)
jmp 0xf575
movq 0x8(%rsp), %rax
movl 0x4(%rsp), %ecx
movslq %ecx, %rcx
movq $0x0, -0x8(%rax,%rcx,8)
movl 0x68(%rsp), %ecx
movq 0x88(%rsp), %rax
movl %ecx, (%rax)
movq 0x70(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rax
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)