// File: /workspace/github_cpp_makefile_star2_O1/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, 0x30(%rsp)
movq %rsi, %r15
movq %rdi, %rbp
cmpw $-0x1, 0x2(%rdi)
movq %rdi, (%rsp)
jne 0xe632
movq 0x18(%rbp), %r14
testq %r14, %r14
je 0xe4c4
movl -0x10(%r14), %eax
addl $0x1f, %eax
sarl $0x5, %eax
jmp 0xe4c6
xorl %eax, %eax
movl %eax, 0x40(%rbp)
xorl %ebx, %ebx
testq %r14, %r14
je 0xe4d6
movslq -0x10(%r14), %rax
jmp 0xe4d8
xorl %eax, %eax
cmpq %rax, %rbx
jge 0xe556
leaq (%rbx,%rbx,2), %rax
leaq (%r14,%rax,8), %r12
movq 0x8(%r12), %r13
xorl %ebp, %ebp
testq %r13, %r13
je 0xe4f7
movslq -0x10(%r13), %rax
jmp 0xe4f9
xorl %eax, %eax
cmpq %rax, %rbp
jge 0xe518
movzwl 0x2(%r13,%rbp,4), %esi
movq (%rsp), %rdi
callq 0x115f6
movw %ax, 0x2(%r13,%rbp,4)
incq %rbp
jmp 0xe4ec
movq 0x10(%r12), %r12
xorl %r13d, %r13d
movq (%rsp), %rbp
testq %r12, %r12
je 0xe530
movslq -0x10(%r12), %rax
jmp 0xe532
xorl %eax, %eax
cmpq %rax, %r13
jge 0xe54e
movzwl (%r12,%r13,2), %esi
movq %rbp, %rdi
callq 0x115f6
movw %ax, (%r12,%r13,2)
incq %r13
jmp 0xe524
incq %rbx
jmp 0xe4cb
movzwl (%rbp), %esi
movq %rbp, %rdi
callq 0x115f6
movw %ax, (%rbp)
movzwl %ax, %edx
xorl %ebx, %ebx
movq %rbp, %rdi
xorl %esi, %esi
callq 0xe0ad
movq %rax, 0x10(%rsp)
movq %rbp, %rdi
movq %rax, %rsi
callq 0xe13c
movq %rax, %r12
movq %rax, 0x10(%rsp)
cmpl $0x0, 0x20(%rbp)
je 0xe5dd
movq %rbp, %rdi
movq %r12, %rsi
callq 0xe1ba
movw %ax, 0x2(%rbp)
xorl %ecx, %ecx
testq %r12, %r12
je 0xe5b0
movslq -0x10(%r12), %rdx
jmp 0xe5b2
xorl %edx, %edx
cmpq %rdx, %rcx
jge 0xe5ce
movq 0x18(%rbp), %rdx
movzwl (%r12,%rcx,2), %esi
leaq (%rsi,%rsi,2), %rsi
movb $0x0, 0x2(%rdx,%rsi,8)
incq %rcx
jmp 0xe5a4
cmpw $-0x4, %ax
jg 0xe628
movl $0xfffffffc, %ecx       # imm = 0xFFFFFFFC
subl %eax, %ecx
jmp 0xe624
xorl %eax, %eax
testq %r12, %r12
je 0xe5eb
movslq -0x10(%r12), %rcx
jmp 0xe5ed
xorl %ecx, %ecx
cmpq %rcx, %rax
jge 0xe60f
movq 0x18(%rbp), %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 0xe5df
movw $0xfffe, %cx            # imm = 0xFFFE
testl %ebx, %ebx
jne 0xe624
movq %rbp, %rdi
movq %r12, %rsi
callq 0xe1ba
movl %eax, %ecx
movw %cx, 0x2(%rbp)
leaq 0x10(%rsp), %rdi
callq 0x56c1
movq %rbp, %rcx
movzwl 0x2(%rbp), %ebp
movl $0x1, %eax
cmpw $-0x2, %bp
je 0xea39
movq 0x28(%rcx), %rbx
movl %r15d, %esi
negl %esi
xorl %r8d, %r8d
xorl %edi, %edi
movq %rsi, 0x38(%rsp)
testw %bp, %bp
js 0xea86
movq (%rsp), %rax
movq 0x28(%rax), %rax
leal (%rsi,%r15), %r12d
movzwl %bp, %r13d
movl %r13d, %ecx
shll $0x9, %ecx
addq %rbx, %rcx
movzbl (%r15), %edx
incq %r15
movswl (%rcx,%rdx,2), %ebp
incl %r12d
testl %ebp, %ebp
jns 0xe670
movl $0xfffffffc, %ecx       # imm = 0xFFFFFFFC
testq %rax, %rax
je 0xe69c
subl -0x10(%rax), %ecx
cmpl %ebp, %ecx
jg 0xea48
testq %rax, %rax
je 0xe6ae
movl -0x10(%rax), %ecx
jmp 0xe6b0
xorl %ecx, %ecx
cmpl %ebp, %ecx
jle 0xea67
cmpw $-0x4, %bp
jg 0xe6cc
movl $0xfffffffc, %edi       # imm = 0xFFFFFFFC
subl %ebp, %edi
movl %edi, %ebp
movl %r12d, %r8d
jmp 0xe66c
cmpw $-0x1, %bp
jne 0xe9ca
movq %rbx, 0x20(%rsp)
movl %r8d, 0x18(%rsp)
movl %edi, 0x1c(%rsp)
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movq %rax, 0x8(%rsp)
movq (%rsp), %rbx
movq 0x30(%rbx), %r14
movslq 0x40(%rbx), %rbp
leaq 0x10(%rsp), %rdi
movl $0x2, %esi
movl $0x4, %edx
xorl %ecx, %ecx
callq 0x56fd
leaq 0x8(%rsp), %rdi
movl $0x2, %esi
movl $0x4, %edx
xorl %ecx, %ecx
callq 0x56fd
cmpl $0x0, 0x40(%rbx)
jle 0xe7c8
imulq %r13, %rbp
leaq (%r14,%rbp,4), %rbx
xorl %r14d, %r14d
xorl %ecx, %ecx
movl %ecx, 0x28(%rsp)
xorl %ebp, %ebp
movl (%rbx), %eax
btl %ebp, %eax
jae 0xe7a6
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xe75d
movl -0x10(%rax), %ecx
incl %ecx
jmp 0xe762
movl $0x1, %ecx
testq %rax, %rax
je 0xe76c
movl -0xc(%rax), %edx
jmp 0xe76e
xorl %edx, %edx
cmpl %edx, %ecx
jle 0xe788
leaq 0x10(%rsp), %rdi
movl $0x2, %esi
movl $0x1, %edx
callq 0x57e0
jmp 0xe78b
incl -0x10(%rax)
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xe79b
movslq -0x10(%rax), %rcx
jmp 0xe79d
xorl %ecx, %ecx
leal (%r14,%rbp), %edx
movw %dx, -0x2(%rax,%rcx,2)
incl %ebp
cmpl $0x20, %ebp
jne 0xe745
addq $0x4, %rbx
movl 0x28(%rsp), %ecx
incl %ecx
addl $0x20, %r14d
movq (%rsp), %rax
cmpl 0x40(%rax), %ecx
jl 0xe73f
movq 0x10(%rsp), %rcx
testq %rcx, %rcx
je 0xe7d7
movl -0x10(%rcx), %eax
jmp 0xe7d9
xorl %eax, %eax
movq (%rsp), %rbx
testl %eax, %eax
jle 0xe8c4
movl %eax, %eax
movq %rax, 0x40(%rsp)
xorl %esi, %esi
movq %rcx, 0x48(%rsp)
movq 0x18(%rbx), %rax
movzwl (%rcx,%rsi,2), %ecx
leaq (%rcx,%rcx,2), %rcx
movq 0x8(%rax,%rcx,8), %rdx
testq %rdx, %rdx
movq %rsi, 0x50(%rsp)
je 0xe813
movl -0x10(%rdx), %edx
jmp 0xe815
xorl %edx, %edx
testl %edx, %edx
jle 0xe8a8
leaq (%rax,%rcx,8), %rax
addq $0x8, %rax
movq %rax, 0x28(%rsp)
movl %edx, %ebp
xorl %ebx, %ebx
movq 0x28(%rsp), %rax
movq (%rax), %rax
movswl (%rax,%rbx,4), %ecx
testl %ecx, %ecx
js 0xe853
movzbl -0x1(%r15), %edx
cmpl %edx, %ecx
je 0xe888
cmpw $0xa, %cx
jne 0xe8a0
testb %dl, %dl
je 0xe888
jmp 0xe8a0
cmpw $-0x1, %cx
je 0xe87a
movq (%rsp), %rdx
movq 0x8(%rdx), %rdx
movzbl -0x1(%r15), %esi
movl (%rdx,%rsi,4), %edx
movb $-0x2, %sil
subb %cl, %sil
movzbl %sil, %ecx
btl %ecx, %edx
jb 0xe888
jmp 0xe8a0
movzbl -0x1(%r15), %ecx
testl %ecx, %ecx
je 0xe8a0
cmpl $0xa, %ecx
je 0xe8a0
movq 0x8(%rsp), %rsi
movzwl 0x2(%rax,%rbx,4), %edx
movq (%rsp), %rdi
callq 0xe0ad
movq %rax, 0x8(%rsp)
incq %rbx
cmpq %rbx, %rbp
jne 0xe82e
movq 0x50(%rsp), %rsi
incq %rsi
cmpq 0x40(%rsp), %rsi
movq (%rsp), %rbx
movq 0x48(%rsp), %rcx
jne 0xe7f3
cmpl $0x0, 0x14(%rbx)
je 0xe8d7
cmpb $0xa, -0x1(%r15)
jne 0xe8ec
cmpl $0x0, 0x20(%rbx)
jne 0xe8ec
movq 0x8(%rsp), %rsi
movzwl (%rbx), %edx
movq %rbx, %rdi
callq 0xe0ad
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xe13c
movq %rax, %rsi
movq %rax, 0x8(%rsp)
xorl %eax, %eax
xorl %ecx, %ecx
testq %rsi, %rsi
je 0xe910
movslq -0x10(%rsi), %rdx
jmp 0xe912
xorl %edx, %edx
cmpq %rdx, %rax
jge 0xe935
movq 0x18(%rbx), %rdx
movzwl (%rsi,%rax,2), %edi
leaq (%rdi,%rdi,2), %rdi
movswl (%rdx,%rdi,8), %r8d
addl %r8d, %ecx
movb $0x0, 0x2(%rdx,%rdi,8)
incq %rax
jmp 0xe905
testl %ecx, %ecx
je 0xe95f
cmpl $0x0, 0x20(%rbx)
je 0xe97f
movq %rbx, %rdi
callq 0xe1ba
movl %eax, %ecx
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
movl %ecx, 0x1c(%rsp)
subl %ecx, %eax
movl %r12d, 0x18(%rsp)
movq 0x28(%rbx), %rbx
jmp 0xe988
movw $0xfffd, %ax            # imm = 0xFFFD
cmpb $0x0, -0x1(%r15)
je 0xe983
testq %rsi, %rsi
je 0xe983
cmpl $0x0, -0x10(%rsi)
je 0xe983
movq %rbx, %rdi
callq 0xe1ba
jmp 0xe959
movw $0xfffe, %ax            # imm = 0xFFFE
movq 0x20(%rsp), %rbx
shll $0x9, %r13d
addq %rbx, %r13
movzbl -0x1(%r15), %ecx
movw %ax, (%r13,%rcx,2)
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
subl %eax, %ebp
cmpw $-0x3, %ax
cmovgel %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0x56c1
leaq 0x10(%rsp), %rdi
callq 0x56c1
movq 0x38(%rsp), %rsi
movl 0x1c(%rsp), %edi
movl 0x18(%rsp), %r8d
cmpw $-0x3, %bp
je 0xea04
movzwl %bp, %eax
cmpl $0xfffe, %eax           # imm = 0xFFFE
je 0xea34
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0xe65b
leaq 0x4975(%rip), %rdi      # 0x13361
leaq 0x3b0e(%rip), %rsi      # 0x12501
leaq 0x48ec(%rip), %rcx      # 0x132e6
movl $0x2653, %edx           # imm = 0x2653
callq 0x2140
xorl %eax, %eax
movq (%rsp), %rcx
cmpl $0x0, 0x20(%rcx)
je 0xea39
testw %di, %di
je 0xea39
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0xea22
movl %r8d, (%rax)
movq (%rsp), %rax
movq 0x38(%rax), %rax
movswq %di, %rcx
movswl (%rax,%rcx,2), %eax
jmp 0xea39
movl $0x1, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x48ca(%rip), %rdi      # 0x13319
leaq 0x3aab(%rip), %rsi      # 0x12501
leaq 0x4889(%rip), %rcx      # 0x132e6
movl $0x25f1, %edx           # imm = 0x25F1
callq 0x2140
leaq 0x48d8(%rip), %rdi      # 0x13346
leaq 0x3a8c(%rip), %rsi      # 0x12501
leaq 0x486a(%rip), %rcx      # 0x132e6
movl $0x25f2, %edx           # imm = 0x25F2
callq 0x2140
leaq 0x4842(%rip), %rdi      # 0x132cf
leaq 0x3a6d(%rip), %rsi      # 0x12501
leaq 0x484b(%rip), %rcx      # 0x132e6
movl $0x25e8, %edx           # imm = 0x25E8
callq 0x2140