// File: /workspace/github_cpp_makefile_star2_O3/attractivechaos[P]udb2/stb/./stb.h
// Function: stb__get_dfa_node
stb_int16 stb__get_dfa_node(stb_matcher *m, stb_uint16 *list)
{
   stb_uint16 node;
   stb_uint32 data[8], *state, *newstate;
   int i,j,n;

   state = (stb_uint32 *) stb_temp(data, m->num_words_per_dfa * 4);
   memset(state, 0, m->num_words_per_dfa*4);

   n = stb_arr_len(list);
   for (i=0; i < n; ++i) {
      int x = list[i];
      state[x >> 5] |= 1 << (x & 31);
   }

   // @TODO use a hash table
   n = stb_arr_len(m->dfa_mapping);
   i=j=0;
   for(; j < n; ++i, j += m->num_words_per_dfa) {
      // @TODO special case for <= 32
      if (!memcmp(state, m->dfa_mapping + j, m->num_words_per_dfa*4)) {
         node = i;
         goto done;
      }
   }

   assert(stb_arr_len(m->dfa) == i);
   node = i;

   newstate = stb_arr_addn(m->dfa_mapping, m->num_words_per_dfa);
   memcpy(newstate, state, m->num_words_per_dfa*4);

   // set all transitions to 'unknown'
   stb_arr_add(m->dfa);
   memset(m->dfa[i].transition, -1, sizeof(m->dfa[i].transition));

   if (m->does_lex) {
      int result = -1;
      n = stb_arr_len(list);
      for (i=0; i < n; ++i) {
         if (m->nodes[(int) list[i]].goal > result)
            result = m->nodes[(int) list[i]].goal;
      }

      stb_arr_push(m->dfa_result, result);
   }

done:
   stb_tempfree(data, state);
   return node;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, 0x10(%rsp)
movq %rdi, %rbx
movslq 0x40(%rdi), %rax
leaq (,%rax,4), %r13
movq %rax, (%rsp)
cmpq $0x9, %rax
jl 0xdf3d
movl %r13d, %edi
callq 0x2250
movq %rax, %r15
jmp 0xdf42
leaq 0x20(%rsp), %r15
xorl %ebp, %ebp
movq %r15, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x2160
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xdf80
movslq -0x10(%rdi), %rax
testq %rax, %rax
jle 0xdf80
xorl %edx, %edx
movzwl (%rdi,%rdx,2), %ecx
movl $0x1, %esi
shll %cl, %esi
shrl $0x5, %ecx
orl %esi, (%r15,%rcx,4)
incq %rdx
cmpq %rdx, %rax
jne 0xdf66
movq %rbx, 0x18(%rsp)
movq 0x30(%rbx), %rax
testq %rax, %rax
movq %rax, 0x8(%rsp)
je 0xdfc9
movslq -0x10(%rax), %r12
testq %r12, %r12
jle 0xdfc9
xorl %ebx, %ebx
movq 0x8(%rsp), %r14
xorl %ebp, %ebp
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x2280
testl %eax, %eax
je 0xe126
incl %ebp
addq (%rsp), %rbx
addq %r13, %r14
cmpq %r12, %rbx
jl 0xdfa5
movq 0x18(%rsp), %r12
movq 0x28(%r12), %rax
testq %rax, %rax
je 0xdfdd
movl -0x10(%rax), %eax
jmp 0xdfdf
xorl %eax, %eax
movq 0x8(%rsp), %rdx
cmpl %ebp, %eax
jne 0xe149
testq %rdx, %rdx
je 0xdffc
movl -0x10(%rdx), %eax
addl (%rsp), %eax
movl -0xc(%rdx), %ecx
jmp 0xe002
xorl %ecx, %ecx
movq (%rsp), %rax
cmpl %ecx, %eax
jle 0xe02a
leaq 0x30(%r12), %r14
movq %r14, %rdi
movl $0x4, %esi
movq (%rsp), %rdx
callq 0x56ce
movq (%r14), %rdx
testq %rdx, %rdx
jne 0xe031
xorl %edx, %edx
xorl %eax, %eax
jmp 0xe035
movq (%rsp), %rax
addl %eax, -0x10(%rdx)
movslq -0x10(%rdx), %rax
leaq (%rdx,%rax,4), %rdi
movslq 0x40(%r12), %rdx
shlq $0x2, %rdx
subq %rdx, %rdi
movq %r15, %rsi
callq 0x2230
movq 0x28(%r12), %rax
testq %rax, %rax
je 0xe066
movl -0x10(%rax), %ecx
cmpl -0xc(%rax), %ecx
jge 0xe066
incl %ecx
movl %ecx, -0x10(%rax)
jmp 0xe080
leaq 0x28(%r12), %r14
movq %r14, %rdi
movl $0x200, %esi            # imm = 0x200
movl $0x1, %edx
callq 0x56ce
movq (%r14), %rax
movl %ebp, %edi
shlq $0x9, %rdi
addq %rax, %rdi
movl $0x200, %edx            # imm = 0x200
movl $0xff, %esi
callq 0x2160
cmpl $0x0, 0x20(%r12)
je 0xe126
movw $0xffff, %r14w          # imm = 0xFFFF
movq 0x10(%rsp), %r8
testq %r8, %r8
je 0xe0e9
movslq -0x10(%r8), %rax
testq %rax, %rax
jle 0xe0e9
movq 0x18(%r12), %rcx
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
xorl %edx, %edx
movl %r14d, %esi
movzwl (%r8,%rdx,2), %edi
leaq (%rdi,%rdi,2), %rdi
movswl (%rcx,%rdi,8), %r14d
cmpl %r14d, %esi
cmovgl %esi, %r14d
incq %rdx
cmpq %rdx, %rax
jne 0xe0c9
movq 0x38(%r12), %rax
testq %rax, %rax
je 0xe102
movl -0x10(%rax), %ecx
cmpl -0xc(%rax), %ecx
jge 0xe102
incl %ecx
movl %ecx, -0x10(%rax)
jmp 0xe11c
addq $0x38, %r12
movq %r12, %rdi
movl $0x2, %esi
movl $0x1, %edx
callq 0x56ce
movq (%r12), %rax
movslq -0x10(%rax), %rcx
movw %r14w, -0x2(%rax,%rcx,2)
leaq 0x20(%rsp), %rax
cmpq %rax, %r15
je 0xe138
movq %r15, %rdi
callq 0x23c0
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4bcf(%rip), %rdi      # 0x12d1f
leaq 0x435a(%rip), %rsi      # 0x124b1
leaq 0x4bda(%rip), %rcx      # 0x12d38
movl $0x25a4, %edx           # imm = 0x25A4
callq 0x2140