// File: /workspace/github_cpp_makefile_star2_O1/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, %r14
movq %rdi, %rbx
xorl %r13d, %r13d
leaq 0x8(%rsp), %r15
movq %r13, (%r15)
leaq 0x10(%rsp), %r12
movq %r13, (%r12)
movq %r15, %rdi
movl $0x2, %esi
movl $0x4, %edx
xorl %ecx, %ecx
callq 0x56fd
movq %r12, %rdi
movl $0x2, %esi
movl $0x4, %edx
xorl %ecx, %ecx
callq 0x56fd
movq (%r15), %rsi
movzwl (%rbx), %edx
movq %rbx, %rdi
callq 0xe0ad
movq %rax, (%r15)
movq %rbx, %rdi
movq %rax, %rsi
callq 0xe13c
movq %rax, (%r15)
testq %rax, %rax
je 0xddbc
movslq -0x10(%rax), %rcx
jmp 0xddbe
xorl %ecx, %ecx
cmpq %rcx, %r13
jge 0xddda
movq 0x18(%rbx), %rcx
movzwl (%rax,%r13,2), %edx
leaq (%rdx,%rdx,2), %rdx
movb $0x0, 0x2(%rcx,%rdx,8)
incq %r13
jmp 0xddb1
cmpb $0x0, (%r14)
je 0xdf3d
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0xdf3d
movl -0x10(%rax), %ecx
testq %rcx, %rcx
je 0xdf3d
testl %ecx, %ecx
jle 0xdebc
xorl %ebp, %ebp
movq %rax, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq 0x18(%rbx), %rcx
movzwl (%rax,%rbp,2), %eax
leaq (%rax,%rax,2), %rdx
movq 0x8(%rcx,%rdx,8), %rax
testq %rax, %rax
je 0xde2d
movl -0x10(%rax), %esi
jmp 0xde2f
xorl %esi, %esi
movq 0x10(%rsp), %rax
testl %esi, %esi
jle 0xdea1
leaq (%rcx,%rdx,8), %r15
addq $0x8, %r15
movl %esi, %r13d
xorl %r12d, %r12d
movq (%r15), %rcx
movzwl (%rcx,%r12,4), %edx
testw %dx, %dx
js 0xde77
movsbl (%r14), %esi
cmpw %si, %dx
jne 0xde6d
movzwl 0x2(%rcx,%r12,4), %edx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xe0ad
incq %r12
cmpq %r12, %r13
jne 0xde46
jmp 0xdea1
cmpw $-0x1, %dx
je 0xde99
movq 0x8(%rbx), %rsi
movzbl (%r14), %edi
movl (%rsi,%rdi,4), %esi
movb $-0x2, %dil
subb %dl, %dil
movzbl %dil, %edx
btl %edx, %esi
jb 0xde5c
jmp 0xde6d
cmpb $0xa, (%r14)
jne 0xde5c
jmp 0xde6d
movq %rax, 0x10(%rsp)
incq %rbp
movq 0x18(%rsp), %rcx
cmpq %rcx, %rbp
movq 0x20(%rsp), %rax
jne 0xde12
cmpl $0x0, -0xc(%rax)
js 0xdecb
movl $0x0, -0x10(%rax)
jmp 0xdede
leaq 0x8(%rsp), %rdi
movl $0x2, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x56fd
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
callq 0xe13c
movq %rax, 0x8(%rsp)
xorl %ecx, %ecx
testq %rax, %rax
je 0xdf0c
movslq -0x10(%rax), %rdx
jmp 0xdf0e
xorl %edx, %edx
cmpq %rdx, %rcx
jge 0xdf29
movq 0x18(%rbx), %rdx
movzwl (%rax,%rcx,2), %esi
leaq (%rsi,%rsi,2), %rsi
movb $0x0, 0x2(%rdx,%rsi,8)
incq %rcx
jmp 0xdf01
leaq 0x1(%r14), %rax
cmpb $0x0, 0x1(%r14)
movq %rax, %r14
jne 0xdde4
jmp 0xdf40
movq %r14, %rax
movq %rax, 0x18(%rsp)
movq 0x8(%rsp), %rsi
testq %rsi, %rsi
je 0xdf54
movl -0x10(%rsi), %eax
jmp 0xdf56
xorl %eax, %eax
movl %eax, %r15d
testl %eax, %eax
jle 0xdf78
movq 0x18(%rbx), %rcx
xorl %edx, %edx
movzwl (%rsi,%rdx,2), %edi
leaq (%rdi,%rdi,2), %rdi
movb $0x1, 0x2(%rcx,%rdi,8)
incq %rdx
cmpq %rdx, %r15
jne 0xdf63
testl %eax, %eax
jle 0xdff1
xorl %r13d, %r13d
movq %rsi, 0x20(%rsp)
movq 0x18(%rbx), %rcx
movzwl (%rsi,%r13,2), %eax
leaq (%rax,%rax,2), %rdx
movq 0x8(%rcx,%rdx,8), %rax
movl $0x0, %edi
testq %rax, %rax
je 0xdfa3
movl -0x10(%rax), %edi
movq 0x10(%rsp), %rax
testl %edi, %edi
jle 0xdfdf
leaq (%rcx,%rdx,8), %rbp
addq $0x8, %rbp
movl %edi, %r12d
xorl %r14d, %r14d
movq (%rbp), %rcx
cmpw $0xa, (%rcx,%r14,4)
jne 0xdfd7
movzwl 0x2(%rcx,%r14,4), %edx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xe0ad
incq %r14
cmpq %r14, %r12
jne 0xdfba
movq %rax, 0x10(%rsp)
incq %r13
cmpq %r15, %r13
movq 0x20(%rsp), %rsi
jne 0xdf84
movq %rbx, %rdi
callq 0xe13c
movq %rax, 0x8(%rsp)
xorl %ecx, %ecx
testq %rax, %rax
je 0xe00b
movslq -0x10(%rax), %rdx
jmp 0xe00d
xorl %edx, %edx
cmpq %rdx, %rcx
jge 0xe028
movq 0x18(%rbx), %rdx
movzwl (%rax,%rcx,2), %esi
leaq (%rsi,%rsi,2), %rsi
movb $0x0, 0x2(%rdx,%rsi,8)
incq %rcx
jmp 0xe000
testq %rax, %rax
je 0xe032
movl -0x10(%rax), %edx
jmp 0xe034
xorl %edx, %edx
testl %edx, %edx
jle 0xe088
movq 0x18(%rbx), %rcx
movl %edx, %edx
xorl %esi, %esi
movl $0x1, %edi
xorl %ebx, %ebx
movzwl (%rax,%rsi,2), %r8d
leaq (%r8,%r8,2), %r8
cmpw $0x0, (%rcx,%r8,8)
cmovnel %edi, %ebx
incq %rsi
cmpq %rsi, %rdx
jne 0xe047
leaq 0x8(%rsp), %rdi
callq 0x56c1
leaq 0x10(%rsp), %rdi
callq 0x56c1
testl %ebx, %ebx
je 0xe09c
xorl %eax, %eax
movq 0x18(%rsp), %rcx
cmpb $0x0, (%rcx)
sete %al
jmp 0xe09e
leaq 0x8(%rsp), %rdi
callq 0x56c1
leaq 0x10(%rsp), %rdi
callq 0x56c1
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq