// File: /workspace/github_c_makefile_star2_O0/jondurbin[P]dre2/src/dre2_parse.c
// Function: dre2_initial_skip
int dre2_initial_skip( struct dre2 *graph )
{
  int i, j;
  int complete;
  int *reachable, *r_temp, *swapper;
  int count, c_temp;
  int total;

  count = 0;

  reachable = ( int * )malloc( sizeof( int ) * graph->count );
  r_temp = ( int * )malloc( sizeof( int ) * graph->count );

  for ( i = 0; i < graph->v[0].n_count; i++ )
  {
    reachable[count++] = graph->v[0].n[i];
  }

  total = 0;
  complete = false;
  while ( true )
  {
    c_temp = 0;
    if ( count == 1 )
    {
      if ( ( graph->v[reachable[0]].c == DRE2_BOL ) ||
           ( graph->v[reachable[0]].c == DRE2_EOL ) ||
           ( graph->v[reachable[0]].c == DRE2_EOF ) )
        total--;
    }
    for ( i = 0; i < count; i++ )
    {
      if ( reachable[i] == graph->starting_point )
      {
        total--;
        complete = true;
        break;
      }
      for ( j = 0; j < graph->v[reachable[i]].n_count; j++ )
      {
        if ( graph->v[reachable[i]].n[j] > reachable[i] && !dre2_contains_int( r_temp, c_temp, graph->v[reachable[i]].n[j] ) )
          r_temp[c_temp++] = graph->v[reachable[i]].n[j];
      }
    }

    total++;
    if ( complete )
      break;
    count = c_temp;
    swapper = reachable;
    reachable = r_temp;
    r_temp = swapper;
  }

  free( reachable );
  free( r_temp );
  reachable = NULL;
  r_temp = NULL;

  return total;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl $0x0, 0x14(%rsp)
movq 0x40(%rsp), %rax
movslq 0x8(%rax), %rdi
shlq $0x2, %rdi
callq 0x2280
movq %rax, 0x28(%rsp)
movq 0x40(%rsp), %rax
movslq 0x8(%rax), %rdi
shlq $0x2, %rdi
callq 0x2280
movq %rax, 0x20(%rsp)
movl $0x0, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
movq 0x40(%rsp), %rcx
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
jge 0x62c1
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movslq 0x3c(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movq 0x28(%rsp), %rax
movl 0x14(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x14(%rsp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x6277
movl $0x0, 0xc(%rsp)
movl $0x0, 0x34(%rsp)
movl $0x0, 0x10(%rsp)
cmpl $0x1, 0x14(%rsp)
jne 0x6341
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x28(%rsp), %rcx
movslq (%rcx), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
cmpl $-0x12, (%rax)
je 0x6334
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x28(%rsp), %rcx
movslq (%rcx), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
cmpl $-0x11, (%rax)
je 0x6334
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x28(%rsp), %rcx
movslq (%rcx), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
cmpl $-0x4, (%rax)
jne 0x633f
movl 0xc(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x6341
movl $0x0, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
cmpl 0x14(%rsp), %eax
jge 0x6494
movq 0x28(%rsp), %rax
movslq 0x3c(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movq 0x40(%rsp), %rcx
cmpl 0x410(%rcx), %eax
jne 0x6389
movl 0xc(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0xc(%rsp)
movl $0x1, 0x34(%rsp)
jmp 0x6494
movl $0x0, 0x38(%rsp)
movl 0x38(%rsp), %eax
movq 0x40(%rsp), %rcx
movq (%rcx), %rcx
movq 0x28(%rsp), %rdx
movslq 0x3c(%rsp), %rsi
movslq (%rdx,%rsi,4), %rdx
shlq $0x6, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
jge 0x6482
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x28(%rsp), %rcx
movslq 0x3c(%rsp), %rdx
movslq (%rcx,%rdx,4), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movslq 0x38(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movq 0x28(%rsp), %rcx
movslq 0x3c(%rsp), %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x6470
movq 0x20(%rsp), %rdi
movl 0x10(%rsp), %esi
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x28(%rsp), %rcx
movslq 0x3c(%rsp), %rdx
movslq (%rcx,%rdx,4), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movslq 0x38(%rsp), %rcx
movl (%rax,%rcx,4), %edx
callq 0x2310
cmpl $0x0, %eax
jne 0x6470
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x28(%rsp), %rcx
movslq 0x3c(%rsp), %rdx
movslq (%rcx,%rdx,4), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movslq 0x38(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movq 0x20(%rsp), %rax
movl 0x10(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x10(%rsp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x6472
movl 0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x38(%rsp)
jmp 0x6391
jmp 0x6484
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x6349
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
cmpl $0x0, 0x34(%rsp)
je 0x64a8
jmp 0x64d3
movl 0x10(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x62d1
movq 0x28(%rsp), %rdi
callq 0x2070
movq 0x20(%rsp), %rdi
callq 0x2070
movq $0x0, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movl 0xc(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)