// File: /workspace/github_c_makefile_star2_O0/jondurbin[P]dre2/src/dre2_parse.c
// Function: dre2_starting_chars
void dre2_starting_chars( struct dre2 *graph, int *minimal )
{
  int i, count;
  struct dre2_node *node;

  for ( i = 0; i < RANGE; i++ )
    graph->starting_chars[i] = false;

  if ( graph->starting_point == graph->count - 1 && graph->v[graph->count - 1].n_count > 0 && ( graph->options & DRE2_GREEDY ) )
    graph->starting_point = 0;

  if ( graph->starting_point == -1 )
  {
    // Using multiple nodes.
    for ( i = 0; i < graph->starting_count; i++ )
      dre2_set_chars( graph, graph->starting_points[i] );
  } else if ( graph->starting_point != 0 && graph->starting_point != graph->count - 1 )
  {
    // Only a single node, set the chars for that node.
    dre2_set_chars( graph, graph->starting_point );
  } else if ( graph->starting_point == 0 )
  {
    // Set all of the chars possible from the reachable nodes of the first node.
    for ( i = 0; i < graph->v[0].n_count; i++ )
    {
      if ( minimal[graph->v[0].n[i]] || ( graph->options & DRE2_GREEDY ) )
        dre2_set_chars( graph, graph->v[0].n[i] );
    }
  } else
  {
    // Set all of the chars possible from the parents of the last node.
    for ( i = 0; i < graph->v[graph->count - 1].p_count; i++ )
    {
      if ( minimal[graph->v[graph->count - 1].p[i]] || ( graph->options & DRE2_GREEDY ) )
        dre2_set_chars( graph, graph->v[graph->count - 1].p[i] );
    }
  }

  // Check if the there is a single starting char or multiple (determines matching method)
  count = 0;
  for ( i = 0; i < RANGE; i++ )
  {
    if ( graph->starting_chars[i] )
      count++;
    if ( count > 1 )
      break;
  }
  if ( count > 1 )
    graph->single = false;
  else
    graph->single = true;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
cmpl $0x100, 0x14(%rsp)      # imm = 0x100
jge 0x3f35
movq 0x20(%rsp), %rax
movq 0x418(%rax), %rax
movslq 0x14(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x3f06
movq 0x20(%rsp), %rax
movl 0x410(%rax), %eax
movq 0x20(%rsp), %rcx
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3f94
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x6, %rcx
addq %rcx, %rax
cmpl $0x0, 0x10(%rax)
jle 0x3f94
movq 0x20(%rsp), %rax
movl 0x43c(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x3f94
movq 0x20(%rsp), %rax
movl $0x0, 0x410(%rax)
movq 0x20(%rsp), %rax
cmpl $-0x1, 0x410(%rax)
jne 0x3feb
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x438(%rcx), %eax
jge 0x3fe6
movq 0x20(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0x430(%rax), %rax
movslq 0x14(%rsp), %rcx
movl (%rax,%rcx,4), %esi
callq 0x2240
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x3faa
jmp 0x417e
movq 0x20(%rsp), %rax
cmpl $0x0, 0x410(%rax)
je 0x402d
movq 0x20(%rsp), %rax
movl 0x410(%rax), %eax
movq 0x20(%rsp), %rcx
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
je 0x402d
movq 0x20(%rsp), %rdi
movq 0x20(%rsp), %rax
movl 0x410(%rax), %esi
callq 0x2240
jmp 0x417c
movq 0x20(%rsp), %rax
cmpl $0x0, 0x410(%rax)
jne 0x40b9
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movq 0x20(%rsp), %rcx
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
jge 0x40b4
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rcx), %rcx
movq 0x8(%rcx), %rcx
movslq 0x14(%rsp), %rdx
movslq (%rcx,%rdx,4), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x4087
movq 0x20(%rsp), %rax
movl 0x43c(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x40a5
movq 0x20(%rsp), %rdi
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movslq 0x14(%rsp), %rcx
movl (%rax,%rcx,4), %esi
callq 0x2240
jmp 0x40a7
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x4043
jmp 0x417a
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movq 0x20(%rsp), %rcx
movq (%rcx), %rcx
movq 0x20(%rsp), %rdx
movl 0x8(%rdx), %edx
subl $0x1, %edx
movslq %edx, %rdx
shlq $0x6, %rdx
addq %rdx, %rcx
cmpl 0x20(%rcx), %eax
jge 0x4178
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rcx), %rcx
movq 0x20(%rsp), %rdx
movl 0x8(%rdx), %edx
subl $0x1, %edx
movslq %edx, %rdx
shlq $0x6, %rdx
addq %rdx, %rcx
movq 0x18(%rcx), %rcx
movslq 0x14(%rsp), %rdx
movslq (%rcx,%rdx,4), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x4133
movq 0x20(%rsp), %rax
movl 0x43c(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x4166
movq 0x20(%rsp), %rdi
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movslq 0x14(%rsp), %rcx
movl (%rax,%rcx,4), %esi
callq 0x2240
jmp 0x4168
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x40c1
jmp 0x417a
jmp 0x417c
jmp 0x417e
movl $0x0, 0x10(%rsp)
movl $0x0, 0x14(%rsp)
cmpl $0x100, 0x14(%rsp)      # imm = 0x100
jge 0x41d2
movq 0x20(%rsp), %rax
movq 0x418(%rax), %rax
movslq 0x14(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x41ba
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
cmpl $0x1, 0x10(%rsp)
jle 0x41c3
jmp 0x41d2
jmp 0x41c5
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x418e
cmpl $0x1, 0x10(%rsp)
jle 0x41ea
movq 0x20(%rsp), %rax
movl $0x0, 0x420(%rax)
jmp 0x41f9
movq 0x20(%rsp), %rax
movl $0x1, 0x420(%rax)
addq $0x28, %rsp
retq
nop