Module("system/posix/time",[Strategies([SDefNoArgs("times",PrimNoArgs("\"SSL_times\"")),SDefNoArgs("ticks-to-seconds",Seq(Match(Var("t")),Prim("\"SSL_TicksToSeconds\"",[Var("t")]))),RDefNoArgs("diff-times",RuleNoCond(NoAnnoList(Tuple([NoAnnoList(Tuple([Var("a1"),Var("b1"),Var("c1"),Var("d1")])),NoAnnoList(Tuple([Var("a2"),Var("b2"),Var("c2"),Var("d2")]))])),NoAnnoList(Tuple([App(CallNoArgs(SVar("subt")),NoAnnoList(Tuple([Var("a1"),Var("a2")]))),App(CallNoArgs(SVar("subt")),NoAnnoList(Tuple([Var("b1"),Var("b2")]))),App(CallNoArgs(SVar("subt")),NoAnnoList(Tuple([Var("c1"),Var("c2")]))),App(CallNoArgs(SVar("subt")),NoAnnoList(Tuple([Var("d1"),Var("d2")])))])))),RDefNoArgs("add-times",RuleNoCond(NoAnnoList(Tuple([NoAnnoList(Tuple([Var("a1"),Var("b1"),Var("c1"),Var("d1")])),NoAnnoList(Tuple([Var("a2"),Var("b2"),Var("c2"),Var("d2")]))])),NoAnnoList(Tuple([App(CallNoArgs(SVar("add")),NoAnnoList(Tuple([Var("a1"),Var("a2")]))),App(CallNoArgs(SVar("add")),NoAnnoList(Tuple([Var("b1"),Var("b2")]))),App(CallNoArgs(SVar("add")),NoAnnoList(Tuple([Var("c1"),Var("c2")]))),App(CallNoArgs(SVar("add")),NoAnnoList(Tuple([Var("d1"),Var("d2")])))])))),RDefNoArgs("times-to-seconds",RuleNoCond(NoAnnoList(Tuple([Var("a"),Var("b"),Var("c"),Var("d")])),NoAnnoList(Tuple([App(CallNoArgs(SVar("ticks-to-seconds")),Var("a")),App(CallNoArgs(SVar("ticks-to-seconds")),Var("b")),App(CallNoArgs(SVar("ticks-to-seconds")),Var("c")),App(CallNoArgs(SVar("ticks-to-seconds")),Var("d"))])))),RDefNoArgs("user-time",RuleNoCond(NoAnnoList(Tuple([Var("a"),Var("b"),Var("c"),Var("d")])),Var("a"))),RDefNoArgs("system-time",RuleNoCond(NoAnnoList(Tuple([Var("a"),Var("b"),Var("c"),Var("d")])),Var("b"))),RDefNoArgs("cuser-time",RuleNoCond(NoAnnoList(Tuple([Var("a"),Var("b"),Var("c"),Var("d")])),Var("c"))),RDefNoArgs("csystem-time",RuleNoCond(NoAnnoList(Tuple([Var("a"),Var("b"),Var("c"),Var("d")])),Var("d"))),RDefNoArgs("self-children-user-time",RuleNoCond(NoAnnoList(Tuple([Var("a"),Var("b"),Var("c"),Var("d")])),App(CallNoArgs(SVar("add")),NoAnnoList(Tuple([Var("a"),Var("c")]))))),RDefNoArgs("self-children-sys-time",RuleNoCond(NoAnnoList(Tuple([Var("a"),Var("b"),Var("c"),Var("d")])),App(CallNoArgs(SVar("add")),NoAnnoList(Tuple([Var("b"),Var("d")]))))),SDefNoArgs("run-time",Seq(CallNoArgs(SVar("times")),Seq(Call(SVar("crush"),[Build(NoAnnoList(Int("0"))),CallNoArgs(SVar("add"))]),CallNoArgs(SVar("ticks-to-seconds"))))),SDefNoArgs("report-run-time",IfThen(BA(CallNoArgs(SVar("geq")),NoAnnoList(Tuple([App(CallNoArgs(SVar("get-config")),NoAnnoList(Str("\"--statistics\""))),NoAnnoList(Int("1"))]))),BA(CallNoArgs(SVar("fprintnl")),NoAnnoList(Tuple([NoAnnoList(Op("stderr",[])),NoAnnoList(List([App(CallNoArgs(SVar("whoami")),NoAnnoList(Tuple([]))),NoAnnoList(Str("\" (\"")),RootApp(CallNoArgs(SVar("run-time"))),NoAnnoList(Str("\" secs)\""))]))]))))),SDef("profile",[DefaultVarDec("s")],Seq(Where(AM(CallNoArgs(SVar("times")),Var("start"))),Seq(CallNoArgs(SVar("s")),Build(NoAnnoList(Tuple([RootApp(Id),RootApp(Seq(BA(CallNoArgs(SVar("diff-times")),NoAnnoList(Tuple([RootApp(CallNoArgs(SVar("times"))),Var("start")]))),Call(SVar("crush"),[Build(NoAnnoList(Int("0"))),CallNoArgs(SVar("add"))])))])))))),SDef("profile",[DefaultVarDec("msg"),DefaultVarDec("s")],Seq(Where(AM(CallNoArgs(SVar("times")),Var("start"))),Seq(CallNoArgs(SVar("s")),Where(BA(Seq(CallNoArgs(SVar("diff-times")),BA(CallNoArgs(SVar("fprint")),NoAnnoList(Tuple([NoAnnoList(Op("stderr",[])),NoAnnoList(List([RootApp(CallNoArgs(SVar("msg"))),NoAnnoList(Str("\" user \"")),RootApp(Seq(CallNoArgs(SVar("self-children-user-time")),CallNoArgs(SVar("ticks-to-seconds")))),NoAnnoList(Str("\" system \"")),RootApp(Seq(CallNoArgs(SVar("self-children-sys-time")),CallNoArgs(SVar("ticks-to-seconds")))),NoAnnoList(Str("\"\\n\""))]))])))),NoAnnoList(Tuple([RootApp(CallNoArgs(SVar("times"))),Var("start")]))))))),SDef("profile'",[DefaultVarDec("msg"),DefaultVarDec("s")],Seq(Where(AM(CallNoArgs(SVar("times")),Var("start"))),Seq(CallNoArgs(SVar("s")),Where(Seq(Build(NoAnnoList(Tuple([RootApp(CallNoArgs(SVar("times"))),Var("start")]))),Seq(CallNoArgs(SVar("diff-times")),Seq(Build(NoAnnoList(List([NoAnnoList(Str("\" user \"")),RootApp(Seq(CallNoArgs(SVar("self-children-user-time")),CallNoArgs(SVar("ticks-to-seconds")))),NoAnnoList(Str("\" system \"")),RootApp(Seq(CallNoArgs(SVar("self-children-sys-time")),CallNoArgs(SVar("ticks-to-seconds"))))]))),CallNoArgs(SVar("msg")))))))))])])
