// File: /workspace/github_cpp_makefile_star2_O3/attractivechaos[P]udb2/stb/./stb.h
// Function: stb_matcher_match
int stb_matcher_match(stb_matcher *m, char *str)
{
   int result = 0;
   int i,j,y,z;
   stb_uint16 *previous = NULL;
   stb_uint16 *current = NULL;
   stb_uint16 *temp;

   stb_arr_setsize(previous, 4);
   stb_arr_setsize(current, 4);

   previous = stb__add_if_inactive(m, previous, m->start_node);
   previous = stb__eps_closure(m,previous);
   stb__clear(m, previous);

   while (*str && stb_arr_len(previous)) {
      y = stb_arr_len(previous);
      for (i=0; i < y; ++i) {
         stb_nfa_node *n = &m->nodes[(int) previous[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)
                  current = stb__add_if_inactive(m, current, n->out[j].node);
            } else if (n->out[j].match == -1) {
               if (*str != '\n')
                  current = stb__add_if_inactive(m, current, n->out[j].node);
            } else if (n->out[j].match < -1) {
               int z = -n->out[j].match - 2;
               if (m->charset[(stb_uint8) *str] & (1 << z))
                  current = stb__add_if_inactive(m, current, n->out[j].node);
            }
         }
      }
      stb_arr_setlen(previous, 0);

      temp = previous;
      previous = current;
      current = temp;

      previous = stb__eps_closure(m,previous);
      stb__clear(m, previous);

      ++str;
   }

   // transition to pick up a '$' at the end
   y = stb_arr_len(previous);
   for (i=0; i < y; ++i)
      m->nodes[(int) previous[i]].active = 1;

   for (i=0; i < y; ++i) {
      stb_nfa_node *n = &m->nodes[(int) previous[i]];
      z = stb_arr_len(n->out);
      for (j=0; j < z; ++j) {
         if (n->out[j].match == '\n')
            current = stb__add_if_inactive(m, current, n->out[j].node);
      }
   }

   previous = stb__eps_closure(m,previous);
   stb__clear(m, previous);

   y = stb_arr_len(previous);
   for (i=0; i < y; ++i)
      if (m->nodes[(int) previous[i]].goal)
         result = 1;

   stb_arr_free(previous);
   stb_arr_free(current);

   return result && *str == 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorl %r13d, %r13d
movq %rsp, %r12
movq %r13, (%r12)
leaq 0x10(%rsp), %r15
movq %r13, (%r15)
movq %r12, %rdi
movl $0x2, %esi
movl $0x4, %edx
xorl %ecx, %ecx
callq 0x55f6
movq %r15, %rdi
movl $0x2, %esi
movl $0x4, %edx
xorl %ecx, %ecx
callq 0x55f6
movq (%r12), %rsi
movzwl (%r14), %edx
movq %r14, %rdi
callq 0xde14
movq %r14, %rdi
movq %rax, %rsi
callq 0xde85
movq %rbx, %rdi
movq %rax, (%r12)
testq %rax, %rax
je 0xdb26
movslq -0x10(%rax), %rcx
jmp 0xdb28
xorl %ecx, %ecx
cmpq %rcx, %r13
jge 0xdb44
movq 0x18(%r14), %rdx
movzwl (%rax,%r13,2), %ecx
leaq (%rcx,%rcx,2), %rcx
movb $0x0, 0x2(%rdx,%rcx,8)
incq %r13
jmp 0xdb1b
movq 0x10(%rsp), %r8
cmpb $0x0, (%rdi)
je 0xdca4
testq %rax, %rax
movq %rdi, 0x8(%rsp)
je 0xdd59
movl -0x10(%rax), %ecx
testq %rcx, %rcx
je 0xdcb3
testl %ecx, %ecx
jle 0xdc26
xorl %r12d, %r12d
movq %r8, %rbp
movq %rax, 0x18(%rsp)
movq %rcx, 0x20(%rsp)
movq 0x18(%r14), %rsi
movzwl (%rax,%r12,2), %ecx
leaq (%rcx,%rcx,2), %rcx
movq 0x8(%rsi,%rcx,8), %rdx
testq %rdx, %rdx
je 0xdc0e
movslq -0x10(%rdx), %r13
testq %r13, %r13
jle 0xdc0e
leaq (%rsi,%rcx,8), %r15
addq $0x8, %r15
xorl %ebx, %ebx
movq (%r15), %rax
movzwl (%rax,%rbx,4), %ecx
testw %cx, %cx
js 0xdbe4
movsbl (%rdi), %edx
cmpw %dx, %cx
jne 0xdbda
movzwl 0x2(%rax,%rbx,4), %edx
movq %r14, %rdi
movq %rbp, %rsi
callq 0xde14
movq 0x8(%rsp), %rdi
movq %rax, %rbp
incq %rbx
cmpq %rbx, %r13
jne 0xdbae
jmp 0xdc0e
cmpl $0xffff, %ecx           # imm = 0xFFFF
je 0xdc07
movq 0x8(%r14), %rdx
movzbl (%rdi), %esi
movl (%rdx,%rsi,4), %edx
movb $-0x2, %sil
subb %cl, %sil
movzbl %sil, %ecx
btl %ecx, %edx
jb 0xdbc2
jmp 0xdbda
cmpb $0xa, (%rdi)
jne 0xdbc2
jmp 0xdbda
incq %r12
movq 0x20(%rsp), %rcx
cmpq %rcx, %r12
movq 0x18(%rsp), %rax
jne 0xdb84
jmp 0xdc29
movq %r8, %rbp
cmpl $0x0, -0xc(%rax)
js 0xdc3b
movl $0x0, -0x10(%rax)
movq %rax, %rbx
jmp 0xdc50
movq %rsp, %rdi
movl $0x2, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x55f6
movq (%rsp), %rbx
movq %r14, %rdi
movq %rbp, %rsi
callq 0xde85
movq %rax, (%rsp)
xorl %edi, %edi
movq 0x8(%rsp), %rsi
movq %rbx, %r8
testq %rax, %rax
je 0xdc74
movslq -0x10(%rax), %rcx
jmp 0xdc76
xorl %ecx, %ecx
cmpq %rcx, %rdi
jge 0xdc91
movq 0x18(%r14), %rcx
movzwl (%rax,%rdi,2), %edx
leaq (%rdx,%rdx,2), %rdx
movb $0x0, 0x2(%rcx,%rdx,8)
incq %rdi
jmp 0xdc69
leaq 0x1(%rsi), %rcx
cmpb $0x0, 0x1(%rsi)
movq %rcx, %rdi
jne 0xdb52
jmp 0xdca7
movq %rdi, %rcx
testq %rax, %rax
je 0xdd50
movq %rcx, %rdi
movq %rdi, 0x8(%rsp)
movslq -0x10(%rax), %rdi
testq %rdi, %rdi
jle 0xdd5b
movq 0x18(%r14), %rsi
xorl %ecx, %ecx
movzwl (%rax,%rcx,2), %edx
leaq (%rdx,%rdx,2), %rdx
movb $0x1, 0x2(%rsi,%rdx,8)
incq %rcx
cmpq %rcx, %rdi
jne 0xdccb
testl %edi, %edi
jle 0xdd5b
xorl %r13d, %r13d
movq %rdi, 0x18(%rsp)
movq 0x18(%r14), %rsi
movq %rax, %r12
movzwl (%rax,%r13,2), %ecx
leaq (%rcx,%rcx,2), %rcx
movq 0x8(%rsi,%rcx,8), %rdx
testq %rdx, %rdx
je 0xdd3e
movslq -0x10(%rdx), %rbx
testq %rbx, %rbx
jle 0xdd3e
leaq (%rsi,%rcx,8), %r15
addq $0x8, %r15
xorl %ebp, %ebp
movq (%r15), %rax
cmpw $0xa, (%rax,%rbp,4)
jne 0xdd36
movzwl 0x2(%rax,%rbp,4), %edx
movq %r14, %rdi
movq %r8, %rsi
callq 0xde14
movq %rax, %r8
incq %rbp
cmpq %rbp, %rbx
jne 0xdd19
incq %r13
movq 0x18(%rsp), %rdi
cmpq %rdi, %r13
movq %r12, %rax
jne 0xdcec
jmp 0xdd5b
xorl %eax, %eax
movq %rcx, 0x8(%rsp)
jmp 0xdd5b
xorl %eax, %eax
movq %r8, 0x10(%rsp)
movq %r14, %rdi
movq %rax, %rsi
callq 0xde85
movq %rax, (%rsp)
testq %rax, %rax
je 0xddf1
movslq -0x10(%rax), %rcx
xorl %edx, %edx
testl %ecx, %ecx
cmovgl %ecx, %edx
testq %rcx, %rcx
jle 0xdda1
movq 0x18(%r14), %rsi
xorl %edi, %edi
movzwl (%rax,%rdi,2), %r8d
leaq (%r8,%r8,2), %r8
movb $0x0, 0x2(%rsi,%r8,8)
incq %rdi
cmpq %rdi, %rdx
jne 0xdd8a
testl %ecx, %ecx
jle 0xddf1
movq 0x18(%r14), %rdx
xorl %esi, %esi
movl $0x1, %edi
xorl %ebx, %ebx
movzwl (%rax,%rsi,2), %r8d
leaq (%r8,%r8,2), %r8
cmpw $0x0, (%rdx,%r8,8)
cmovnel %edi, %ebx
incq %rsi
cmpq %rsi, %rcx
jne 0xddb2
movq %rsp, %rdi
callq 0x55ba
leaq 0x10(%rsp), %rdi
callq 0x55ba
testl %ebx, %ebx
je 0xde03
xorl %eax, %eax
movq 0x8(%rsp), %rcx
cmpb $0x0, (%rcx)
sete %al
jmp 0xde05
movq %rsp, %rdi
callq 0x55ba
leaq 0x10(%rsp), %rdi
callq 0x55ba
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq