#!/bin/csh -f
#
# nonprefile - give the name of the non-prefetched file corresponding
# to each prefetching file given as an argument. One is output on each line.
#
# usage:
#  nonprefile file...
#
# typical usage:
#  set base=`nonprefile $file`
# or
#  set bases=`nonprefile $files`
#

# There are two forms of non-prefetching file: one where the
# prefetching is just turned off, and one where it is on, but with the
# NONE predictor. This makes a difference in the total number of
# buffers available, which matters to rnd, grnd, lpr, gpr, and lw.

foreach i ($*)
    set nonfile=`echo $i | sed 's/\(.*\)y......\.[0-9][0-9]\....\.[0-9][0-9][0-9]\..\.[0-9][0-9]\(.*\)/\1n.n.n.n.00.000.000.n.00\2/'`
    if (! -f $nonfile) then
        set nonfile=`echo $i | sed 's/\(.*\)\.[eiopaOPHgrws]\.[0-9][0-9]\.\(.*\)/\1.n.00.\2/'`
    endif

    echo $nonfile
end





