// File: /workspace/github_cpp_makefile_star2_O2/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
movq %rsp, %rbp
andq $0x0, (%rbp)
leaq 0x20(%rsp), %r12
andq $0x0, (%r12)
pushq $0x2
popq %r13
pushq $0x4
popq %r15
movq %rbp, %rdi
movl %r13d, %esi
movl %r15d, %edx
callq 0x5135
movq %r12, %rdi
movl %r13d, %esi
movl %r15d, %edx
callq 0x5135
movq (%rbp), %rsi
movzwl (%r14), %edx
movq %r14, %rdi
callq 0xc689
movq %r14, %rdi
movq %rax, %rsi
callq 0xc6f6
movq %rax, %r13
movq %rax, (%rbp)
movq %r14, %rdi
movq %rax, %rsi
callq 0xc783
movq (%r12), %r12
cmpb $0x0, (%rbx)
movq %r13, 0x18(%rsp)
je 0xc548
testq %r13, %r13
je 0xc553
movl -0x10(%r13), %ecx
testl %ecx, %ecx
je 0xc54d
movl $0x0, %eax
cmovlel %eax, %ecx
xorl %edx, %edx
movq %rcx, 0x8(%rsp)
cmpq %rcx, %rdx
je 0xc50f
movq 0x18(%r14), %rax
movq %rdx, 0x10(%rsp)
movzwl (%r13,%rdx,2), %ecx
imulq $0x18, %rcx, %rcx
movq 0x8(%rax,%rcx), %rdx
testq %rdx, %rdx
je 0xc483
movl -0x10(%rdx), %r15d
jmp 0xc486
xorl %r15d, %r15d
leaq (%rax,%rcx), %r13
addq $0x8, %r13
testl %r15d, %r15d
movl $0x0, %eax
cmovlel %eax, %r15d
xorl %ebp, %ebp
cmpq %rbp, %r15
je 0xc4f8
movq (%r13), %rax
movzwl (%rax,%rbp,4), %ecx
testw %cx, %cx
js 0xc4ce
movsbl (%rbx), %edx
cmpw %dx, %cx
jne 0xc4c9
movzwl 0x2(%rax,%rbp,4), %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0xc689
movq %rax, %r12
incq %rbp
jmp 0xc49c
cmpl $0xffff, %ecx           # imm = 0xFFFF
je 0xc4f1
movq 0x8(%r14), %rdx
movzbl (%rbx), %esi
movl (%rdx,%rsi,4), %edx
movb $-0x2, %sil
subb %cl, %sil
movzbl %sil, %ecx
btl %ecx, %edx
jb 0xc4b6
jmp 0xc4c9
cmpb $0xa, (%rbx)
jne 0xc4b6
jmp 0xc4c9
movq 0x10(%rsp), %rdx
incq %rdx
movq 0x18(%rsp), %r13
movq 0x8(%rsp), %rcx
jmp 0xc457
movq %rsp, %rdi
pushq $0x2
popq %rsi
xorl %edx, %edx
callq 0x5206
movq (%rsp), %r15
movq %r14, %rdi
movq %r12, %rsi
callq 0xc6f6
movq %rax, %r13
movq %rax, (%rsp)
movq %r14, %rdi
movq %rax, %rsi
callq 0xc783
incq %rbx
movq %r15, %r12
jmp 0xc425
testq %r13, %r13
je 0xc553
movl -0x10(%r13), %esi
jmp 0xc555
xorl %esi, %esi
xorl %eax, %eax
testl %esi, %esi
cmovlel %eax, %esi
cmpq %rax, %rsi
je 0xc579
movq 0x18(%r14), %rcx
movzwl (%r13,%rax,2), %edx
imulq $0x18, %rdx, %rdx
movb $0x1, 0x2(%rcx,%rdx)
incq %rax
jmp 0xc55c
xorl %edi, %edi
movq %rsi, 0x8(%rsp)
cmpq %rsi, %rdi
je 0xc5fd
movq 0x18(%r14), %rax
movzwl (%r13,%rdi,2), %ecx
imulq $0x18, %rcx, %rcx
movq 0x8(%rax,%rcx), %rdx
testq %rdx, %rdx
movq %rdi, 0x10(%rsp)
je 0xc5a8
movl -0x10(%rdx), %r15d
jmp 0xc5ab
xorl %r15d, %r15d
leaq (%rax,%rcx), %r13
addq $0x8, %r13
testl %r15d, %r15d
movl $0x0, %eax
cmovlel %eax, %r15d
xorl %ebp, %ebp
cmpq %rbp, %r15
je 0xc5e9
movq (%r13), %rax
cmpw $0xa, (%rax,%rbp,4)
jne 0xc5e4
movzwl 0x2(%rax,%rbp,4), %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0xc689
movq %rax, %r12
incq %rbp
jmp 0xc5c1
movq 0x10(%rsp), %rdi
incq %rdi
movq 0x18(%rsp), %r13
movq 0x8(%rsp), %rsi
jmp 0xc580
movq %r12, 0x20(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0xc6f6
movq %rax, %r15
movq %rax, (%rsp)
movq %r14, %rdi
movq %rax, %rsi
callq 0xc783
xorl %r12d, %r12d
movl $0x0, %eax
testq %r15, %r15
je 0xc630
movl -0x10(%r15), %eax
testl %eax, %eax
cmovlel %r12d, %eax
pushq $0x1
popq %rcx
xorl %edx, %edx
cmpq %rdx, %rax
je 0xc65b
movq 0x18(%r14), %rsi
movzwl (%r15,%rdx,2), %edi
imulq $0x18, %rdi, %rdi
cmpw $0x0, (%rsi,%rdi)
cmovnel %ecx, %r12d
incq %rdx
jmp 0xc63b
movq %rsp, %rdi
callq 0x510d
leaq 0x20(%rsp), %rdi
callq 0x510d
xorl %eax, %eax
testl %r12d, %r12d
je 0xc67a
cmpb $0x0, (%rbx)
sete %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq