// File: /workspace/github_c_makefile_star2_O1/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:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x418(%rdi), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x2180
movslq 0x8(%rbx), %rax
decq %rax
cmpl %eax, 0x410(%rbx)
jne 0x33b4
movq (%rbx), %rcx
movq %rax, %rdx
shlq $0x6, %rdx
cmpl $0x0, 0x10(%rcx,%rdx)
jle 0x33b4
testb $0x1, 0x43c(%rbx)
je 0x33b4
movl $0x0, 0x410(%rbx)
movl 0x410(%rbx), %esi
testl %esi, %esi
je 0x3464
cmpl $-0x1, %esi
jne 0x33fe
cmpl $0x0, 0x438(%rbx)
jle 0x34a9
xorl %r14d, %r14d
movq 0x430(%rbx), %rax
movl (%rax,%r14,4), %esi
movq %rbx, %rdi
callq 0x2260
incq %r14
movslq 0x438(%rbx), %rax
cmpq %rax, %r14
jl 0x33d7
jmp 0x34a9
cmpl %eax, %esi
jne 0x34a1
testl %esi, %esi
je 0x3464
movq (%rbx), %rax
movslq 0x8(%rbx), %rcx
shlq $0x6, %rcx
cmpl $0x0, -0x20(%rax,%rcx)
jle 0x34a9
addq %rcx, %rax
xorl %r15d, %r15d
movq -0x28(%rax), %rax
movslq (%rax,%r15,4), %rsi
cmpl $0x0, (%r14,%rsi,4)
jne 0x343e
testb $0x1, 0x43c(%rbx)
je 0x3446
movq %rbx, %rdi
callq 0x2260
incq %r15
movq (%rbx), %rcx
movslq 0x8(%rbx), %rdx
shlq $0x6, %rdx
leaq (%rcx,%rdx), %rax
movslq -0x20(%rcx,%rdx), %rcx
cmpq %rcx, %r15
jl 0x3426
jmp 0x34a9
movq (%rbx), %rax
cmpl $0x0, 0x10(%rax)
jle 0x34a9
xorl %r15d, %r15d
movq 0x8(%rax), %rax
movslq (%rax,%r15,4), %rsi
cmpl $0x0, (%r14,%rsi,4)
jne 0x3488
testb $0x1, 0x43c(%rbx)
je 0x3490
movq %rbx, %rdi
callq 0x2260
incq %r15
movq (%rbx), %rax
movslq 0x10(%rax), %rcx
cmpq %rcx, %r15
jl 0x3470
jmp 0x34a9
movq %rbx, %rdi
callq 0x2260
movq 0x418(%rbx), %rcx
xorl %eax, %eax
xorl %edx, %edx
xorl %esi, %esi
cmpl $0x1, (%rcx,%rdx,4)
sbbl $-0x1, %esi
cmpl $0x2, %esi
jae 0x34d3
incq %rdx
cmpq $0x100, %rdx            # imm = 0x100
jne 0x34b6
movl $0x1, %eax
movl %eax, 0x420(%rbx)
popq %rbx
popq %r14
popq %r15
retq