// File: /workspace/github_cpp_makefile_star2_O1/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, %r14
movslq 0x40(%rdi), %rax
leaq (,%rax,4), %r13
movq %rax, (%rsp)
cmpq $0x9, %rax
jl 0xe1f3
movl %r13d, %edi
callq 0x2250
movq %rax, %r15
jmp 0xe1f8
leaq 0x20(%rsp), %r15
xorl %ebx, %ebx
movq %r15, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x2160
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xe214
movl -0x10(%rdi), %ebx
testl %ebx, %ebx
jle 0xe236
movl %ebx, %eax
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 0xe21c
movq %r14, 0x18(%rsp)
movq 0x30(%r14), %rcx
xorl %ebp, %ebp
movl $0x0, %eax
testq %rcx, %rcx
je 0xe24e
movl -0x10(%rcx), %eax
movq %rcx, 0x8(%rsp)
testl %eax, %eax
jle 0xe287
movl %eax, %r12d
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 0xe41b
incl %ebp
addq (%rsp), %rbx
addq %r13, %r14
cmpq %r12, %rbx
jl 0xe263
movq 0x18(%rsp), %r12
movq 0x28(%r12), %rax
testq %rax, %rax
je 0xe29b
movl -0x10(%rax), %eax
jmp 0xe29d
xorl %eax, %eax
cmpl %ebp, %eax
movq 0x8(%rsp), %rsi
jne 0xe43e
xorl %eax, %eax
movl $0x0, %ecx
testq %rsi, %rsi
je 0xe2b9
movl -0x10(%rsi), %ecx
movq (%rsp), %rdx
addl %edx, %ecx
testq %rsi, %rsi
je 0xe2c7
movl -0xc(%rsi), %eax
leaq 0x30(%r12), %r14
cmpl %eax, %ecx
jle 0xe2e3
movq %r14, %rdi
movl $0x4, %esi
movq (%rsp), %rdx
callq 0x57e0
jmp 0xe2ea
movq (%rsp), %rax
addl %eax, -0x10(%rsi)
movq (%r14), %rax
testq %rax, %rax
je 0xe2f8
movslq -0x10(%rax), %rcx
jmp 0xe2fa
xorl %ecx, %ecx
leaq (%rax,%rcx,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 0xe323
movl -0x10(%rax), %ecx
incl %ecx
jmp 0xe328
movl $0x1, %ecx
testq %rax, %rax
je 0xe332
movl -0xc(%rax), %edx
jmp 0xe334
xorl %edx, %edx
cmpl %edx, %ecx
jle 0xe34e
leaq 0x28(%r12), %rdi
movl $0x200, %esi            # imm = 0x200
movl $0x1, %edx
callq 0x57e0
jmp 0xe351
incl -0x10(%rax)
movl %ebp, %edi
shlq $0x9, %rdi
addq 0x28(%r12), %rdi
movl $0x200, %edx            # imm = 0x200
movl $0xff, %esi
callq 0x2160
cmpl $0x0, 0x20(%r12)
je 0xe41b
movq 0x10(%rsp), %r8
testq %r8, %r8
je 0xe387
movl -0x10(%r8), %ecx
jmp 0xe389
xorl %ecx, %ecx
testl %ecx, %ecx
jle 0xe3be
movq 0x18(%r12), %rax
movl %ecx, %ecx
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
xorl %edx, %edx
movl %r14d, %esi
movzwl (%r8,%rdx,2), %edi
leaq (%rdi,%rdi,2), %rdi
movswl (%rax,%rdi,8), %r14d
cmpl %r14d, %esi
cmovgl %esi, %r14d
incq %rdx
cmpq %rdx, %rcx
jne 0xe39c
jmp 0xe3c3
movw $0xffff, %r14w          # imm = 0xFFFF
movq 0x38(%r12), %rax
testq %rax, %rax
je 0xe3d4
movl -0x10(%rax), %ecx
incl %ecx
jmp 0xe3d9
movl $0x1, %ecx
testq %rax, %rax
je 0xe3e3
movl -0xc(%rax), %edx
jmp 0xe3e5
xorl %edx, %edx
addq $0x38, %r12
cmpl %edx, %ecx
jle 0xe401
movq %r12, %rdi
movl $0x2, %esi
movl $0x1, %edx
callq 0x57e0
jmp 0xe404
incl -0x10(%rax)
movq (%r12), %rax
testq %rax, %rax
je 0xe413
movslq -0x10(%rax), %rcx
jmp 0xe415
xorl %ecx, %ecx
movw %r14w, -0x2(%rax,%rcx,2)
leaq 0x20(%rsp), %rax
cmpq %rax, %r15
je 0xe42d
movq %r15, %rdi
callq 0x23d0
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4934(%rip), %rdi      # 0x12d79
leaq 0x40b5(%rip), %rsi      # 0x12501
leaq 0x493f(%rip), %rcx      # 0x12d92
movl $0x25a4, %edx           # imm = 0x25A4
callq 0x2140