// File: /workspace/github_cpp_makefile_star2_O3/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, %r13
movq %rdi, %r14
leaq 0xe(%rsp), %rax
movw %si, (%rax)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
leaq 0x144f(%rip), %rbx      # 0x122b4
movzwl 0xe(%rsp), %r12d
incq %r13
movzbl -0x1(%r13), %eax
cmpl $0x3e, %eax
jg 0x10ea8
leal -0x24(%rax), %ecx
cmpl $0xa, %ecx
ja 0x10f3d
movslq (%rbx,%rcx,4), %rax
addq %rbx, %rax
jmpq *%rax
testl %ebp, %ebp
js 0x111a1
movzwl %r12w, %r15d
movq %r14, %rdi
movl %ebp, %esi
movl %r15d, %edx
callq 0x10d6a
jmp 0x10eda
cmpl $0x5a, %eax
jg 0x10f0a
cmpl $0x3f, %eax
jne 0x10f45
testl %ebp, %ebp
js 0x111a1
movzwl %r12w, %edx
movq %r14, %rdi
movl %ebp, %esi
callq 0x10d6a
jmp 0x10e6b
testl %ebp, %ebp
js 0x111a1
movzwl %r12w, %r15d
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x10d6a
movq %r14, %rdi
callq 0x10ceb
movl %eax, %r12d
movq %r14, %rdi
movl %r15d, %esi
movl %eax, %edx
callq 0x10d6a
movw %r12w, 0xe(%rsp)
jmp 0x10e6b
cmpl $0x7a, %eax
jg 0x10f29
cmpl $0x5b, %eax
je 0x10fef
cmpl $0x5c, %eax
jne 0x10f45
cmpb $0x0, (%r13)
jne 0x10f48
jmp 0x111a1
cmpl $0x7b, %eax
je 0x111a1
cmpl $0x7c, %eax
je 0x111a6
jmp 0x10f45
testl %eax, %eax
je 0x111a6
decq %r13
movq %r14, %rdi
callq 0x10ceb
movl %eax, %r15d
movzwl 0xe(%rsp), %ebp
movsbl (%r13), %ecx
movq %r14, %rdi
movl %ebp, %esi
movl %eax, %edx
callq 0x111ea
movw %r15w, 0xe(%rsp)
jmp 0x10f9d
movzwl 0xe(%rsp), %ebp
movq %r14, %rdi
movl %ebp, %esi
movq %r13, %rdx
leaq 0xe(%rsp), %rcx
callq 0xd778
testq %rax, %rax
je 0x111a1
movq %rax, %r13
cmpb $0x29, (%rax)
jne 0x111a1
incq %r13
jmp 0x10e65
movq %r14, %rdi
callq 0x10ceb
movl %eax, %r15d
movzwl 0xe(%rsp), %ebp
movq %r14, %rdi
movl %ebp, %esi
movl %eax, %edx
movl $0xa, %ecx
jmp 0x10fdf
movq %r14, %rdi
callq 0x10ceb
movl %eax, %r15d
movzwl 0xe(%rsp), %ebp
movq %r14, %rdi
movl %ebp, %esi
movl %eax, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x111ea
movw %r15w, 0xe(%rsp)
jmp 0x10e65
cmpl $0x0, 0x10(%r14)
jne 0x11021
movl 0x9228(%rip), %ecx      # 0x1a224
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdi
movl $0x2, %edx
callq 0x508a
movq %rax, 0x8(%r14)
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 (%r13), %al
leaq 0x1(%r13), %r12
cmpb $0x5e, %al
cmovneq %r13, %r12
movb (%r12), %cl
cmpb $0x5d, %cl
jne 0x11065
movb $0x1, 0x7d(%rsp)
movb 0x1(%r12), %cl
incq %r12
cmpb $0x5d, %cl
movdqa 0x111f(%rip), %xmm1     # 0x12180
jne 0x1106d
jmp 0x110ba
movdqa 0x1113(%rip), %xmm1     # 0x12180
testb %cl, %cl
je 0x111a1
movsbl %cl, %edx
cmpb $0x2d, 0x1(%r12)
jne 0x1108b
movsbl 0x2(%r12), %esi
cmpl $0x5d, %esi
jne 0x11097
incq %r12
movl %edx, %ecx
movb $0x1, 0x20(%rsp,%rcx)
jmp 0x110b1
cmpb %sil, %cl
ja 0x111a1
addq $0x3, %r12
movl %edx, %ecx
movb $0x1, 0x20(%rsp,%rcx)
incl %edx
cmpl %esi, %edx
jbe 0x110a4
movb (%r12), %cl
cmpb $0x5d, %cl
jne 0x1106d
cmpb $0x5e, %al
jne 0x110dc
xorl %eax, %eax
movdqa %xmm1, %xmm0
psubb 0x20(%rsp,%rax), %xmm0
movdqa %xmm0, 0x20(%rsp,%rax)
addq $0x10, %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x110c0
movl 0x10(%r14), %edx
testl %edx, %edx
jle 0x1112d
movq 0x8(%r14), %rsi
xorl %eax, %eax
movl $0x1, %edi
movl %eax, %ecx
shll %cl, %edi
movl $0x0, 0x18(%rsp)
movl %edi, 0x1c(%rsp)
xorl %ecx, %ecx
movzbl 0x20(%rsp,%rcx), %r8d
movl (%rsi,%rcx,4), %r9d
andl %edi, %r9d
cmpl 0x18(%rsp,%r8,4), %r9d
jne 0x11123
incq %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0x11101
jmp 0x1112f
incl %eax
cmpl %edx, %eax
jne 0x110ea
movl %edx, %eax
jmp 0x11133
xorl %eax, %eax
cmpl %edx, %eax
jne 0x11168
leal 0x1(%rdx), %ecx
movl %ecx, 0x10(%r14)
cmpl $0x1f, %edx
jg 0x111cb
movl $0x1, %esi
movl %edx, %ecx
shll %cl, %esi
xorl %ecx, %ecx
cmpb $0x0, 0x20(%rsp,%rcx)
je 0x1115c
movq 0x8(%r14), %rdx
orl %esi, (%rdx,%rcx,4)
incq %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0x1114e
movl $0xfffffffe, %r15d      # imm = 0xFFFFFFFE
subl %eax, %r15d
incq %r12
movq %r14, %rdi
callq 0x10ceb
movl %eax, %r13d
movzwl 0xe(%rsp), %ebp
movq %r14, %rdi
movl %ebp, %esi
movl %eax, %edx
movl %r15d, %ecx
callq 0x111ea
movw %r13w, 0xe(%rsp)
movq %r12, %r13
jmp 0x10e65
xorl %r13d, %r13d
jmp 0x111b6
movzwl 0xe(%rsp), %eax
movq 0x10(%rsp), %rcx
movw %ax, (%rcx)
decq %r13
movq %r13, %rax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1604(%rip), %rdi      # 0x127d6
leaq 0x12d8(%rip), %rsi      # 0x124b1
leaq 0x2056(%rip), %rcx      # 0x13236
movl $0x242d, %edx           # imm = 0x242D
callq 0x2140