// File: 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:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movl $0x0, 0x64(%rsp)
movq $0x0, 0x48(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0x48(%rsp), %rdi
movl $0x2, %esi
movl $0x4, %edx
callq 0x7d80
leaq 0x40(%rsp), %rdi
movl $0x2, %esi
movl $0x4, %edx
callq 0x7d80
movq 0x70(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x70(%rsp), %rax
movzwl (%rax), %edx
callq 0x17ca0
movq %rax, 0x48(%rsp)
movq 0x70(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x17dc0
movq %rax, 0x48(%rsp)
movq 0x70(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x17ef0
movq 0x68(%rsp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x1f(%rsp)
je 0x177fe
cmpq $0x0, 0x48(%rsp)
je 0x177e8
movq 0x48(%rsp), %rax
movl -0x10(%rax), %eax
movl %eax, 0x18(%rsp)
jmp 0x177f0
xorl %eax, %eax
movl %eax, 0x18(%rsp)
jmp 0x177f0
movl 0x18(%rsp), %eax
cmpl $0x0, %eax
setne %al
movb %al, 0x1f(%rsp)
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0x1780b
jmp 0x17a74
cmpq $0x0, 0x48(%rsp)
je 0x17821
movq 0x48(%rsp), %rax
movl -0x10(%rax), %eax
movl %eax, 0x14(%rsp)
jmp 0x17829
xorl %eax, %eax
movl %eax, 0x14(%rsp)
jmp 0x17829
movl 0x14(%rsp), %eax
movl %eax, 0x58(%rsp)
movl $0x0, 0x60(%rsp)
movl 0x60(%rsp), %eax
cmpl 0x58(%rsp), %eax
jge 0x17a0f
movq 0x70(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x48(%rsp), %rcx
movslq 0x60(%rsp), %rdx
movzwl (%rcx,%rdx,2), %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1788b
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movl -0x10(%rax), %eax
movl %eax, 0x10(%rsp)
jmp 0x17893
xorl %eax, %eax
movl %eax, 0x10(%rsp)
jmp 0x17893
movl 0x10(%rsp), %eax
movl %eax, 0x54(%rsp)
movl $0x0, 0x5c(%rsp)
movl 0x5c(%rsp), %eax
cmpl 0x54(%rsp), %eax
jge 0x179fd
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movslq 0x5c(%rsp), %rcx
movswl (%rax,%rcx,4), %eax
cmpl $0x0, %eax
jl 0x17912
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movslq 0x5c(%rsp), %rcx
movswl (%rax,%rcx,4), %eax
movq 0x68(%rsp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x1790d
movq 0x70(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movslq 0x5c(%rsp), %rcx
movzwl 0x2(%rax,%rcx,4), %edx
callq 0x17ca0
movq %rax, 0x40(%rsp)
jmp 0x179eb
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movslq 0x5c(%rsp), %rcx
movswl (%rax,%rcx,4), %eax
cmpl $-0x1, %eax
jne 0x17962
movq 0x68(%rsp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
je 0x1795d
movq 0x70(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movslq 0x5c(%rsp), %rcx
movzwl 0x2(%rax,%rcx,4), %edx
callq 0x17ca0
movq %rax, 0x40(%rsp)
jmp 0x179e9
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movslq 0x5c(%rsp), %rcx
movswl (%rax,%rcx,4), %eax
cmpl $-0x1, %eax
jge 0x179e7
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movslq 0x5c(%rsp), %rcx
movswl (%rax,%rcx,4), %ecx
xorl %eax, %eax
subl %ecx, %eax
subl $0x2, %eax
movl %eax, 0x2c(%rsp)
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x68(%rsp), %rcx
movzbl (%rcx), %ecx
movl (%rax,%rcx,4), %eax
movl 0x2c(%rsp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x179e5
movq 0x70(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movslq 0x5c(%rsp), %rcx
movzwl 0x2(%rax,%rcx,4), %edx
callq 0x17ca0
movq %rax, 0x40(%rsp)
jmp 0x179e7
jmp 0x179e9
jmp 0x179eb
jmp 0x179ed
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0x178a3
jmp 0x179ff
movl 0x60(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x60(%rsp)
jmp 0x17839
leaq 0x48(%rsp), %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x7fb0
movq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x70(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x17dc0
movq %rax, 0x48(%rsp)
movq 0x70(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x17ef0
movq 0x68(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x68(%rsp)
jmp 0x177bf
cmpq $0x0, 0x48(%rsp)
je 0x17a8a
movq 0x48(%rsp), %rax
movl -0x10(%rax), %eax
movl %eax, 0xc(%rsp)
jmp 0x17a92
xorl %eax, %eax
movl %eax, 0xc(%rsp)
jmp 0x17a92
movl 0xc(%rsp), %eax
movl %eax, 0x58(%rsp)
movl $0x0, 0x60(%rsp)
movl 0x60(%rsp), %eax
cmpl 0x58(%rsp), %eax
jge 0x17ade
movq 0x70(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x48(%rsp), %rcx
movslq 0x60(%rsp), %rdx
movzwl (%rcx,%rdx,2), %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movb $0x1, 0x2(%rax)
movl 0x60(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x60(%rsp)
jmp 0x17aa2
movl $0x0, 0x60(%rsp)
movl 0x60(%rsp), %eax
cmpl 0x58(%rsp), %eax
jge 0x17bb9
movq 0x70(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x48(%rsp), %rcx
movslq 0x60(%rsp), %rdx
movzwl (%rcx,%rdx,2), %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x17b38
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movl -0x10(%rax), %eax
movl %eax, 0x8(%rsp)
jmp 0x17b40
xorl %eax, %eax
movl %eax, 0x8(%rsp)
jmp 0x17b40
movl 0x8(%rsp), %eax
movl %eax, 0x54(%rsp)
movl $0x0, 0x5c(%rsp)
movl 0x5c(%rsp), %eax
cmpl 0x54(%rsp), %eax
jge 0x17ba7
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movslq 0x5c(%rsp), %rcx
movswl (%rax,%rcx,4), %eax
cmpl $0xa, %eax
jne 0x17b98
movq 0x70(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movslq 0x5c(%rsp), %rcx
movzwl 0x2(%rax,%rcx,4), %edx
callq 0x17ca0
movq %rax, 0x40(%rsp)
jmp 0x17b9a
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0x17b50
jmp 0x17ba9
movl 0x60(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x60(%rsp)
jmp 0x17ae6
movq 0x70(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x17dc0
movq %rax, 0x48(%rsp)
movq 0x70(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x17ef0
cmpq $0x0, 0x48(%rsp)
je 0x17bf2
movq 0x48(%rsp), %rax
movl -0x10(%rax), %eax
movl %eax, 0x4(%rsp)
jmp 0x17bfa
xorl %eax, %eax
movl %eax, 0x4(%rsp)
jmp 0x17bfa
movl 0x4(%rsp), %eax
movl %eax, 0x58(%rsp)
movl $0x0, 0x60(%rsp)
movl 0x60(%rsp), %eax
cmpl 0x58(%rsp), %eax
jge 0x17c52
movq 0x70(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x48(%rsp), %rcx
movslq 0x60(%rsp), %rdx
movzwl (%rcx,%rdx,2), %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpw $0x0, (%rax)
je 0x17c43
movl $0x1, 0x64(%rsp)
jmp 0x17c45
movl 0x60(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x60(%rsp)
jmp 0x17c0a
leaq 0x48(%rsp), %rdi
callq 0x7d20
leaq 0x40(%rsp), %rdi
callq 0x7d20
xorl %eax, %eax
cmpl $0x0, 0x64(%rsp)
movb %al, 0x3(%rsp)
je 0x17c85
movq 0x68(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
sete %al
movb %al, 0x3(%rsp)
movb 0x3(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)