// File: /workspace/github_cpp_makefile_star2_O3/attractivechaos[P]udb2/stb/./stb.h
// Function: stb__matcher_dfa
static int stb__matcher_dfa(stb_matcher *m, char *str_c, int *len)
{
   stb_uint8 *str = (stb_uint8 *) str_c;
   stb_int16 node,prevnode;
   stb_dfa *trans;
   int match_length = 0;
   stb_int16 match_result=0;

   if (m->dfa_start == STB__DFA_UNDEF) {
      stb_uint16 *list;

      m->num_words_per_dfa = (stb_arr_len(m->nodes)+31) >> 5;
      stb__optimize(m);

      list = stb__add_if_inactive(m, NULL, m->start_node);
      list = stb__eps_closure(m,list);
      if (m->does_lex) {
         m->dfa_start = stb__get_dfa_node(m,list);
         stb__clear(m, list);
         // DON'T allow start state to be a goal state!
         // this allows people to specify regexes that can match 0
         // characters without them actually matching (also we don't
         // check _before_ advancing anyway
         if (m->dfa_start <= STB__DFA_MGOAL)
            m->dfa_start = -(m->dfa_start - STB__DFA_MGOAL);
      } else {
         if (stb__clear_goalcheck(m, list))
            m->dfa_start = STB__DFA_GOAL;
         else
            m->dfa_start = stb__get_dfa_node(m,list);
      }
      stb_arr_free(list);
   }

   prevnode = STB__DFA_UNDEF;
   node = m->dfa_start;
   trans = m->dfa;

   if (m->dfa_start == STB__DFA_GOAL)
      return 1;

   for(;;) {
      assert(node >= STB__DFA_VALID);

      // fast inner DFA loop; especially if STB__DFA_VALID is 0

      do {
         prevnode = node;
         node = trans[node].transition[*str++];
      } while (node >= STB__DFA_VALID);

      assert(node >= STB__DFA_MGOAL - stb_arr_len(m->dfa));
      assert(node < stb_arr_len(m->dfa));

      // special case for lex: need _longest_ match, so notice goal
      // state without stopping
      if (node <= STB__DFA_MGOAL) {
         match_length = str - (stb_uint8 *) str_c;
         node = -(node - STB__DFA_MGOAL);
         match_result = node;
         continue;
      }

      // slow NFA->DFA conversion

      // or we hit the goal or the end of the string, but those
      // can only happen once per search...

      if (node == STB__DFA_UNDEF) {
         // build a list  -- @TODO special case <= 32 states
         // heck, use a more compact data structure for <= 16 and <= 8 ?!

         // @TODO keep states/newstates around instead of reallocating them
         stb_uint16 *states = NULL;
         stb_uint16 *newstates = NULL;
         int i,j,y,z;
         stb_uint32 *flags = &m->dfa_mapping[prevnode * m->num_words_per_dfa];
         assert(prevnode != STB__DFA_UNDEF);
         stb_arr_setsize(states, 4);
         stb_arr_setsize(newstates,4);
         for (j=0; j < m->num_words_per_dfa; ++j) {
            for (i=0; i < 32; ++i) {
               if (*flags & (1 << i))
                  stb_arr_push(states, j*32+i);
            }
            ++flags;
         }
         // states is now the states we were in in the previous node;
         // so now we can compute what node it transitions to on str[-1]

         y = stb_arr_len(states);
         for (i=0; i < y; ++i) {
            stb_nfa_node *n = &m->nodes[(int) states[i]];
            z = stb_arr_len(n->out);
            for (j=0; j < z; ++j) {
               if (n->out[j].match >= 0) {
                  if (n->out[j].match == str[-1] || (str[-1] == 0 && n->out[j].match == '\n'))
                     newstates = stb__add_if_inactive(m, newstates, n->out[j].node);
               } else if (n->out[j].match == -1) {
                  if (str[-1] != '\n' && str[-1])
                     newstates = stb__add_if_inactive(m, newstates, n->out[j].node);
               } else if (n->out[j].match < -1) {
                  int z = -n->out[j].match - 2;
                  if (m->charset[str[-1]] & (1 << z))
                     newstates = stb__add_if_inactive(m, newstates, n->out[j].node);
               }
            }
         }
         // AND add in the start state!
         if (!m->match_start || (str[-1] == '\n' && !m->does_lex))
            newstates = stb__add_if_inactive(m, newstates, m->start_node);
         // AND epsilon close it
         newstates = stb__eps_closure(m, newstates);
         // if it's a goal state, then that's all there is to it
         if (stb__clear_goalcheck(m, newstates)) {
            if (m->does_lex) {
               match_length = str - (stb_uint8 *) str_c;
               node = stb__get_dfa_node(m,newstates);
               match_result = node;
               node = -node + STB__DFA_MGOAL;
               trans = m->dfa; // could have gotten realloc()ed
            } else
               node = STB__DFA_GOAL;
         } else if (str[-1] == 0 || stb_arr_len(newstates) == 0) {
            node = STB__DFA_END;
         } else {
            node = stb__get_dfa_node(m,newstates);
            trans = m->dfa; // could have gotten realloc()ed
         }
         trans[prevnode].transition[str[-1]] = node;
         if (node <= STB__DFA_MGOAL)
            node = -(node - STB__DFA_MGOAL);
         stb_arr_free(newstates);
         stb_arr_free(states);
      }

      if (node == STB__DFA_GOAL) {
         return 1;
      }
      if (node == STB__DFA_END) {
         if (m->does_lex) {
            if (match_result) {
               if (len) *len = match_length;
               return m->dfa_result[(int) match_result];
            }
         }
         return 0;
      }

      assert(node != STB__DFA_UNDEF);
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, 0x40(%rsp)
movq %rsi, %r15
movq %rdi, %r14
movzwl 0x2(%rdi), %ebp
cmpw $-0x1, %bp
movq %rdi, 0x8(%rsp)
jne 0xe34b
movq 0x18(%r14), %rbx
testq %rbx, %rbx
je 0xe1d2
movl -0x10(%rbx), %eax
addl $0x1f, %eax
sarl $0x5, %eax
jmp 0xe1d4
xorl %eax, %eax
movl %eax, 0x40(%r14)
xorl %r14d, %r14d
testq %rbx, %rbx
je 0xe1e6
movslq -0x10(%rbx), %rax
jmp 0xe1e8
xorl %eax, %eax
cmpq %rax, %r14
jge 0xe265
leaq (%r14,%r14,2), %rax
leaq (%rbx,%rax,8), %r12
movq 0x8(%r12), %r13
xorl %ebp, %ebp
testq %r13, %r13
je 0xe207
movslq -0x10(%r13), %rax
jmp 0xe209
xorl %eax, %eax
cmpq %rax, %rbp
jge 0xe229
movzwl 0x2(%r13,%rbp,4), %esi
movq 0x8(%rsp), %rdi
callq 0x11291
movw %ax, 0x2(%r13,%rbp,4)
incq %rbp
jmp 0xe1fc
movq 0x10(%r12), %r12
xorl %r13d, %r13d
testq %r12, %r12
je 0xe23d
movslq -0x10(%r12), %rax
jmp 0xe23f
xorl %eax, %eax
cmpq %rax, %r13
jge 0xe25d
movzwl (%r12,%r13,2), %esi
movq 0x8(%rsp), %rdi
callq 0x11291
movw %ax, (%r12,%r13,2)
incq %r13
jmp 0xe231
incq %r14
jmp 0xe1db
movq 0x8(%rsp), %r14
movzwl (%r14), %esi
movq %r14, %rdi
callq 0x11291
movw %ax, (%r14)
movzwl %ax, %edx
xorl %ebx, %ebx
movq %r14, %rdi
xorl %esi, %esi
callq 0xde14
movq %r14, %rdi
movq %rax, %rsi
callq 0xde85
movq %r14, %rdi
movq %rax, %r12
movq %rax, 0x10(%rsp)
cmpl $0x0, 0x20(%r14)
je 0xe2f1
movq %r12, %rsi
callq 0xdf04
movq %r14, %rdi
movw %ax, 0x2(%r14)
xorl %ecx, %ecx
testq %r12, %r12
je 0xe2c4
movslq -0x10(%r12), %rdx
jmp 0xe2c6
xorl %edx, %edx
cmpq %rdx, %rcx
jge 0xe2e2
movq 0x18(%rdi), %rdx
movzwl (%r12,%rcx,2), %esi
leaq (%rsi,%rsi,2), %rsi
movb $0x0, 0x2(%rdx,%rsi,8)
incq %rcx
jmp 0xe2b8
cmpw $-0x4, %ax
jg 0xe33c
movl $0xfffffffc, %ecx       # imm = 0xFFFFFFFC
subl %eax, %ecx
jmp 0xe338
xorl %eax, %eax
testq %r12, %r12
je 0xe2ff
movslq -0x10(%r12), %rcx
jmp 0xe301
xorl %ecx, %ecx
cmpq %rcx, %rax
jge 0xe323
movq 0x18(%rdi), %rcx
movzwl (%r12,%rax,2), %edx
leaq (%rdx,%rdx,2), %rdx
movswl (%rcx,%rdx,8), %esi
addl %esi, %ebx
movb $0x0, 0x2(%rcx,%rdx,8)
incq %rax
jmp 0xe2f3
movw $0xfffe, %cx            # imm = 0xFFFE
testl %ebx, %ebx
jne 0xe338
movq %r12, %rsi
callq 0xdf04
movq %r14, %rdi
movl %eax, %ecx
movw %cx, 0x2(%rdi)
leaq 0x10(%rsp), %rdi
callq 0x55ba
movzwl 0x2(%r14), %ebp
movl $0x1, %eax
cmpw $-0x2, %bp
je 0xe75c
movq 0x28(%r14), %r9
movl %r15d, %esi
negl %esi
xorl %r8d, %r8d
xorl %edi, %edi
movq %rsi, 0x48(%rsp)
testw %bp, %bp
js 0xe7a9
movq 0x28(%r14), %rax
leal (%rsi,%r15), %ebx
movzwl %bp, %r12d
movl %r12d, %r13d
shll $0x9, %r13d
addq %r9, %r13
movzbl (%r15), %ecx
incq %r15
movswl (%r13,%rcx,2), %ebp
incl %ebx
testl %ebp, %ebp
jns 0xe37e
testq %rax, %rax
je 0xe3b7
movl -0x10(%rax), %ecx
movl $0xfffffffc, %edx       # imm = 0xFFFFFFFC
subl %ecx, %edx
cmpl %ebp, %edx
jle 0xe3c3
jmp 0xe76b
xorl %ecx, %ecx
cmpw $-0x4, %bp
jb 0xe76b
cmpl %ebp, %ecx
jle 0xe78a
cmpw $-0x4, %bp
ja 0xe3df
movl $0xfffffffc, %edi       # imm = 0xFFFFFFFC
subl %ebp, %edi
movl %edi, %ebp
movl %ebx, %r8d
jmp 0xe37a
movq %r9, 0x30(%rsp)
cmpw $-0x1, %bp
jne 0xe6ef
movl %r8d, 0x20(%rsp)
movl %edi, 0x24(%rsp)
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movq %rax, (%rsp)
movq 0x30(%r14), %rax
movq %rax, 0x18(%rsp)
movslq 0x40(%r14), %rbp
leaq 0x10(%rsp), %rdi
movl $0x2, %esi
movl $0x4, %edx
xorl %ecx, %ecx
callq 0x55f6
movq %rsp, %rdi
movl $0x2, %esi
movl $0x4, %edx
xorl %ecx, %ecx
callq 0x55f6
cmpl $0x0, 0x40(%r14)
jle 0xe4d9
imulq %r12, %rbp
movq 0x18(%rsp), %rax
leaq (%rax,%rbp,4), %rbp
movq $0x0, 0x18(%rsp)
xorl %ecx, %ecx
movl %ecx, 0x28(%rsp)
xorl %r14d, %r14d
movl (%rbp), %eax
btl %r14d, %eax
jae 0xe4af
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xe485
movl -0x10(%rax), %ecx
cmpl -0xc(%rax), %ecx
jge 0xe485
incl %ecx
movl %ecx, -0x10(%rax)
jmp 0xe49e
leaq 0x10(%rsp), %rdi
movl $0x2, %esi
movl $0x1, %edx
callq 0x56ce
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
addl %r14d, %ecx
movslq -0x10(%rax), %rdx
movw %cx, -0x2(%rax,%rdx,2)
incl %r14d
cmpl $0x20, %r14d
jne 0xe463
addq $0x4, %rbp
movl 0x28(%rsp), %ecx
incl %ecx
movq 0x18(%rsp), %rax
addl $0x20, %eax
movq %rax, 0x18(%rsp)
movq 0x8(%rsp), %rax
cmpl 0x40(%rax), %ecx
jl 0xe45c
movq 0x10(%rsp), %rax
movq %rax, 0x38(%rsp)
testq %rax, %rax
movq 0x8(%rsp), %rdi
je 0xe5d5
movq 0x38(%rsp), %rax
movslq -0x10(%rax), %rax
movq %rax, 0x50(%rsp)
testq %rax, %rax
jle 0xe5d5
xorl %edx, %edx
movq 0x18(%rdi), %rax
movq 0x38(%rsp), %rcx
movq %rdx, 0x28(%rsp)
movzwl (%rcx,%rdx,2), %ecx
leaq (%rcx,%rcx,2), %rcx
movq 0x8(%rax,%rcx,8), %rdx
testq %rdx, %rdx
je 0xe5c2
movslq -0x10(%rdx), %rdx
testq %rdx, %rdx
jle 0xe5c2
movq %rdx, %r14
leaq (%rax,%rcx,8), %rax
addq $0x8, %rax
movq %rax, 0x18(%rsp)
xorl %ebp, %ebp
movq 0x18(%rsp), %rax
movq (%rax), %rax
movswl (%rax,%rbp,4), %ecx
testl %ecx, %ecx
js 0xe572
movzbl -0x1(%r15), %edx
cmpl %edx, %ecx
je 0xe5a3
cmpw $0xa, %cx
jne 0xe5ba
testb %dl, %dl
je 0xe5a3
jmp 0xe5ba
cmpw $-0x1, %cx
je 0xe595
movq 0x8(%rdi), %rdx
movzbl -0x1(%r15), %esi
movl (%rdx,%rsi,4), %edx
movb $-0x2, %sil
subb %cl, %sil
movzbl %sil, %ecx
btl %ecx, %edx
jb 0xe5a3
jmp 0xe5ba
movzbl -0x1(%r15), %ecx
testl %ecx, %ecx
je 0xe5ba
cmpl $0xa, %ecx
je 0xe5ba
movq (%rsp), %rsi
movzwl 0x2(%rax,%rbp,4), %edx
callq 0xde14
movq 0x8(%rsp), %rdi
movq %rax, (%rsp)
incq %rbp
cmpq %rbp, %r14
jne 0xe54d
movq 0x28(%rsp), %rdx
incq %rdx
cmpq 0x50(%rsp), %rdx
jne 0xe50a
cmpl $0x0, 0x14(%rdi)
je 0xe5e8
cmpb $0xa, -0x1(%r15)
jne 0xe5fd
cmpl $0x0, 0x20(%rdi)
jne 0xe5fd
movq (%rsp), %rsi
movzwl (%rdi), %edx
callq 0xde14
movq 0x8(%rsp), %rdi
movq %rax, (%rsp)
movq (%rsp), %rsi
callq 0xde85
movq 0x8(%rsp), %rdi
movq %rax, (%rsp)
xorl %ecx, %ecx
xorl %edx, %edx
testq %rax, %rax
je 0xe61e
movslq -0x10(%rax), %rsi
jmp 0xe620
xorl %esi, %esi
cmpq %rsi, %rcx
jge 0xe645
movq 0x18(%rdi), %rsi
movzwl (%rax,%rcx,2), %r8d
leaq (%r8,%r8,2), %r9
movswl (%rsi,%r9,8), %r8d
addl %r8d, %edx
movb $0x0, 0x2(%rsi,%r9,8)
incq %rcx
jmp 0xe613
testl %edx, %edx
je 0xe66d
cmpl $0x0, 0x20(%rdi)
je 0xe6b9
movq %rax, %rsi
movq %rdi, %r14
callq 0xdf04
movl %eax, %ecx
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
movl %ecx, 0x24(%rsp)
subl %ecx, %eax
movl %ebx, 0x20(%rsp)
jmp 0xe68f
movb -0x1(%r15), %cl
movw $0xfffd, %bp            # imm = 0xFFFD
testq %rax, %rax
je 0xe6c1
testb %cl, %cl
je 0xe6c1
cmpl $0x0, -0x10(%rax)
je 0xe6c1
movq %rax, %rsi
movq %rdi, %r14
callq 0xdf04
movq 0x28(%r14), %rcx
shll $0x9, %r12d
movq %rcx, 0x30(%rsp)
addq %rcx, %r12
movzbl -0x1(%r15), %ecx
movw %ax, (%r12,%rcx,2)
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
subl %eax, %ebp
cmpw $-0x3, %ax
cmovgel %eax, %ebp
jmp 0xe6ca
movb -0x1(%r15), %cl
movw $0xfffe, %bp            # imm = 0xFFFE
movzbl %cl, %eax
movw %bp, (%r13,%rax,2)
movq %rsp, %rdi
callq 0x55ba
leaq 0x10(%rsp), %rdi
callq 0x55ba
movq 0x48(%rsp), %rsi
movl 0x24(%rsp), %edi
movl 0x20(%rsp), %r8d
movq 0x8(%rsp), %r14
cmpw $-0x3, %bp
je 0xe72e
movzwl %bp, %eax
cmpl $0xfffe, %eax           # imm = 0xFFFE
je 0xe757
cmpl $0xffff, %eax           # imm = 0xFFFF
movq 0x30(%rsp), %r9
jne 0xe36d
leaq 0x4bf1(%rip), %rdi      # 0x13307
leaq 0x3d94(%rip), %rsi      # 0x124b1
leaq 0x4b68(%rip), %rcx      # 0x1328c
movl $0x2653, %edx           # imm = 0x2653
callq 0x2140
xorl %eax, %eax
cmpl $0x0, 0x20(%r14)
je 0xe75c
testw %di, %di
je 0xe75c
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0xe749
movl %r8d, (%rax)
movq 0x38(%r14), %rax
movswq %di, %rcx
movswl (%rax,%rcx,2), %eax
jmp 0xe75c
movl $0x1, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4b4d(%rip), %rdi      # 0x132bf
leaq 0x3d38(%rip), %rsi      # 0x124b1
leaq 0x4b0c(%rip), %rcx      # 0x1328c
movl $0x25f1, %edx           # imm = 0x25F1
callq 0x2140
leaq 0x4b5b(%rip), %rdi      # 0x132ec
leaq 0x3d19(%rip), %rsi      # 0x124b1
leaq 0x4aed(%rip), %rcx      # 0x1328c
movl $0x25f2, %edx           # imm = 0x25F2
callq 0x2140
leaq 0x4ac5(%rip), %rdi      # 0x13275
leaq 0x3cfa(%rip), %rsi      # 0x124b1
leaq 0x4ace(%rip), %rcx      # 0x1328c
movl $0x25e8, %edx           # imm = 0x25E8
callq 0x2140