<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> from time import clock <EOL> LOOPS = <NUM_LIT> <EOL> __version__ = "<STR_LIT>" <EOL> [ Ident1 , Ident2 , Ident3 , Ident4 , Ident5 ] = range ( <NUM_LIT:1> , <NUM_LIT:6> ) <EOL> class Record ( object ) : <EOL> def __init__ ( self , PtrComp = None , Discr = <NUM_LIT:0> , EnumComp = <NUM_LIT:0> , <EOL> IntComp = <NUM_LIT:0> , StringComp = <NUM_LIT:0> ) : <EOL> self . PtrComp = PtrComp <EOL> self . Discr = Discr <EOL> self . EnumComp = EnumComp <EOL> self . IntComp = IntComp <EOL> self . StringComp = StringComp <EOL> def copy ( self ) : <EOL> return Record ( self . PtrComp , self . Discr , self . EnumComp , <EOL> self . IntComp , self . StringComp ) <EOL> TRUE = <NUM_LIT:1> <EOL> FALSE = <NUM_LIT:0> <EOL> def main ( loops = LOOPS ) : <EOL> benchtime , stones = pystones ( loops ) <EOL> print ( "<STR_LIT>" % ( __version__ , loops , benchtime ) ) <EOL> print ( "<STR_LIT>" % stones ) <EOL> def pystones ( loops = LOOPS ) : <EOL> return Proc0 ( loops ) <EOL> IntGlob = <NUM_LIT:0> <EOL> BoolGlob = FALSE <EOL> Char1Glob = '<STR_LIT>' <EOL> Char2Glob = '<STR_LIT>' <EOL> Array1Glob = [ <NUM_LIT:0> ] * <NUM_LIT> <EOL> Array2Glob = [ x [ : ] for x in [ Array1Glob ] * <NUM_LIT> ] <EOL> PtrGlb = None <EOL> PtrGlbNext = None <EOL> def Proc0 ( loops = LOOPS ) : <EOL> global IntGlob <EOL> global BoolGlob <EOL> global Char1Glob <EOL> global Char2Glob <EOL> global Array1Glob <EOL> global Array2Glob <EOL> global PtrGlb <EOL> global PtrGlbNext <EOL> starttime = clock ( ) <EOL> for i in range ( loops ) : <EOL> pass <EOL> nulltime = clock ( ) - starttime <EOL> PtrGlbNext = Record ( ) <EOL> PtrGlb = Record ( ) <EOL> PtrGlb . PtrComp = PtrGlbNext <EOL> PtrGlb . Discr = Ident1 <EOL> PtrGlb . EnumComp = Ident3 <EOL> PtrGlb . IntComp = <NUM_LIT> <EOL> PtrGlb . StringComp = "<STR_LIT>" <EOL> String1Loc = "<STR_LIT>" <EOL> Array2Glob [ <NUM_LIT:8> ] [ <NUM_LIT:7> ] = <NUM_LIT:10> <EOL> starttime = clock ( ) <EOL> for i in range ( loops ) : <EOL> Proc5 ( ) <EOL> Proc4 ( ) <EOL> IntLoc1 = <NUM_LIT:2> <EOL> IntLoc2 = <NUM_LIT:3> <EOL> String2Loc = "<STR_LIT>" <EOL> EnumLoc = Ident2 <EOL> BoolGlob = not Func2 ( String1Loc , String2Loc ) <EOL> while IntLoc1 < IntLoc2 : <EOL> IntLoc3 = <NUM_LIT:5> * IntLoc1 - IntLoc2 <EOL> IntLoc3 = Proc7 ( IntLoc1 , IntLoc2 ) <EOL> IntLoc1 = IntLoc1 + <NUM_LIT:1> <EOL> Proc8 ( Array1Glob , Array2Glob , IntLoc1 , IntLoc3 ) <EOL> PtrGlb = Proc1 ( PtrGlb ) <EOL> CharIndex = '<STR_LIT:A>' <EOL> while CharIndex <= Char2Glob : <EOL> if EnumLoc == Func1 ( CharIndex , '<STR_LIT:C>' ) : <EOL> EnumLoc = Proc6 ( Ident1 ) <EOL> CharIndex = chr ( ord ( CharIndex ) + <NUM_LIT:1> ) <EOL> IntLoc3 = IntLoc2 * IntLoc1 <EOL> IntLoc2 = IntLoc3 / IntLoc1 <EOL> IntLoc2 = <NUM_LIT:7> * ( IntLoc3 - IntLoc2 ) - IntLoc1 <EOL> IntLoc1 = Proc2 ( IntLoc1 ) <EOL> benchtime = clock ( ) - starttime - nulltime <EOL> if benchtime == <NUM_LIT:0.0> : <EOL> loopsPerBenchtime = <NUM_LIT:0.0> <EOL> else : <EOL> loopsPerBenchtime = ( loops / benchtime ) <EOL> return benchtime , loopsPerBenchtime <EOL> def Proc1 ( PtrParIn ) : <EOL> PtrParIn . PtrComp = NextRecord = PtrGlb . copy ( ) <EOL> PtrParIn . IntComp = <NUM_LIT:5> <EOL> NextRecord . IntComp = PtrParIn . IntComp <EOL> NextRecord . PtrComp = PtrParIn . PtrComp <EOL> NextRecord . PtrComp = Proc3 ( NextRecord . PtrComp ) <EOL> if NextRecord . Discr == Ident1 : <EOL> NextRecord . IntComp = <NUM_LIT:6> <EOL> NextRecord . EnumComp = Proc6 ( PtrParIn . EnumComp ) <EOL> NextRecord . PtrComp = PtrGlb . PtrComp <EOL> NextRecord . IntComp = Proc7 ( NextRecord . IntComp , <NUM_LIT:10> ) <EOL> else : <EOL> PtrParIn = NextRecord . copy ( ) <EOL> NextRecord . PtrComp = None <EOL> return PtrParIn <EOL> def Proc2 ( IntParIO ) : <EOL> IntLoc = IntParIO + <NUM_LIT:10> <EOL> while <NUM_LIT:1> : <EOL> if Char1Glob == '<STR_LIT:A>' : <EOL> IntLoc = IntLoc - <NUM_LIT:1> <EOL> IntParIO = IntLoc - IntGlob <EOL> EnumLoc = Ident1 <EOL> if EnumLoc == Ident1 : <EOL> break <EOL> return IntParIO <EOL> def Proc3 ( PtrParOut ) : <EOL> global IntGlob <EOL> if PtrGlb is not None : <EOL> PtrParOut = PtrGlb . PtrComp <EOL> else : <EOL> IntGlob = <NUM_LIT:100> <EOL> PtrGlb . IntComp = Proc7 ( <NUM_LIT:10> , IntGlob ) <EOL> return PtrParOut <EOL> def Proc4 ( ) : <EOL> global Char2Glob <EOL> BoolLoc = Char1Glob == '<STR_LIT:A>' <EOL> BoolLoc = BoolLoc or BoolGlob <EOL> Char2Glob = '<STR_LIT:B>' <EOL> def Proc5 ( ) : <EOL> global Char1Glob <EOL> global BoolGlob <EOL> Char1Glob = '<STR_LIT:A>' <EOL> BoolGlob = FALSE <EOL> def Proc6 ( EnumParIn ) : <EOL> EnumParOut = EnumParIn <EOL> if not Func3 ( EnumParIn ) : <EOL> EnumParOut = Ident4 <EOL> if EnumParIn == Ident1 : <EOL> EnumParOut = Ident1 <EOL> elif EnumParIn == Ident2 : <EOL> if IntGlob > <NUM_LIT:100> : <EOL> EnumParOut = Ident1 <EOL> else : <EOL> EnumParOut = Ident4 <EOL> elif EnumParIn == Ident3 : <EOL> EnumParOut = Ident2 <EOL> elif EnumParIn == Ident4 : <EOL> pass <EOL> elif EnumParIn == Ident5 : <EOL> EnumParOut = Ident3 <EOL> return EnumParOut <EOL> def Proc7 ( IntParI1 , IntParI2 ) : <EOL> IntLoc = IntParI1 + <NUM_LIT:2> <EOL> IntParOut = IntParI2 + IntLoc <EOL> return IntParOut <EOL> def Proc8 ( Array1Par , Array2Par , IntParI1 , IntParI2 ) : <EOL> global IntGlob <EOL> IntLoc = IntParI1 + <NUM_LIT:5> <EOL> Array1Par [ IntLoc ] = IntParI2 <EOL> Array1Par [ IntLoc + <NUM_LIT:1> ] = Array1Par [ IntLoc ] <EOL> Array1Par [ IntLoc + <NUM_LIT:30> ] = IntLoc <EOL> for IntIndex in range ( IntLoc , IntLoc + <NUM_LIT:2> ) : <EOL> Array2Par [ IntLoc ] [ IntIndex ] = IntLoc <EOL> Array2Par [ IntLoc ] [ IntLoc - <NUM_LIT:1> ] = Array2Par [ IntLoc ] [ IntLoc - <NUM_LIT:1> ] + <NUM_LIT:1> <EOL> Array2Par [ IntLoc + <NUM_LIT:20> ] [ IntLoc ] = Array1Par [ IntLoc ] <EOL> IntGlob = <NUM_LIT:5> <EOL> def Func1 ( CharPar1 , CharPar2 ) : <EOL> CharLoc1 = CharPar1 <EOL> CharLoc2 = CharLoc1 <EOL> if CharLoc2 != CharPar2 : <EOL> return Ident1 <EOL> else : <EOL> return Ident2 <EOL> def Func2 ( StrParI1 , StrParI2 ) : <EOL> IntLoc = <NUM_LIT:1> <EOL> while IntLoc <= <NUM_LIT:1> : <EOL> if Func1 ( StrParI1 [ IntLoc ] , StrParI2 [ IntLoc + <NUM_LIT:1> ] ) == Ident1 : <EOL> CharLoc = '<STR_LIT:A>' <EOL> IntLoc = IntLoc + <NUM_LIT:1> <EOL> if CharLoc >= '<STR_LIT>' and CharLoc <= '<STR_LIT>' : <EOL> IntLoc = <NUM_LIT:7> <EOL> if CharLoc == '<STR_LIT:X>' : <EOL> return TRUE <EOL> else : <EOL> if StrParI1 > StrParI2 : <EOL> IntLoc = IntLoc + <NUM_LIT:7> <EOL> return TRUE <EOL> else : <EOL> return FALSE <EOL> def Func3 ( EnumParIn ) : <EOL> EnumLoc = EnumParIn <EOL> if EnumLoc == Ident3 : return TRUE <EOL> return FALSE <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> import sys <EOL> def error ( msg ) : <EOL> print ( msg , end = '<STR_LIT:U+0020>' , file = sys . stderr ) <EOL> print ( "<STR_LIT>" % sys . argv [ <NUM_LIT:0> ] , file = sys . stderr ) <EOL> sys . exit ( <NUM_LIT:100> ) <EOL> nargs = len ( sys . argv ) - <NUM_LIT:1> <EOL> if nargs > <NUM_LIT:1> : <EOL> error ( "<STR_LIT>" % nargs ) <EOL> elif nargs == <NUM_LIT:1> : <EOL> try : loops = int ( sys . argv [ <NUM_LIT:1> ] ) <EOL> except ValueError : <EOL> error ( "<STR_LIT>" % sys . argv [ <NUM_LIT:1> ] ) <EOL> else : <EOL> loops = LOOPS <EOL> main ( loops ) </s>
