// File: /workspace/github_c_makefile_star2_O0/jondurbin[P]dre2/src/dre2_parse.c
// Function: dre2_strip_groups
void dre2_strip_groups( struct dre2 *graph, struct dre2 *new_graph, struct dre2_node **new_nodes, int *minimal, int **new_minimal, int *new_minimal_count, int **minimal_id )
{
  int i, j, k;
  struct dre2_node *nodes, *node;
  int node_count;
  int removed, offset;
  int *reachable, *visited, *temp_minimal;
  int *min_reachable, *min_visited;

  // Allocate some memory.
  reachable = ( int * )malloc( sizeof( int ) * graph->count );
  visited = ( int * )malloc( sizeof( int ) * graph->count );
  temp_minimal = ( int * )malloc( sizeof( int ) );
  min_reachable = ( int * )malloc( sizeof( int ) * graph->count );
  min_visited = ( int * )malloc( sizeof( int ) * graph->count );

  for ( i = 0; i < graph->count; i++ )
    ( *new_minimal )[i] = false;

  node_count = 0;
  *new_minimal_count = 0;
  for ( i = 0; i < graph->count; i++ )
  {
    // Initialize reachable nodes to all false.
    for ( j = 0; j < graph->count; j++ )
    {
      reachable[j] = false;
      visited[j] = false;
      min_reachable[j] = false;
      min_visited[j] = false;
    }
    dre2_reachable( graph, &reachable, &visited, i );
    dre2_min_reachable( graph, &min_reachable, &min_visited, i );

    if ( ( graph->v[i].c != DRE2_GROUP_OPEN && graph->v[i].c != DRE2_GROUP_CLOSE ) || ( i == 0 || i == graph->count - 1 ) )
    {
      // Add node to our min tree.
      dre2_add_node( new_nodes, &node_count, graph->v[i].c, &temp_minimal, true );

      ( *new_nodes )[node_count - 1].min_n_count = 0;
      ( *new_nodes )[node_count - 1].min_n = NULL;
      if ( minimal[i] )
      {
        ( *new_minimal )[node_count - 1] = true;
        *new_minimal_count = *new_minimal_count + 1;
        ( *minimal_id )[*new_minimal_count - 1] = node_count - 1;
      }
      graph->v[i].min_id = node_count - 1;
      if ( graph->v[i].c == DRE2_CHAR_CLASS )
      {
        for ( j = 0; j < RANGE; j++ )
          ( *new_nodes )[node_count - 1].possible[j] = graph->v[i].possible[j];
      }

      // Find the reachable nodes.
      for ( j = 0; j < graph->count; j++ )
      {
        if ( reachable[j] )
          dre2_add_neighbor( new_nodes, node_count - 1, j );
        if ( min_reachable[j] && minimal[j] )
        {
          ( *new_nodes )[node_count - 1].min_n_count++;
          if ( ( *new_nodes )[node_count - 1].min_n == NULL )
            ( *new_nodes )[node_count - 1].min_n = ( int * )malloc( sizeof( int ) * graph->count );
          ( *new_nodes )[node_count - 1].min_n[( *new_nodes )[node_count - 1].min_n_count - 1] = j;
        }
      }
    }
  }

  // Update the node IDs.
  for ( i = 0; i < node_count; i++ )
  {
    for ( j = 0; j < ( *new_nodes )[i].n_count; j++ )
      ( *new_nodes )[i].n[j] = graph->v[( *new_nodes )[i].n[j]].min_id;
  }

  for ( i = 0; i < *new_minimal_count; i++ )
  {
    for ( j = 0; j < ( *new_nodes )[( *minimal_id )[i]].min_n_count; j++ )
      ( *new_nodes )[( *minimal_id )[i]].min_n[j] = graph->v[( *new_nodes )[( *minimal_id )[i]].min_n[j]].min_id;
  }

  // Setup the minimized graph.
  new_graph->count = node_count;

  // Free the temp reachable nodes array.
  free( reachable );
  free( visited );
  free( temp_minimal );
  free( min_reachable );
  free( min_visited );

  // Set them all to null.
  reachable = NULL;
  visited = NULL;
  temp_minimal = NULL;
  min_reachable = NULL;
  min_visited = NULL;
}

// Assembly:
subq $0x88, %rsp
movq 0x90(%rsp), %rax
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq %rcx, 0x68(%rsp)
movq %r8, 0x60(%rsp)
movq %r9, 0x58(%rsp)
movq 0x80(%rsp), %rax
movslq 0x8(%rax), %rdi
shlq $0x2, %rdi
callq 0x2280
movq %rax, 0x20(%rsp)
movq 0x80(%rsp), %rax
movslq 0x8(%rax), %rdi
shlq $0x2, %rdi
callq 0x2280
movq %rax, 0x18(%rsp)
movl $0x4, %edi
callq 0x2280
movq %rax, 0x10(%rsp)
movq 0x80(%rsp), %rax
movslq 0x8(%rax), %rdi
shlq $0x2, %rdi
callq 0x2280
movq %rax, 0x8(%rsp)
movq 0x80(%rsp), %rax
movslq 0x8(%rax), %rdi
shlq $0x2, %rdi
callq 0x2280
movq %rax, (%rsp)
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
movq 0x80(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x5670
movq 0x60(%rsp), %rax
movq (%rax), %rax
movslq 0x54(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0x563e
movl $0x0, 0x34(%rsp)
movq 0x58(%rsp), %rax
movl $0x0, (%rax)
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
movq 0x80(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x5a59
movl $0x0, 0x50(%rsp)
movl 0x50(%rsp), %eax
movq 0x80(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x5709
movq 0x20(%rsp), %rax
movslq 0x50(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movq 0x18(%rsp), %rax
movslq 0x50(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movq 0x8(%rsp), %rax
movslq 0x50(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movq (%rsp), %rax
movslq 0x50(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movl 0x50(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x50(%rsp)
jmp 0x56a8
movq 0x80(%rsp), %rdi
movl 0x54(%rsp), %ecx
leaq 0x20(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x2190
movq 0x80(%rsp), %rdi
movl 0x54(%rsp), %ecx
leaq 0x8(%rsp), %rsi
movq %rsp, %rdx
callq 0x2060
movq 0x80(%rsp), %rax
movq (%rax), %rax
movslq 0x54(%rsp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
cmpl $-0x1, (%rax)
je 0x5775
movq 0x80(%rsp), %rax
movq (%rax), %rax
movslq 0x54(%rsp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
cmpl $-0x2, (%rax)
jne 0x5796
cmpl $0x0, 0x54(%rsp)
je 0x5796
movl 0x54(%rsp), %eax
movq 0x80(%rsp), %rcx
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x5a47
movq 0x70(%rsp), %rdi
movq 0x80(%rsp), %rax
movq (%rax), %rax
movslq 0x54(%rsp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movl (%rax), %edx
leaq 0x34(%rsp), %rsi
leaq 0x10(%rsp), %rcx
movl $0x1, %r8d
callq 0x20a0
movq 0x70(%rsp), %rax
movq (%rax), %rax
movl 0x34(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movl $0x0, 0x38(%rax)
movq 0x70(%rsp), %rax
movq (%rax), %rax
movl 0x34(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq $0x0, 0x30(%rax)
movq 0x68(%rsp), %rax
movslq 0x54(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x5866
movq 0x60(%rsp), %rax
movq (%rax), %rax
movl 0x34(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl $0x1, (%rax,%rcx,4)
movq 0x58(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movq 0x58(%rsp), %rax
movl %ecx, (%rax)
movl 0x34(%rsp), %edx
subl $0x1, %edx
movq 0x90(%rsp), %rax
movq (%rax), %rax
movq 0x58(%rsp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl 0x34(%rsp), %ecx
subl $0x1, %ecx
movq 0x80(%rsp), %rax
movq (%rax), %rax
movslq 0x54(%rsp), %rdx
shlq $0x6, %rdx
addq %rdx, %rax
movl %ecx, 0x24(%rax)
movq 0x80(%rsp), %rax
movq (%rax), %rax
movslq 0x54(%rsp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
cmpl $-0x3, (%rax)
jne 0x590c
movl $0x0, 0x50(%rsp)
cmpl $0x100, 0x50(%rsp)      # imm = 0x100
jge 0x590a
movq 0x80(%rsp), %rax
movq (%rax), %rax
movslq 0x54(%rsp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x28(%rax), %rax
movslq 0x50(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movq 0x70(%rsp), %rax
movq (%rax), %rax
movl 0x34(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x28(%rax), %rax
movslq 0x50(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x50(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x50(%rsp)
jmp 0x58ab
jmp 0x590c
movl $0x0, 0x50(%rsp)
movl 0x50(%rsp), %eax
movq 0x80(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x5a45
movq 0x20(%rsp), %rax
movslq 0x50(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x594e
movq 0x70(%rsp), %rdi
movl 0x34(%rsp), %esi
subl $0x1, %esi
movl 0x50(%rsp), %edx
callq 0x21a0
movq 0x8(%rsp), %rax
movslq 0x50(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x5a33
movq 0x68(%rsp), %rax
movslq 0x50(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x5a33
movq 0x70(%rsp), %rax
movq (%rax), %rax
movl 0x34(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x38(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x38(%rax)
movq 0x70(%rsp), %rax
movq (%rax), %rax
movl 0x34(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x6, %rcx
addq %rcx, %rax
cmpq $0x0, 0x30(%rax)
jne 0x59ed
movq 0x80(%rsp), %rax
movslq 0x8(%rax), %rdi
shlq $0x2, %rdi
callq 0x2280
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq (%rax), %rax
movl 0x34(%rsp), %edx
subl $0x1, %edx
movslq %edx, %rdx
shlq $0x6, %rdx
addq %rdx, %rax
movq %rcx, 0x30(%rax)
movl 0x50(%rsp), %edx
movq 0x70(%rsp), %rax
movq (%rax), %rax
movl 0x34(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x30(%rax), %rax
movq 0x70(%rsp), %rcx
movq (%rcx), %rcx
movl 0x34(%rsp), %esi
subl $0x1, %esi
movslq %esi, %rsi
shlq $0x6, %rsi
addq %rsi, %rcx
movl 0x38(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x5a35
movl 0x50(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x50(%rsp)
jmp 0x5914
jmp 0x5a47
jmp 0x5a49
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0x568b
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
cmpl 0x34(%rsp), %eax
jge 0x5b09
movl $0x0, 0x50(%rsp)
movl 0x50(%rsp), %eax
movq 0x70(%rsp), %rcx
movq (%rcx), %rcx
movslq 0x54(%rsp), %rdx
shlq $0x6, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
jge 0x5af7
movq 0x80(%rsp), %rax
movq (%rax), %rax
movq 0x70(%rsp), %rcx
movq (%rcx), %rcx
movslq 0x54(%rsp), %rdx
shlq $0x6, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
movslq 0x50(%rsp), %rdx
movslq (%rcx,%rdx,4), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x24(%rax), %edx
movq 0x70(%rsp), %rax
movq (%rax), %rax
movslq 0x54(%rsp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movslq 0x50(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x50(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x50(%rsp)
jmp 0x5a77
jmp 0x5af9
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0x5a61
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
movq 0x58(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x5bf0
movl $0x0, 0x50(%rsp)
movl 0x50(%rsp), %eax
movq 0x70(%rsp), %rcx
movq (%rcx), %rcx
movq 0x90(%rsp), %rdx
movq (%rdx), %rdx
movslq 0x54(%rsp), %rsi
movslq (%rdx,%rsi,4), %rdx
shlq $0x6, %rdx
addq %rdx, %rcx
cmpl 0x38(%rcx), %eax
jge 0x5bde
movq 0x80(%rsp), %rax
movq (%rax), %rax
movq 0x70(%rsp), %rcx
movq (%rcx), %rcx
movq 0x90(%rsp), %rdx
movq (%rdx), %rdx
movslq 0x54(%rsp), %rsi
movslq (%rdx,%rsi,4), %rdx
shlq $0x6, %rdx
addq %rdx, %rcx
movq 0x30(%rcx), %rcx
movslq 0x50(%rsp), %rdx
movslq (%rcx,%rdx,4), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x24(%rax), %edx
movq 0x70(%rsp), %rax
movq (%rax), %rax
movq 0x90(%rsp), %rcx
movq (%rcx), %rcx
movslq 0x54(%rsp), %rsi
movslq (%rcx,%rsi,4), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x30(%rax), %rax
movslq 0x50(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x50(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x50(%rsp)
jmp 0x5b2a
jmp 0x5be0
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0x5b11
movl 0x34(%rsp), %ecx
movq 0x78(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x20(%rsp), %rdi
callq 0x2070
movq 0x18(%rsp), %rdi
callq 0x2070
movq 0x10(%rsp), %rdi
callq 0x2070
movq 0x8(%rsp), %rdi
callq 0x2070
movq (%rsp), %rdi
callq 0x2070
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, (%rsp)
addq $0x88, %rsp
retq
nopw %cs:(%rax,%rax)