private void callGraphDFS(int s){
  int t;
  CgEdge p;
  vis_cg[s]=low_cg[s]=pre_cnt++;
  queue_cg.addLast(s);
  p=call_graph[s];
  while (p != null) {
    t=p.t;
    if (vis_cg[t] == 0)     callGraphDFS(t);
    if (low_cg[t] < low_cg[s])     low_cg[s]=low_cg[t];
    p=p.next;
  }
  if (low_cg[s] < vis_cg[s]) {
    scc_size[s]=1;
    return;
  }
  scc_size[s]=queue_cg.size();
  do {
    t=queue_cg.getLast();
    queue_cg.removeLast();
    rep_cg[t]=s;
    low_cg[t]+=n_func;
  }
 while (s != t);
  scc_size[s]-=queue_cg.size();
  if (scc_size[s] > max_scc_size) {
    max_scc_size=scc_size[s];
    max_scc_id=s;
  }
}

private void callGraphDFS ( int s ) { int t ; CgEdge p ; vis_cg [ s ] = low_cg [ s ] = pre_cnt ++ ; queue_cg . addLast ( s ) ; p = call_graph [ s ] ; while ( p != null ) { t = p . t ; if ( vis_cg [ t ] == 0 ) callGraphDFS ( t ) ; if ( low_cg [ t ] < low_cg [ s ] ) low_cg [ s ] = low_cg [ t ] ; p = p . next ; } if ( low_cg [ s ] < vis_cg [ s ] ) { scc_size [ s ] = 1 ; return ; } scc_size [ s ] = queue_cg . size ( ) ; do { t = queue_cg . getLast ( ) ; queue_cg . removeLast ( ) ; rep_cg [ t ] = s ; low_cg [ t ] += n_func ; } while ( s != t ) ; scc_size [ s ] -= queue_cg . size ( ) ; if ( scc_size [ s ] > max_scc_size ) { max_scc_size = scc_size [ s ] ; max_scc_id = s ; } }
using tarjan ' s algorithm to contract the sccs .
