// File: /workspace/github_c_makefile_star2_O3/jondurbin[P]dre2/src/dre2_parse.c
// Function: dre2_set_chars
void dre2_set_chars( struct dre2 *graph, int id )
{
  int i, iter;
  int index;
  struct dre2_node *node;

  node = &graph->v[id];
  if ( node->c >= 0 )
  {
    graph->starting_chars[node->c] = true;
    if ( graph->options & DRE2_NO_CASE )
    {
      if ( node->c >= 'a' && node->c <= 'z' )
        graph->starting_chars[node->c - ( 'a' - 'A' )] = true;
      else if ( node->c >= 'A' && node->c <= 'Z' )
        graph->starting_chars[node->c + ( 'a' - 'A' )] = true;
    }
  } else if ( node->c == DRE2_CHAR_CLASS )
  {
    for ( i = 0; i < RANGE; i++ )
    {
      if ( node->possible[i] )
      {
        graph->starting_chars[i] = true;
        if ( graph->options & DRE2_NO_CASE )
        {
          if ( i >= 'a' && i <= 'z' )
            graph->starting_chars[i - ( 'a' - 'A' )] = true;
          else if ( i >= 'A' && i <= 'Z' )
            graph->starting_chars[i + ( 'a' - 'A' )] = true;
        }
      }
    }
  } else if ( node->c == DRE2_DOT )
  {
    for ( i = 0; i < RANGE; i++ )
      graph->starting_chars[i] = true;
  } else if ( node->c >= DRE2_8BIT && node->c <= DRE2_ALPHA )
  {
    index = node->c * -1 - 5;
    i = 0;
    while ( dre2_predefined_classes[index][i] != -1 )
    {
      graph->starting_chars[dre2_predefined_classes[index][i]] = true;
      if ( graph->options & DRE2_NO_CASE )
      {
        if ( dre2_predefined_classes[index][i] >= 'a' && dre2_predefined_classes[index][i] <= 'z' )
          graph->starting_chars[dre2_predefined_classes[index][i] - ( 'a' - 'A' )] = true;
        else if ( dre2_predefined_classes[index][i] >= 'A' && dre2_predefined_classes[index][i] <= 'Z' )
          graph->starting_chars[dre2_predefined_classes[index][i] + ( 'a' - 'A' )] = true;
      }
      i++;
    }
  }
}

// Assembly:
movq (%rdi), %rax
movslq %esi, %rcx
shlq $0x6, %rcx
leaq (%rax,%rcx), %rdx
movl (%rax,%rcx), %eax
testl %eax, %eax
js 0x31df
movq 0x418(%rdi), %rcx
movl $0x1, (%rcx,%rax,4)
testb $0x4, 0x43c(%rdi)
je 0x3305
movl (%rdx), %eax
leal -0x61(%rax), %esi
movq $-0x80, %rdx
cmpl $0x1a, %esi
jb 0x31d3
leal -0x41(%rax), %esi
movl $0x80, %edx
cmpl $0x1a, %esi
jae 0x3305
leaq (%rcx,%rax,4), %rax
movl $0x1, (%rdx,%rax)
retq
movl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
cmpq %rcx, %rax
je 0x3218
cmpl $-0x10, %eax
jne 0x328a
movq 0x418(%rdi), %rax
xorl %ecx, %ecx
movaps 0x7f3e(%rip), %xmm0     # 0xb140
movups %xmm0, (%rax,%rcx,4)
addq $0x4, %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0x3202
jmp 0x3305
movq 0x28(%rdx), %rax
movl $0xffffff9f, %ecx       # imm = 0xFFFFFF9F
movq $-0x80, %rdx
xorl %esi, %esi
cmpl $0x0, 0x80(%rax,%rdx)
je 0x3276
movq 0x418(%rdi), %r8
movl $0x1, 0x80(%r8,%rdx)
testb $0x4, 0x43c(%rdi)
je 0x3276
cmpl $0x19, %ecx
ja 0x325a
addq %rdx, %r8
jmp 0x326f
leal 0x20(%rcx), %r9d
cmpl $0x19, %r9d
ja 0x3276
leaq (%r8,%rsi,4), %r8
addq $0x80, %r8
movl $0x1, (%r8)
incq %rsi
incl %ecx
addq $0x4, %rdx
cmpq $0x380, %rdx            # imm = 0x380
jne 0x322a
jmp 0x3305
leal 0xf(%rax), %ecx
cmpl $0xa, %ecx
ja 0x3305
movl $0xfffffffb, %edx       # imm = 0xFFFFFFFB
subq %rax, %rdx
shlq $0xa, %rdx
movq 0xad33(%rip), %rsi      # 0xdfd8
movl (%rsi,%rdx), %eax
cmpl $-0x1, %eax
je 0x3305
movq 0x418(%rdi), %rcx
addq %rsi, %rdx
addq $0x4, %rdx
movslq %eax, %rsi
movl $0x1, (%rcx,%rsi,4)
testb $0x4, 0x43c(%rdi)
je 0x32fa
leal -0x61(%rax), %r8d
movq $-0x80, %rsi
cmpl $0x1a, %r8d
jb 0x32ee
leal -0x41(%rax), %r8d
movl $0x80, %esi
cmpl $0x19, %r8d
ja 0x32fa
addq %rcx, %rsi
movl %eax, %eax
movl $0x1, (%rsi,%rax,4)
movl (%rdx), %eax
addq $0x4, %rdx
cmpl $-0x1, %eax
jne 0x32bb
retq