// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/stb/./stb.h
// Function: stb__reg_parse
static char *stb__reg_parse(stb_matcher *matcher, int start, char *regex, stb_uint16 *end)
{
   int n;
   int last_start = -1;
   stb_uint16 last_end = start;

   while (*regex) {
      switch (*regex) {
         case '(':
            last_start = last_end;
            regex = stb__reg_parse_alt(matcher, last_end, regex+1, &last_end);
            if (regex == NULL || *regex != ')')
               return NULL;
            ++regex;
            break;

         case '|':
         case ')':
            *end = last_end;
            return regex;

         case '?':
            if (last_start < 0) return NULL;
            stb__add_epsilon(matcher, last_start, last_end);
            ++regex;
            break;

         case '*':
            if (last_start < 0) return NULL;
            stb__add_epsilon(matcher, last_start, last_end);

            // fall through

         case '+':
            if (last_start < 0) return NULL;
            stb__add_epsilon(matcher, last_end, last_start);
            // prevent links back to last_end from chaining to last_start
            n = stb__add_node(matcher);
            stb__add_epsilon(matcher, last_end, n);
            last_end = n;
            ++regex;
            break;

         case '{':   // not supported!
            // @TODO: given {n,m}, clone last_start to last_end m times,
            // and include epsilons from start to first m-n blocks
            return NULL; 

         case '\\':
            ++regex;
            if (!*regex) return NULL;

            // fallthrough
         default: // match exactly this character
            n = stb__add_node(matcher);
            stb__add_edge(matcher, last_end, n, *regex);
            last_start = last_end;
            last_end = n;
            ++regex;
            break;

         case '$':
            n = stb__add_node(matcher);
            stb__add_edge(matcher, last_end, n, '\n');
            last_start = last_end;
            last_end = n;
            ++regex;
            break;

         case '.':
            n = stb__add_node(matcher);
            stb__add_edge(matcher, last_end, n, -1);
            last_start = last_end;
            last_end = n;
            ++regex;
            break;

         case '[': {
            stb_uint8 flags[256];
            int invert = 0,z;
            ++regex;
            if (matcher->num_charset == 0) {
               matcher->charset = (stb_uint *) stb_malloc(matcher, sizeof(*matcher->charset) * 256);
               memset(matcher->charset, 0, sizeof(*matcher->charset) * 256);
            }

            memset(flags,0,sizeof(flags));

            // leading ^ is special
            if (*regex == '^')
               ++regex, invert = 1;

            // leading ] is special
            if (*regex == ']') {
               flags[']'] = 1;
               ++regex;
            }
            while (*regex != ']') {
               stb_uint a;
               if (!*regex) return NULL;
               a = *regex++;
               if (regex[0] == '-' && regex[1] != ']') {
                  stb_uint i,b = regex[1];
                  regex += 2;
                  if (b == 0) return NULL;
                  if (a > b) return NULL;
                  for (i=a; i <= b; ++i)
                     flags[i] = 1;
               } else
                  flags[a] = 1;
            }
            ++regex;
            if (invert) {
               int i;
               for (i=0; i < 256; ++i)
                  flags[i] = 1-flags[i];
            }

            // now check if any existing charset matches
            for (z=0; z < matcher->num_charset; ++z) {
               int i, k[2] = { 0, 1 << z};
               for (i=0; i < 256; ++i) {
                  unsigned int f = k[flags[i]];
                  if ((matcher->charset[i] & k[1]) != f)
                     break;
               }
               if (i == 256) break;
            }

            if (z == matcher->num_charset) {
               int i;
               ++matcher->num_charset;
               if (matcher->num_charset > 32) {
                  assert(0); /* NOTREACHED */
                  return NULL; // too many charsets, oops
               }
               for (i=0; i < 256; ++i)
                  if (flags[i])
                     matcher->charset[i] |= (1 << z);
            }

            n = stb__add_node(matcher);
            stb__add_edge(matcher, last_end, n, -2 - z);
            last_start = last_end;
            last_end = n;
            break;
         }
      }
   }
   *end = last_end;
   return regex;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rcx, 0x10(%rsp)
movq %rdx, %rbx
movq %rdi, %r15
leaq 0xe(%rsp), %rax
movw %si, (%rax)
pushq $-0x1
popq %rbp
leaq 0xf0d(%rip), %r14       # 0x10224
movzwl 0xe(%rsp), %r12d
incq %rbx
movzbl -0x1(%rbx), %eax
leal -0x24(%rax), %ecx
cmpl $0xa, %ecx
ja 0xf350
movslq (%r14,%rcx,4), %rax
addq %r14, %rax
jmpq *%rax
testl %ebp, %ebp
js 0xf5ff
movzwl %r12w, %r13d
movq %r15, %rdi
movl %ebp, %esi
movl %r13d, %edx
callq 0xf253
jmp 0xf379
cmpl $0x3f, %eax
jne 0xf3a9
testl %ebp, %ebp
js 0xf5ff
movzwl %r12w, %edx
movq %r15, %rdi
movl %ebp, %esi
callq 0xf253
jmp 0xf31d
testl %ebp, %ebp
js 0xf5ff
movzwl %r12w, %r13d
movq %r15, %rdi
movl %r13d, %esi
movl %ebp, %edx
callq 0xf253
movq %r15, %rdi
callq 0xf1db
movl %eax, %r12d
movq %r15, %rdi
movl %r13d, %esi
movl %eax, %edx
callq 0xf253
movw %r12w, 0xe(%rsp)
jmp 0xf31d
testl %eax, %eax
je 0xf603
cmpl $0x5b, %eax
je 0xf453
cmpl $0x5c, %eax
je 0xf4f2
cmpl $0x7b, %eax
je 0xf5ff
cmpl $0x7c, %eax
je 0xf603
decq %rbx
jmp 0xf4fb
movq %r15, %rdi
callq 0xf1db
movl %eax, %r12d
movzwl 0xe(%rsp), %ebp
movq %r15, %rdi
movl %ebp, %esi
movl %eax, %edx
pushq $-0x1
jmp 0xf411
movq %r15, %rdi
callq 0xf1db
movl %eax, %r12d
movzwl 0xe(%rsp), %ebp
movq %r15, %rdi
movl %ebp, %esi
movl %eax, %edx
pushq $0xa
popq %rcx
callq 0xf647
movw %r12w, 0xe(%rsp)
jmp 0xf317
movzwl 0xe(%rsp), %ebp
movq %r15, %rdi
movl %ebp, %esi
movq %rbx, %rdx
leaq 0xe(%rsp), %rcx
callq 0xc0c7
testq %rax, %rax
je 0xf5ff
movq %rax, %rbx
cmpb $0x29, (%rax)
je 0xf520
jmp 0xf5ff
cmpl $0x0, 0x10(%r15)
jne 0xf47a
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdi
callq 0x4dcf
movq %rax, 0x8(%r15)
movl $0x400, %edx            # imm = 0x400
movq %rax, %rdi
xorl %esi, %esi
callq 0x2160
movl $0x100, %edx            # imm = 0x100
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x2160
movb (%rbx), %al
leaq 0x1(%rbx), %rcx
cmpb $0x5e, %al
cmovneq %rbx, %rcx
cmpb $0x5d, (%rcx)
jne 0xf4a4
movb $0x1, 0x7d(%rsp)
incq %rcx
movq %rcx, %rbx
movzbl (%rbx), %esi
testl %esi, %esi
je 0xf5ff
cmpl $0x5d, %esi
je 0xf528
movsbl %sil, %ecx
cmpb $0x2d, 0x1(%rbx)
jne 0xf4ca
movsbl 0x2(%rbx), %edx
cmpl $0x5d, %edx
jne 0xf4d6
incq %rbx
movl %ecx, %ecx
movb $0x1, 0x20(%rsp,%rcx)
jmp 0xf4a7
cmpb %dl, %sil
ja 0xf5ff
addq $0x3, %rbx
cmpl %edx, %ecx
ja 0xf4a7
movl %ecx, %esi
movb $0x1, 0x20(%rsp,%rsi)
incl %ecx
jmp 0xf4e3
cmpb $0x0, (%rbx)
je 0xf5ff
movq %r15, %rdi
callq 0xf1db
movl %eax, %r12d
movzwl 0xe(%rsp), %ebp
movsbl (%rbx), %ecx
movq %r15, %rdi
movl %ebp, %esi
movl %eax, %edx
callq 0xf647
movw %r12w, 0xe(%rsp)
incq %rbx
jmp 0xf317
cmpb $0x5e, %al
jne 0xf545
xorl %eax, %eax
cmpq $0x100, %rax            # imm = 0x100
je 0xf545
movb $0x1, %cl
subb 0x20(%rsp,%rax), %cl
movb %cl, 0x20(%rsp,%rax)
incq %rax
jmp 0xf52e
incq %rbx
movl 0x10(%r15), %eax
xorl %r12d, %r12d
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
cmpl %edx, %r12d
je 0xf59a
andl $0x0, 0x18(%rsp)
pushq $0x1
popq %rsi
movl %r12d, %ecx
shll %cl, %esi
movl %esi, 0x1c(%rsp)
movq 0x8(%r15), %rcx
xorl %edi, %edi
cmpq $0x100, %rdi            # imm = 0x100
je 0xf59d
movzbl 0x20(%rsp,%rdi), %r8d
movl (%rcx,%rdi,4), %r9d
andl %esi, %r9d
incq %rdi
cmpl 0x18(%rsp,%r8,4), %r9d
je 0xf575
incl %r12d
jmp 0xf559
movl %edx, %r12d
cmpl %eax, %r12d
jne 0xf5d2
leal 0x1(%rax), %ecx
movl %ecx, 0x10(%r15)
cmpl $0x1f, %eax
jg 0xf628
pushq $0x1
popq %rdx
movl %eax, %ecx
shll %cl, %edx
xorl %eax, %eax
cmpq $0x100, %rax            # imm = 0x100
je 0xf5d2
cmpb $0x0, 0x20(%rsp,%rax)
je 0xf5cd
movq 0x8(%r15), %rcx
orl %edx, (%rcx,%rax,4)
incq %rax
jmp 0xf5b7
movq %r15, %rdi
callq 0xf1db
movl %eax, %r13d
movzwl 0xe(%rsp), %ebp
pushq $-0x2
popq %rcx
subl %r12d, %ecx
movq %r15, %rdi
movl %ebp, %esi
movl %eax, %edx
callq 0xf647
movw %r13w, 0xe(%rsp)
jmp 0xf317
xorl %ebx, %ebx
jmp 0xf613
movzwl 0xe(%rsp), %eax
movq 0x10(%rsp), %rcx
movw %ax, (%rcx)
decq %rbx
movq %rbx, %rax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1117(%rip), %rdi      # 0x10746
leaq 0xdeb(%rip), %rsi       # 0x10421
leaq 0x1b69(%rip), %rcx      # 0x111a6
movl $0x242d, %edx           # imm = 0x242D
callq 0x2140