question: private void markReachableMethods ( ) { int ans = 0 ; CgEdge p ; for ( int i = 0 ; i < n_func ; ++ i ) vis_cg [ i ] = 0 ; queue_cg . clear ( ) ; queue_cg . add ( Constants . SUPER_MAIN ) ; vis_cg [ Constants . SUPER_MAIN ] = 1 ; while ( queue_cg . size ( ) > 0 ) { int s = queue_cg . removeFirst ( ) ; p = call_graph [ s ] ; while ( p != null ) { int t = p . t ; if ( vis_cg [ t ] == 0 ) { queue_cg . add ( t ) ; vis_cg [ t ] = 1 ; ++ ans ; } p = p . next ; } } n_reach_methods = ans ; ans = 0 ; for ( int i = 1 ; i < n_func ; ++ i ) { SootMethod sm = int2func . get ( i ) ; if ( vis_cg [ i ] == 0 ) { func2int . remove ( sm ) ; int2func . remove ( i ) ; } else { if ( ! sm . isJavaLibraryMethod ( ) ) ++ ans ; } } n_reach_user_methods = ans ; }
target:  Scan the call graph and mark the reachable methods.