// File: /workspace/github_cpp_makefile_star2_O2/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, %r13
movq %rdi, %r15
movslq 0x40(%rdi), %r12
shlq $0x2, %r12
leaq 0x20(%rsp), %rdi
pushq $0x20
popq %rsi
movl %r12d, %edx
callq 0x32ac
movq %rax, %rbx
xorl %r14d, %r14d
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x2160
movl $0x0, %eax
testq %r13, %r13
je 0xc7fb
movl -0x10(%r13), %eax
testl %eax, %eax
cmovlel %r14d, %eax
pushq $0x1
popq %rdx
cmpq %r14, %rax
je 0xc81e
movzwl (%r13,%r14,2), %ecx
movl %edx, %esi
shll %cl, %esi
shrl $0x5, %ecx
orl %esi, (%rbx,%rcx,4)
incq %r14
jmp 0xc804
movq %rbx, 0x8(%rsp)
movq %r13, 0x18(%rsp)
movq 0x30(%r15), %rsi
xorl %ebx, %ebx
movl $0x0, 0x4(%rsp)
testq %rsi, %rsi
je 0xc842
movl -0x10(%rsi), %eax
movl %eax, 0x4(%rsp)
leaq 0x30(%r15), %rax
movq %rax, 0x10(%rsp)
xorl %r14d, %r14d
xorl %r12d, %r12d
cmpl 0x4(%rsp), %r12d
jge 0xc89a
movslq %r12d, %rax
movq %rsi, %rbp
leaq (%rsi,%rax,4), %rsi
movq %r15, %r13
movslq 0x40(%r15), %r15
leaq (,%r15,4), %rdx
movq 0x8(%rsp), %rdi
callq 0x2280
testl %eax, %eax
je 0xc9cd
incl %ebx
addl %r12d, %r15d
addq $0x200, %r14            # imm = 0x200
movl %r15d, %r12d
movq %r13, %r15
movq %rbp, %rsi
jmp 0xc851
movq 0x28(%r15), %rax
testq %rax, %rax
je 0xc8a8
movl -0x10(%rax), %eax
jmp 0xc8aa
xorl %eax, %eax
cmpl %ebx, %eax
jne 0xc9ed
testq %rsi, %rsi
je 0xc8c5
movl 0x40(%r15), %edx
movl -0x10(%rsi), %eax
addl %edx, %eax
movl -0xc(%rsi), %ecx
jmp 0xc8cd
movl 0x40(%r15), %eax
xorl %ecx, %ecx
movl %eax, %edx
cmpl %ecx, %eax
jle 0xc8f0
pushq $0x4
popq %rsi
movq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x521e
movq (%r12), %rsi
testq %rsi, %rsi
jne 0xc8f3
xorl %esi, %esi
xorl %eax, %eax
jmp 0xc8f7
addl %edx, -0x10(%rsi)
movslq -0x10(%rsi), %rax
leaq (%rsi,%rax,4), %rdi
movslq 0x40(%r15), %rdx
shlq $0x2, %rdx
subq %rdx, %rdi
movq 0x8(%rsp), %rsi
callq 0x2230
movq 0x28(%r15), %rdi
testq %rdi, %rdi
je 0xc928
movl -0x10(%rdi), %eax
cmpl -0xc(%rdi), %eax
jge 0xc928
incl %eax
movl %eax, -0x10(%rdi)
jmp 0xc940
leaq 0x28(%r15), %r13
pushq $0x1
popq %rdx
movq %r13, %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x521e
movq (%r13), %rdi
addq %r14, %rdi
movl $0x200, %edx            # imm = 0x200
movl $0xff, %esi
callq 0x2160
cmpl $0x0, 0x20(%r15)
je 0xc9cd
movq %r15, %r14
xorl %eax, %eax
movl $0x0, %ecx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xc970
movl -0x10(%rdi), %ecx
testl %ecx, %ecx
cmovlel %eax, %ecx
pushq $-0x1
popq %rbp
cmpq %rax, %rcx
je 0xc997
movq 0x18(%r14), %rdx
movzwl (%rdi,%rax,2), %esi
imulq $0x18, %rsi, %rsi
movswl (%rdx,%rsi), %edx
cmpl %edx, %ebp
cmovlel %edx, %ebp
incq %rax
jmp 0xc978
movq 0x38(%r14), %rax
testq %rax, %rax
je 0xc9af
movl -0x10(%rax), %ecx
cmpl -0xc(%rax), %ecx
jge 0xc9af
incl %ecx
movl %ecx, -0x10(%rax)
jmp 0xc9c4
addq $0x38, %r14
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x521e
movq (%r14), %rax
movslq -0x10(%rax), %rcx
movw %bp, -0x2(%rax,%rcx,2)
leaq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x32bc
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x429b(%rip), %rdi      # 0x10c8f
leaq 0x3a26(%rip), %rsi      # 0x10421
leaq 0x42a6(%rip), %rcx      # 0x10ca8
movl $0x25a4, %edx           # imm = 0x25A4
callq 0x2140