(val _ = Record
  ("StatusRegister"
    (sqbkt ("'rst" (FTy 23)) ("BEV" bTy) ("ERL" bTy) ("EXL" bTy)
           ("IE" bTy) ("IM0" bTy) ("IM1" bTy) ("KSU" (FTy 2)) ("RE" bTy))))


(val _ = Record ("ConfigRegister" (sqbkt ("'rst" (FTy 31)) ("BE" bTy))))


(val _ = Record
  ("CauseRegister" (sqbkt ("'rst" (FTy 27)) ("ExcCode" (FTy 5)))))


(val _ = Record
  ("CP0"
    (sqbkt ("Cause" CTy"CauseRegister") ("Config" CTy"ConfigRegister")
           ("Count" F32) ("EPC" F64) ("ErrorEPC" F64)
           ("Status" CTy"StatusRegister"))))


(val _ = Construct
  (sqbkt ("HLStatus"
           (sqbkt ("HLarith" []) ("HLok" []) ("HLmthi" []) ("HLmtlo" [])))))


(val _ = Construct
  (sqbkt ("IorD" (sqbkt ("INSTRUCTION" []) ("DATA" [])))))


(val _ = Construct (sqbkt ("LorS" (sqbkt ("LOAD" []) ("STORE" [])))))


(val _ = Construct
  (sqbkt ("ExceptionType"
           (sqbkt ("AdEL" []) ("AdES" []) ("Sys" []) ("Bp" []) ("RI" [])
                  ("Ov" []) ("Tr" [])))))


(val _ = Construct
  (sqbkt ("Branch"
           (sqbkt ("BEQ" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("BEQL" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("BGEZ" (sqbkt (PTy (FTy 5) F16)))
                  ("BGEZAL" (sqbkt (PTy (FTy 5) F16)))
                  ("BGEZALL" (sqbkt (PTy (FTy 5) F16)))
                  ("BGEZL" (sqbkt (PTy (FTy 5) F16)))
                  ("BGTZ" (sqbkt (PTy (FTy 5) F16)))
                  ("BGTZL" (sqbkt (PTy (FTy 5) F16)))
                  ("BLEZ" (sqbkt (PTy (FTy 5) F16)))
                  ("BLEZL" (sqbkt (PTy (FTy 5) F16)))
                  ("BLTZ" (sqbkt (PTy (FTy 5) F16)))
                  ("BLTZAL" (sqbkt (PTy (FTy 5) F16)))
                  ("BLTZALL" (sqbkt (PTy (FTy 5) F16)))
                  ("BLTZL" (sqbkt (PTy (FTy 5) F16)))
                  ("BNE" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("BNEL" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("J" (sqbkt (FTy 26))) ("JAL" (sqbkt (FTy 26)))
                  ("JALR" (sqbkt (PTy (FTy 5) (FTy 5))))
                  ("JR" (sqbkt (FTy 5)))))))


(val _ = Construct
  (sqbkt ("CP"
           (sqbkt ("DMFC0" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 3)))))
                  ("DMTC0" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 3)))))
                  ("MFC0" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 3)))))
                  ("MTC0" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 3)))))))))


(val _ = Construct
  (sqbkt ("Store"
           (sqbkt ("SB" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("SC" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("SCD" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("SD" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("SDL" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("SDR" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("SH" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("SW" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("SWL" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("SWR" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))))))


(val _ = Construct
  (sqbkt ("Load"
           (sqbkt ("LB" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("LBU" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("LD" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("LDL" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("LDR" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("LH" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("LHU" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("LL" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("LLD" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("LW" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("LWL" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("LWR" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("LWU" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))))))


(val _ = Construct
  (sqbkt ("Trap"
           (sqbkt ("TEQ" (sqbkt (PTy (FTy 5) (FTy 5))))
                  ("TEQI" (sqbkt (PTy (FTy 5) F16)))
                  ("TGE" (sqbkt (PTy (FTy 5) (FTy 5))))
                  ("TGEI" (sqbkt (PTy (FTy 5) F16)))
                  ("TGEIU" (sqbkt (PTy (FTy 5) F16)))
                  ("TGEU" (sqbkt (PTy (FTy 5) (FTy 5))))
                  ("TLT" (sqbkt (PTy (FTy 5) (FTy 5))))
                  ("TLTI" (sqbkt (PTy (FTy 5) F16)))
                  ("TLTIU" (sqbkt (PTy (FTy 5) F16)))
                  ("TLTU" (sqbkt (PTy (FTy 5) (FTy 5))))
                  ("TNE" (sqbkt (PTy (FTy 5) (FTy 5))))
                  ("TNEI" (sqbkt (PTy (FTy 5) F16)))))))


(val _ = Construct
  (sqbkt ("Shift"
           (sqbkt ("DSLL" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("DSLL32" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("DSLLV" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("DSRA" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("DSRA32" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("DSRAV" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("DSRL" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("DSRL32" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("DSRLV" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("SLL" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("SLLV" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("SRA" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("SRAV" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("SRL" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("SRLV" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))))))


(val _ = Construct
  (sqbkt ("MultDiv"
           (sqbkt ("DDIV" (sqbkt (PTy (FTy 5) (FTy 5))))
                  ("DDIVU" (sqbkt (PTy (FTy 5) (FTy 5))))
                  ("DIV" (sqbkt (PTy (FTy 5) (FTy 5))))
                  ("DIVU" (sqbkt (PTy (FTy 5) (FTy 5))))
                  ("DMULT" (sqbkt (PTy (FTy 5) (FTy 5))))
                  ("DMULTU" (sqbkt (PTy (FTy 5) (FTy 5))))
                  ("MFHI" (sqbkt (FTy 5))) ("MFLO" (sqbkt (FTy 5)))
                  ("MTHI" (sqbkt (FTy 5))) ("MTLO" (sqbkt (FTy 5)))
                  ("MULT" (sqbkt (PTy (FTy 5) (FTy 5))))
                  ("MULTU" (sqbkt (PTy (FTy 5) (FTy 5))))))))


(val _ = Construct
  (sqbkt ("ArithR"
           (sqbkt ("ADD" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("ADDU" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("AND" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("DADD" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("DADDU" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("DSUB" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("DSUBU" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("NOR" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("OR" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("SLT" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("SLTU" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("SUB" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("SUBU" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                  ("XOR" (sqbkt (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))))))


(val _ = Construct
  (sqbkt ("ArithI"
           (sqbkt ("ADDI" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("ADDIU" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("ANDI" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("DADDI" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("DADDIU" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("LUI" (sqbkt (PTy (FTy 5) F16)))
                  ("ORI" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("SLTI" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("SLTIU" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))
                  ("XORI" (sqbkt (PTy (FTy 5) (PTy (FTy 5) F16))))))))


(val _ = Construct
  (sqbkt ("instruction"
           (sqbkt ("ArithI" (sqbkt CTy"ArithI"))
                  ("ArithR" (sqbkt CTy"ArithR")) ("BREAK" [])
                  ("Branch" (sqbkt CTy"Branch")) ("CP" (sqbkt CTy"CP"))
                  ("ERET" []) ("Load" (sqbkt CTy"Load"))
                  ("MultDiv" (sqbkt CTy"MultDiv"))
                  ("ReservedInstruction" []) ("SYNC" (sqbkt (FTy 5)))
                  ("SYSCALL" []) ("Shift" (sqbkt CTy"Shift"))
                  ("Store" (sqbkt CTy"Store")) ("Trap" (sqbkt CTy"Trap"))))))


(val _ = Construct
  (sqbkt ("exception"
           (sqbkt ("NoException" []) ("UNPREDICTABLE" (sqbkt sTy))))))


(val _ = Record
  ("state"
    (sqbkt ("BranchStatus" (OTy F64)) ("CP0" CTy"CP0") ("HI" F64)
           ("HLStatus" CTy"HLStatus") ("LLbit" (OTy bTy)) ("LO" F64)
           ("MEM" (ATy F64 F8)) ("PC" F64) ("exception" CTy"exception")
           ("gpr" (ATy (FTy 5) F64)))))


(Def "raise'exception" (Var "e" CTy"exception")
  (Close qVar"state"
    (TP
      (sqbkt (LX VTy"a")
             (ITE
               (EQ (Dest "exception" CTy"exception" qVar"state")
                 (Const "NoException" CTy"exception"))
               (Rupd "exception"
                 (TP (sqbkt qVar"state" (Var "e" CTy"exception"))))
               qVar"state")))))


(Def "reg'StatusRegister" (Var "x" CTy"StatusRegister")
  (CS (Var "x" CTy"StatusRegister")
    (sqbkt ((Rec CTy"StatusRegister"
               (sqbkt (Var "'rst" (FTy 23)) bVar"BEV" bVar"ERL" bVar"EXL"
                      bVar"IE" bVar"IM0" bVar"IM1" (Var "KSU" (FTy 2))
                      bVar"RE"))
             (Bop Mdfy
               (Close (TP (sqbkt nVar"i" (AVar bTy)))
                 (ITB
                   (sqbkt ((EQ nVar"i" (LN 31))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 4)))
                          ((EQ nVar"i" (LN 30))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 3)))
                          ((EQ nVar"i" (LN 29))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 2)))
                          ((EQ nVar"i" (LN 28))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 1)))
                          ((EQ nVar"i" (LN 27))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 0)))
                          ((EQ nVar"i" (LN 26)) bVar"RE")
                          ((EQ nVar"i" (LN 25))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 7)))
                          ((EQ nVar"i" (LN 24))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 6)))
                          ((EQ nVar"i" (LN 23))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 5)))
                          ((EQ nVar"i" (LN 22)) bVar"BEV")
                          ((EQ nVar"i" (LN 21))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 19)))
                          ((EQ nVar"i" (LN 20))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 18)))
                          ((EQ nVar"i" (LN 19))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 17)))
                          ((EQ nVar"i" (LN 18))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 16)))
                          ((EQ nVar"i" (LN 17))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 15)))
                          ((EQ nVar"i" (LN 16))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 14)))
                          ((EQ nVar"i" (LN 15))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 13)))
                          ((EQ nVar"i" (LN 14))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 12)))
                          ((EQ nVar"i" (LN 13))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 11)))
                          ((EQ nVar"i" (LN 12))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 10)))
                          ((EQ nVar"i" (LN 11))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 9)))
                          ((EQ nVar"i" (LN 10))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 8)))
                          ((EQ nVar"i" (LN 9)) bVar"IM1")
                          ((EQ nVar"i" (LN 8)) bVar"IM0")
                          ((EQ nVar"i" (LN 7))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 22)))
                          ((EQ nVar"i" (LN 6))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 21)))
                          ((EQ nVar"i" (LN 5))
                            (Bop Bit (Var "'rst" (FTy 23)) (LN 20)))
                          ((EQ nVar"i" (LN 4))
                            (Bop Bit (Var "KSU" (FTy 2)) (LN 1)))
                          ((EQ nVar"i" (LN 3))
                            (Bop Bit (Var "KSU" (FTy 2)) (LN 0)))
                          ((EQ nVar"i" (LN 2)) bVar"ERL")
                          ((EQ nVar"i" (LN 1)) bVar"EXL")) bVar"IE"))
               (LW 0 32))))))


(Def "rec'StatusRegister" (Var "x" F32)
  (Rec CTy"StatusRegister"
    (sqbkt CC(sqbkt (EX (Var "x" F32) (LN 7) (LN 5) (FTy 3))
                    (EX (Var "x" F32) (LN 21) (LN 10) (FTy 12))
                    (EX (Var "x" F32) (LN 25) (LN 23) (FTy 3))
                    (EX (Var "x" F32) (LN 31) (LN 27) (FTy 5)))
           (Bop Bit (Var "x" F32) (LN 22)) (Bop Bit (Var "x" F32) (LN 2))
           (Bop Bit (Var "x" F32) (LN 1)) (Bop Bit (Var "x" F32) (LN 0))
           (Bop Bit (Var "x" F32) (LN 8)) (Bop Bit (Var "x" F32) (LN 9))
           (EX (Var "x" F32) (LN 4) (LN 3) (FTy 2))
           (Bop Bit (Var "x" F32) (LN 26)))))


(Def "write'rec'StatusRegister"
  (TP (sqbkt (AVar F32) (Var "x" CTy"StatusRegister")))
  (Call "reg'StatusRegister" F32 (Var "x" CTy"StatusRegister")))


(Def "write'reg'StatusRegister"
  (TP (sqbkt (AVar CTy"StatusRegister") (Var "x" F32)))
  (Call "rec'StatusRegister" CTy"StatusRegister" (Var "x" F32)))


(Def "reg'ConfigRegister" (Var "x" CTy"ConfigRegister")
  (CS (Var "x" CTy"ConfigRegister")
    (sqbkt ((Rec CTy"ConfigRegister"
               (sqbkt (Var "'rst" (FTy 31)) bVar"BE"))
             (Bop Mdfy
               (Close (TP (sqbkt nVar"i" (AVar bTy)))
                 (ITB
                   (sqbkt ((EQ nVar"i" (LN 31))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 15)))
                          ((EQ nVar"i" (LN 30))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 14)))
                          ((EQ nVar"i" (LN 29))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 13)))
                          ((EQ nVar"i" (LN 28))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 12)))
                          ((EQ nVar"i" (LN 27))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 11)))
                          ((EQ nVar"i" (LN 26))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 10)))
                          ((EQ nVar"i" (LN 25))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 9)))
                          ((EQ nVar"i" (LN 24))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 8)))
                          ((EQ nVar"i" (LN 23))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 7)))
                          ((EQ nVar"i" (LN 22))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 6)))
                          ((EQ nVar"i" (LN 21))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 5)))
                          ((EQ nVar"i" (LN 20))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 4)))
                          ((EQ nVar"i" (LN 19))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 3)))
                          ((EQ nVar"i" (LN 18))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 2)))
                          ((EQ nVar"i" (LN 17))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 1)))
                          ((EQ nVar"i" (LN 16))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 0)))
                          ((EQ nVar"i" (LN 15)) bVar"BE")
                          ((EQ nVar"i" (LN 14))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 30)))
                          ((EQ nVar"i" (LN 13))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 29)))
                          ((EQ nVar"i" (LN 12))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 28)))
                          ((EQ nVar"i" (LN 11))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 27)))
                          ((EQ nVar"i" (LN 10))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 26)))
                          ((EQ nVar"i" (LN 9))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 25)))
                          ((EQ nVar"i" (LN 8))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 24)))
                          ((EQ nVar"i" (LN 7))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 23)))
                          ((EQ nVar"i" (LN 6))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 22)))
                          ((EQ nVar"i" (LN 5))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 21)))
                          ((EQ nVar"i" (LN 4))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 20)))
                          ((EQ nVar"i" (LN 3))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 19)))
                          ((EQ nVar"i" (LN 2))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 18)))
                          ((EQ nVar"i" (LN 1))
                            (Bop Bit (Var "'rst" (FTy 31)) (LN 17))))
                   (Bop Bit (Var "'rst" (FTy 31)) (LN 16)))) (LW 0 32))))))


(Def "rec'ConfigRegister" (Var "x" F32)
  (Rec CTy"ConfigRegister"
    (sqbkt CC(sqbkt (EX (Var "x" F32) (LN 14) (LN 0) (FTy 15))
                    (EX (Var "x" F32) (LN 31) (LN 16) F16))
           (Bop Bit (Var "x" F32) (LN 15)))))


(Def "write'rec'ConfigRegister"
  (TP (sqbkt (AVar F32) (Var "x" CTy"ConfigRegister")))
  (Call "reg'ConfigRegister" F32 (Var "x" CTy"ConfigRegister")))


(Def "write'reg'ConfigRegister"
  (TP (sqbkt (AVar CTy"ConfigRegister") (Var "x" F32)))
  (Call "rec'ConfigRegister" CTy"ConfigRegister" (Var "x" F32)))


(Def "reg'CauseRegister" (Var "x" CTy"CauseRegister")
  (CS (Var "x" CTy"CauseRegister")
    (sqbkt ((Rec CTy"CauseRegister"
               (sqbkt (Var "'rst" (FTy 27)) (Var "ExcCode" (FTy 5))))
             (Bop Mdfy
               (Close (TP (sqbkt nVar"i" (AVar bTy)))
                 (ITB
                   (sqbkt ((EQ nVar"i" (LN 31))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 24)))
                          ((EQ nVar"i" (LN 30))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 23)))
                          ((EQ nVar"i" (LN 29))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 22)))
                          ((EQ nVar"i" (LN 28))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 21)))
                          ((EQ nVar"i" (LN 27))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 20)))
                          ((EQ nVar"i" (LN 26))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 19)))
                          ((EQ nVar"i" (LN 25))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 18)))
                          ((EQ nVar"i" (LN 24))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 17)))
                          ((EQ nVar"i" (LN 23))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 16)))
                          ((EQ nVar"i" (LN 22))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 15)))
                          ((EQ nVar"i" (LN 21))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 14)))
                          ((EQ nVar"i" (LN 20))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 13)))
                          ((EQ nVar"i" (LN 19))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 12)))
                          ((EQ nVar"i" (LN 18))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 11)))
                          ((EQ nVar"i" (LN 17))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 10)))
                          ((EQ nVar"i" (LN 16))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 9)))
                          ((EQ nVar"i" (LN 15))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 8)))
                          ((EQ nVar"i" (LN 14))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 7)))
                          ((EQ nVar"i" (LN 13))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 6)))
                          ((EQ nVar"i" (LN 12))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 5)))
                          ((EQ nVar"i" (LN 11))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 4)))
                          ((EQ nVar"i" (LN 10))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 3)))
                          ((EQ nVar"i" (LN 9))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 2)))
                          ((EQ nVar"i" (LN 8))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 1)))
                          ((EQ nVar"i" (LN 7))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 0)))
                          ((EQ nVar"i" (LN 6))
                            (Bop Bit (Var "ExcCode" (FTy 5)) (LN 4)))
                          ((EQ nVar"i" (LN 5))
                            (Bop Bit (Var "ExcCode" (FTy 5)) (LN 3)))
                          ((EQ nVar"i" (LN 4))
                            (Bop Bit (Var "ExcCode" (FTy 5)) (LN 2)))
                          ((EQ nVar"i" (LN 3))
                            (Bop Bit (Var "ExcCode" (FTy 5)) (LN 1)))
                          ((EQ nVar"i" (LN 2))
                            (Bop Bit (Var "ExcCode" (FTy 5)) (LN 0)))
                          ((EQ nVar"i" (LN 1))
                            (Bop Bit (Var "'rst" (FTy 27)) (LN 26))))
                   (Bop Bit (Var "'rst" (FTy 27)) (LN 25)))) (LW 0 32))))))


(Def "rec'CauseRegister" (Var "x" F32)
  (Rec CTy"CauseRegister"
    (sqbkt CC(sqbkt (EX (Var "x" F32) (LN 1) (LN 0) (FTy 2))
                    (EX (Var "x" F32) (LN 31) (LN 7) (FTy 25)))
           (EX (Var "x" F32) (LN 6) (LN 2) (FTy 5)))))


(Def "write'rec'CauseRegister"
  (TP (sqbkt (AVar F32) (Var "x" CTy"CauseRegister")))
  (Call "reg'CauseRegister" F32 (Var "x" CTy"CauseRegister")))


(Def "write'reg'CauseRegister"
  (TP (sqbkt (AVar CTy"CauseRegister") (Var "x" F32)))
  (Call "rec'CauseRegister" CTy"CauseRegister" (Var "x" F32)))


(Def "write'GPR" (TP (sqbkt (Var "value" F64) (Var "n" (FTy 5))))
  (Close qVar"state"
    (TP
      (sqbkt LU
             (ITE (Mop Not (EQ (Var "n" (FTy 5)) (LW 0 5)))
               (Rupd "gpr"
                 (TP
                   (sqbkt qVar"state"
                          (Fupd (Dest "gpr" (ATy (FTy 5) F64) qVar"state")
                            (Var "n" (FTy 5)) (Var "value" F64)))))
               qVar"state")))))


(Def "GPR" (Var "n" (FTy 5))
  (Close qVar"state"
    (TP
      (sqbkt (ITE (EQ (Var "n" (FTy 5)) (LW 0 5)) (LW 0 64)
               (Apply (Dest "gpr" (ATy (FTy 5) F64) qVar"state")
                 (Var "n" (FTy 5)))) qVar"state"))))


(Def "write'CPR"
  (TP
    (sqbkt (Var "value" F64) nVar"n" (Var "reg" (FTy 5))
           (Var "sel" (FTy 3))))
  (Close qVar"state"
    (CS (TP (sqbkt nVar"n" (Var "reg" (FTy 5)) (Var "sel" (FTy 3))))
      (sqbkt ((TP (sqbkt LN 0 (LW 9 5) (LW 0 3)))
               (TP
                 (sqbkt LU
                        (Rupd "CP0"
                          (TP
                            (sqbkt qVar"state"
                                   (Rupd "Count"
                                     (TP
                                       (sqbkt (Dest "CP0" CTy"CP0"
                                                qVar"state")
                                              (EX (Var "value" F64)
                                                (LN 31) (LN 0) F32))))))))))
             ((TP (sqbkt LN 0 (LW 12 5) (LW 0 3)))
               (Let (Var "v" CTy"CP0") (Dest "CP0" CTy"CP0" qVar"state")
                 (TP
                   (sqbkt LU
                          (Rupd "CP0"
                            (TP
                              (sqbkt qVar"state"
                                     (Rupd "Status"
                                       (TP
                                         (sqbkt (Var "v" CTy"CP0")
                                                (Call
                                                  "write'reg'StatusRegister"
                                                  CTy"StatusRegister"
                                                  (TP
                                                    (sqbkt (Dest "Status"
                                                             CTy"StatusRegister"
                                                             (Var "v"
                                                               CTy"CP0"))
                                                           (EX
                                                             (Var "value"
                                                               F64)
                                                             (LN 31)
                                                             (LN 0) F32))))))))))))))
             ((TP (sqbkt LN 0 (LW 13 5) (LW 0 3)))
               (Let (Var "v" CTy"CP0") (Dest "CP0" CTy"CP0" qVar"state")
                 (TP
                   (sqbkt LU
                          (Rupd "CP0"
                            (TP
                              (sqbkt qVar"state"
                                     (Rupd "Cause"
                                       (TP
                                         (sqbkt (Var "v" CTy"CP0")
                                                (Call
                                                  "write'reg'CauseRegister"
                                                  CTy"CauseRegister"
                                                  (TP
                                                    (sqbkt (Dest "Cause"
                                                             CTy"CauseRegister"
                                                             (Var "v"
                                                               CTy"CP0"))
                                                           (EX
                                                             (Var "value"
                                                               F64)
                                                             (LN 31)
                                                             (LN 0) F32))))))))))))))
             ((TP (sqbkt LN 0 (LW 14 5) (LW 0 3)))
               (TP
                 (sqbkt LU
                        (Rupd "CP0"
                          (TP
                            (sqbkt qVar"state"
                                   (Rupd "EPC"
                                     (TP
                                       (sqbkt (Dest "CP0" CTy"CP0"
                                                qVar"state")
                                              (Var "value" F64))))))))))
             ((TP (sqbkt LN 0 (LW 16 5) (LW 0 3)))
               (Let (Var "v" CTy"CP0") (Dest "CP0" CTy"CP0" qVar"state")
                 (TP
                   (sqbkt LU
                          (Rupd "CP0"
                            (TP
                              (sqbkt qVar"state"
                                     (Rupd "Config"
                                       (TP
                                         (sqbkt (Var "v" CTy"CP0")
                                                (Call
                                                  "write'reg'ConfigRegister"
                                                  CTy"ConfigRegister"
                                                  (TP
                                                    (sqbkt (Dest "Config"
                                                             CTy"ConfigRegister"
                                                             (Var "v"
                                                               CTy"CP0"))
                                                           (EX
                                                             (Var "value"
                                                               F64)
                                                             (LN 31)
                                                             (LN 0) F32))))))))))))))
             ((TP (sqbkt LN 0 (LW 30 5) (LW 0 3)))
               (TP
                 (sqbkt LU
                        (Rupd "CP0"
                          (TP
                            (sqbkt qVar"state"
                                   (Rupd "ErrorEPC"
                                     (TP
                                       (sqbkt (Dest "CP0" CTy"CP0"
                                                qVar"state")
                                              (Var "value" F64))))))))))
             ((AVar (PTy nTy (PTy (FTy 5) (FTy 3))))
               (TP (sqbkt LU qVar"state")))))))


(Def "CPR" (TP (sqbkt nVar"n" (Var "reg" (FTy 5)) (Var "sel" (FTy 3))))
  (Close qVar"state"
    (CS (TP (sqbkt nVar"n" (Var "reg" (FTy 5)) (Var "sel" (FTy 3))))
      (sqbkt ((TP (sqbkt LN 0 (LW 9 5) (LW 0 3)))
               (TP
                 (sqbkt (Mop (Cast F64)
                          (Dest "Count" F32
                            (Dest "CP0" CTy"CP0" qVar"state")))
                        qVar"state")))
             ((TP (sqbkt LN 0 (LW 12 5) (LW 0 3)))
               (TP
                 (sqbkt (Mop (Cast F64)
                          (Call "reg'StatusRegister" F32
                            (Dest "Status" CTy"StatusRegister"
                              (Dest "CP0" CTy"CP0" qVar"state"))))
                        qVar"state")))
             ((TP (sqbkt LN 0 (LW 13 5) (LW 0 3)))
               (TP
                 (sqbkt (Mop (Cast F64)
                          (Call "reg'CauseRegister" F32
                            (Dest "Cause" CTy"CauseRegister"
                              (Dest "CP0" CTy"CP0" qVar"state"))))
                        qVar"state")))
             ((TP (sqbkt LN 0 (LW 14 5) (LW 0 3)))
               (TP
                 (sqbkt (Dest "EPC" F64 (Dest "CP0" CTy"CP0" qVar"state"))
                        qVar"state")))
             ((TP (sqbkt LN 0 (LW 16 5) (LW 0 3)))
               (TP
                 (sqbkt (Mop (Cast F64)
                          (Call "reg'ConfigRegister" F32
                            (Dest "Config" CTy"ConfigRegister"
                              (Dest "CP0" CTy"CP0" qVar"state"))))
                        qVar"state")))
             ((TP (sqbkt LN 0 (LW 30 5) (LW 0 3)))
               (TP
                 (sqbkt (Dest "ErrorEPC" F64
                          (Dest "CP0" CTy"CP0" qVar"state")) qVar"state")))
             ((AVar (PTy nTy (PTy (FTy 5) (FTy 3))))
               (TP (sqbkt (LX F64) qVar"state")))))))


(Def0 "BYTE" (LW 0 3))


(Def0 "HALFWORD" (LW 1 3))


(Def0 "WORD" (LW 3 3))


(Def0 "DOUBLEWORD" (LW 7 3))


(Def0 "PSIZE" (LN 64))


(Def "UserMode" qVar"state"
  (TP
    (sqbkt (Bop And
             (Bop And
               (EQ
                 (Dest "KSU" (FTy 2)
                   (Dest "Status" CTy"StatusRegister"
                     (Dest "CP0" CTy"CP0" qVar"state"))) (LW 2 2))
               (Mop Not
                 (Dest "EXL" bTy
                   (Dest "Status" CTy"StatusRegister"
                     (Dest "CP0" CTy"CP0" qVar"state")))))
             (Mop Not
               (Dest "ERL" bTy
                 (Dest "Status" CTy"StatusRegister"
                   (Dest "CP0" CTy"CP0" qVar"state"))))) qVar"state")))


(Def "BigEndianMem" qVar"state"
  (TP
    (sqbkt (Dest "BE" bTy
             (Dest "Config" CTy"ConfigRegister"
               (Dest "CP0" CTy"CP0" qVar"state"))) qVar"state")))


(Def "ReverseEndian" qVar"state"
  (TP
    (sqbkt (Mop (Cast F1)
             (Bop And
               (Dest "RE" bTy
                 (Dest "Status" CTy"StatusRegister"
                   (Dest "CP0" CTy"CP0" qVar"state")))
               (Mop Fst
                 (Apply (Const "UserMode" (ATy qTy (PTy bTy qTy)))
                   qVar"state")))) qVar"state")))


(Def "BigEndianCPU" qVar"state"
  (TP
    (sqbkt (Bop BXor
             (Mop (Cast F1)
               (Mop Fst
                 (Apply (Const "BigEndianMem" (ATy qTy (PTy bTy qTy)))
                   qVar"state")))
             (Mop Fst
               (Apply (Const "ReverseEndian" (ATy qTy (PTy F1 qTy)))
                 qVar"state"))) qVar"state")))


(Def "AddressTranslation"
  (TP
    (sqbkt (Var "vAddr" F64) (Var "IorD" CTy"IorD") (Var "LorS" CTy"LorS")))
  (TP (sqbkt (Var "vAddr" F64) (LX (FTy 3)))))


(Def "LoadMemory"
  (TP
    (sqbkt (Var "CCA" (FTy 3)) (Var "AccessLength" (FTy 3))
           (Var "pAddr" F64) (Var "vAddr" F64) (Var "IorD" CTy"IorD")))
  (Close qVar"state"
    (Let (Var "a" F64) (Bop BAnd (Var "pAddr" F64) (Mop BNot (LW 7 64)))
      (TP
        (sqbkt (ITE
                 (EQ
                   (Mop Fst
                     (Apply (Const "BigEndianCPU" (ATy qTy (PTy F1 qTy)))
                       qVar"state")) (LW 1 1))
                 (CC(sqbkt (Apply (Dest "MEM" (ATy F64 F8) qVar"state")
                             (Var "a" F64))
                           (Apply (Dest "MEM" (ATy F64 F8) qVar"state")
                             (Bop Add (Var "a" F64) (LW 1 64)))
                           (Apply (Dest "MEM" (ATy F64 F8) qVar"state")
                             (Bop Add (Var "a" F64) (LW 2 64)))
                           (Apply (Dest "MEM" (ATy F64 F8) qVar"state")
                             (Bop Add (Var "a" F64) (LW 3 64)))
                           (Apply (Dest "MEM" (ATy F64 F8) qVar"state")
                             (Bop Add (Var "a" F64) (LW 4 64)))
                           (Apply (Dest "MEM" (ATy F64 F8) qVar"state")
                             (Bop Add (Var "a" F64) (LW 5 64)))
                           (Apply (Dest "MEM" (ATy F64 F8) qVar"state")
                             (Bop Add (Var "a" F64) (LW 6 64)))
                           (Apply (Dest "MEM" (ATy F64 F8) qVar"state")
                             (Bop Add (Var "a" F64) (LW 7 64)))))
                 (CC(sqbkt (Apply (Dest "MEM" (ATy F64 F8) qVar"state")
                             (Bop Add (Var "a" F64) (LW 7 64)))
                           (Apply (Dest "MEM" (ATy F64 F8) qVar"state")
                             (Bop Add (Var "a" F64) (LW 6 64)))
                           (Apply (Dest "MEM" (ATy F64 F8) qVar"state")
                             (Bop Add (Var "a" F64) (LW 5 64)))
                           (Apply (Dest "MEM" (ATy F64 F8) qVar"state")
                             (Bop Add (Var "a" F64) (LW 4 64)))
                           (Apply (Dest "MEM" (ATy F64 F8) qVar"state")
                             (Bop Add (Var "a" F64) (LW 3 64)))
                           (Apply (Dest "MEM" (ATy F64 F8) qVar"state")
                             (Bop Add (Var "a" F64) (LW 2 64)))
                           (Apply (Dest "MEM" (ATy F64 F8) qVar"state")
                             (Bop Add (Var "a" F64) (LW 1 64)))
                           (Apply (Dest "MEM" (ATy F64 F8) qVar"state")
                             (Var "a" F64))))) qVar"state")))))


(Def "StoreMemory"
  (TP
    (sqbkt (Var "CCA" (FTy 3)) (Var "AccessLength" (FTy 3))
           (Var "MemElem" F64) (Var "pAddr" F64) (Var "vAddr" F64)
           (Var "IorD" CTy"IorD")))
  (Close qVar"state"
    (Let (Var "a" F64) (Bop BAnd (Var "pAddr" F64) (Mop BNot (LW 7 64)))
      (Let (Var "l" (FTy 3)) (EX (Var "vAddr" F64) (LN 2) (LN 0) (FTy 3))
        (Let (Var "h" (FTy 3))
          (Bop Add (Var "l" (FTy 3)) (Var "AccessLength" (FTy 3)))
          (ITE
            (EQ
              (Mop Fst
                (Apply (Const "BigEndianCPU" (ATy qTy (PTy F1 qTy)))
                  qVar"state")) (LW 1 1))
            (Let qVar"s"
              (ITE (EQ (Var "l" (FTy 3)) (LW 0 3))
                (Rupd "MEM"
                  (TP
                    (sqbkt qVar"state"
                           (Fupd (Dest "MEM" (ATy F64 F8) qVar"state")
                             (Var "a" F64)
                             (EX (Var "MemElem" F64) (LN 63) (LN 56) F8)))))
                qVar"state")
              (Let qVar"s"
                (ITE
                  (Bop And (Bop Ule (Var "l" (FTy 3)) (LW 1 3))
                    (Bop Ule (LW 1 3) (Var "h" (FTy 3))))
                  (Rupd "MEM"
                    (TP
                      (sqbkt qVar"s"
                             (Fupd (Dest "MEM" (ATy F64 F8) qVar"s")
                               (Bop Add (Var "a" F64) (LW 1 64))
                               (EX (Var "MemElem" F64) (LN 55) (LN 48) F8)))))
                  qVar"s")
                (Let qVar"s"
                  (ITE
                    (Bop And (Bop Ule (Var "l" (FTy 3)) (LW 2 3))
                      (Bop Ule (LW 2 3) (Var "h" (FTy 3))))
                    (Rupd "MEM"
                      (TP
                        (sqbkt qVar"s"
                               (Fupd (Dest "MEM" (ATy F64 F8) qVar"s")
                                 (Bop Add (Var "a" F64) (LW 2 64))
                                 (EX (Var "MemElem" F64) (LN 47) (LN 40)
                                   F8))))) qVar"s")
                  (Let qVar"s"
                    (ITE
                      (Bop And (Bop Ule (Var "l" (FTy 3)) (LW 3 3))
                        (Bop Ule (LW 3 3) (Var "h" (FTy 3))))
                      (Rupd "MEM"
                        (TP
                          (sqbkt qVar"s"
                                 (Fupd (Dest "MEM" (ATy F64 F8) qVar"s")
                                   (Bop Add (Var "a" F64) (LW 3 64))
                                   (EX (Var "MemElem" F64) (LN 39) (LN 32)
                                     F8))))) qVar"s")
                    (Let qVar"s"
                      (ITE
                        (Bop And (Bop Ule (Var "l" (FTy 3)) (LW 4 3))
                          (Bop Ule (LW 4 3) (Var "h" (FTy 3))))
                        (Rupd "MEM"
                          (TP
                            (sqbkt qVar"s"
                                   (Fupd (Dest "MEM" (ATy F64 F8) qVar"s")
                                     (Bop Add (Var "a" F64) (LW 4 64))
                                     (EX (Var "MemElem" F64) (LN 31)
                                       (LN 24) F8))))) qVar"s")
                      (Let qVar"s"
                        (ITE
                          (Bop And (Bop Ule (Var "l" (FTy 3)) (LW 5 3))
                            (Bop Ule (LW 5 3) (Var "h" (FTy 3))))
                          (Rupd "MEM"
                            (TP
                              (sqbkt qVar"s"
                                     (Fupd
                                       (Dest "MEM" (ATy F64 F8) qVar"s")
                                       (Bop Add (Var "a" F64) (LW 5 64))
                                       (EX (Var "MemElem" F64) (LN 23)
                                         (LN 16) F8))))) qVar"s")
                        (Let qVar"s"
                          (ITE
                            (Bop And (Bop Ule (Var "l" (FTy 3)) (LW 6 3))
                              (Bop Ule (LW 6 3) (Var "h" (FTy 3))))
                            (Rupd "MEM"
                              (TP
                                (sqbkt qVar"s"
                                       (Fupd
                                         (Dest "MEM" (ATy F64 F8) qVar"s")
                                         (Bop Add (Var "a" F64) (LW 6 64))
                                         (EX (Var "MemElem" F64) (LN 15)
                                           (LN 8) F8))))) qVar"s")
                          (TP
                            (sqbkt LU
                                   (ITE
                                     (Bop And
                                       (Bop Ule (Var "l" (FTy 3))
                                         (LW 7 3))
                                       (Bop Ule (LW 7 3)
                                         (Var "h" (FTy 3))))
                                     (Rupd "MEM"
                                       (TP
                                         (sqbkt qVar"s"
                                                (Fupd
                                                  (Dest "MEM" (ATy F64 F8)
                                                    qVar"s")
                                                  (Bop Add (Var "a" F64)
                                                    (LW 7 64))
                                                  (EX (Var "MemElem" F64)
                                                    (LN 7) (LN 0) F8)))))
                                     qVar"s"))))))))))
            (Let qVar"s"
              (ITE
                (Bop And (Bop Ule (Var "l" (FTy 3)) (LW 7 3))
                  (Bop Ule (LW 7 3) (Var "h" (FTy 3))))
                (Rupd "MEM"
                  (TP
                    (sqbkt qVar"state"
                           (Fupd (Dest "MEM" (ATy F64 F8) qVar"state")
                             (Bop Add (Var "a" F64) (LW 7 64))
                             (EX (Var "MemElem" F64) (LN 63) (LN 56) F8)))))
                qVar"state")
              (Let qVar"s"
                (ITE
                  (Bop And (Bop Ule (Var "l" (FTy 3)) (LW 6 3))
                    (Bop Ule (LW 6 3) (Var "h" (FTy 3))))
                  (Rupd "MEM"
                    (TP
                      (sqbkt qVar"s"
                             (Fupd (Dest "MEM" (ATy F64 F8) qVar"s")
                               (Bop Add (Var "a" F64) (LW 6 64))
                               (EX (Var "MemElem" F64) (LN 55) (LN 48) F8)))))
                  qVar"s")
                (Let qVar"s"
                  (ITE
                    (Bop And (Bop Ule (Var "l" (FTy 3)) (LW 5 3))
                      (Bop Ule (LW 5 3) (Var "h" (FTy 3))))
                    (Rupd "MEM"
                      (TP
                        (sqbkt qVar"s"
                               (Fupd (Dest "MEM" (ATy F64 F8) qVar"s")
                                 (Bop Add (Var "a" F64) (LW 5 64))
                                 (EX (Var "MemElem" F64) (LN 47) (LN 40)
                                   F8))))) qVar"s")
                  (Let qVar"s"
                    (ITE
                      (Bop And (Bop Ule (Var "l" (FTy 3)) (LW 4 3))
                        (Bop Ule (LW 4 3) (Var "h" (FTy 3))))
                      (Rupd "MEM"
                        (TP
                          (sqbkt qVar"s"
                                 (Fupd (Dest "MEM" (ATy F64 F8) qVar"s")
                                   (Bop Add (Var "a" F64) (LW 4 64))
                                   (EX (Var "MemElem" F64) (LN 39) (LN 32)
                                     F8))))) qVar"s")
                    (Let qVar"s"
                      (ITE
                        (Bop And (Bop Ule (Var "l" (FTy 3)) (LW 3 3))
                          (Bop Ule (LW 3 3) (Var "h" (FTy 3))))
                        (Rupd "MEM"
                          (TP
                            (sqbkt qVar"s"
                                   (Fupd (Dest "MEM" (ATy F64 F8) qVar"s")
                                     (Bop Add (Var "a" F64) (LW 3 64))
                                     (EX (Var "MemElem" F64) (LN 31)
                                       (LN 24) F8))))) qVar"s")
                      (Let qVar"s"
                        (ITE
                          (Bop And (Bop Ule (Var "l" (FTy 3)) (LW 2 3))
                            (Bop Ule (LW 2 3) (Var "h" (FTy 3))))
                          (Rupd "MEM"
                            (TP
                              (sqbkt qVar"s"
                                     (Fupd
                                       (Dest "MEM" (ATy F64 F8) qVar"s")
                                       (Bop Add (Var "a" F64) (LW 2 64))
                                       (EX (Var "MemElem" F64) (LN 23)
                                         (LN 16) F8))))) qVar"s")
                        (Let qVar"s"
                          (ITE
                            (Bop And (Bop Ule (Var "l" (FTy 3)) (LW 1 3))
                              (Bop Ule (LW 1 3) (Var "h" (FTy 3))))
                            (Rupd "MEM"
                              (TP
                                (sqbkt qVar"s"
                                       (Fupd
                                         (Dest "MEM" (ATy F64 F8) qVar"s")
                                         (Bop Add (Var "a" F64) (LW 1 64))
                                         (EX (Var "MemElem" F64) (LN 15)
                                           (LN 8) F8))))) qVar"s")
                          (TP
                            (sqbkt LU
                                   (ITE (EQ (Var "l" (FTy 3)) (LW 0 3))
                                     (Rupd "MEM"
                                       (TP
                                         (sqbkt qVar"s"
                                                (Fupd
                                                  (Dest "MEM" (ATy F64 F8)
                                                    qVar"s") (Var "a" F64)
                                                  (EX (Var "MemElem" F64)
                                                    (LN 7) (LN 0) F8)))))
                                     qVar"s"))))))))))))))))


(Def "ExceptionCode" (Var "ExceptionType" CTy"ExceptionType")
  (CS (Var "ExceptionType" CTy"ExceptionType")
    (sqbkt ((LC "AdEL" CTy"ExceptionType") (LW 4 5))
           ((LC "AdES" CTy"ExceptionType") (LW 5 5))
           ((LC "Sys" CTy"ExceptionType") (LW 8 5))
           ((LC "Bp" CTy"ExceptionType") (LW 9 5))
           ((LC "RI" CTy"ExceptionType") (LW 10 5))
           ((LC "Ov" CTy"ExceptionType") (LW 12 5))
           ((LC "Tr" CTy"ExceptionType") (LW 13 5)))))


(Def "SignalException" (Var "ExceptionType" CTy"ExceptionType")
  (Close qVar"state"
    (Let qVar"s"
      (ITE
        (Mop Not
          (Dest "EXL" bTy
            (Dest "Status" CTy"StatusRegister"
              (Dest "CP0" CTy"CP0" qVar"state"))))
        (Rupd "CP0"
          (TP
            (sqbkt qVar"state"
                   (Rupd "EPC"
                     (TP
                       (sqbkt (Dest "CP0" CTy"CP0" qVar"state")
                              (Dest "PC" F64 qVar"state")))))))
        qVar"state")
      (Let (Var "v" CTy"CP0") (Dest "CP0" CTy"CP0" qVar"s")
        (Let qVar"s"
          (Rupd "CP0"
            (TP
              (sqbkt qVar"s"
                     (Rupd "Cause"
                       (TP
                         (sqbkt (Var "v" CTy"CP0")
                                (Rupd "ExcCode"
                                  (TP
                                    (sqbkt (Dest "Cause"
                                             CTy"CauseRegister"
                                             (Var "v" CTy"CP0"))
                                           (Call "ExceptionCode" (FTy 5)
                                             (Var "ExceptionType"
                                               CTy"ExceptionType")))))))))))
          (Let (Var "v" CTy"CP0") (Dest "CP0" CTy"CP0" qVar"s")
            (Let qVar"s"
              (Rupd "CP0"
                (TP
                  (sqbkt qVar"s"
                         (Rupd "Status"
                           (TP
                             (sqbkt (Var "v" CTy"CP0")
                                    (Rupd "EXL"
                                      (TP
                                        (sqbkt (Dest "Status"
                                                 CTy"StatusRegister"
                                                 (Var "v" CTy"CP0")) LT)))))))))
              (Let (Var "v" F64)
                (ITE
                  (Dest "BEV" bTy
                    (Dest "Status" CTy"StatusRegister"
                      (Dest "CP0" CTy"CP0" qVar"s")))
                  (LW 18446744072631616000 64)
                  (LW 18446744071562067968 64))
                (TP
                  (sqbkt LU
                         (Rupd "PC"
                           (TP
                             (sqbkt qVar"s"
                                    CC(sqbkt (EX (Var "v" F64) (LN 63)
                                               (LN 30) (FTy 34))
                                             (Bop Add
                                               (EX (Var "v" F64) (LN 29)
                                                 (LN 0) (FTy 30))
                                               (LW 384 30))))))))))))))))


(Def "NotWordValue" (Var "value" F64)
  (Let (Var "top" F32) (EX (Var "value" F64) (LN 63) (LN 32) F32)
    (ITE (Bop Bit (Var "value" F64) (LN 31))
      (Mop Not (EQ (Var "top" F32) (LW 4294967295 32)))
      (Mop Not (EQ (Var "top" F32) (LW 0 32))))))


(Def "dfn'ADDI"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "immediate" F16)))
  (Close qVar"state"
    (Let qVar"s"
      (ITE
        (Call "NotWordValue" bTy
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
              qVar"state")))
        (Mop Snd
          (Apply
            (Call "raise'exception" (ATy qTy (PTy uTy qTy))
              (Call "UNPREDICTABLE" CTy"exception"
                (LS"ADDI: NotWordValue"))) qVar"state")) qVar"state")
      (Let (Var "v" (FTy 33))
        (Bop Add
          (EX
            (Mop Fst
              (Apply
                (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
                qVar"s")) (LN 32) (LN 0) (FTy 33))
          (Mop (SE (FTy 33)) (Var "immediate" F16)))
        (ITE
          (Mop Not
            (EQ (Bop Bit (Var "v" (FTy 33)) (LN 32))
              (Bop Bit (Var "v" (FTy 33)) (LN 31))))
          (Apply
            (Call "SignalException" (ATy qTy (PTy uTy qTy))
              (LC "Ov" CTy"ExceptionType")) qVar"s")
          (Apply
            (Call "write'GPR" (ATy qTy (PTy uTy qTy))
              (TP
                (sqbkt (Mop (SE F64)
                         (EX (Var "v" (FTy 33)) (LN 31) (LN 0) F32))
                       (Var "rt" (FTy 5))))) qVar"s"))))))


(Def "dfn'ADDIU"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "immediate" F16)))
  (Close qVar"state"
    (Let qVar"s"
      (ITE
        (Call "NotWordValue" bTy
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
              qVar"state")))
        (Mop Snd
          (Apply
            (Call "raise'exception" (ATy qTy (PTy uTy qTy))
              (Call "UNPREDICTABLE" CTy"exception"
                (LS"ADDIU: NotWordValue"))) qVar"state")) qVar"state")
      (Apply
        (Call "write'GPR" (ATy qTy (PTy uTy qTy))
          (TP
            (sqbkt (Mop (SE F64)
                     (Bop Add
                       (EX
                         (Mop Fst
                           (Apply
                             (Call "GPR" (ATy qTy (PTy F64 qTy))
                               (Var "rs" (FTy 5))) qVar"s")) (LN 31)
                         (LN 0) F32) (Mop (SE F32) (Var "immediate" F16))))
                   (Var "rt" (FTy 5))))) qVar"s"))))


(Def "dfn'DADDI"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "immediate" F16)))
  (Close qVar"state"
    (Let (Var "v" (FTy 65))
      (Bop Add
        (Mop (SE (FTy 65))
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
              qVar"state"))) (Mop (SE (FTy 65)) (Var "immediate" F16)))
      (ITE
        (Mop Not
          (EQ (Bop Bit (Var "v" (FTy 65)) (LN 64))
            (Bop Bit (Var "v" (FTy 65)) (LN 63))))
        (Apply
          (Call "SignalException" (ATy qTy (PTy uTy qTy))
            (LC "Ov" CTy"ExceptionType")) qVar"state")
        (Apply
          (Call "write'GPR" (ATy qTy (PTy uTy qTy))
            (TP
              (sqbkt (EX (Var "v" (FTy 65)) (LN 63) (LN 0) F64)
                     (Var "rt" (FTy 5))))) qVar"state")))))


(Def "dfn'DADDIU"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "immediate" F16)))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Bop Add
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rs" (FTy 5))) qVar"state"))
                   (Mop (SE F64) (Var "immediate" F16)))
                 (Var "rt" (FTy 5))))) qVar"state")))


(Def "dfn'SLTI"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "immediate" F16)))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Mop (Cast F64)
                   (Bop Lt
                     (Mop Fst
                       (Apply
                         (Call "GPR" (ATy qTy (PTy F64 qTy))
                           (Var "rs" (FTy 5))) qVar"state"))
                     (Mop (SE F64) (Var "immediate" F16))))
                 (Var "rt" (FTy 5))))) qVar"state")))


(Def "dfn'SLTIU"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "immediate" F16)))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Mop (Cast F64)
                   (Bop Ult
                     (Mop Fst
                       (Apply
                         (Call "GPR" (ATy qTy (PTy F64 qTy))
                           (Var "rs" (FTy 5))) qVar"state"))
                     (Mop (SE F64) (Var "immediate" F16))))
                 (Var "rt" (FTy 5))))) qVar"state")))


(Def "dfn'ANDI"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "immediate" F16)))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Bop BAnd
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rs" (FTy 5))) qVar"state"))
                   (Mop (Cast F64) (Var "immediate" F16)))
                 (Var "rt" (FTy 5))))) qVar"state")))


(Def "dfn'ORI"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "immediate" F16)))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Bop BOr
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rs" (FTy 5))) qVar"state"))
                   (Mop (Cast F64) (Var "immediate" F16)))
                 (Var "rt" (FTy 5))))) qVar"state")))


(Def "dfn'XORI"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "immediate" F16)))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Bop BXor
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rs" (FTy 5))) qVar"state"))
                   (Mop (Cast F64) (Var "immediate" F16)))
                 (Var "rt" (FTy 5))))) qVar"state")))


(Def "dfn'LUI" (TP (sqbkt (Var "rt" (FTy 5)) (Var "immediate" F16)))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Mop (SE F64)
                   (CC(sqbkt (Var "immediate" F16) (LW 0 16))))
                 (Var "rt" (FTy 5))))) qVar"state")))


(Def "dfn'ADD"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (Let qVar"s"
      (ITE
        (Bop Or
          (Call "NotWordValue" bTy
            (Mop Fst
              (Apply
                (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
                qVar"state")))
          (Call "NotWordValue" bTy
            (Mop Fst
              (Apply
                (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
                qVar"state"))))
        (Mop Snd
          (Apply
            (Call "raise'exception" (ATy qTy (PTy uTy qTy))
              (Call "UNPREDICTABLE" CTy"exception"
                (LS"ADD: NotWordValue"))) qVar"state")) qVar"state")
      (Let (Var "v" (FTy 33))
        (Bop Add
          (EX
            (Mop Fst
              (Apply
                (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
                qVar"s")) (LN 32) (LN 0) (FTy 33))
          (EX
            (Mop Fst
              (Apply
                (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
                qVar"s")) (LN 32) (LN 0) (FTy 33)))
        (ITE
          (Mop Not
            (EQ (Bop Bit (Var "v" (FTy 33)) (LN 32))
              (Bop Bit (Var "v" (FTy 33)) (LN 31))))
          (Apply
            (Call "SignalException" (ATy qTy (PTy uTy qTy))
              (LC "Ov" CTy"ExceptionType")) qVar"s")
          (Apply
            (Call "write'GPR" (ATy qTy (PTy uTy qTy))
              (TP
                (sqbkt (Mop (SE F64)
                         (EX (Var "v" (FTy 33)) (LN 31) (LN 0) F32))
                       (Var "rd" (FTy 5))))) qVar"s"))))))


(Def "dfn'ADDU"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (Let qVar"s"
      (ITE
        (Bop Or
          (Call "NotWordValue" bTy
            (Mop Fst
              (Apply
                (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
                qVar"state")))
          (Call "NotWordValue" bTy
            (Mop Fst
              (Apply
                (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
                qVar"state"))))
        (Mop Snd
          (Apply
            (Call "raise'exception" (ATy qTy (PTy uTy qTy))
              (Call "UNPREDICTABLE" CTy"exception"
                (LS"ADDU: NotWordValue"))) qVar"state")) qVar"state")
      (Apply
        (Call "write'GPR" (ATy qTy (PTy uTy qTy))
          (TP
            (sqbkt (Mop (SE F64)
                     (Bop Add
                       (EX
                         (Mop Fst
                           (Apply
                             (Call "GPR" (ATy qTy (PTy F64 qTy))
                               (Var "rs" (FTy 5))) qVar"s")) (LN 31)
                         (LN 0) F32)
                       (EX
                         (Mop Fst
                           (Apply
                             (Call "GPR" (ATy qTy (PTy F64 qTy))
                               (Var "rt" (FTy 5))) qVar"s")) (LN 31)
                         (LN 0) F32))) (Var "rd" (FTy 5))))) qVar"s"))))


(Def "dfn'SUB"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (Let qVar"s"
      (ITE
        (Bop Or
          (Call "NotWordValue" bTy
            (Mop Fst
              (Apply
                (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
                qVar"state")))
          (Call "NotWordValue" bTy
            (Mop Fst
              (Apply
                (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
                qVar"state"))))
        (Mop Snd
          (Apply
            (Call "raise'exception" (ATy qTy (PTy uTy qTy))
              (Call "UNPREDICTABLE" CTy"exception"
                (LS"SUB: NotWordValue"))) qVar"state")) qVar"state")
      (Let (Var "v" (FTy 33))
        (Bop Sub
          (EX
            (Mop Fst
              (Apply
                (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
                qVar"s")) (LN 32) (LN 0) (FTy 33))
          (EX
            (Mop Fst
              (Apply
                (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
                qVar"s")) (LN 32) (LN 0) (FTy 33)))
        (ITE
          (Mop Not
            (EQ (Bop Bit (Var "v" (FTy 33)) (LN 32))
              (Bop Bit (Var "v" (FTy 33)) (LN 31))))
          (Apply
            (Call "SignalException" (ATy qTy (PTy uTy qTy))
              (LC "Ov" CTy"ExceptionType")) qVar"s")
          (Apply
            (Call "write'GPR" (ATy qTy (PTy uTy qTy))
              (TP
                (sqbkt (Mop (SE F64)
                         (EX (Var "v" (FTy 33)) (LN 31) (LN 0) F32))
                       (Var "rd" (FTy 5))))) qVar"s"))))))


(Def "dfn'SUBU"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (Let qVar"s"
      (ITE
        (Bop Or
          (Call "NotWordValue" bTy
            (Mop Fst
              (Apply
                (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
                qVar"state")))
          (Call "NotWordValue" bTy
            (Mop Fst
              (Apply
                (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
                qVar"state"))))
        (Mop Snd
          (Apply
            (Call "raise'exception" (ATy qTy (PTy uTy qTy))
              (Call "UNPREDICTABLE" CTy"exception"
                (LS"SUBU: NotWordValue"))) qVar"state")) qVar"state")
      (Apply
        (Call "write'GPR" (ATy qTy (PTy uTy qTy))
          (TP
            (sqbkt (Mop (SE F64)
                     (Bop Sub
                       (EX
                         (Mop Fst
                           (Apply
                             (Call "GPR" (ATy qTy (PTy F64 qTy))
                               (Var "rs" (FTy 5))) qVar"s")) (LN 32)
                         (LN 0) (FTy 33))
                       (EX
                         (Mop Fst
                           (Apply
                             (Call "GPR" (ATy qTy (PTy F64 qTy))
                               (Var "rt" (FTy 5))) qVar"s")) (LN 32)
                         (LN 0) (FTy 33)))) (Var "rd" (FTy 5))))) qVar"s"))))


(Def "dfn'DADD"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (Let (Var "v" (FTy 65))
      (Bop Add
        (Mop (SE (FTy 65))
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
              qVar"state")))
        (Mop (SE (FTy 65))
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
              qVar"state"))))
      (ITE
        (Mop Not
          (EQ (Bop Bit (Var "v" (FTy 65)) (LN 64))
            (Bop Bit (Var "v" (FTy 65)) (LN 63))))
        (Apply
          (Call "SignalException" (ATy qTy (PTy uTy qTy))
            (LC "Ov" CTy"ExceptionType")) qVar"state")
        (Apply
          (Call "write'GPR" (ATy qTy (PTy uTy qTy))
            (TP
              (sqbkt (EX (Var "v" (FTy 65)) (LN 63) (LN 0) F64)
                     (Var "rd" (FTy 5))))) qVar"state")))))


(Def "dfn'DADDU"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Bop Add
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rs" (FTy 5))) qVar"state"))
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rt" (FTy 5))) qVar"state")))
                 (Var "rd" (FTy 5))))) qVar"state")))


(Def "dfn'DSUB"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (Let (Var "v" (FTy 65))
      (Bop Sub
        (Mop (SE (FTy 65))
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
              qVar"state")))
        (Mop (SE (FTy 65))
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
              qVar"state"))))
      (ITE
        (Mop Not
          (EQ (Bop Bit (Var "v" (FTy 65)) (LN 64))
            (Bop Bit (Var "v" (FTy 65)) (LN 63))))
        (Apply
          (Call "SignalException" (ATy qTy (PTy uTy qTy))
            (LC "Ov" CTy"ExceptionType")) qVar"state")
        (Apply
          (Call "write'GPR" (ATy qTy (PTy uTy qTy))
            (TP
              (sqbkt (EX (Var "v" (FTy 65)) (LN 63) (LN 0) F64)
                     (Var "rd" (FTy 5))))) qVar"state")))))


(Def "dfn'DSUBU"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Bop Sub
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rs" (FTy 5))) qVar"state"))
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rt" (FTy 5))) qVar"state")))
                 (Var "rd" (FTy 5))))) qVar"state")))


(Def "dfn'SLT"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Mop (Cast F64)
                   (Bop Lt
                     (Mop Fst
                       (Apply
                         (Call "GPR" (ATy qTy (PTy F64 qTy))
                           (Var "rs" (FTy 5))) qVar"state"))
                     (Mop Fst
                       (Apply
                         (Call "GPR" (ATy qTy (PTy F64 qTy))
                           (Var "rt" (FTy 5))) qVar"state"))))
                 (Var "rd" (FTy 5))))) qVar"state")))


(Def "dfn'SLTU"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Mop (Cast F64)
                   (Bop Ult
                     (Mop Fst
                       (Apply
                         (Call "GPR" (ATy qTy (PTy F64 qTy))
                           (Var "rs" (FTy 5))) qVar"state"))
                     (Mop Fst
                       (Apply
                         (Call "GPR" (ATy qTy (PTy F64 qTy))
                           (Var "rt" (FTy 5))) qVar"state"))))
                 (Var "rd" (FTy 5))))) qVar"state")))


(Def "dfn'AND"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Bop BAnd
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rs" (FTy 5))) qVar"state"))
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rt" (FTy 5))) qVar"state")))
                 (Var "rd" (FTy 5))))) qVar"state")))


(Def "dfn'OR"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Bop BOr
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rs" (FTy 5))) qVar"state"))
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rt" (FTy 5))) qVar"state")))
                 (Var "rd" (FTy 5))))) qVar"state")))


(Def "dfn'XOR"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Bop BXor
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rs" (FTy 5))) qVar"state"))
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rt" (FTy 5))) qVar"state")))
                 (Var "rd" (FTy 5))))) qVar"state")))


(Def "dfn'NOR"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Mop BNot
                   (Bop BOr
                     (Mop Fst
                       (Apply
                         (Call "GPR" (ATy qTy (PTy F64 qTy))
                           (Var "rs" (FTy 5))) qVar"state"))
                     (Mop Fst
                       (Apply
                         (Call "GPR" (ATy qTy (PTy F64 qTy))
                           (Var "rt" (FTy 5))) qVar"state"))))
                 (Var "rd" (FTy 5))))) qVar"state")))


(Def "dfn'MULT" (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5))))
  (Close qVar"state"
    (Let qVar"s"
      (ITE
        (Bop Or
          (Call "NotWordValue" bTy
            (Mop Fst
              (Apply
                (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
                qVar"state")))
          (Call "NotWordValue" bTy
            (Mop Fst
              (Apply
                (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
                qVar"state"))))
        (Mop Snd
          (Apply
            (Call "raise'exception" (ATy qTy (PTy uTy qTy))
              (Call "UNPREDICTABLE" CTy"exception"
                (LS"MULT: NotWordValue"))) qVar"state")) qVar"state")
      (Let (Var "v" F64)
        (Bop Mul
          (Mop (SE F64)
            (EX
              (Mop Fst
                (Apply
                  (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
                  qVar"s")) (LN 31) (LN 0) F32))
          (Mop (SE F64)
            (EX
              (Mop Fst
                (Apply
                  (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
                  qVar"s")) (LN 31) (LN 0) F32)))
        (TP
          (sqbkt LU
                 (Rupd "HLStatus"
                   (TP
                     (sqbkt (Rupd "HI"
                              (TP
                                (sqbkt (Rupd "LO"
                                         (TP
                                           (sqbkt qVar"s"
                                                  (Mop (SE F64)
                                                    (EX (Var "v" F64)
                                                      (LN 31) (LN 0) F32)))))
                                       (Mop (SE F64)
                                         (EX (Var "v" F64) (LN 63) (LN 32)
                                           F32)))))
                            (LC "HLarith" CTy"HLStatus"))))))))))


(Def "dfn'MULTU" (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5))))
  (Close qVar"state"
    (Let qVar"s"
      (ITE
        (Bop Or
          (Call "NotWordValue" bTy
            (Mop Fst
              (Apply
                (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
                qVar"state")))
          (Call "NotWordValue" bTy
            (Mop Fst
              (Apply
                (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
                qVar"state"))))
        (Mop Snd
          (Apply
            (Call "raise'exception" (ATy qTy (PTy uTy qTy))
              (Call "UNPREDICTABLE" CTy"exception"
                (LS"MULTU: NotWordValue"))) qVar"state")) qVar"state")
      (Let (Var "v" F64)
        (Bop Mul
          (Mop (Cast F64)
            (EX
              (Mop Fst
                (Apply
                  (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
                  qVar"s")) (LN 31) (LN 0) F32))
          (Mop (Cast F64)
            (EX
              (Mop Fst
                (Apply
                  (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
                  qVar"s")) (LN 31) (LN 0) F32)))
        (TP
          (sqbkt LU
                 (Rupd "HLStatus"
                   (TP
                     (sqbkt (Rupd "HI"
                              (TP
                                (sqbkt (Rupd "LO"
                                         (TP
                                           (sqbkt qVar"s"
                                                  (Mop (SE F64)
                                                    (EX (Var "v" F64)
                                                      (LN 31) (LN 0) F32)))))
                                       (Mop (SE F64)
                                         (EX (Var "v" F64) (LN 63) (LN 32)
                                           F32)))))
                            (LC "HLarith" CTy"HLStatus"))))))))))


(Def "dfn'DMULT" (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5))))
  (Close qVar"state"
    (Let (Var "v" (FTy 128))
      (Bop Mul
        (Mop (SE (FTy 128))
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
              qVar"state")))
        (Mop (SE (FTy 128))
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
              qVar"state"))))
      (TP
        (sqbkt LU
               (Rupd "HLStatus"
                 (TP
                   (sqbkt (Rupd "HI"
                            (TP
                              (sqbkt (Rupd "LO"
                                       (TP
                                         (sqbkt qVar"state"
                                                (EX (Var "v" (FTy 128))
                                                  (LN 63) (LN 0) F64))))
                                     (EX (Var "v" (FTy 128)) (LN 127)
                                       (LN 64) F64))))
                          (LC "HLarith" CTy"HLStatus")))))))))


(Def "dfn'DMULTU" (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5))))
  (Close qVar"state"
    (Let (Var "v" (FTy 128))
      (Bop Mul
        (Mop (Cast (FTy 128))
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
              qVar"state")))
        (Mop (Cast (FTy 128))
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
              qVar"state"))))
      (TP
        (sqbkt LU
               (Rupd "HLStatus"
                 (TP
                   (sqbkt (Rupd "HI"
                            (TP
                              (sqbkt (Rupd "LO"
                                       (TP
                                         (sqbkt qVar"state"
                                                (EX (Var "v" (FTy 128))
                                                  (LN 63) (LN 0) F64))))
                                     (EX (Var "v" (FTy 128)) (LN 127)
                                       (LN 64) F64))))
                          (LC "HLarith" CTy"HLStatus")))))))))


(Def "dfn'DIV" (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5))))
  (Close qVar"state"
    (Let qVar"s"
      (ITE
        (EQ
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
              qVar"state")) (LW 0 64))
        (Mop Snd
          (Apply
            (Call "raise'exception" (ATy qTy (PTy uTy qTy))
              (Call "UNPREDICTABLE" CTy"exception"
                (LS"DIV: divide by zero"))) qVar"state")) qVar"state")
      (Let qVar"s"
        (ITE
          (Bop Or
            (Call "NotWordValue" bTy
              (Mop Fst
                (Apply
                  (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
                  qVar"s")))
            (Call "NotWordValue" bTy
              (Mop Fst
                (Apply
                  (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
                  qVar"s"))))
          (Mop Snd
            (Apply
              (Call "raise'exception" (ATy qTy (PTy uTy qTy))
                (Call "UNPREDICTABLE" CTy"exception"
                  (LS"DIV: NotWordValue"))) qVar"s")) qVar"s")
        (Let qVar"s"
          (Rupd "LO"
            (TP
              (sqbkt qVar"s"
                     (Mop (SE F64)
                       (Bop Quot
                         (EX
                           (Mop Fst
                             (Apply
                               (Call "GPR" (ATy qTy (PTy F64 qTy))
                                 (Var "rs" (FTy 5))) qVar"s")) (LN 31)
                           (LN 0) F32)
                         (EX
                           (Mop Fst
                             (Apply
                               (Call "GPR" (ATy qTy (PTy F64 qTy))
                                 (Var "rt" (FTy 5))) qVar"s")) (LN 31)
                           (LN 0) F32))))))
          (TP
            (sqbkt LU
                   (Rupd "HLStatus"
                     (TP
                       (sqbkt (Rupd "HI"
                                (TP
                                  (sqbkt qVar"s"
                                         (Mop (SE F64)
                                           (Bop Rem
                                             (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rs" (FTy 5)))
                                                   qVar"s")) (LN 31)
                                               (LN 0) F32)
                                             (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"s")) (LN 31)
                                               (LN 0) F32))))))
                              (LC "HLarith" CTy"HLStatus")))))))))))


(Def "dfn'DIVU" (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5))))
  (Close qVar"state"
    (Let qVar"s"
      (ITE
        (EQ
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
              qVar"state")) (LW 0 64))
        (Mop Snd
          (Apply
            (Call "raise'exception" (ATy qTy (PTy uTy qTy))
              (Call "UNPREDICTABLE" CTy"exception"
                (LS"DIVU: divide by zero"))) qVar"state")) qVar"state")
      (Let qVar"s"
        (ITE
          (Bop Or
            (Call "NotWordValue" bTy
              (Mop Fst
                (Apply
                  (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
                  qVar"s")))
            (Call "NotWordValue" bTy
              (Mop Fst
                (Apply
                  (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
                  qVar"s"))))
          (Mop Snd
            (Apply
              (Call "raise'exception" (ATy qTy (PTy uTy qTy))
                (Call "UNPREDICTABLE" CTy"exception"
                  (LS"DIVU: NotWordValue"))) qVar"s")) qVar"s")
        (TP
          (sqbkt LU
                 (Rupd "HLStatus"
                   (TP
                     (sqbkt (Rupd "HI"
                              (TP
                                (sqbkt (Rupd "LO"
                                         (TP
                                           (sqbkt qVar"s"
                                                  (Mop (SE F64)
                                                    (Bop Div
                                                      (EX
                                                        (Mop Fst
                                                          (Apply
                                                            (Call "GPR"
                                                              (ATy qTy
                                                                (PTy F64
                                                                  qTy))
                                                              (Var "rs"
                                                                (FTy 5)))
                                                            qVar"s"))
                                                        (LN 31) (LN 0)
                                                        F32)
                                                      (EX
                                                        (Mop Fst
                                                          (Apply
                                                            (Call "GPR"
                                                              (ATy qTy
                                                                (PTy F64
                                                                  qTy))
                                                              (Var "rt"
                                                                (FTy 5)))
                                                            qVar"s"))
                                                        (LN 31) (LN 0)
                                                        F32))))))
                                       (Mop (SE F64)
                                         (Bop Mod
                                           (EX
                                             (Mop Fst
                                               (Apply
                                                 (Call "GPR"
                                                   (ATy qTy (PTy F64 qTy))
                                                   (Var "rs" (FTy 5)))
                                                 qVar"s")) (LN 31) (LN 0)
                                             F32)
                                           (EX
                                             (Mop Fst
                                               (Apply
                                                 (Call "GPR"
                                                   (ATy qTy (PTy F64 qTy))
                                                   (Var "rt" (FTy 5)))
                                                 qVar"s")) (LN 31) (LN 0)
                                             F32))))))
                            (LC "HLarith" CTy"HLStatus"))))))))))


(Def "dfn'DDIV" (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5))))
  (Close qVar"state"
    (Let qVar"s"
      (ITE
        (EQ
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
              qVar"state")) (LW 0 64))
        (Mop Snd
          (Apply
            (Call "raise'exception" (ATy qTy (PTy uTy qTy))
              (Call "UNPREDICTABLE" CTy"exception"
                (LS"DDIV: divide by zero"))) qVar"state")) qVar"state")
      (Let qVar"s"
        (Rupd "LO"
          (TP
            (sqbkt qVar"s"
                   (Bop Quot
                     (Mop Fst
                       (Apply
                         (Call "GPR" (ATy qTy (PTy F64 qTy))
                           (Var "rs" (FTy 5))) qVar"s"))
                     (Mop Fst
                       (Apply
                         (Call "GPR" (ATy qTy (PTy F64 qTy))
                           (Var "rt" (FTy 5))) qVar"s"))))))
        (TP
          (sqbkt LU
                 (Rupd "HLStatus"
                   (TP
                     (sqbkt (Rupd "HI"
                              (TP
                                (sqbkt qVar"s"
                                       (Bop Rem
                                         (Mop Fst
                                           (Apply
                                             (Call "GPR"
                                               (ATy qTy (PTy F64 qTy))
                                               (Var "rs" (FTy 5)))
                                             qVar"s"))
                                         (Mop Fst
                                           (Apply
                                             (Call "GPR"
                                               (ATy qTy (PTy F64 qTy))
                                               (Var "rt" (FTy 5)))
                                             qVar"s"))))))
                            (LC "HLarith" CTy"HLStatus"))))))))))


(Def "dfn'DDIVU" (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5))))
  (Close qVar"state"
    (Let qVar"s"
      (ITE
        (EQ
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
              qVar"state")) (LW 0 64))
        (Mop Snd
          (Apply
            (Call "raise'exception" (ATy qTy (PTy uTy qTy))
              (Call "UNPREDICTABLE" CTy"exception"
                (LS"DDIVU: divide by zero"))) qVar"state")) qVar"state")
      (Let qVar"s"
        (Rupd "LO"
          (TP
            (sqbkt qVar"s"
                   (Bop Div
                     (Mop Fst
                       (Apply
                         (Call "GPR" (ATy qTy (PTy F64 qTy))
                           (Var "rs" (FTy 5))) qVar"s"))
                     (Mop Fst
                       (Apply
                         (Call "GPR" (ATy qTy (PTy F64 qTy))
                           (Var "rt" (FTy 5))) qVar"s"))))))
        (TP
          (sqbkt LU
                 (Rupd "HLStatus"
                   (TP
                     (sqbkt (Rupd "HI"
                              (TP
                                (sqbkt qVar"s"
                                       (Bop Mod
                                         (Mop Fst
                                           (Apply
                                             (Call "GPR"
                                               (ATy qTy (PTy F64 qTy))
                                               (Var "rs" (FTy 5)))
                                             qVar"s"))
                                         (Mop Fst
                                           (Apply
                                             (Call "GPR"
                                               (ATy qTy (PTy F64 qTy))
                                               (Var "rt" (FTy 5)))
                                             qVar"s"))))))
                            (LC "HLarith" CTy"HLStatus"))))))))))


(Def "dfn'MFHI" (Var "rd" (FTy 5))
  (Close qVar"state"
    (Let qVar"s"
      (ITE
        (EQ (Dest "HLStatus" CTy"HLStatus" qVar"state")
          (LC "HLmtlo" CTy"HLStatus"))
        (Mop Snd
          (Apply
            (Call "raise'exception" (ATy qTy (PTy uTy qTy))
              (Call "UNPREDICTABLE" CTy"exception" (LS"MFHI")))
            qVar"state")) qVar"state")
      (Let qVar"s"
        (ITE
          (EQ (Dest "HLStatus" CTy"HLStatus" qVar"s")
            (LC "HLarith" CTy"HLStatus"))
          (Rupd "HLStatus" (TP (sqbkt qVar"s" (LC "HLok" CTy"HLStatus"))))
          qVar"s")
        (Apply
          (Call "write'GPR" (ATy qTy (PTy uTy qTy))
            (TP (sqbkt (Dest "HI" F64 qVar"s") (Var "rd" (FTy 5)))))
          qVar"s")))))


(Def "dfn'MFLO" (Var "rd" (FTy 5))
  (Close qVar"state"
    (Let qVar"s"
      (ITE
        (EQ (Dest "HLStatus" CTy"HLStatus" qVar"state")
          (LC "HLmthi" CTy"HLStatus"))
        (Mop Snd
          (Apply
            (Call "raise'exception" (ATy qTy (PTy uTy qTy))
              (Call "UNPREDICTABLE" CTy"exception" (LS"MFLO")))
            qVar"state")) qVar"state")
      (Let qVar"s"
        (ITE
          (EQ (Dest "HLStatus" CTy"HLStatus" qVar"s")
            (LC "HLarith" CTy"HLStatus"))
          (Rupd "HLStatus" (TP (sqbkt qVar"s" (LC "HLok" CTy"HLStatus"))))
          qVar"s")
        (Apply
          (Call "write'GPR" (ATy qTy (PTy uTy qTy))
            (TP (sqbkt (Dest "LO" F64 qVar"s") (Var "rd" (FTy 5)))))
          qVar"s")))))


(Def "dfn'MTHI" (Var "rd" (FTy 5))
  (Close qVar"state"
    (Let qVar"s"
      (ITB
        (sqbkt ((EQ (Dest "HLStatus" CTy"HLStatus" qVar"state")
                   (LC "HLarith" CTy"HLStatus"))
                 (Rupd "HLStatus"
                   (TP (sqbkt qVar"state" (LC "HLmthi" CTy"HLStatus")))))
               ((EQ (Dest "HLStatus" CTy"HLStatus" qVar"state")
                   (LC "HLmtlo" CTy"HLStatus"))
                 (Rupd "HLStatus"
                   (TP (sqbkt qVar"state" (LC "HLok" CTy"HLStatus"))))))
        qVar"state")
      (TP
        (sqbkt LU
               (Rupd "HI"
                 (TP
                   (sqbkt qVar"s"
                          (Mop Fst
                            (Apply
                              (Call "GPR" (ATy qTy (PTy F64 qTy))
                                (Var "rd" (FTy 5))) qVar"s"))))))))))


(Def "dfn'MTLO" (Var "rd" (FTy 5))
  (Close qVar"state"
    (Let qVar"s"
      (ITB
        (sqbkt ((EQ (Dest "HLStatus" CTy"HLStatus" qVar"state")
                   (LC "HLarith" CTy"HLStatus"))
                 (Rupd "HLStatus"
                   (TP (sqbkt qVar"state" (LC "HLmtlo" CTy"HLStatus")))))
               ((EQ (Dest "HLStatus" CTy"HLStatus" qVar"state")
                   (LC "HLmthi" CTy"HLStatus"))
                 (Rupd "HLStatus"
                   (TP (sqbkt qVar"state" (LC "HLok" CTy"HLStatus"))))))
        qVar"state")
      (TP
        (sqbkt LU
               (Rupd "LO"
                 (TP
                   (sqbkt qVar"s"
                          (Mop Fst
                            (Apply
                              (Call "GPR" (ATy qTy (PTy F64 qTy))
                                (Var "rd" (FTy 5))) qVar"s"))))))))))


(Def "dfn'SLL"
  (TP (sqbkt (Var "rt" (FTy 5)) (Var "rd" (FTy 5)) (Var "sa" (FTy 5))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Mop (SE F64)
                   (Bop Lsl
                     (EX
                       (Mop Fst
                         (Apply
                           (Call "GPR" (ATy qTy (PTy F64 qTy))
                             (Var "rt" (FTy 5))) qVar"state")) (LN 31)
                       (LN 0) F32) (Mop (Cast nTy) (Var "sa" (FTy 5)))))
                 (Var "rd" (FTy 5))))) qVar"state")))


(Def "dfn'SRL"
  (TP (sqbkt (Var "rt" (FTy 5)) (Var "rd" (FTy 5)) (Var "sa" (FTy 5))))
  (Close qVar"state"
    (Let qVar"s"
      (ITE
        (Call "NotWordValue" bTy
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
              qVar"state")))
        (Mop Snd
          (Apply
            (Call "raise'exception" (ATy qTy (PTy uTy qTy))
              (Call "UNPREDICTABLE" CTy"exception"
                (LS"SRL: NotWordValue"))) qVar"state")) qVar"state")
      (Apply
        (Call "write'GPR" (ATy qTy (PTy uTy qTy))
          (TP
            (sqbkt (Mop (SE F64)
                     (Bop Lsr
                       (EX
                         (Mop Fst
                           (Apply
                             (Call "GPR" (ATy qTy (PTy F64 qTy))
                               (Var "rt" (FTy 5))) qVar"s")) (LN 31)
                         (LN 0) F32) (Mop (Cast nTy) (Var "sa" (FTy 5)))))
                   (Var "rd" (FTy 5))))) qVar"s"))))


(Def "dfn'SRA"
  (TP (sqbkt (Var "rt" (FTy 5)) (Var "rd" (FTy 5)) (Var "sa" (FTy 5))))
  (Close qVar"state"
    (Let qVar"s"
      (ITE
        (Call "NotWordValue" bTy
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
              qVar"state")))
        (Mop Snd
          (Apply
            (Call "raise'exception" (ATy qTy (PTy uTy qTy))
              (Call "UNPREDICTABLE" CTy"exception"
                (LS"SRA: NotWordValue"))) qVar"state")) qVar"state")
      (Apply
        (Call "write'GPR" (ATy qTy (PTy uTy qTy))
          (TP
            (sqbkt (Mop (SE F64)
                     (Bop Asr
                       (EX
                         (Mop Fst
                           (Apply
                             (Call "GPR" (ATy qTy (PTy F64 qTy))
                               (Var "rt" (FTy 5))) qVar"s")) (LN 31)
                         (LN 0) F32) (Mop (Cast nTy) (Var "sa" (FTy 5)))))
                   (Var "rd" (FTy 5))))) qVar"s"))))


(Def "dfn'SLLV"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Mop (SE F64)
                   (Bop Lsl
                     (EX
                       (Mop Fst
                         (Apply
                           (Call "GPR" (ATy qTy (PTy F64 qTy))
                             (Var "rt" (FTy 5))) qVar"state")) (LN 31)
                       (LN 0) F32)
                     (Mop (Cast nTy)
                       (EX
                         (Mop Fst
                           (Apply
                             (Call "GPR" (ATy qTy (PTy F64 qTy))
                               (Var "rs" (FTy 5))) qVar"state")) (LN 4)
                         (LN 0) (FTy 5))))) (Var "rd" (FTy 5)))))
      qVar"state")))


(Def "dfn'SRLV"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (Let qVar"s"
      (ITE
        (Call "NotWordValue" bTy
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
              qVar"state")))
        (Mop Snd
          (Apply
            (Call "raise'exception" (ATy qTy (PTy uTy qTy))
              (Call "UNPREDICTABLE" CTy"exception"
                (LS"SRLV: NotWordValue"))) qVar"state")) qVar"state")
      (Apply
        (Call "write'GPR" (ATy qTy (PTy uTy qTy))
          (TP
            (sqbkt (Mop (SE F64)
                     (Bop Lsr
                       (EX
                         (Mop Fst
                           (Apply
                             (Call "GPR" (ATy qTy (PTy F64 qTy))
                               (Var "rt" (FTy 5))) qVar"s")) (LN 31)
                         (LN 0) F32)
                       (Mop (Cast nTy)
                         (EX
                           (Mop Fst
                             (Apply
                               (Call "GPR" (ATy qTy (PTy F64 qTy))
                                 (Var "rs" (FTy 5))) qVar"s")) (LN 4)
                           (LN 0) (FTy 5))))) (Var "rd" (FTy 5)))))
        qVar"s"))))


(Def "dfn'SRAV"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (Let qVar"s"
      (ITE
        (Call "NotWordValue" bTy
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
              qVar"state")))
        (Mop Snd
          (Apply
            (Call "raise'exception" (ATy qTy (PTy uTy qTy))
              (Call "UNPREDICTABLE" CTy"exception"
                (LS"SRAV: NotWordValue"))) qVar"state")) qVar"state")
      (Apply
        (Call "write'GPR" (ATy qTy (PTy uTy qTy))
          (TP
            (sqbkt (Mop (SE F64)
                     (Bop Asr
                       (EX
                         (Mop Fst
                           (Apply
                             (Call "GPR" (ATy qTy (PTy F64 qTy))
                               (Var "rt" (FTy 5))) qVar"s")) (LN 31)
                         (LN 0) F32)
                       (Mop (Cast nTy)
                         (EX
                           (Mop Fst
                             (Apply
                               (Call "GPR" (ATy qTy (PTy F64 qTy))
                                 (Var "rs" (FTy 5))) qVar"s")) (LN 4)
                           (LN 0) (FTy 5))))) (Var "rd" (FTy 5)))))
        qVar"s"))))


(Def "dfn'DSLL"
  (TP (sqbkt (Var "rt" (FTy 5)) (Var "rd" (FTy 5)) (Var "sa" (FTy 5))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Bop Lsl
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rt" (FTy 5))) qVar"state"))
                   (Mop (Cast nTy) (Var "sa" (FTy 5)))) (Var "rd" (FTy 5)))))
      qVar"state")))


(Def "dfn'DSRL"
  (TP (sqbkt (Var "rt" (FTy 5)) (Var "rd" (FTy 5)) (Var "sa" (FTy 5))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Bop Lsr
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rt" (FTy 5))) qVar"state"))
                   (Mop (Cast nTy) (Var "sa" (FTy 5)))) (Var "rd" (FTy 5)))))
      qVar"state")))


(Def "dfn'DSRA"
  (TP (sqbkt (Var "rt" (FTy 5)) (Var "rd" (FTy 5)) (Var "sa" (FTy 5))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Bop Asr
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rt" (FTy 5))) qVar"state"))
                   (Mop (Cast nTy) (Var "sa" (FTy 5)))) (Var "rd" (FTy 5)))))
      qVar"state")))


(Def "dfn'DSLLV"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Bop Lsl
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rt" (FTy 5))) qVar"state"))
                   (Mop (Cast nTy)
                     (EX
                       (Mop Fst
                         (Apply
                           (Call "GPR" (ATy qTy (PTy F64 qTy))
                             (Var "rs" (FTy 5))) qVar"state")) (LN 5)
                       (LN 0) (FTy 6)))) (Var "rd" (FTy 5)))))
      qVar"state")))


(Def "dfn'DSRLV"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Bop Lsr
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rt" (FTy 5))) qVar"state"))
                   (Mop (Cast nTy)
                     (EX
                       (Mop Fst
                         (Apply
                           (Call "GPR" (ATy qTy (PTy F64 qTy))
                             (Var "rs" (FTy 5))) qVar"state")) (LN 5)
                       (LN 0) (FTy 6)))) (Var "rd" (FTy 5)))))
      qVar"state")))


(Def "dfn'DSRAV"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Bop Asr
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rt" (FTy 5))) qVar"state"))
                   (Mop (Cast nTy)
                     (EX
                       (Mop Fst
                         (Apply
                           (Call "GPR" (ATy qTy (PTy F64 qTy))
                             (Var "rs" (FTy 5))) qVar"state")) (LN 5)
                       (LN 0) (FTy 6)))) (Var "rd" (FTy 5)))))
      qVar"state")))


(Def "dfn'DSLL32"
  (TP (sqbkt (Var "rt" (FTy 5)) (Var "rd" (FTy 5)) (Var "sa" (FTy 5))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Bop Lsl
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rt" (FTy 5))) qVar"state"))
                   (Bop Add (Mop (Cast nTy) (Var "sa" (FTy 5))) (LN 32)))
                 (Var "rd" (FTy 5))))) qVar"state")))


(Def "dfn'DSRL32"
  (TP (sqbkt (Var "rt" (FTy 5)) (Var "rd" (FTy 5)) (Var "sa" (FTy 5))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Bop Lsr
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rt" (FTy 5))) qVar"state"))
                   (Bop Add (Mop (Cast nTy) (Var "sa" (FTy 5))) (LN 32)))
                 (Var "rd" (FTy 5))))) qVar"state")))


(Def "dfn'DSRA32"
  (TP (sqbkt (Var "rt" (FTy 5)) (Var "rd" (FTy 5)) (Var "sa" (FTy 5))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Bop Asr
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rt" (FTy 5))) qVar"state"))
                   (Bop Add (Mop (Cast nTy) (Var "sa" (FTy 5))) (LN 32)))
                 (Var "rd" (FTy 5))))) qVar"state")))


(Def "dfn'TGE" (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5))))
  (Close qVar"state"
    (ITE
      (Bop Ge
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
            qVar"state"))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
            qVar"state")))
      (Apply
        (Call "SignalException" (ATy qTy (PTy uTy qTy))
          (LC "Tr" CTy"ExceptionType")) qVar"state")
      (TP (sqbkt LU qVar"state")))))


(Def "dfn'TGEU" (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5))))
  (Close qVar"state"
    (ITE
      (Bop Uge
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
            qVar"state"))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
            qVar"state")))
      (Apply
        (Call "SignalException" (ATy qTy (PTy uTy qTy))
          (LC "Tr" CTy"ExceptionType")) qVar"state")
      (TP (sqbkt LU qVar"state")))))


(Def "dfn'TLT" (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5))))
  (Close qVar"state"
    (ITE
      (Bop Lt
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
            qVar"state"))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
            qVar"state")))
      (Apply
        (Call "SignalException" (ATy qTy (PTy uTy qTy))
          (LC "Tr" CTy"ExceptionType")) qVar"state")
      (TP (sqbkt LU qVar"state")))))


(Def "dfn'TLTU" (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5))))
  (Close qVar"state"
    (ITE
      (Bop Ult
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
            qVar"state"))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
            qVar"state")))
      (Apply
        (Call "SignalException" (ATy qTy (PTy uTy qTy))
          (LC "Tr" CTy"ExceptionType")) qVar"state")
      (TP (sqbkt LU qVar"state")))))


(Def "dfn'TEQ" (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5))))
  (Close qVar"state"
    (ITE
      (EQ
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
            qVar"state"))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
            qVar"state")))
      (Apply
        (Call "SignalException" (ATy qTy (PTy uTy qTy))
          (LC "Tr" CTy"ExceptionType")) qVar"state")
      (TP (sqbkt LU qVar"state")))))


(Def "dfn'TNE" (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5))))
  (Close qVar"state"
    (ITE
      (Mop Not
        (EQ
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
              qVar"state"))
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rt" (FTy 5)))
              qVar"state"))))
      (Apply
        (Call "SignalException" (ATy qTy (PTy uTy qTy))
          (LC "Tr" CTy"ExceptionType")) qVar"state")
      (TP (sqbkt LU qVar"state")))))


(Def "dfn'TGEI" (TP (sqbkt (Var "rs" (FTy 5)) (Var "immediate" F16)))
  (Close qVar"state"
    (ITE
      (Bop Ge
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
            qVar"state")) (Mop (SE F64) (Var "immediate" F16)))
      (Apply
        (Call "SignalException" (ATy qTy (PTy uTy qTy))
          (LC "Tr" CTy"ExceptionType")) qVar"state")
      (TP (sqbkt LU qVar"state")))))


(Def "dfn'TGEIU" (TP (sqbkt (Var "rs" (FTy 5)) (Var "immediate" F16)))
  (Close qVar"state"
    (ITE
      (Bop Uge
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
            qVar"state")) (Mop (SE F64) (Var "immediate" F16)))
      (Apply
        (Call "SignalException" (ATy qTy (PTy uTy qTy))
          (LC "Tr" CTy"ExceptionType")) qVar"state")
      (TP (sqbkt LU qVar"state")))))


(Def "dfn'TLTI" (TP (sqbkt (Var "rs" (FTy 5)) (Var "immediate" F16)))
  (Close qVar"state"
    (ITE
      (Bop Lt
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
            qVar"state")) (Mop (SE F64) (Var "immediate" F16)))
      (Apply
        (Call "SignalException" (ATy qTy (PTy uTy qTy))
          (LC "Tr" CTy"ExceptionType")) qVar"state")
      (TP (sqbkt LU qVar"state")))))


(Def "dfn'TLTIU" (TP (sqbkt (Var "rs" (FTy 5)) (Var "immediate" F16)))
  (Close qVar"state"
    (ITE
      (Bop Ult
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
            qVar"state")) (Mop (SE F64) (Var "immediate" F16)))
      (Apply
        (Call "SignalException" (ATy qTy (PTy uTy qTy))
          (LC "Tr" CTy"ExceptionType")) qVar"state")
      (TP (sqbkt LU qVar"state")))))


(Def "dfn'TEQI" (TP (sqbkt (Var "rs" (FTy 5)) (Var "immediate" F16)))
  (Close qVar"state"
    (ITE
      (EQ
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
            qVar"state")) (Mop (SE F64) (Var "immediate" F16)))
      (Apply
        (Call "SignalException" (ATy qTy (PTy uTy qTy))
          (LC "Tr" CTy"ExceptionType")) qVar"state")
      (TP (sqbkt LU qVar"state")))))


(Def "dfn'TNEI" (TP (sqbkt (Var "rs" (FTy 5)) (Var "immediate" F16)))
  (Close qVar"state"
    (ITE
      (Mop Not
        (EQ
          (Mop Fst
            (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "rs" (FTy 5)))
              qVar"state")) (Mop (SE F64) (Var "immediate" F16))))
      (Apply
        (Call "SignalException" (ATy qTy (PTy uTy qTy))
          (LC "Tr" CTy"ExceptionType")) qVar"state")
      (TP (sqbkt LU qVar"state")))))


(Def "loadByte"
  (TP
    (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)
           bVar"unsigned"))
  (Close qVar"state"
    (Let (Var "v" F64)
      (Bop Add (Mop (SE F64) (Var "offset" F16))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "base" (FTy 5)))
            qVar"state")))
      (Let (TP (sqbkt (Var "pAddr" F64) (Var "CCA" (FTy 3))))
        (Call "AddressTranslation" (PTy F64 (FTy 3))
          (TP
            (sqbkt (Var "v" F64) (LC "DATA" CTy"IorD")
                   (LC "LOAD" CTy"LorS"))))
        (Let (Var "v0" (FTy 3))
          (Bop BXor (EX (Var "v" F64) (LN 2) (LN 0) (FTy 3))
            (Bop Rep
              (Mop Fst
                (Apply (Const "BigEndianCPU" (ATy qTy (PTy F1 qTy)))
                  qVar"state")) (LN 3)))
          (Let (Var "membyte" F8)
            (EX
              (Mop Fst
                (Apply
                  (Call "LoadMemory" (ATy qTy (PTy F64 qTy))
                    (TP
                      (sqbkt (Var "CCA" (FTy 3)) (Const "BYTE" (FTy 3))
                             CC(sqbkt (EX (Var "pAddr" F64)
                                        (Bop Sub (Const "PSIZE" nTy)
                                          (LN 1)) (LN 3) (FTy 61))
                                      (Bop BXor
                                        (EX (Var "pAddr" F64) (LN 2)
                                          (LN 0) (FTy 3))
                                        (Bop Rep
                                          (Mop Fst
                                            (Apply
                                              (Const "ReverseEndian"
                                                (ATy qTy (PTy F1 qTy)))
                                              qVar"state")) (LN 3))))
                             (Var "v" F64) (LC "DATA" CTy"IorD"))))
                  qVar"state"))
              (Bop Add (LN 7)
                (Bop Mul (LN 8) (Mop (Cast nTy) (Var "v0" (FTy 3)))))
              (Bop Mul (LN 8) (Mop (Cast nTy) (Var "v0" (FTy 3)))) F8)
            (Apply
              (Call "write'GPR" (ATy qTy (PTy uTy qTy))
                (TP
                  (sqbkt (ITE bVar"unsigned"
                           (Mop (Cast F64) (Var "membyte" F8))
                           (Mop (SE F64) (Var "membyte" F8)))
                         (Var "rt" (FTy 5))))) qVar"state")))))))


(Def "loadHalf"
  (TP
    (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)
           bVar"unsigned"))
  (Close qVar"state"
    (Let (Var "v" F64)
      (Bop Add (Mop (SE F64) (Var "offset" F16))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "base" (FTy 5)))
            qVar"state")))
      (ITE (Bop Bit (Var "v" F64) (LN 0))
        (Apply
          (Call "SignalException" (ATy qTy (PTy uTy qTy))
            (LC "AdEL" CTy"ExceptionType")) qVar"state")
        (Let (TP (sqbkt (Var "pAddr" F64) (Var "CCA" (FTy 3))))
          (Call "AddressTranslation" (PTy F64 (FTy 3))
            (TP
              (sqbkt (Var "v" F64) (LC "DATA" CTy"IorD")
                     (LC "LOAD" CTy"LorS"))))
          (Let (Var "v0" (FTy 3))
            (Bop BXor (EX (Var "v" F64) (LN 2) (LN 0) (FTy 3))
              (CC(sqbkt (Bop Rep
                          (Mop Fst
                            (Apply
                              (Const "BigEndianCPU"
                                (ATy qTy (PTy F1 qTy))) qVar"state"))
                          (LN 2)) (LW 0 1))))
            (Let (Var "memhalf" F16)
              (EX
                (Mop Fst
                  (Apply
                    (Call "LoadMemory" (ATy qTy (PTy F64 qTy))
                      (TP
                        (sqbkt (Var "CCA" (FTy 3))
                               (Const "HALFWORD" (FTy 3))
                               CC(sqbkt (EX (Var "pAddr" F64)
                                          (Bop Sub (Const "PSIZE" nTy)
                                            (LN 1)) (LN 3) (FTy 61))
                                        (Bop BXor
                                          (EX (Var "pAddr" F64) (LN 2)
                                            (LN 0) (FTy 3))
                                          (CC(sqbkt (Bop Rep
                                                      (Mop Fst
                                                        (Apply
                                                          (Const
                                                            "ReverseEndian"
                                                            (ATy qTy
                                                              (PTy F1 qTy)))
                                                          qVar"state"))
                                                      (LN 2)) (LW 0 1)))))
                               (Var "v" F64) (LC "DATA" CTy"IorD"))))
                    qVar"state"))
                (Bop Add (LN 15)
                  (Bop Mul (LN 8) (Mop (Cast nTy) (Var "v0" (FTy 3)))))
                (Bop Mul (LN 8) (Mop (Cast nTy) (Var "v0" (FTy 3)))) F16)
              (Apply
                (Call "write'GPR" (ATy qTy (PTy uTy qTy))
                  (TP
                    (sqbkt (ITE bVar"unsigned"
                             (Mop (Cast F64) (Var "memhalf" F16))
                             (Mop (SE F64) (Var "memhalf" F16)))
                           (Var "rt" (FTy 5))))) qVar"state"))))))))


(Def "loadWord"
  (TP
    (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)
           bVar"unsigned"))
  (Close qVar"state"
    (Let (Var "v" F64)
      (Bop Add (Mop (SE F64) (Var "offset" F16))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "base" (FTy 5)))
            qVar"state")))
      (ITE
        (Mop Not (EQ (EX (Var "v" F64) (LN 1) (LN 0) (FTy 2)) (LW 0 2)))
        (Apply
          (Call "SignalException" (ATy qTy (PTy uTy qTy))
            (LC "AdEL" CTy"ExceptionType")) qVar"state")
        (Let (TP (sqbkt (Var "pAddr" F64) (Var "CCA" (FTy 3))))
          (Call "AddressTranslation" (PTy F64 (FTy 3))
            (TP
              (sqbkt (Var "v" F64) (LC "DATA" CTy"IorD")
                     (LC "LOAD" CTy"LorS"))))
          (Let (Var "v0" (FTy 3))
            (Bop BXor (EX (Var "v" F64) (LN 2) (LN 0) (FTy 3))
              (CC(sqbkt (Mop Fst
                          (Apply
                            (Const "BigEndianCPU" (ATy qTy (PTy F1 qTy)))
                            qVar"state")) (LW 0 2))))
            (Let (Var "memword" F32)
              (EX
                (Mop Fst
                  (Apply
                    (Call "LoadMemory" (ATy qTy (PTy F64 qTy))
                      (TP
                        (sqbkt (Var "CCA" (FTy 3)) (Const "WORD" (FTy 3))
                               CC(sqbkt (EX (Var "pAddr" F64)
                                          (Bop Sub (Const "PSIZE" nTy)
                                            (LN 1)) (LN 3) (FTy 61))
                                        (Bop BXor
                                          (EX (Var "pAddr" F64) (LN 2)
                                            (LN 0) (FTy 3))
                                          (CC(sqbkt (Mop Fst
                                                      (Apply
                                                        (Const
                                                          "ReverseEndian"
                                                          (ATy qTy
                                                            (PTy F1 qTy)))
                                                        qVar"state"))
                                                    (LW 0 2)))))
                               (Var "v" F64) (LC "DATA" CTy"IorD"))))
                    qVar"state"))
                (Bop Add (LN 31)
                  (Bop Mul (LN 8) (Mop (Cast nTy) (Var "v0" (FTy 3)))))
                (Bop Mul (LN 8) (Mop (Cast nTy) (Var "v0" (FTy 3)))) F32)
              (Apply
                (Call "write'GPR" (ATy qTy (PTy uTy qTy))
                  (TP
                    (sqbkt (ITE bVar"unsigned"
                             (Mop (Cast F64) (Var "memword" F32))
                             (Mop (SE F64) (Var "memword" F32)))
                           (Var "rt" (FTy 5))))) qVar"state"))))))))


(Def "loadDoubleword"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Let (Var "v" F64)
      (Bop Add (Mop (SE F64) (Var "offset" F16))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "base" (FTy 5)))
            qVar"state")))
      (ITE
        (Mop Not (EQ (EX (Var "v" F64) (LN 2) (LN 0) (FTy 3)) (LW 0 3)))
        (Apply
          (Call "SignalException" (ATy qTy (PTy uTy qTy))
            (LC "AdEL" CTy"ExceptionType")) qVar"state")
        (Let (TP (sqbkt (Var "pAddr" F64) (Var "CCA" (FTy 3))))
          (Call "AddressTranslation" (PTy F64 (FTy 3))
            (TP
              (sqbkt (Var "v" F64) (LC "DATA" CTy"IorD")
                     (LC "LOAD" CTy"LorS"))))
          (Apply
            (Call "write'GPR" (ATy qTy (PTy uTy qTy))
              (TP
                (sqbkt (Mop Fst
                         (Apply
                           (Call "LoadMemory" (ATy qTy (PTy F64 qTy))
                             (TP
                               (sqbkt (Var "CCA" (FTy 3))
                                      (Const "DOUBLEWORD" (FTy 3))
                                      (Var "pAddr" F64) (Var "v" F64)
                                      (LC "DATA" CTy"IorD"))))
                           qVar"state")) (Var "rt" (FTy 5)))))
            qVar"state"))))))


(Def "dfn'LB"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Apply
      (Call "loadByte" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5))
                 (Var "offset" F16) LF))) qVar"state")))


(Def "dfn'LBU"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Apply
      (Call "loadByte" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5))
                 (Var "offset" F16) LT))) qVar"state")))


(Def "dfn'LH"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Apply
      (Call "loadHalf" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5))
                 (Var "offset" F16) LF))) qVar"state")))


(Def "dfn'LHU"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Apply
      (Call "loadHalf" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5))
                 (Var "offset" F16) LT))) qVar"state")))


(Def "dfn'LW"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Apply
      (Call "loadWord" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5))
                 (Var "offset" F16) LF))) qVar"state")))


(Def "dfn'LWU"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Apply
      (Call "loadWord" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5))
                 (Var "offset" F16) LT))) qVar"state")))


(Def "dfn'LL"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (TP
      (sqbkt LU
             (Rupd "LLbit"
               (TP
                 (sqbkt (Mop Snd
                          (Apply
                            (Call "loadWord" (ATy qTy (PTy uTy qTy))
                              (TP
                                (sqbkt (Var "base" (FTy 5))
                                       (Var "rt" (FTy 5))
                                       (Var "offset" F16) LF)))
                            qVar"state")) (Mop Some LT))))))))


(Def "dfn'LD"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Apply
      (Call "loadDoubleword" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5))
                 (Var "offset" F16)))) qVar"state")))


(Def "dfn'LLD"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (TP
      (sqbkt LU
             (Rupd "LLbit"
               (TP
                 (sqbkt (Mop Snd
                          (Apply
                            (Call "loadDoubleword" (ATy qTy (PTy uTy qTy))
                              (TP
                                (sqbkt (Var "base" (FTy 5))
                                       (Var "rt" (FTy 5))
                                       (Var "offset" F16)))) qVar"state"))
                        (Mop Some LT))))))))


(Def "dfn'LWL"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Let (Var "v" F64)
      (Bop Add (Mop (SE F64) (Var "offset" F16))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "base" (FTy 5)))
            qVar"state")))
      (Let (TP (sqbkt (Var "pAddr" F64) (Var "CCA" (FTy 3))))
        (Call "AddressTranslation" (PTy F64 (FTy 3))
          (TP
            (sqbkt (Var "v" F64) (LC "DATA" CTy"IorD")
                   (LC "LOAD" CTy"LorS"))))
        (Let (Var "v0" F64)
          (CC(sqbkt (EX (Var "pAddr" F64)
                      (Bop Sub (Const "PSIZE" nTy) (LN 1)) (LN 3)
                      (FTy 61))
                    (Bop BXor (EX (Var "pAddr" F64) (LN 2) (LN 0) (FTy 3))
                      (Bop Rep
                        (Mop Fst
                          (Apply
                            (Const "ReverseEndian" (ATy qTy (PTy F1 qTy)))
                            qVar"state")) (LN 3)))))
          (Let (Var "v1" (FTy 2))
            (Bop BXor (EX (Var "v" F64) (LN 1) (LN 0) (FTy 2))
              (Bop Rep
                (Mop Fst
                  (Apply (Const "BigEndianCPU" (ATy qTy (PTy F1 qTy)))
                    qVar"state")) (LN 2)))
            (Let (Var "v2" F64)
              (Mop Fst
                (Apply
                  (Call "LoadMemory" (ATy qTy (PTy F64 qTy))
                    (TP
                      (sqbkt (Var "CCA" (FTy 3))
                             CC(sqbkt (LW 0 1) (Var "v1" (FTy 2)))
                             (ITE
                               (Mop Fst
                                 (Apply
                                   (Const "BigEndianMem"
                                     (ATy qTy (PTy bTy qTy))) qVar"state"))
                               (Var "v0" F64)
                               (Bop BAnd (Var "v0" F64)
                                 (Mop BNot (LW 7 64)))) (Var "v" F64)
                             (LC "DATA" CTy"IorD")))) qVar"state"))
              (Let (TP (sqbkt (Var "v" F32) qVar"s"))
                (CS
                  (TP
                    (sqbkt (Bop BXor (EX (Var "v" F64) (LN 2) (LN 2) F1)
                             (Mop Fst
                               (Apply
                                 (Const "BigEndianCPU"
                                   (ATy qTy (PTy F1 qTy))) qVar"state")))
                           (Var "v1" (FTy 2))))
                  (sqbkt ((TP (sqbkt (LW 0 1) (LW 0 2)))
                           (TP
                             (sqbkt CC(sqbkt (EX (Var "v2" F64) (LN 7)
                                               (LN 0) F8)
                                             (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 23)
                                               (LN 0) (FTy 24)))
                                    qVar"state")))
                         ((TP (sqbkt (LW 0 1) (LW 1 2)))
                           (TP
                             (sqbkt CC(sqbkt (EX (Var "v2" F64) (LN 15)
                                               (LN 0) F16)
                                             (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 15)
                                               (LN 0) F16)) qVar"state")))
                         ((TP (sqbkt (LW 0 1) (LW 2 2)))
                           (TP
                             (sqbkt CC(sqbkt (EX (Var "v2" F64) (LN 23)
                                               (LN 0) (FTy 24))
                                             (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 7)
                                               (LN 0) F8)) qVar"state")))
                         ((TP (sqbkt (LW 0 1) (LW 3 2)))
                           (TP
                             (sqbkt (EX (Var "v2" F64) (LN 31) (LN 0) F32)
                                    qVar"state")))
                         ((TP (sqbkt (LW 1 1) (LW 0 2)))
                           (TP
                             (sqbkt CC(sqbkt (EX (Var "v2" F64) (LN 39)
                                               (LN 32) F8)
                                             (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 23)
                                               (LN 0) (FTy 24)))
                                    qVar"state")))
                         ((TP (sqbkt (LW 1 1) (LW 1 2)))
                           (TP
                             (sqbkt CC(sqbkt (EX (Var "v2" F64) (LN 47)
                                               (LN 32) F16)
                                             (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 15)
                                               (LN 0) F16)) qVar"state")))
                         ((TP (sqbkt (LW 1 1) (LW 2 2)))
                           (TP
                             (sqbkt CC(sqbkt (EX (Var "v2" F64) (LN 55)
                                               (LN 32) (FTy 24))
                                             (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 7)
                                               (LN 0) F8)) qVar"state")))
                         ((TP (sqbkt (LW 1 1) (LW 3 2)))
                           (TP
                             (sqbkt (EX (Var "v2" F64) (LN 63) (LN 32)
                                      F32) qVar"state")))))
                (Apply
                  (Call "write'GPR" (ATy qTy (PTy uTy qTy))
                    (TP
                      (sqbkt (Mop (SE F64) (Var "v" F32))
                             (Var "rt" (FTy 5))))) qVar"s")))))))))


(Def "dfn'LWR"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Let (Var "v" F64)
      (Bop Add (Mop (SE F64) (Var "offset" F16))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "base" (FTy 5)))
            qVar"state")))
      (Let (TP (sqbkt (Var "pAddr" F64) (Var "CCA" (FTy 3))))
        (Call "AddressTranslation" (PTy F64 (FTy 3))
          (TP
            (sqbkt (Var "v" F64) (LC "DATA" CTy"IorD")
                   (LC "LOAD" CTy"LorS"))))
        (Let (Var "v0" F64)
          (CC(sqbkt (EX (Var "pAddr" F64)
                      (Bop Sub (Const "PSIZE" nTy) (LN 1)) (LN 3)
                      (FTy 61))
                    (Bop BXor (EX (Var "pAddr" F64) (LN 2) (LN 0) (FTy 3))
                      (Bop Rep
                        (Mop Fst
                          (Apply
                            (Const "ReverseEndian" (ATy qTy (PTy F1 qTy)))
                            qVar"state")) (LN 3)))))
          (Let (Var "v1" (FTy 2))
            (Bop BXor (EX (Var "v" F64) (LN 1) (LN 0) (FTy 2))
              (Bop Rep
                (Mop Fst
                  (Apply (Const "BigEndianCPU" (ATy qTy (PTy F1 qTy)))
                    qVar"state")) (LN 2)))
            (Let (Var "v2" F64)
              (Mop Fst
                (Apply
                  (Call "LoadMemory" (ATy qTy (PTy F64 qTy))
                    (TP
                      (sqbkt (Var "CCA" (FTy 3))
                             (Bop Sub (Const "WORD" (FTy 3))
                               (CC(sqbkt (LW 0 1) (Var "v1" (FTy 2)))))
                             (ITE
                               (Mop Fst
                                 (Apply
                                   (Const "BigEndianMem"
                                     (ATy qTy (PTy bTy qTy))) qVar"state"))
                               (Var "v0" F64)
                               (Bop BAnd (Var "v0" F64)
                                 (Mop BNot (LW 7 64)))) (Var "v" F64)
                             (LC "DATA" CTy"IorD")))) qVar"state"))
              (Let (TP (sqbkt (Var "v" F32) qVar"s"))
                (CS
                  (TP
                    (sqbkt (Bop BXor (EX (Var "v" F64) (LN 2) (LN 2) F1)
                             (Mop Fst
                               (Apply
                                 (Const "BigEndianCPU"
                                   (ATy qTy (PTy F1 qTy))) qVar"state")))
                           (Var "v1" (FTy 2))))
                  (sqbkt ((TP (sqbkt (LW 0 1) (LW 0 2)))
                           (TP
                             (sqbkt (EX (Var "v2" F64) (LN 31) (LN 0) F32)
                                    qVar"state")))
                         ((TP (sqbkt (LW 0 1) (LW 1 2)))
                           (TP
                             (sqbkt CC(sqbkt (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 31)
                                               (LN 24) F8)
                                             (EX (Var "v2" F64) (LN 31)
                                               (LN 8) (FTy 24)))
                                    qVar"state")))
                         ((TP (sqbkt (LW 0 1) (LW 2 2)))
                           (TP
                             (sqbkt CC(sqbkt (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 31)
                                               (LN 16) F16)
                                             (EX (Var "v2" F64) (LN 31)
                                               (LN 16) F16)) qVar"state")))
                         ((TP (sqbkt (LW 0 1) (LW 3 2)))
                           (TP
                             (sqbkt CC(sqbkt (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 31)
                                               (LN 8) (FTy 24))
                                             (EX (Var "v2" F64) (LN 31)
                                               (LN 24) F8)) qVar"state")))
                         ((TP (sqbkt (LW 1 1) (LW 0 2)))
                           (TP
                             (sqbkt (EX (Var "v2" F64) (LN 63) (LN 32)
                                      F32) qVar"state")))
                         ((TP (sqbkt (LW 1 1) (LW 1 2)))
                           (TP
                             (sqbkt CC(sqbkt (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 31)
                                               (LN 24) F8)
                                             (EX (Var "v2" F64) (LN 63)
                                               (LN 40) (FTy 24)))
                                    qVar"state")))
                         ((TP (sqbkt (LW 1 1) (LW 2 2)))
                           (TP
                             (sqbkt CC(sqbkt (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 31)
                                               (LN 16) F16)
                                             (EX (Var "v2" F64) (LN 63)
                                               (LN 48) F16)) qVar"state")))
                         ((TP (sqbkt (LW 1 1) (LW 3 2)))
                           (TP
                             (sqbkt CC(sqbkt (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 31)
                                               (LN 8) (FTy 24))
                                             (EX (Var "v2" F64) (LN 63)
                                               (LN 56) F8)) qVar"state")))))
                (Apply
                  (Call "write'GPR" (ATy qTy (PTy uTy qTy))
                    (TP
                      (sqbkt (Mop (SE F64) (Var "v" F32))
                             (Var "rt" (FTy 5))))) qVar"s")))))))))


(Def "dfn'LDL"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Let (Var "v" F64)
      (Bop Add (Mop (SE F64) (Var "offset" F16))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "base" (FTy 5)))
            qVar"state")))
      (Let (TP (sqbkt (Var "pAddr" F64) (Var "CCA" (FTy 3))))
        (Call "AddressTranslation" (PTy F64 (FTy 3))
          (TP
            (sqbkt (Var "v" F64) (LC "DATA" CTy"IorD")
                   (LC "LOAD" CTy"LorS"))))
        (Let (Var "v0" F64)
          (CC(sqbkt (EX (Var "pAddr" F64)
                      (Bop Sub (Const "PSIZE" nTy) (LN 1)) (LN 3)
                      (FTy 61))
                    (Bop BXor (EX (Var "pAddr" F64) (LN 2) (LN 0) (FTy 3))
                      (Bop Rep
                        (Mop Fst
                          (Apply
                            (Const "ReverseEndian" (ATy qTy (PTy F1 qTy)))
                            qVar"state")) (LN 3)))))
          (Let (Var "v1" (FTy 3))
            (Bop BXor (EX (Var "v" F64) (LN 2) (LN 0) (FTy 3))
              (Bop Rep
                (Mop Fst
                  (Apply (Const "BigEndianCPU" (ATy qTy (PTy F1 qTy)))
                    qVar"state")) (LN 3)))
            (Let (Var "v2" F64)
              (Mop Fst
                (Apply
                  (Call "LoadMemory" (ATy qTy (PTy F64 qTy))
                    (TP
                      (sqbkt (Var "CCA" (FTy 3)) (Var "v1" (FTy 3))
                             (ITE
                               (Mop Fst
                                 (Apply
                                   (Const "BigEndianMem"
                                     (ATy qTy (PTy bTy qTy))) qVar"state"))
                               (Var "v0" F64)
                               (Bop BAnd (Var "v0" F64)
                                 (Mop BNot (LW 7 64)))) (Var "v" F64)
                             (LC "DATA" CTy"IorD")))) qVar"state"))
              (Let (TP (sqbkt (Var "v" F64) qVar"s"))
                (CS (Var "v1" (FTy 3))
                  (sqbkt ((LW 0 3)
                           (TP
                             (sqbkt CC(sqbkt (EX (Var "v2" F64) (LN 7)
                                               (LN 0) F8)
                                             (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 55)
                                               (LN 0) (FTy 56)))
                                    qVar"state")))
                         ((LW 1 3)
                           (TP
                             (sqbkt CC(sqbkt (EX (Var "v2" F64) (LN 15)
                                               (LN 0) F16)
                                             (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 47)
                                               (LN 0) (FTy 48)))
                                    qVar"state")))
                         ((LW 2 3)
                           (TP
                             (sqbkt CC(sqbkt (EX (Var "v2" F64) (LN 23)
                                               (LN 0) (FTy 24))
                                             (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 39)
                                               (LN 0) (FTy 40)))
                                    qVar"state")))
                         ((LW 3 3)
                           (TP
                             (sqbkt CC(sqbkt (EX (Var "v2" F64) (LN 31)
                                               (LN 0) F32)
                                             (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 31)
                                               (LN 0) F32)) qVar"state")))
                         ((LW 4 3)
                           (TP
                             (sqbkt CC(sqbkt (EX (Var "v2" F64) (LN 39)
                                               (LN 0) (FTy 40))
                                             (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 23)
                                               (LN 0) (FTy 24)))
                                    qVar"state")))
                         ((LW 5 3)
                           (TP
                             (sqbkt CC(sqbkt (EX (Var "v2" F64) (LN 47)
                                               (LN 0) (FTy 48))
                                             (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 15)
                                               (LN 0) F16)) qVar"state")))
                         ((LW 6 3)
                           (TP
                             (sqbkt CC(sqbkt (EX (Var "v2" F64) (LN 55)
                                               (LN 0) (FTy 56))
                                             (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 7)
                                               (LN 0) F8)) qVar"state")))
                         ((LW 7 3)
                           (TP
                             (sqbkt (EX (Var "v2" F64) (LN 63) (LN 0) F64)
                                    qVar"state")))))
                (Apply
                  (Call "write'GPR" (ATy qTy (PTy uTy qTy))
                    (TP (sqbkt (Var "v" F64) (Var "rt" (FTy 5)))))
                  qVar"s")))))))))


(Def "dfn'LDR"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Let (Var "v" F64)
      (Bop Add (Mop (SE F64) (Var "offset" F16))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "base" (FTy 5)))
            qVar"state")))
      (Let (TP (sqbkt (Var "pAddr" F64) (Var "CCA" (FTy 3))))
        (Call "AddressTranslation" (PTy F64 (FTy 3))
          (TP
            (sqbkt (Var "v" F64) (LC "DATA" CTy"IorD")
                   (LC "LOAD" CTy"LorS"))))
        (Let (Var "v0" F64)
          (CC(sqbkt (EX (Var "pAddr" F64)
                      (Bop Sub (Const "PSIZE" nTy) (LN 1)) (LN 3)
                      (FTy 61))
                    (Bop BXor (EX (Var "pAddr" F64) (LN 2) (LN 0) (FTy 3))
                      (Bop Rep
                        (Mop Fst
                          (Apply
                            (Const "ReverseEndian" (ATy qTy (PTy F1 qTy)))
                            qVar"state")) (LN 3)))))
          (Let (Var "v1" (FTy 3))
            (Bop BXor (EX (Var "v" F64) (LN 2) (LN 0) (FTy 3))
              (Bop Rep
                (Mop Fst
                  (Apply (Const "BigEndianCPU" (ATy qTy (PTy F1 qTy)))
                    qVar"state")) (LN 3)))
            (Let (Var "v2" F64)
              (Mop Fst
                (Apply
                  (Call "LoadMemory" (ATy qTy (PTy F64 qTy))
                    (TP
                      (sqbkt (Var "CCA" (FTy 3))
                             (Bop Sub (Const "DOUBLEWORD" (FTy 3))
                               (Var "v1" (FTy 3)))
                             (ITE
                               (Mop Fst
                                 (Apply
                                   (Const "BigEndianMem"
                                     (ATy qTy (PTy bTy qTy))) qVar"state"))
                               (Var "v0" F64)
                               (Bop BAnd (Var "v0" F64)
                                 (Mop BNot (LW 7 64)))) (Var "v" F64)
                             (LC "DATA" CTy"IorD")))) qVar"state"))
              (Let (TP (sqbkt (Var "v" F64) qVar"s"))
                (CS (Var "v1" (FTy 3))
                  (sqbkt ((LW 0 3)
                           (TP
                             (sqbkt (EX (Var "v2" F64) (LN 63) (LN 0) F64)
                                    qVar"state")))
                         ((LW 1 3)
                           (TP
                             (sqbkt CC(sqbkt (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 63)
                                               (LN 56) F8)
                                             (EX (Var "v2" F64) (LN 63)
                                               (LN 8) (FTy 56)))
                                    qVar"state")))
                         ((LW 2 3)
                           (TP
                             (sqbkt CC(sqbkt (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 63)
                                               (LN 48) F16)
                                             (EX (Var "v2" F64) (LN 63)
                                               (LN 16) (FTy 48)))
                                    qVar"state")))
                         ((LW 3 3)
                           (TP
                             (sqbkt CC(sqbkt (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 63)
                                               (LN 40) (FTy 24))
                                             (EX (Var "v2" F64) (LN 63)
                                               (LN 24) (FTy 40)))
                                    qVar"state")))
                         ((LW 4 3)
                           (TP
                             (sqbkt CC(sqbkt (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 63)
                                               (LN 32) F32)
                                             (EX (Var "v2" F64) (LN 63)
                                               (LN 32) F32)) qVar"state")))
                         ((LW 5 3)
                           (TP
                             (sqbkt CC(sqbkt (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 63)
                                               (LN 24) (FTy 40))
                                             (EX (Var "v2" F64) (LN 63)
                                               (LN 40) (FTy 24)))
                                    qVar"state")))
                         ((LW 6 3)
                           (TP
                             (sqbkt CC(sqbkt (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 63)
                                               (LN 16) (FTy 48))
                                             (EX (Var "v2" F64) (LN 63)
                                               (LN 48) F16)) qVar"state")))
                         ((LW 7 3)
                           (TP
                             (sqbkt CC(sqbkt (EX
                                               (Mop Fst
                                                 (Apply
                                                   (Call "GPR"
                                                     (ATy qTy
                                                       (PTy F64 qTy))
                                                     (Var "rt" (FTy 5)))
                                                   qVar"state")) (LN 63)
                                               (LN 8) (FTy 56))
                                             (EX (Var "v2" F64) (LN 63)
                                               (LN 56) F8)) qVar"state")))))
                (Apply
                  (Call "write'GPR" (ATy qTy (PTy uTy qTy))
                    (TP (sqbkt (Var "v" F64) (Var "rt" (FTy 5)))))
                  qVar"s")))))))))


(Def "dfn'SB"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Let (Var "v" F64)
      (Bop Add (Mop (SE F64) (Var "offset" F16))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "base" (FTy 5)))
            qVar"state")))
      (Let (TP (sqbkt (Var "pAddr" F64) (Var "CCA" (FTy 3))))
        (Call "AddressTranslation" (PTy F64 (FTy 3))
          (TP
            (sqbkt (Var "v" F64) (LC "DATA" CTy"IorD")
                   (LC "STORE" CTy"LorS"))))
        (Apply
          (Call "StoreMemory" (ATy qTy (PTy uTy qTy))
            (TP
              (sqbkt (Var "CCA" (FTy 3)) (Const "BYTE" (FTy 3))
                     (Bop Lsl
                       (Mop Fst
                         (Apply
                           (Call "GPR" (ATy qTy (PTy F64 qTy))
                             (Var "rt" (FTy 5))) qVar"state"))
                       (Bop Mul (LN 8)
                         (Mop (Cast nTy)
                           (Bop BXor
                             (EX (Var "v" F64) (LN 2) (LN 0) (FTy 3))
                             (Bop Rep
                               (Mop Fst
                                 (Apply
                                   (Const "BigEndianCPU"
                                     (ATy qTy (PTy F1 qTy))) qVar"state"))
                               (LN 3))))))
                     CC(sqbkt (EX (Var "pAddr" F64)
                                (Bop Sub (Const "PSIZE" nTy) (LN 1))
                                (LN 3) (FTy 61))
                              (Bop BXor
                                (EX (Var "pAddr" F64) (LN 2) (LN 0)
                                  (FTy 3))
                                (Bop Rep
                                  (Mop Fst
                                    (Apply
                                      (Const "ReverseEndian"
                                        (ATy qTy (PTy F1 qTy)))
                                      qVar"state")) (LN 3))))
                     (Var "v" F64) (LC "DATA" CTy"IorD")))) qVar"state")))))


(Def "dfn'SH"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Let (Var "v" F64)
      (Bop Add (Mop (SE F64) (Var "offset" F16))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "base" (FTy 5)))
            qVar"state")))
      (ITE (Bop Bit (Var "v" F64) (LN 0))
        (Apply
          (Call "SignalException" (ATy qTy (PTy uTy qTy))
            (LC "AdES" CTy"ExceptionType")) qVar"state")
        (Let (TP (sqbkt (Var "pAddr" F64) (Var "CCA" (FTy 3))))
          (Call "AddressTranslation" (PTy F64 (FTy 3))
            (TP
              (sqbkt (Var "v" F64) (LC "DATA" CTy"IorD")
                     (LC "STORE" CTy"LorS"))))
          (Apply
            (Call "StoreMemory" (ATy qTy (PTy uTy qTy))
              (TP
                (sqbkt (Var "CCA" (FTy 3)) (Const "HALFWORD" (FTy 3))
                       (Bop Lsl
                         (Mop Fst
                           (Apply
                             (Call "GPR" (ATy qTy (PTy F64 qTy))
                               (Var "rt" (FTy 5))) qVar"state"))
                         (Bop Mul (LN 8)
                           (Mop (Cast nTy)
                             (Bop BXor
                               (EX (Var "v" F64) (LN 2) (LN 0) (FTy 3))
                               (CC(sqbkt (Bop Rep
                                           (Mop Fst
                                             (Apply
                                               (Const "BigEndianCPU"
                                                 (ATy qTy (PTy F1 qTy)))
                                               qVar"state")) (LN 2))
                                         (LW 0 1)))))))
                       CC(sqbkt (EX (Var "pAddr" F64)
                                  (Bop Sub (Const "PSIZE" nTy) (LN 1))
                                  (LN 3) (FTy 61))
                                (Bop BXor
                                  (EX (Var "pAddr" F64) (LN 2) (LN 0)
                                    (FTy 3))
                                  (CC(sqbkt (Bop Rep
                                              (Mop Fst
                                                (Apply
                                                  (Const "ReverseEndian"
                                                    (ATy qTy (PTy F1 qTy)))
                                                  qVar"state")) (LN 2))
                                            (LW 0 1))))) (Var "v" F64)
                       (LC "DATA" CTy"IorD")))) qVar"state"))))))


(Def "storeWord"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Let (Var "v" F64)
      (Bop Add (Mop (SE F64) (Var "offset" F16))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "base" (FTy 5)))
            qVar"state")))
      (ITE
        (Mop Not (EQ (EX (Var "v" F64) (LN 1) (LN 0) (FTy 2)) (LW 0 2)))
        (Apply
          (Call "SignalException" (ATy qTy (PTy uTy qTy))
            (LC "AdES" CTy"ExceptionType")) qVar"state")
        (Let (TP (sqbkt (Var "pAddr" F64) (Var "CCA" (FTy 3))))
          (Call "AddressTranslation" (PTy F64 (FTy 3))
            (TP
              (sqbkt (Var "v" F64) (LC "DATA" CTy"IorD")
                     (LC "STORE" CTy"LorS"))))
          (Apply
            (Call "StoreMemory" (ATy qTy (PTy uTy qTy))
              (TP
                (sqbkt (Var "CCA" (FTy 3)) (Const "WORD" (FTy 3))
                       (Bop Lsl
                         (Mop Fst
                           (Apply
                             (Call "GPR" (ATy qTy (PTy F64 qTy))
                               (Var "rt" (FTy 5))) qVar"state"))
                         (Bop Mul (LN 8)
                           (Mop (Cast nTy)
                             (Bop BXor
                               (EX (Var "v" F64) (LN 2) (LN 0) (FTy 3))
                               (CC(sqbkt (Mop Fst
                                           (Apply
                                             (Const "BigEndianCPU"
                                               (ATy qTy (PTy F1 qTy)))
                                             qVar"state")) (LW 0 2)))))))
                       CC(sqbkt (EX (Var "pAddr" F64)
                                  (Bop Sub (Const "PSIZE" nTy) (LN 1))
                                  (LN 3) (FTy 61))
                                (Bop BXor
                                  (EX (Var "pAddr" F64) (LN 2) (LN 0)
                                    (FTy 3))
                                  (CC(sqbkt (Mop Fst
                                              (Apply
                                                (Const "ReverseEndian"
                                                  (ATy qTy (PTy F1 qTy)))
                                                qVar"state")) (LW 0 2)))))
                       (Var "v" F64) (LC "DATA" CTy"IorD")))) qVar"state"))))))


(Def "storeDoubleword"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Let (Var "v" F64)
      (Bop Add (Mop (SE F64) (Var "offset" F16))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "base" (FTy 5)))
            qVar"state")))
      (ITE
        (Mop Not (EQ (EX (Var "v" F64) (LN 2) (LN 0) (FTy 3)) (LW 0 3)))
        (Apply
          (Call "SignalException" (ATy qTy (PTy uTy qTy))
            (LC "AdES" CTy"ExceptionType")) qVar"state")
        (Let (TP (sqbkt (Var "pAddr" F64) (Var "CCA" (FTy 3))))
          (Call "AddressTranslation" (PTy F64 (FTy 3))
            (TP
              (sqbkt (Var "v" F64) (LC "DATA" CTy"IorD")
                     (LC "STORE" CTy"LorS"))))
          (Apply
            (Call "StoreMemory" (ATy qTy (PTy uTy qTy))
              (TP
                (sqbkt (Var "CCA" (FTy 3)) (Const "DOUBLEWORD" (FTy 3))
                       (Mop Fst
                         (Apply
                           (Call "GPR" (ATy qTy (PTy F64 qTy))
                             (Var "rt" (FTy 5))) qVar"state"))
                       (Var "pAddr" F64) (Var "v" F64)
                       (LC "DATA" CTy"IorD")))) qVar"state"))))))


(Def "dfn'SW"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Apply
      (Call "storeWord" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5))
                 (Var "offset" F16)))) qVar"state")))


(Def "dfn'SD"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Apply
      (Call "storeDoubleword" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5))
                 (Var "offset" F16)))) qVar"state")))


(Def "dfn'SC"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (CS (Dest "LLbit" (OTy bTy) qVar"state")
      (sqbkt ((LO bTy)
               (Apply
                 (Call "raise'exception" (ATy qTy (PTy uTy qTy))
                   (Call "UNPREDICTABLE" CTy"exception"
                     (LS"SC: LLbit not set"))) qVar"state"))
             ((Mop Some LF)
               (Apply
                 (Call "write'GPR" (ATy qTy (PTy uTy qTy))
                   (TP (sqbkt (LW 0 64) (Var "rt" (FTy 5))))) qVar"state"))
             ((Mop Some LT)
               (Apply
                 (Call "write'GPR" (ATy qTy (PTy uTy qTy))
                   (TP (sqbkt (LW 1 64) (Var "rt" (FTy 5)))))
                 (Mop Snd
                   (Apply
                     (Call "storeWord" (ATy qTy (PTy uTy qTy))
                       (TP
                         (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5))
                                (Var "offset" F16)))) qVar"state"))))))))


(Def "dfn'SCD"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (CS (Dest "LLbit" (OTy bTy) qVar"state")
      (sqbkt ((LO bTy)
               (Apply
                 (Call "raise'exception" (ATy qTy (PTy uTy qTy))
                   (Call "UNPREDICTABLE" CTy"exception"
                     (LS"SCD: LLbit not set"))) qVar"state"))
             ((Mop Some LF)
               (Apply
                 (Call "write'GPR" (ATy qTy (PTy uTy qTy))
                   (TP (sqbkt (LW 0 64) (Var "rt" (FTy 5))))) qVar"state"))
             ((Mop Some LT)
               (Apply
                 (Call "write'GPR" (ATy qTy (PTy uTy qTy))
                   (TP (sqbkt (LW 1 64) (Var "rt" (FTy 5)))))
                 (Mop Snd
                   (Apply
                     (Call "storeDoubleword" (ATy qTy (PTy uTy qTy))
                       (TP
                         (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5))
                                (Var "offset" F16)))) qVar"state"))))))))


(Def "dfn'SWL"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Let (Var "v" F64)
      (Bop Add (Mop (SE F64) (Var "offset" F16))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "base" (FTy 5)))
            qVar"state")))
      (Let (TP (sqbkt (Var "pAddr" F64) (Var "CCA" (FTy 3))))
        (Call "AddressTranslation" (PTy F64 (FTy 3))
          (TP
            (sqbkt (Var "v" F64) (LC "DATA" CTy"IorD")
                   (LC "STORE" CTy"LorS"))))
        (Let (Var "v0" F64)
          (CC(sqbkt (EX (Var "pAddr" F64)
                      (Bop Sub (Const "PSIZE" nTy) (LN 1)) (LN 3)
                      (FTy 61))
                    (Bop BXor (EX (Var "pAddr" F64) (LN 2) (LN 0) (FTy 3))
                      (Bop Rep
                        (Mop Fst
                          (Apply
                            (Const "ReverseEndian" (ATy qTy (PTy F1 qTy)))
                            qVar"state")) (LN 3)))))
          (Let (Var "v1" (FTy 2))
            (Bop BXor (EX (Var "v" F64) (LN 1) (LN 0) (FTy 2))
              (Bop Rep
                (Mop Fst
                  (Apply (Const "BigEndianCPU" (ATy qTy (PTy F1 qTy)))
                    qVar"state")) (LN 2)))
            (Let (TP (sqbkt (Var "v2" F64) qVar"s0"))
              (CS (Var "v1" (FTy 2))
                (sqbkt ((LW 0 2)
                         (TP
                           (sqbkt (Mop (Cast F64)
                                    (EX
                                      (Mop Fst
                                        (Apply
                                          (Call "GPR"
                                            (ATy qTy (PTy F64 qTy))
                                            (Var "rt" (FTy 5)))
                                          qVar"state")) (LN 31) (LN 24)
                                      F8)) qVar"state")))
                       ((LW 1 2)
                         (TP
                           (sqbkt (Mop (Cast F64)
                                    (EX
                                      (Mop Fst
                                        (Apply
                                          (Call "GPR"
                                            (ATy qTy (PTy F64 qTy))
                                            (Var "rt" (FTy 5)))
                                          qVar"state")) (LN 31) (LN 16)
                                      F16)) qVar"state")))
                       ((LW 2 2)
                         (TP
                           (sqbkt (Mop (Cast F64)
                                    (EX
                                      (Mop Fst
                                        (Apply
                                          (Call "GPR"
                                            (ATy qTy (PTy F64 qTy))
                                            (Var "rt" (FTy 5)))
                                          qVar"state")) (LN 31) (LN 8)
                                      (FTy 24))) qVar"state")))
                       ((LW 3 2)
                         (TP
                           (sqbkt (Mop (Cast F64)
                                    (EX
                                      (Mop Fst
                                        (Apply
                                          (Call "GPR"
                                            (ATy qTy (PTy F64 qTy))
                                            (Var "rt" (FTy 5)))
                                          qVar"state")) (LN 31) (LN 0)
                                      F32)) qVar"state")))))
              (Apply
                (Call "StoreMemory" (ATy qTy (PTy uTy qTy))
                  (TP
                    (sqbkt (Var "CCA" (FTy 3))
                           (Mop (Cast (FTy 3)) (Var "v1" (FTy 2)))
                           (ITE
                             (EQ
                               (Bop BXor
                                 (EX (Var "v" F64) (LN 2) (LN 2) F1)
                                 (Mop Fst
                                   (Apply
                                     (Const "BigEndianCPU"
                                       (ATy qTy (PTy F1 qTy)))
                                     qVar"state"))) (LW 1 1))
                             (Bop Lsl (Var "v2" F64) (LN 32))
                             (Var "v2" F64))
                           (ITE
                             (Mop Fst
                               (Apply
                                 (Const "BigEndianMem"
                                   (ATy qTy (PTy bTy qTy))) qVar"state"))
                             (Var "v0" F64)
                             (Bop BAnd (Var "v0" F64)
                               (Mop BNot (LW 3 64)))) (Var "v" F64)
                           (LC "DATA" CTy"IorD")))) qVar"s0"))))))))


(Def "dfn'SWR"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Let (Var "v" F64)
      (Bop Add (Mop (SE F64) (Var "offset" F16))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "base" (FTy 5)))
            qVar"state")))
      (Let (TP (sqbkt (Var "pAddr" F64) (Var "CCA" (FTy 3))))
        (Call "AddressTranslation" (PTy F64 (FTy 3))
          (TP
            (sqbkt (Var "v" F64) (LC "DATA" CTy"IorD")
                   (LC "STORE" CTy"LorS"))))
        (Let (Var "v0" F64)
          (CC(sqbkt (EX (Var "pAddr" F64)
                      (Bop Sub (Const "PSIZE" nTy) (LN 1)) (LN 3)
                      (FTy 61))
                    (Bop BXor (EX (Var "pAddr" F64) (LN 2) (LN 0) (FTy 3))
                      (Bop Rep
                        (Mop Fst
                          (Apply
                            (Const "ReverseEndian" (ATy qTy (PTy F1 qTy)))
                            qVar"state")) (LN 3)))))
          (Let (Var "v1" (FTy 2))
            (Bop BXor (EX (Var "v" F64) (LN 1) (LN 0) (FTy 2))
              (Bop Rep
                (Mop Fst
                  (Apply (Const "BigEndianCPU" (ATy qTy (PTy F1 qTy)))
                    qVar"state")) (LN 2)))
            (Let (TP (sqbkt (Var "v2" F64) qVar"s0"))
              (CS
                (TP
                  (sqbkt (Bop BXor (EX (Var "v" F64) (LN 2) (LN 2) F1)
                           (Mop Fst
                             (Apply
                               (Const "BigEndianCPU"
                                 (ATy qTy (PTy F1 qTy))) qVar"state")))
                         (Var "v1" (FTy 2))))
                (sqbkt ((TP (sqbkt (LW 0 1) (LW 0 2)))
                         (TP
                           (sqbkt (Mop (Cast F64)
                                    (EX
                                      (Mop Fst
                                        (Apply
                                          (Call "GPR"
                                            (ATy qTy (PTy F64 qTy))
                                            (Var "rt" (FTy 5)))
                                          qVar"state")) (LN 31) (LN 0)
                                      F32)) qVar"state")))
                       ((TP (sqbkt (LW 0 1) (LW 1 2)))
                         (TP
                           (sqbkt (Bop Lsl
                                    (Mop (Cast F64)
                                      (EX
                                        (Mop Fst
                                          (Apply
                                            (Call "GPR"
                                              (ATy qTy (PTy F64 qTy))
                                              (Var "rt" (FTy 5)))
                                            qVar"state")) (LN 23) (LN 0)
                                        (FTy 24))) (LN 8)) qVar"state")))
                       ((TP (sqbkt (LW 0 1) (LW 2 2)))
                         (TP
                           (sqbkt (Bop Lsl
                                    (Mop (Cast F64)
                                      (EX
                                        (Mop Fst
                                          (Apply
                                            (Call "GPR"
                                              (ATy qTy (PTy F64 qTy))
                                              (Var "rt" (FTy 5)))
                                            qVar"state")) (LN 15) (LN 0)
                                        F16)) (LN 16)) qVar"state")))
                       ((TP (sqbkt (LW 0 1) (LW 3 2)))
                         (TP
                           (sqbkt (Bop Lsl
                                    (Mop (Cast F64)
                                      (EX
                                        (Mop Fst
                                          (Apply
                                            (Call "GPR"
                                              (ATy qTy (PTy F64 qTy))
                                              (Var "rt" (FTy 5)))
                                            qVar"state")) (LN 7) (LN 0)
                                        F8)) (LN 24)) qVar"state")))
                       ((TP (sqbkt (LW 1 1) (LW 0 2)))
                         (TP
                           (sqbkt (Bop Lsl
                                    (Mop (Cast F64)
                                      (EX
                                        (Mop Fst
                                          (Apply
                                            (Call "GPR"
                                              (ATy qTy (PTy F64 qTy))
                                              (Var "rt" (FTy 5)))
                                            qVar"state")) (LN 31) (LN 0)
                                        F32)) (LN 32)) qVar"state")))
                       ((TP (sqbkt (LW 1 1) (LW 1 2)))
                         (TP
                           (sqbkt (Bop Lsl
                                    (Mop (Cast F64)
                                      (EX
                                        (Mop Fst
                                          (Apply
                                            (Call "GPR"
                                              (ATy qTy (PTy F64 qTy))
                                              (Var "rt" (FTy 5)))
                                            qVar"state")) (LN 23) (LN 0)
                                        (FTy 24))) (LN 40)) qVar"state")))
                       ((TP (sqbkt (LW 1 1) (LW 2 2)))
                         (TP
                           (sqbkt (Bop Lsl
                                    (Mop (Cast F64)
                                      (EX
                                        (Mop Fst
                                          (Apply
                                            (Call "GPR"
                                              (ATy qTy (PTy F64 qTy))
                                              (Var "rt" (FTy 5)))
                                            qVar"state")) (LN 15) (LN 0)
                                        F16)) (LN 48)) qVar"state")))
                       ((TP (sqbkt (LW 1 1) (LW 3 2)))
                         (TP
                           (sqbkt (Bop Lsl
                                    (Mop (Cast F64)
                                      (EX
                                        (Mop Fst
                                          (Apply
                                            (Call "GPR"
                                              (ATy qTy (PTy F64 qTy))
                                              (Var "rt" (FTy 5)))
                                            qVar"state")) (LN 7) (LN 0)
                                        F8)) (LN 56)) qVar"state")))))
              (Apply
                (Call "StoreMemory" (ATy qTy (PTy uTy qTy))
                  (TP
                    (sqbkt (Var "CCA" (FTy 3))
                           (Bop Sub (Const "WORD" (FTy 3))
                             (Mop (Cast (FTy 3)) (Var "v1" (FTy 2))))
                           (Var "v2" F64)
                           (ITE
                             (Mop Fst
                               (Apply
                                 (Const "BigEndianMem"
                                   (ATy qTy (PTy bTy qTy))) qVar"state"))
                             (Var "v0" F64)
                             (Bop BAnd (Var "v0" F64)
                               (Mop BNot (LW 3 64)))) (Var "v" F64)
                           (LC "DATA" CTy"IorD")))) qVar"s0"))))))))


(Def "dfn'SDL"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Let (Var "v" F64)
      (Bop Add (Mop (SE F64) (Var "offset" F16))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "base" (FTy 5)))
            qVar"state")))
      (Let (TP (sqbkt (Var "pAddr" F64) (Var "CCA" (FTy 3))))
        (Call "AddressTranslation" (PTy F64 (FTy 3))
          (TP
            (sqbkt (Var "v" F64) (LC "DATA" CTy"IorD")
                   (LC "STORE" CTy"LorS"))))
        (Let (Var "v0" F64)
          (CC(sqbkt (EX (Var "pAddr" F64)
                      (Bop Sub (Const "PSIZE" nTy) (LN 1)) (LN 3)
                      (FTy 61))
                    (Bop BXor (EX (Var "pAddr" F64) (LN 2) (LN 0) (FTy 3))
                      (Bop Rep
                        (Mop Fst
                          (Apply
                            (Const "ReverseEndian" (ATy qTy (PTy F1 qTy)))
                            qVar"state")) (LN 3)))))
          (Let (Var "v1" (FTy 3))
            (Bop BXor (EX (Var "v" F64) (LN 2) (LN 0) (FTy 3))
              (Bop Rep
                (Mop Fst
                  (Apply (Const "BigEndianCPU" (ATy qTy (PTy F1 qTy)))
                    qVar"state")) (LN 3)))
            (Let (TP (sqbkt (Var "v2" F64) qVar"s0"))
              (CS (Var "v1" (FTy 3))
                (sqbkt ((LW 0 3)
                         (TP
                           (sqbkt (Mop (Cast F64)
                                    (EX
                                      (Mop Fst
                                        (Apply
                                          (Call "GPR"
                                            (ATy qTy (PTy F64 qTy))
                                            (Var "rt" (FTy 5)))
                                          qVar"state")) (LN 63) (LN 56)
                                      F8)) qVar"state")))
                       ((LW 1 3)
                         (TP
                           (sqbkt (Mop (Cast F64)
                                    (EX
                                      (Mop Fst
                                        (Apply
                                          (Call "GPR"
                                            (ATy qTy (PTy F64 qTy))
                                            (Var "rt" (FTy 5)))
                                          qVar"state")) (LN 63) (LN 48)
                                      F16)) qVar"state")))
                       ((LW 2 3)
                         (TP
                           (sqbkt (Mop (Cast F64)
                                    (EX
                                      (Mop Fst
                                        (Apply
                                          (Call "GPR"
                                            (ATy qTy (PTy F64 qTy))
                                            (Var "rt" (FTy 5)))
                                          qVar"state")) (LN 63) (LN 40)
                                      (FTy 24))) qVar"state")))
                       ((LW 3 3)
                         (TP
                           (sqbkt (Mop (Cast F64)
                                    (EX
                                      (Mop Fst
                                        (Apply
                                          (Call "GPR"
                                            (ATy qTy (PTy F64 qTy))
                                            (Var "rt" (FTy 5)))
                                          qVar"state")) (LN 63) (LN 32)
                                      F32)) qVar"state")))
                       ((LW 4 3)
                         (TP
                           (sqbkt (Mop (Cast F64)
                                    (EX
                                      (Mop Fst
                                        (Apply
                                          (Call "GPR"
                                            (ATy qTy (PTy F64 qTy))
                                            (Var "rt" (FTy 5)))
                                          qVar"state")) (LN 63) (LN 24)
                                      (FTy 40))) qVar"state")))
                       ((LW 5 3)
                         (TP
                           (sqbkt (Mop (Cast F64)
                                    (EX
                                      (Mop Fst
                                        (Apply
                                          (Call "GPR"
                                            (ATy qTy (PTy F64 qTy))
                                            (Var "rt" (FTy 5)))
                                          qVar"state")) (LN 63) (LN 16)
                                      (FTy 48))) qVar"state")))
                       ((LW 6 3)
                         (TP
                           (sqbkt (Mop (Cast F64)
                                    (EX
                                      (Mop Fst
                                        (Apply
                                          (Call "GPR"
                                            (ATy qTy (PTy F64 qTy))
                                            (Var "rt" (FTy 5)))
                                          qVar"state")) (LN 63) (LN 8)
                                      (FTy 56))) qVar"state")))
                       ((LW 7 3)
                         (TP
                           (sqbkt (Mop Fst
                                    (Apply
                                      (Call "GPR" (ATy qTy (PTy F64 qTy))
                                        (Var "rt" (FTy 5))) qVar"state"))
                                  qVar"state")))))
              (Apply
                (Call "StoreMemory" (ATy qTy (PTy uTy qTy))
                  (TP
                    (sqbkt (Var "CCA" (FTy 3)) (Var "v1" (FTy 3))
                           (Var "v2" F64)
                           (ITE
                             (Mop Fst
                               (Apply
                                 (Const "BigEndianMem"
                                   (ATy qTy (PTy bTy qTy))) qVar"state"))
                             (Var "v0" F64)
                             (Bop BAnd (Var "v0" F64)
                               (Mop BNot (LW 7 64)))) (Var "v" F64)
                           (LC "DATA" CTy"IorD")))) qVar"s0"))))))))


(Def "dfn'SDR"
  (TP (sqbkt (Var "base" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Let (Var "v" F64)
      (Bop Add (Mop (SE F64) (Var "offset" F16))
        (Mop Fst
          (Apply (Call "GPR" (ATy qTy (PTy F64 qTy)) (Var "base" (FTy 5)))
            qVar"state")))
      (Let (TP (sqbkt (Var "pAddr" F64) (Var "CCA" (FTy 3))))
        (Call "AddressTranslation" (PTy F64 (FTy 3))
          (TP
            (sqbkt (Var "v" F64) (LC "DATA" CTy"IorD")
                   (LC "STORE" CTy"LorS"))))
        (Let (Var "v0" F64)
          (CC(sqbkt (EX (Var "pAddr" F64)
                      (Bop Sub (Const "PSIZE" nTy) (LN 1)) (LN 3)
                      (FTy 61))
                    (Bop BXor (EX (Var "pAddr" F64) (LN 2) (LN 0) (FTy 3))
                      (Bop Rep
                        (Mop Fst
                          (Apply
                            (Const "ReverseEndian" (ATy qTy (PTy F1 qTy)))
                            qVar"state")) (LN 3)))))
          (Let (Var "v1" (FTy 3))
            (Bop BXor (EX (Var "v" F64) (LN 2) (LN 0) (FTy 3))
              (Bop Rep
                (Mop Fst
                  (Apply (Const "BigEndianCPU" (ATy qTy (PTy F1 qTy)))
                    qVar"state")) (LN 3)))
            (Let (TP (sqbkt (Var "v2" F64) qVar"s0"))
              (CS (Var "v1" (FTy 3))
                (sqbkt ((LW 0 3)
                         (TP
                           (sqbkt (Mop Fst
                                    (Apply
                                      (Call "GPR" (ATy qTy (PTy F64 qTy))
                                        (Var "rt" (FTy 5))) qVar"state"))
                                  qVar"state")))
                       ((LW 1 3)
                         (TP
                           (sqbkt (Bop Lsl
                                    (Mop (Cast F64)
                                      (EX
                                        (Mop Fst
                                          (Apply
                                            (Call "GPR"
                                              (ATy qTy (PTy F64 qTy))
                                              (Var "rt" (FTy 5)))
                                            qVar"state")) (LN 63) (LN 8)
                                        (FTy 56))) (LN 8)) qVar"state")))
                       ((LW 2 3)
                         (TP
                           (sqbkt (Bop Lsl
                                    (Mop (Cast F64)
                                      (EX
                                        (Mop Fst
                                          (Apply
                                            (Call "GPR"
                                              (ATy qTy (PTy F64 qTy))
                                              (Var "rt" (FTy 5)))
                                            qVar"state")) (LN 63) (LN 16)
                                        (FTy 48))) (LN 16)) qVar"state")))
                       ((LW 3 3)
                         (TP
                           (sqbkt (Bop Lsl
                                    (Mop (Cast F64)
                                      (EX
                                        (Mop Fst
                                          (Apply
                                            (Call "GPR"
                                              (ATy qTy (PTy F64 qTy))
                                              (Var "rt" (FTy 5)))
                                            qVar"state")) (LN 63) (LN 24)
                                        (FTy 40))) (LN 24)) qVar"state")))
                       ((LW 4 3)
                         (TP
                           (sqbkt (Bop Lsl
                                    (Mop (Cast F64)
                                      (EX
                                        (Mop Fst
                                          (Apply
                                            (Call "GPR"
                                              (ATy qTy (PTy F64 qTy))
                                              (Var "rt" (FTy 5)))
                                            qVar"state")) (LN 63) (LN 32)
                                        F32)) (LN 32)) qVar"state")))
                       ((LW 5 3)
                         (TP
                           (sqbkt (Bop Lsl
                                    (Mop (Cast F64)
                                      (EX
                                        (Mop Fst
                                          (Apply
                                            (Call "GPR"
                                              (ATy qTy (PTy F64 qTy))
                                              (Var "rt" (FTy 5)))
                                            qVar"state")) (LN 63) (LN 40)
                                        (FTy 24))) (LN 40)) qVar"state")))
                       ((LW 6 3)
                         (TP
                           (sqbkt (Bop Lsl
                                    (Mop (Cast F64)
                                      (EX
                                        (Mop Fst
                                          (Apply
                                            (Call "GPR"
                                              (ATy qTy (PTy F64 qTy))
                                              (Var "rt" (FTy 5)))
                                            qVar"state")) (LN 63) (LN 48)
                                        F16)) (LN 48)) qVar"state")))
                       ((LW 7 3)
                         (TP
                           (sqbkt (Bop Lsl
                                    (Mop (Cast F64)
                                      (EX
                                        (Mop Fst
                                          (Apply
                                            (Call "GPR"
                                              (ATy qTy (PTy F64 qTy))
                                              (Var "rt" (FTy 5)))
                                            qVar"state")) (LN 63) (LN 56)
                                        F8)) (LN 56)) qVar"state")))))
              (Apply
                (Call "StoreMemory" (ATy qTy (PTy uTy qTy))
                  (TP
                    (sqbkt (Var "CCA" (FTy 3))
                           (Bop Sub (Const "DOUBLEWORD" (FTy 3))
                             (Var "v1" (FTy 3))) (Var "v2" F64)
                           (ITE
                             (Mop Fst
                               (Apply
                                 (Const "BigEndianMem"
                                   (ATy qTy (PTy bTy qTy))) qVar"state"))
                             (Var "v0" F64)
                             (Bop BAnd (Var "v0" F64)
                               (Mop BNot (LW 7 64)))) (Var "v" F64)
                           (LC "DATA" CTy"IorD")))) qVar"s0"))))))))


(Def "dfn'SYNC" (Var "stype" (FTy 5)) LU)


(Def "dfn'BREAK" qVar"state"
  (Apply
    (Call "SignalException" (ATy qTy (PTy uTy qTy))
      (LC "Bp" CTy"ExceptionType")) qVar"state"))


(Def "dfn'SYSCALL" qVar"state"
  (Apply
    (Call "SignalException" (ATy qTy (PTy uTy qTy))
      (LC "Sys" CTy"ExceptionType")) qVar"state"))


(Def "dfn'ERET" qVar"state"
  (TP
    (sqbkt LU
           (Rupd "LLbit"
             (TP
               (sqbkt (ITE
                        (Dest "ERL" bTy
                          (Dest "Status" CTy"StatusRegister"
                            (Dest "CP0" CTy"CP0" qVar"state")))
                        (Let qVar"s"
                          (Rupd "PC"
                            (TP
                              (sqbkt qVar"state"
                                     (Dest "ErrorEPC" F64
                                       (Dest "CP0" CTy"CP0" qVar"state")))))
                          (Let (Var "v" CTy"CP0")
                            (Dest "CP0" CTy"CP0" qVar"s")
                            (Rupd "CP0"
                              (TP
                                (sqbkt qVar"s"
                                       (Rupd "Status"
                                         (TP
                                           (sqbkt (Var "v" CTy"CP0")
                                                  (Rupd "ERL"
                                                    (TP
                                                      (sqbkt (Dest
                                                               "Status"
                                                               CTy"StatusRegister"
                                                               (Var "v"
                                                                 CTy"CP0"))
                                                             LF)))))))))))
                        (Let qVar"s"
                          (Rupd "PC"
                            (TP
                              (sqbkt qVar"state"
                                     (Dest "EPC" F64
                                       (Dest "CP0" CTy"CP0" qVar"state")))))
                          (Let (Var "v" CTy"CP0")
                            (Dest "CP0" CTy"CP0" qVar"s")
                            (Rupd "CP0"
                              (TP
                                (sqbkt qVar"s"
                                       (Rupd "Status"
                                         (TP
                                           (sqbkt (Var "v" CTy"CP0")
                                                  (Rupd "EXL"
                                                    (TP
                                                      (sqbkt (Dest
                                                               "Status"
                                                               CTy"StatusRegister"
                                                               (Var "v"
                                                                 CTy"CP0"))
                                                             LF))))))))))))
                      (Mop Some LF)))))))


(Def "dfn'MTC0"
  (TP (sqbkt (Var "rt" (FTy 5)) (Var "rd" (FTy 5)) (Var "sel" (FTy 3))))
  (Close qVar"state"
    (Apply
      (Call "write'CPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Mop Fst
                   (Apply
                     (Call "GPR" (ATy qTy (PTy F64 qTy))
                       (Var "rt" (FTy 5))) qVar"state")) LN 0
                 (Var "rd" (FTy 5)) (Var "sel" (FTy 3))))) qVar"state")))


(Def "dfn'DMTC0"
  (TP (sqbkt (Var "rt" (FTy 5)) (Var "rd" (FTy 5)) (Var "sel" (FTy 3))))
  (Close qVar"state"
    (Apply
      (Call "write'CPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Mop Fst
                   (Apply
                     (Call "GPR" (ATy qTy (PTy F64 qTy))
                       (Var "rt" (FTy 5))) qVar"state")) LN 0
                 (Var "rd" (FTy 5)) (Var "sel" (FTy 3))))) qVar"state")))


(Def "dfn'MFC0"
  (TP (sqbkt (Var "rt" (FTy 5)) (Var "rd" (FTy 5)) (Var "sel" (FTy 3))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Mop (SE F64)
                   (EX
                     (Mop Fst
                       (Apply
                         (Call "CPR" (ATy qTy (PTy F64 qTy))
                           (TP
                             (sqbkt LN 0 (Var "rd" (FTy 5))
                                    (Var "sel" (FTy 3))))) qVar"state"))
                     (LN 32) (LN 0) (FTy 33))) (Var "rt" (FTy 5)))))
      qVar"state")))


(Def "dfn'DMFC0"
  (TP (sqbkt (Var "rt" (FTy 5)) (Var "rd" (FTy 5)) (Var "sel" (FTy 3))))
  (Close qVar"state"
    (Apply
      (Call "write'GPR" (ATy qTy (PTy uTy qTy))
        (TP
          (sqbkt (Mop Fst
                   (Apply
                     (Call "CPR" (ATy qTy (PTy F64 qTy))
                       (TP
                         (sqbkt LN 0 (Var "rd" (FTy 5))
                                (Var "sel" (FTy 3))))) qVar"state"))
                 (Var "rt" (FTy 5))))) qVar"state")))


(Def "dfn'J" (Var "instr_index" (FTy 26))
  (Close qVar"state"
    (TP
      (sqbkt LU
             (Rupd "BranchStatus"
               (TP
                 (sqbkt qVar"state"
                        (Mop Some
                          (CC(sqbkt (EX (Dest "PC" F64 qVar"state")
                                      (LN 63) (LN 28) (FTy 36))
                                    (Var "instr_index" (FTy 26)) (LW 0 2)))))))))))


(Def "dfn'JAL" (Var "instr_index" (FTy 26))
  (Close qVar"state"
    (Let qVar"s"
      (Mop Snd
        (Apply
          (Call "write'GPR" (ATy qTy (PTy uTy qTy))
            (TP
              (sqbkt (Bop Add (Dest "PC" F64 qVar"state") (LW 8 64))
                     (LW 31 5)))) qVar"state"))
      (TP
        (sqbkt LU
               (Rupd "BranchStatus"
                 (TP
                   (sqbkt qVar"s"
                          (Mop Some
                            (CC(sqbkt (EX (Dest "PC" F64 qVar"s") (LN 63)
                                        (LN 28) (FTy 36))
                                      (Var "instr_index" (FTy 26))
                                      (LW 0 2))))))))))))


(Def "dfn'JR" (Var "rs" (FTy 5))
  (Close qVar"state"
    (TP
      (sqbkt LU
             (Rupd "BranchStatus"
               (TP
                 (sqbkt qVar"state"
                        (Mop Some
                          (Mop Fst
                            (Apply
                              (Call "GPR" (ATy qTy (PTy F64 qTy))
                                (Var "rs" (FTy 5))) qVar"state"))))))))))


(Def "dfn'JALR" (TP (sqbkt (Var "rs" (FTy 5)) (Var "rd" (FTy 5))))
  (Close qVar"state"
    (TP
      (sqbkt LU
             (Rupd "BranchStatus"
               (TP
                 (sqbkt (Mop Snd
                          (Apply
                            (Call "write'GPR" (ATy qTy (PTy uTy qTy))
                              (TP
                                (sqbkt (Bop Add
                                         (Dest "PC" F64 qVar"state")
                                         (LW 8 64)) (Var "rd" (FTy 5)))))
                            qVar"state"))
                        (Mop Some
                          (Mop Fst
                            (Apply
                              (Call "GPR" (ATy qTy (PTy F64 qTy))
                                (Var "rs" (FTy 5))) qVar"state"))))))))))


(Def "dfn'BEQ"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (TP
      (sqbkt LU
             (ITE
               (EQ
                 (Mop Fst
                   (Apply
                     (Call "GPR" (ATy qTy (PTy F64 qTy))
                       (Var "rs" (FTy 5))) qVar"state"))
                 (Mop Fst
                   (Apply
                     (Call "GPR" (ATy qTy (PTy F64 qTy))
                       (Var "rt" (FTy 5))) qVar"state")))
               (Rupd "BranchStatus"
                 (TP
                   (sqbkt qVar"state"
                          (Mop Some
                            (Bop Add (Dest "PC" F64 qVar"state")
                              (Bop Lsl (Mop (SE F64) (Var "offset" F16))
                                (LN 2))))))) qVar"state")))))


(Def "dfn'BNE"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (TP
      (sqbkt LU
             (ITE
               (Mop Not
                 (EQ
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rs" (FTy 5))) qVar"state"))
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rt" (FTy 5))) qVar"state"))))
               (Rupd "BranchStatus"
                 (TP
                   (sqbkt qVar"state"
                          (Mop Some
                            (Bop Add (Dest "PC" F64 qVar"state")
                              (Bop Lsl (Mop (SE F64) (Var "offset" F16))
                                (LN 2))))))) qVar"state")))))


(Def "dfn'BLEZ" (TP (sqbkt (Var "rs" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (TP
      (sqbkt LU
             (ITE
               (Bop Le
                 (Mop Fst
                   (Apply
                     (Call "GPR" (ATy qTy (PTy F64 qTy))
                       (Var "rs" (FTy 5))) qVar"state")) (LW 0 64))
               (Rupd "BranchStatus"
                 (TP
                   (sqbkt qVar"state"
                          (Mop Some
                            (Bop Add (Dest "PC" F64 qVar"state")
                              (Bop Lsl (Mop (SE F64) (Var "offset" F16))
                                (LN 2))))))) qVar"state")))))


(Def "dfn'BGTZ" (TP (sqbkt (Var "rs" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (TP
      (sqbkt LU
             (ITE
               (Bop Gt
                 (Mop Fst
                   (Apply
                     (Call "GPR" (ATy qTy (PTy F64 qTy))
                       (Var "rs" (FTy 5))) qVar"state")) (LW 0 64))
               (Rupd "BranchStatus"
                 (TP
                   (sqbkt qVar"state"
                          (Mop Some
                            (Bop Add (Dest "PC" F64 qVar"state")
                              (Bop Lsl (Mop (SE F64) (Var "offset" F16))
                                (LN 2))))))) qVar"state")))))


(Def "dfn'BLTZ" (TP (sqbkt (Var "rs" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (TP
      (sqbkt LU
             (ITE
               (Bop Lt
                 (Mop Fst
                   (Apply
                     (Call "GPR" (ATy qTy (PTy F64 qTy))
                       (Var "rs" (FTy 5))) qVar"state")) (LW 0 64))
               (Rupd "BranchStatus"
                 (TP
                   (sqbkt qVar"state"
                          (Mop Some
                            (Bop Add (Dest "PC" F64 qVar"state")
                              (Bop Lsl (Mop (SE F64) (Var "offset" F16))
                                (LN 2))))))) qVar"state")))))


(Def "dfn'BGEZ" (TP (sqbkt (Var "rs" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (TP
      (sqbkt LU
             (ITE
               (Bop Ge
                 (Mop Fst
                   (Apply
                     (Call "GPR" (ATy qTy (PTy F64 qTy))
                       (Var "rs" (FTy 5))) qVar"state")) (LW 0 64))
               (Rupd "BranchStatus"
                 (TP
                   (sqbkt qVar"state"
                          (Mop Some
                            (Bop Add (Dest "PC" F64 qVar"state")
                              (Bop Lsl (Mop (SE F64) (Var "offset" F16))
                                (LN 2))))))) qVar"state")))))


(Def "dfn'BLTZAL" (TP (sqbkt (Var "rs" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Let qVar"s"
      (Mop Snd
        (Apply
          (Call "write'GPR" (ATy qTy (PTy uTy qTy))
            (TP
              (sqbkt (Bop Add (Dest "PC" F64 qVar"state") (LW 8 64))
                     (LW 31 5)))) qVar"state"))
      (TP
        (sqbkt LU
               (ITE
                 (Bop Lt
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rs" (FTy 5))) qVar"state")) (LW 0 64))
                 (Rupd "BranchStatus"
                   (TP
                     (sqbkt qVar"s"
                            (Mop Some
                              (Bop Add (Dest "PC" F64 qVar"s")
                                (Bop Lsl (Mop (SE F64) (Var "offset" F16))
                                  (LN 2))))))) qVar"s"))))))


(Def "dfn'BGEZAL" (TP (sqbkt (Var "rs" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Let qVar"s"
      (Mop Snd
        (Apply
          (Call "write'GPR" (ATy qTy (PTy uTy qTy))
            (TP
              (sqbkt (Bop Add (Dest "PC" F64 qVar"state") (LW 8 64))
                     (LW 31 5)))) qVar"state"))
      (TP
        (sqbkt LU
               (ITE
                 (Bop Ge
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rs" (FTy 5))) qVar"state")) (LW 0 64))
                 (Rupd "BranchStatus"
                   (TP
                     (sqbkt qVar"s"
                            (Mop Some
                              (Bop Add (Dest "PC" F64 qVar"s")
                                (Bop Lsl (Mop (SE F64) (Var "offset" F16))
                                  (LN 2))))))) qVar"s"))))))


(Def "dfn'BEQL"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (TP
      (sqbkt LU
             (ITE
               (EQ
                 (Mop Fst
                   (Apply
                     (Call "GPR" (ATy qTy (PTy F64 qTy))
                       (Var "rs" (FTy 5))) qVar"state"))
                 (Mop Fst
                   (Apply
                     (Call "GPR" (ATy qTy (PTy F64 qTy))
                       (Var "rt" (FTy 5))) qVar"state")))
               (Rupd "BranchStatus"
                 (TP
                   (sqbkt qVar"state"
                          (Mop Some
                            (Bop Add (Dest "PC" F64 qVar"state")
                              (Bop Lsl (Mop (SE F64) (Var "offset" F16))
                                (LN 2)))))))
               (Rupd "PC"
                 (TP
                   (sqbkt qVar"state"
                          (Bop Add (Dest "PC" F64 qVar"state") (LW 4 64))))))))))


(Def "dfn'BNEL"
  (TP (sqbkt (Var "rs" (FTy 5)) (Var "rt" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (TP
      (sqbkt LU
             (ITE
               (Mop Not
                 (EQ
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rs" (FTy 5))) qVar"state"))
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rt" (FTy 5))) qVar"state"))))
               (Rupd "BranchStatus"
                 (TP
                   (sqbkt qVar"state"
                          (Mop Some
                            (Bop Add (Dest "PC" F64 qVar"state")
                              (Bop Lsl (Mop (SE F64) (Var "offset" F16))
                                (LN 2)))))))
               (Rupd "PC"
                 (TP
                   (sqbkt qVar"state"
                          (Bop Add (Dest "PC" F64 qVar"state") (LW 4 64))))))))))


(Def "dfn'BLEZL" (TP (sqbkt (Var "rs" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (TP
      (sqbkt LU
             (ITE
               (Bop Le
                 (Mop Fst
                   (Apply
                     (Call "GPR" (ATy qTy (PTy F64 qTy))
                       (Var "rs" (FTy 5))) qVar"state")) (LW 0 64))
               (Rupd "BranchStatus"
                 (TP
                   (sqbkt qVar"state"
                          (Mop Some
                            (Bop Add (Dest "PC" F64 qVar"state")
                              (Bop Lsl (Mop (SE F64) (Var "offset" F16))
                                (LN 2)))))))
               (Rupd "PC"
                 (TP
                   (sqbkt qVar"state"
                          (Bop Add (Dest "PC" F64 qVar"state") (LW 4 64))))))))))


(Def "dfn'BGTZL" (TP (sqbkt (Var "rs" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (TP
      (sqbkt LU
             (ITE
               (Bop Gt
                 (Mop Fst
                   (Apply
                     (Call "GPR" (ATy qTy (PTy F64 qTy))
                       (Var "rs" (FTy 5))) qVar"state")) (LW 0 64))
               (Rupd "BranchStatus"
                 (TP
                   (sqbkt qVar"state"
                          (Mop Some
                            (Bop Add (Dest "PC" F64 qVar"state")
                              (Bop Lsl (Mop (SE F64) (Var "offset" F16))
                                (LN 2)))))))
               (Rupd "PC"
                 (TP
                   (sqbkt qVar"state"
                          (Bop Add (Dest "PC" F64 qVar"state") (LW 4 64))))))))))


(Def "dfn'BLTZL" (TP (sqbkt (Var "rs" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (TP
      (sqbkt LU
             (ITE
               (Bop Lt
                 (Mop Fst
                   (Apply
                     (Call "GPR" (ATy qTy (PTy F64 qTy))
                       (Var "rs" (FTy 5))) qVar"state")) (LW 0 64))
               (Rupd "BranchStatus"
                 (TP
                   (sqbkt qVar"state"
                          (Mop Some
                            (Bop Add (Dest "PC" F64 qVar"state")
                              (Bop Lsl (Mop (SE F64) (Var "offset" F16))
                                (LN 2)))))))
               (Rupd "PC"
                 (TP
                   (sqbkt qVar"state"
                          (Bop Add (Dest "PC" F64 qVar"state") (LW 4 64))))))))))


(Def "dfn'BGEZL" (TP (sqbkt (Var "rs" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (TP
      (sqbkt LU
             (ITE
               (Bop Ge
                 (Mop Fst
                   (Apply
                     (Call "GPR" (ATy qTy (PTy F64 qTy))
                       (Var "rs" (FTy 5))) qVar"state")) (LW 0 64))
               (Rupd "BranchStatus"
                 (TP
                   (sqbkt qVar"state"
                          (Mop Some
                            (Bop Add (Dest "PC" F64 qVar"state")
                              (Bop Lsl (Mop (SE F64) (Var "offset" F16))
                                (LN 2)))))))
               (Rupd "PC"
                 (TP
                   (sqbkt qVar"state"
                          (Bop Add (Dest "PC" F64 qVar"state") (LW 4 64))))))))))


(Def "dfn'BLTZALL" (TP (sqbkt (Var "rs" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Let qVar"s"
      (Mop Snd
        (Apply
          (Call "write'GPR" (ATy qTy (PTy uTy qTy))
            (TP
              (sqbkt (Bop Add (Dest "PC" F64 qVar"state") (LW 8 64))
                     (LW 31 5)))) qVar"state"))
      (TP
        (sqbkt LU
               (ITE
                 (Bop Lt
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rs" (FTy 5))) qVar"state")) (LW 0 64))
                 (Rupd "BranchStatus"
                   (TP
                     (sqbkt qVar"s"
                            (Mop Some
                              (Bop Add (Dest "PC" F64 qVar"s")
                                (Bop Lsl (Mop (SE F64) (Var "offset" F16))
                                  (LN 2)))))))
                 (Rupd "PC"
                   (TP
                     (sqbkt qVar"s"
                            (Bop Add (Dest "PC" F64 qVar"s") (LW 4 64)))))))))))


(Def "dfn'BGEZALL" (TP (sqbkt (Var "rs" (FTy 5)) (Var "offset" F16)))
  (Close qVar"state"
    (Let qVar"s"
      (Mop Snd
        (Apply
          (Call "write'GPR" (ATy qTy (PTy uTy qTy))
            (TP
              (sqbkt (Bop Add (Dest "PC" F64 qVar"state") (LW 8 64))
                     (LW 31 5)))) qVar"state"))
      (TP
        (sqbkt LU
               (ITE
                 (Bop Ge
                   (Mop Fst
                     (Apply
                       (Call "GPR" (ATy qTy (PTy F64 qTy))
                         (Var "rs" (FTy 5))) qVar"state")) (LW 0 64))
                 (Rupd "BranchStatus"
                   (TP
                     (sqbkt qVar"s"
                            (Mop Some
                              (Bop Add (Dest "PC" F64 qVar"s")
                                (Bop Lsl (Mop (SE F64) (Var "offset" F16))
                                  (LN 2)))))))
                 (Rupd "PC"
                   (TP
                     (sqbkt qVar"s"
                            (Bop Add (Dest "PC" F64 qVar"s") (LW 4 64)))))))))))


(Def "dfn'ReservedInstruction" qVar"state"
  (Apply
    (Call "SignalException" (ATy qTy (PTy uTy qTy))
      (LC "RI" CTy"ExceptionType")) qVar"state"))


(Def "Run" (Var "v0" CTy"instruction")
  (Close qVar"state"
    (CS (Var "v0" CTy"instruction")
      (sqbkt ((Const "BREAK" CTy"instruction")
               (Apply (Const "dfn'BREAK" (ATy qTy (PTy uTy qTy)))
                 qVar"state"))
             ((Const "ERET" CTy"instruction")
               (Apply (Const "dfn'ERET" (ATy qTy (PTy uTy qTy)))
                 qVar"state"))
             ((Const "ReservedInstruction" CTy"instruction")
               (Apply
                 (Const "dfn'ReservedInstruction" (ATy qTy (PTy uTy qTy)))
                 qVar"state"))
             ((Const "SYSCALL" CTy"instruction")
               (Apply (Const "dfn'SYSCALL" (ATy qTy (PTy uTy qTy)))
                 qVar"state"))
             ((Call "SYNC" CTy"instruction" (Var "v120" (FTy 5)))
               (TP
                 (sqbkt (Call "dfn'SYNC" uTy (Var "v120" (FTy 5)))
                        qVar"state")))
             ((Call "ArithI" CTy"instruction" (Var "v1" CTy"ArithI"))
               (CS (Var "v1" CTy"ArithI")
                 (sqbkt ((Call "ADDI" CTy"ArithI"
                            (Var "v2" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'ADDI" (ATy qTy (PTy uTy qTy))
                              (Var "v2" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "ADDIU" CTy"ArithI"
                            (Var "v3" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'ADDIU" (ATy qTy (PTy uTy qTy))
                              (Var "v3" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "ANDI" CTy"ArithI"
                            (Var "v4" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'ANDI" (ATy qTy (PTy uTy qTy))
                              (Var "v4" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "DADDI" CTy"ArithI"
                            (Var "v5" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'DADDI" (ATy qTy (PTy uTy qTy))
                              (Var "v5" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "DADDIU" CTy"ArithI"
                            (Var "v6" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'DADDIU" (ATy qTy (PTy uTy qTy))
                              (Var "v6" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "LUI" CTy"ArithI"
                            (Var "v7" (PTy (FTy 5) F16)))
                          (Apply
                            (Call "dfn'LUI" (ATy qTy (PTy uTy qTy))
                              (Var "v7" (PTy (FTy 5) F16))) qVar"state"))
                        ((Call "ORI" CTy"ArithI"
                            (Var "v8" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'ORI" (ATy qTy (PTy uTy qTy))
                              (Var "v8" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "SLTI" CTy"ArithI"
                            (Var "v9" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'SLTI" (ATy qTy (PTy uTy qTy))
                              (Var "v9" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "SLTIU" CTy"ArithI"
                            (Var "v10" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'SLTIU" (ATy qTy (PTy uTy qTy))
                              (Var "v10" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "XORI" CTy"ArithI"
                            (Var "v11" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'XORI" (ATy qTy (PTy uTy qTy))
                              (Var "v11" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state")))))
             ((Call "ArithR" CTy"instruction" (Var "v12" CTy"ArithR"))
               (CS (Var "v12" CTy"ArithR")
                 (sqbkt ((Call "ADD" CTy"ArithR"
                            (Var "v13"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'ADD" (ATy qTy (PTy uTy qTy))
                              (Var "v13"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "ADDU" CTy"ArithR"
                            (Var "v14"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'ADDU" (ATy qTy (PTy uTy qTy))
                              (Var "v14"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "AND" CTy"ArithR"
                            (Var "v15"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'AND" (ATy qTy (PTy uTy qTy))
                              (Var "v15"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "DADD" CTy"ArithR"
                            (Var "v16"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'DADD" (ATy qTy (PTy uTy qTy))
                              (Var "v16"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "DADDU" CTy"ArithR"
                            (Var "v17"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'DADDU" (ATy qTy (PTy uTy qTy))
                              (Var "v17"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "DSUB" CTy"ArithR"
                            (Var "v18"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'DSUB" (ATy qTy (PTy uTy qTy))
                              (Var "v18"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "DSUBU" CTy"ArithR"
                            (Var "v19"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'DSUBU" (ATy qTy (PTy uTy qTy))
                              (Var "v19"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "NOR" CTy"ArithR"
                            (Var "v20"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'NOR" (ATy qTy (PTy uTy qTy))
                              (Var "v20"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "OR" CTy"ArithR"
                            (Var "v21"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'OR" (ATy qTy (PTy uTy qTy))
                              (Var "v21"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "SLT" CTy"ArithR"
                            (Var "v22"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'SLT" (ATy qTy (PTy uTy qTy))
                              (Var "v22"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "SLTU" CTy"ArithR"
                            (Var "v23"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'SLTU" (ATy qTy (PTy uTy qTy))
                              (Var "v23"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "SUB" CTy"ArithR"
                            (Var "v24"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'SUB" (ATy qTy (PTy uTy qTy))
                              (Var "v24"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "SUBU" CTy"ArithR"
                            (Var "v25"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'SUBU" (ATy qTy (PTy uTy qTy))
                              (Var "v25"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "XOR" CTy"ArithR"
                            (Var "v26"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'XOR" (ATy qTy (PTy uTy qTy))
                              (Var "v26"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state")))))
             ((Call "Branch" CTy"instruction" (Var "v27" CTy"Branch"))
               (CS (Var "v27" CTy"Branch")
                 (sqbkt ((Call "BEQ" CTy"Branch"
                            (Var "v28" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'BEQ" (ATy qTy (PTy uTy qTy))
                              (Var "v28" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "BEQL" CTy"Branch"
                            (Var "v29" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'BEQL" (ATy qTy (PTy uTy qTy))
                              (Var "v29" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "BGEZ" CTy"Branch"
                            (Var "v30" (PTy (FTy 5) F16)))
                          (Apply
                            (Call "dfn'BGEZ" (ATy qTy (PTy uTy qTy))
                              (Var "v30" (PTy (FTy 5) F16))) qVar"state"))
                        ((Call "BGEZAL" CTy"Branch"
                            (Var "v31" (PTy (FTy 5) F16)))
                          (Apply
                            (Call "dfn'BGEZAL" (ATy qTy (PTy uTy qTy))
                              (Var "v31" (PTy (FTy 5) F16))) qVar"state"))
                        ((Call "BGEZALL" CTy"Branch"
                            (Var "v32" (PTy (FTy 5) F16)))
                          (Apply
                            (Call "dfn'BGEZALL" (ATy qTy (PTy uTy qTy))
                              (Var "v32" (PTy (FTy 5) F16))) qVar"state"))
                        ((Call "BGEZL" CTy"Branch"
                            (Var "v33" (PTy (FTy 5) F16)))
                          (Apply
                            (Call "dfn'BGEZL" (ATy qTy (PTy uTy qTy))
                              (Var "v33" (PTy (FTy 5) F16))) qVar"state"))
                        ((Call "BGTZ" CTy"Branch"
                            (Var "v34" (PTy (FTy 5) F16)))
                          (Apply
                            (Call "dfn'BGTZ" (ATy qTy (PTy uTy qTy))
                              (Var "v34" (PTy (FTy 5) F16))) qVar"state"))
                        ((Call "BGTZL" CTy"Branch"
                            (Var "v35" (PTy (FTy 5) F16)))
                          (Apply
                            (Call "dfn'BGTZL" (ATy qTy (PTy uTy qTy))
                              (Var "v35" (PTy (FTy 5) F16))) qVar"state"))
                        ((Call "BLEZ" CTy"Branch"
                            (Var "v36" (PTy (FTy 5) F16)))
                          (Apply
                            (Call "dfn'BLEZ" (ATy qTy (PTy uTy qTy))
                              (Var "v36" (PTy (FTy 5) F16))) qVar"state"))
                        ((Call "BLEZL" CTy"Branch"
                            (Var "v37" (PTy (FTy 5) F16)))
                          (Apply
                            (Call "dfn'BLEZL" (ATy qTy (PTy uTy qTy))
                              (Var "v37" (PTy (FTy 5) F16))) qVar"state"))
                        ((Call "BLTZ" CTy"Branch"
                            (Var "v38" (PTy (FTy 5) F16)))
                          (Apply
                            (Call "dfn'BLTZ" (ATy qTy (PTy uTy qTy))
                              (Var "v38" (PTy (FTy 5) F16))) qVar"state"))
                        ((Call "BLTZAL" CTy"Branch"
                            (Var "v39" (PTy (FTy 5) F16)))
                          (Apply
                            (Call "dfn'BLTZAL" (ATy qTy (PTy uTy qTy))
                              (Var "v39" (PTy (FTy 5) F16))) qVar"state"))
                        ((Call "BLTZALL" CTy"Branch"
                            (Var "v40" (PTy (FTy 5) F16)))
                          (Apply
                            (Call "dfn'BLTZALL" (ATy qTy (PTy uTy qTy))
                              (Var "v40" (PTy (FTy 5) F16))) qVar"state"))
                        ((Call "BLTZL" CTy"Branch"
                            (Var "v41" (PTy (FTy 5) F16)))
                          (Apply
                            (Call "dfn'BLTZL" (ATy qTy (PTy uTy qTy))
                              (Var "v41" (PTy (FTy 5) F16))) qVar"state"))
                        ((Call "BNE" CTy"Branch"
                            (Var "v42" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'BNE" (ATy qTy (PTy uTy qTy))
                              (Var "v42" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "BNEL" CTy"Branch"
                            (Var "v43" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'BNEL" (ATy qTy (PTy uTy qTy))
                              (Var "v43" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "J" CTy"Branch" (Var "v44" (FTy 26)))
                          (Apply
                            (Call "dfn'J" (ATy qTy (PTy uTy qTy))
                              (Var "v44" (FTy 26))) qVar"state"))
                        ((Call "JAL" CTy"Branch" (Var "v45" (FTy 26)))
                          (Apply
                            (Call "dfn'JAL" (ATy qTy (PTy uTy qTy))
                              (Var "v45" (FTy 26))) qVar"state"))
                        ((Call "JALR" CTy"Branch"
                            (Var "v46" (PTy (FTy 5) (FTy 5))))
                          (Apply
                            (Call "dfn'JALR" (ATy qTy (PTy uTy qTy))
                              (Var "v46" (PTy (FTy 5) (FTy 5))))
                            qVar"state"))
                        ((Call "JR" CTy"Branch" (Var "v47" (FTy 5)))
                          (Apply
                            (Call "dfn'JR" (ATy qTy (PTy uTy qTy))
                              (Var "v47" (FTy 5))) qVar"state")))))
             ((Call "CP" CTy"instruction" (Var "v48" CTy"CP"))
               (CS (Var "v48" CTy"CP")
                 (sqbkt ((Call "DMFC0" CTy"CP"
                            (Var "v49"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 3)))))
                          (Apply
                            (Call "dfn'DMFC0" (ATy qTy (PTy uTy qTy))
                              (Var "v49"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 3)))))
                            qVar"state"))
                        ((Call "DMTC0" CTy"CP"
                            (Var "v50"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 3)))))
                          (Apply
                            (Call "dfn'DMTC0" (ATy qTy (PTy uTy qTy))
                              (Var "v50"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 3)))))
                            qVar"state"))
                        ((Call "MFC0" CTy"CP"
                            (Var "v51"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 3)))))
                          (Apply
                            (Call "dfn'MFC0" (ATy qTy (PTy uTy qTy))
                              (Var "v51"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 3)))))
                            qVar"state"))
                        ((Call "MTC0" CTy"CP"
                            (Var "v52"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 3)))))
                          (Apply
                            (Call "dfn'MTC0" (ATy qTy (PTy uTy qTy))
                              (Var "v52"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 3)))))
                            qVar"state")))))
             ((Call "Load" CTy"instruction" (Var "v53" CTy"Load"))
               (CS (Var "v53" CTy"Load")
                 (sqbkt ((Call "LB" CTy"Load"
                            (Var "v54" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'LB" (ATy qTy (PTy uTy qTy))
                              (Var "v54" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "LBU" CTy"Load"
                            (Var "v55" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'LBU" (ATy qTy (PTy uTy qTy))
                              (Var "v55" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "LD" CTy"Load"
                            (Var "v56" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'LD" (ATy qTy (PTy uTy qTy))
                              (Var "v56" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "LDL" CTy"Load"
                            (Var "v57" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'LDL" (ATy qTy (PTy uTy qTy))
                              (Var "v57" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "LDR" CTy"Load"
                            (Var "v58" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'LDR" (ATy qTy (PTy uTy qTy))
                              (Var "v58" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "LH" CTy"Load"
                            (Var "v59" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'LH" (ATy qTy (PTy uTy qTy))
                              (Var "v59" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "LHU" CTy"Load"
                            (Var "v60" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'LHU" (ATy qTy (PTy uTy qTy))
                              (Var "v60" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "LL" CTy"Load"
                            (Var "v61" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'LL" (ATy qTy (PTy uTy qTy))
                              (Var "v61" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "LLD" CTy"Load"
                            (Var "v62" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'LLD" (ATy qTy (PTy uTy qTy))
                              (Var "v62" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "LW" CTy"Load"
                            (Var "v63" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'LW" (ATy qTy (PTy uTy qTy))
                              (Var "v63" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "LWL" CTy"Load"
                            (Var "v64" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'LWL" (ATy qTy (PTy uTy qTy))
                              (Var "v64" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "LWR" CTy"Load"
                            (Var "v65" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'LWR" (ATy qTy (PTy uTy qTy))
                              (Var "v65" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "LWU" CTy"Load"
                            (Var "v66" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'LWU" (ATy qTy (PTy uTy qTy))
                              (Var "v66" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state")))))
             ((Call "MultDiv" CTy"instruction" (Var "v67" CTy"MultDiv"))
               (CS (Var "v67" CTy"MultDiv")
                 (sqbkt ((Call "DDIV" CTy"MultDiv"
                            (Var "v68" (PTy (FTy 5) (FTy 5))))
                          (Apply
                            (Call "dfn'DDIV" (ATy qTy (PTy uTy qTy))
                              (Var "v68" (PTy (FTy 5) (FTy 5))))
                            qVar"state"))
                        ((Call "DDIVU" CTy"MultDiv"
                            (Var "v69" (PTy (FTy 5) (FTy 5))))
                          (Apply
                            (Call "dfn'DDIVU" (ATy qTy (PTy uTy qTy))
                              (Var "v69" (PTy (FTy 5) (FTy 5))))
                            qVar"state"))
                        ((Call "DIV" CTy"MultDiv"
                            (Var "v70" (PTy (FTy 5) (FTy 5))))
                          (Apply
                            (Call "dfn'DIV" (ATy qTy (PTy uTy qTy))
                              (Var "v70" (PTy (FTy 5) (FTy 5))))
                            qVar"state"))
                        ((Call "DIVU" CTy"MultDiv"
                            (Var "v71" (PTy (FTy 5) (FTy 5))))
                          (Apply
                            (Call "dfn'DIVU" (ATy qTy (PTy uTy qTy))
                              (Var "v71" (PTy (FTy 5) (FTy 5))))
                            qVar"state"))
                        ((Call "DMULT" CTy"MultDiv"
                            (Var "v72" (PTy (FTy 5) (FTy 5))))
                          (Apply
                            (Call "dfn'DMULT" (ATy qTy (PTy uTy qTy))
                              (Var "v72" (PTy (FTy 5) (FTy 5))))
                            qVar"state"))
                        ((Call "DMULTU" CTy"MultDiv"
                            (Var "v73" (PTy (FTy 5) (FTy 5))))
                          (Apply
                            (Call "dfn'DMULTU" (ATy qTy (PTy uTy qTy))
                              (Var "v73" (PTy (FTy 5) (FTy 5))))
                            qVar"state"))
                        ((Call "MFHI" CTy"MultDiv" (Var "v74" (FTy 5)))
                          (Apply
                            (Call "dfn'MFHI" (ATy qTy (PTy uTy qTy))
                              (Var "v74" (FTy 5))) qVar"state"))
                        ((Call "MFLO" CTy"MultDiv" (Var "v75" (FTy 5)))
                          (Apply
                            (Call "dfn'MFLO" (ATy qTy (PTy uTy qTy))
                              (Var "v75" (FTy 5))) qVar"state"))
                        ((Call "MTHI" CTy"MultDiv" (Var "v76" (FTy 5)))
                          (Apply
                            (Call "dfn'MTHI" (ATy qTy (PTy uTy qTy))
                              (Var "v76" (FTy 5))) qVar"state"))
                        ((Call "MTLO" CTy"MultDiv" (Var "v77" (FTy 5)))
                          (Apply
                            (Call "dfn'MTLO" (ATy qTy (PTy uTy qTy))
                              (Var "v77" (FTy 5))) qVar"state"))
                        ((Call "MULT" CTy"MultDiv"
                            (Var "v78" (PTy (FTy 5) (FTy 5))))
                          (Apply
                            (Call "dfn'MULT" (ATy qTy (PTy uTy qTy))
                              (Var "v78" (PTy (FTy 5) (FTy 5))))
                            qVar"state"))
                        ((Call "MULTU" CTy"MultDiv"
                            (Var "v79" (PTy (FTy 5) (FTy 5))))
                          (Apply
                            (Call "dfn'MULTU" (ATy qTy (PTy uTy qTy))
                              (Var "v79" (PTy (FTy 5) (FTy 5))))
                            qVar"state")))))
             ((Call "Shift" CTy"instruction" (Var "v80" CTy"Shift"))
               (CS (Var "v80" CTy"Shift")
                 (sqbkt ((Call "DSLL" CTy"Shift"
                            (Var "v81"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'DSLL" (ATy qTy (PTy uTy qTy))
                              (Var "v81"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "DSLL32" CTy"Shift"
                            (Var "v82"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'DSLL32" (ATy qTy (PTy uTy qTy))
                              (Var "v82"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "DSLLV" CTy"Shift"
                            (Var "v83"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'DSLLV" (ATy qTy (PTy uTy qTy))
                              (Var "v83"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "DSRA" CTy"Shift"
                            (Var "v84"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'DSRA" (ATy qTy (PTy uTy qTy))
                              (Var "v84"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "DSRA32" CTy"Shift"
                            (Var "v85"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'DSRA32" (ATy qTy (PTy uTy qTy))
                              (Var "v85"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "DSRAV" CTy"Shift"
                            (Var "v86"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'DSRAV" (ATy qTy (PTy uTy qTy))
                              (Var "v86"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "DSRL" CTy"Shift"
                            (Var "v87"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'DSRL" (ATy qTy (PTy uTy qTy))
                              (Var "v87"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "DSRL32" CTy"Shift"
                            (Var "v88"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'DSRL32" (ATy qTy (PTy uTy qTy))
                              (Var "v88"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "DSRLV" CTy"Shift"
                            (Var "v89"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'DSRLV" (ATy qTy (PTy uTy qTy))
                              (Var "v89"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "SLL" CTy"Shift"
                            (Var "v90"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'SLL" (ATy qTy (PTy uTy qTy))
                              (Var "v90"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "SLLV" CTy"Shift"
                            (Var "v91"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'SLLV" (ATy qTy (PTy uTy qTy))
                              (Var "v91"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "SRA" CTy"Shift"
                            (Var "v92"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'SRA" (ATy qTy (PTy uTy qTy))
                              (Var "v92"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "SRAV" CTy"Shift"
                            (Var "v93"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'SRAV" (ATy qTy (PTy uTy qTy))
                              (Var "v93"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "SRL" CTy"Shift"
                            (Var "v94"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'SRL" (ATy qTy (PTy uTy qTy))
                              (Var "v94"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state"))
                        ((Call "SRLV" CTy"Shift"
                            (Var "v95"
                              (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                          (Apply
                            (Call "dfn'SRLV" (ATy qTy (PTy uTy qTy))
                              (Var "v95"
                                (PTy (FTy 5) (PTy (FTy 5) (FTy 5)))))
                            qVar"state")))))
             ((Call "Store" CTy"instruction" (Var "v96" CTy"Store"))
               (CS (Var "v96" CTy"Store")
                 (sqbkt ((Call "SB" CTy"Store"
                            (Var "v97" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'SB" (ATy qTy (PTy uTy qTy))
                              (Var "v97" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "SC" CTy"Store"
                            (Var "v98" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'SC" (ATy qTy (PTy uTy qTy))
                              (Var "v98" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "SCD" CTy"Store"
                            (Var "v99" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'SCD" (ATy qTy (PTy uTy qTy))
                              (Var "v99" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "SD" CTy"Store"
                            (Var "v100" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'SD" (ATy qTy (PTy uTy qTy))
                              (Var "v100" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "SDL" CTy"Store"
                            (Var "v101" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'SDL" (ATy qTy (PTy uTy qTy))
                              (Var "v101" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "SDR" CTy"Store"
                            (Var "v102" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'SDR" (ATy qTy (PTy uTy qTy))
                              (Var "v102" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "SH" CTy"Store"
                            (Var "v103" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'SH" (ATy qTy (PTy uTy qTy))
                              (Var "v103" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "SW" CTy"Store"
                            (Var "v104" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'SW" (ATy qTy (PTy uTy qTy))
                              (Var "v104" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "SWL" CTy"Store"
                            (Var "v105" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'SWL" (ATy qTy (PTy uTy qTy))
                              (Var "v105" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state"))
                        ((Call "SWR" CTy"Store"
                            (Var "v106" (PTy (FTy 5) (PTy (FTy 5) F16))))
                          (Apply
                            (Call "dfn'SWR" (ATy qTy (PTy uTy qTy))
                              (Var "v106" (PTy (FTy 5) (PTy (FTy 5) F16))))
                            qVar"state")))))
             ((Call "Trap" CTy"instruction" (Var "v107" CTy"Trap"))
               (CS (Var "v107" CTy"Trap")
                 (sqbkt ((Call "TEQ" CTy"Trap"
                            (Var "v108" (PTy (FTy 5) (FTy 5))))
                          (Apply
                            (Call "dfn'TEQ" (ATy qTy (PTy uTy qTy))
                              (Var "v108" (PTy (FTy 5) (FTy 5))))
                            qVar"state"))
                        ((Call "TEQI" CTy"Trap"
                            (Var "v109" (PTy (FTy 5) F16)))
                          (Apply
                            (Call "dfn'TEQI" (ATy qTy (PTy uTy qTy))
                              (Var "v109" (PTy (FTy 5) F16))) qVar"state"))
                        ((Call "TGE" CTy"Trap"
                            (Var "v110" (PTy (FTy 5) (FTy 5))))
                          (Apply
                            (Call "dfn'TGE" (ATy qTy (PTy uTy qTy))
                              (Var "v110" (PTy (FTy 5) (FTy 5))))
                            qVar"state"))
                        ((Call "TGEI" CTy"Trap"
                            (Var "v111" (PTy (FTy 5) F16)))
                          (Apply
                            (Call "dfn'TGEI" (ATy qTy (PTy uTy qTy))
                              (Var "v111" (PTy (FTy 5) F16))) qVar"state"))
                        ((Call "TGEIU" CTy"Trap"
                            (Var "v112" (PTy (FTy 5) F16)))
                          (Apply
                            (Call "dfn'TGEIU" (ATy qTy (PTy uTy qTy))
                              (Var "v112" (PTy (FTy 5) F16))) qVar"state"))
                        ((Call "TGEU" CTy"Trap"
                            (Var "v113" (PTy (FTy 5) (FTy 5))))
                          (Apply
                            (Call "dfn'TGEU" (ATy qTy (PTy uTy qTy))
                              (Var "v113" (PTy (FTy 5) (FTy 5))))
                            qVar"state"))
                        ((Call "TLT" CTy"Trap"
                            (Var "v114" (PTy (FTy 5) (FTy 5))))
                          (Apply
                            (Call "dfn'TLT" (ATy qTy (PTy uTy qTy))
                              (Var "v114" (PTy (FTy 5) (FTy 5))))
                            qVar"state"))
                        ((Call "TLTI" CTy"Trap"
                            (Var "v115" (PTy (FTy 5) F16)))
                          (Apply
                            (Call "dfn'TLTI" (ATy qTy (PTy uTy qTy))
                              (Var "v115" (PTy (FTy 5) F16))) qVar"state"))
                        ((Call "TLTIU" CTy"Trap"
                            (Var "v116" (PTy (FTy 5) F16)))
                          (Apply
                            (Call "dfn'TLTIU" (ATy qTy (PTy uTy qTy))
                              (Var "v116" (PTy (FTy 5) F16))) qVar"state"))
                        ((Call "TLTU" CTy"Trap"
                            (Var "v117" (PTy (FTy 5) (FTy 5))))
                          (Apply
                            (Call "dfn'TLTU" (ATy qTy (PTy uTy qTy))
                              (Var "v117" (PTy (FTy 5) (FTy 5))))
                            qVar"state"))
                        ((Call "TNE" CTy"Trap"
                            (Var "v118" (PTy (FTy 5) (FTy 5))))
                          (Apply
                            (Call "dfn'TNE" (ATy qTy (PTy uTy qTy))
                              (Var "v118" (PTy (FTy 5) (FTy 5))))
                            qVar"state"))
                        ((Call "TNEI" CTy"Trap"
                            (Var "v119" (PTy (FTy 5) F16)))
                          (Apply
                            (Call "dfn'TNEI" (ATy qTy (PTy uTy qTy))
                              (Var "v119" (PTy (FTy 5) F16))) qVar"state")))))))))


(Def "Decode" (Var "w" F32)
  (Let
    (TP
      (sqbkt bVar"b'31" bVar"b'30" bVar"b'29" bVar"b'28" bVar"b'27"
             bVar"b'26" bVar"b'25" bVar"b'24" bVar"b'23" bVar"b'22"
             bVar"b'21" bVar"b'20" bVar"b'19" bVar"b'18" bVar"b'17"
             bVar"b'16" bVar"b'15" bVar"b'14" bVar"b'13" bVar"b'12"
             bVar"b'11" bVar"b'10" bVar"b'9" bVar"b'8" bVar"b'7" bVar"b'6"
             bVar"b'5" bVar"b'4" bVar"b'3" bVar"b'2" bVar"b'1" bVar"b'0"))
    (BL 32 (Var "w" F32))
    (ITE
      (Bop And (Mop Not bVar"b'31")
        (Bop And (Mop Not bVar"b'29") (Mop Not bVar"b'28")))
      (ITB
        (sqbkt ((Bop And (Mop Not bVar"b'30")
                   (Bop And (Mop Not bVar"b'27") (Mop Not bVar"b'26")))
                 (Let (Var "rt" (FTy 5))
                   (EX (Var "w" F32) (LN 20) (LN 16) (FTy 5))
                   (Let (Var "rs" (FTy 5))
                     (EX (Var "w" F32) (LN 25) (LN 21) (FTy 5))
                     (Let (Var "rd" (FTy 5))
                       (EX (Var "w" F32) (LN 15) (LN 11) (FTy 5))
                       (Let (Var "imm5" (FTy 5))
                         (EX (Var "w" F32) (LN 10) (LN 6) (FTy 5))
                         (Let
                           (TP
                             (sqbkt bVar"b'5" bVar"b'4" bVar"b'3"
                                    bVar"b'2" bVar"b'1" bVar"b'0"))
                           (BL 6 (EX (Var "w" F32) (LN 5) (LN 0) (FTy 6)))
                           (ITB
                             (sqbkt (bVar"b'5"
                                      (ITB
                                        (sqbkt (bVar"b'2"
                                                 (ITB
                                                   (sqbkt (bVar"b'3"
                                                            (ITB
                                                              (sqbkt ((Bop
                                                                         And
                                                                         (Mop
                                                                           Not
                                                                           bVar"b'4")
                                                                         (Bop
                                                                           And
                                                                           (Mop
                                                                             Not
                                                                             bVar"b'1")
                                                                           (Mop
                                                                             Not
                                                                             bVar"b'0")))
                                                                       (Call
                                                                         "ArithR"
                                                                         CTy"instruction"
                                                                         (Call
                                                                           "DADD"
                                                                           CTy"ArithR"
                                                                           (TP
                                                                             (sqbkt (Var
                                                                                      "rs"
                                                                                      (FTy
                                                                                        5))
                                                                                    (Var
                                                                                      "rt"
                                                                                      (FTy
                                                                                        5))
                                                                                    (Var
                                                                                      "rd"
                                                                                      (FTy
                                                                                        5)))))))
                                                                     ((Bop
                                                                         And
                                                                         (Mop
                                                                           Not
                                                                           bVar"b'4")
                                                                         (Bop
                                                                           And
                                                                           (Mop
                                                                             Not
                                                                             bVar"b'1")
                                                                           bVar"b'0"))
                                                                       (Call
                                                                         "ArithR"
                                                                         CTy"instruction"
                                                                         (Call
                                                                           "DADDU"
                                                                           CTy"ArithR"
                                                                           (TP
                                                                             (sqbkt (Var
                                                                                      "rs"
                                                                                      (FTy
                                                                                        5))
                                                                                    (Var
                                                                                      "rt"
                                                                                      (FTy
                                                                                        5))
                                                                                    (Var
                                                                                      "rd"
                                                                                      (FTy
                                                                                        5)))))))
                                                                     ((Bop
                                                                         And
                                                                         (Mop
                                                                           Not
                                                                           bVar"b'4")
                                                                         (Bop
                                                                           And
                                                                           bVar"b'1"
                                                                           (Mop
                                                                             Not
                                                                             bVar"b'0")))
                                                                       (Call
                                                                         "ArithR"
                                                                         CTy"instruction"
                                                                         (Call
                                                                           "DSUB"
                                                                           CTy"ArithR"
                                                                           (TP
                                                                             (sqbkt (Var
                                                                                      "rs"
                                                                                      (FTy
                                                                                        5))
                                                                                    (Var
                                                                                      "rt"
                                                                                      (FTy
                                                                                        5))
                                                                                    (Var
                                                                                      "rd"
                                                                                      (FTy
                                                                                        5)))))))
                                                                     ((Bop
                                                                         And
                                                                         (Mop
                                                                           Not
                                                                           bVar"b'4")
                                                                         (Bop
                                                                           And
                                                                           bVar"b'1"
                                                                           bVar"b'0"))
                                                                       (Call
                                                                         "ArithR"
                                                                         CTy"instruction"
                                                                         (Call
                                                                           "DSUBU"
                                                                           CTy"ArithR"
                                                                           (TP
                                                                             (sqbkt (Var
                                                                                      "rs"
                                                                                      (FTy
                                                                                        5))
                                                                                    (Var
                                                                                      "rt"
                                                                                      (FTy
                                                                                        5))
                                                                                    (Var
                                                                                      "rd"
                                                                                      (FTy
                                                                                        5)))))))
                                                                     ((Bop
                                                                         And
                                                                         bVar"b'4"
                                                                         (Bop
                                                                           And
                                                                           (Mop
                                                                             Not
                                                                             bVar"b'1")
                                                                           (Mop
                                                                             Not
                                                                             bVar"b'0")))
                                                                       (Call
                                                                         "Shift"
                                                                         CTy"instruction"
                                                                         (Call
                                                                           "DSLL32"
                                                                           CTy"Shift"
                                                                           (TP
                                                                             (sqbkt (Var
                                                                                      "rt"
                                                                                      (FTy
                                                                                        5))
                                                                                    (Var
                                                                                      "rd"
                                                                                      (FTy
                                                                                        5))
                                                                                    (Var
                                                                                      "imm5"
                                                                                      (FTy
                                                                                        5)))))))
                                                                     ((Bop
                                                                         And
                                                                         bVar"b'4"
                                                                         (Bop
                                                                           And
                                                                           bVar"b'1"
                                                                           (Mop
                                                                             Not
                                                                             bVar"b'0")))
                                                                       (Call
                                                                         "Shift"
                                                                         CTy"instruction"
                                                                         (Call
                                                                           "DSRL32"
                                                                           CTy"Shift"
                                                                           (TP
                                                                             (sqbkt (Var
                                                                                      "rt"
                                                                                      (FTy
                                                                                        5))
                                                                                    (Var
                                                                                      "rd"
                                                                                      (FTy
                                                                                        5))
                                                                                    (Var
                                                                                      "imm5"
                                                                                      (FTy
                                                                                        5)))))))
                                                                     ((Bop
                                                                         And
                                                                         bVar"b'4"
                                                                         (Bop
                                                                           And
                                                                           bVar"b'1"
                                                                           bVar"b'0"))
                                                                       (Call
                                                                         "Shift"
                                                                         CTy"instruction"
                                                                         (Call
                                                                           "DSRA32"
                                                                           CTy"Shift"
                                                                           (TP
                                                                             (sqbkt (Var
                                                                                      "rt"
                                                                                      (FTy
                                                                                        5))
                                                                                    (Var
                                                                                      "rd"
                                                                                      (FTy
                                                                                        5))
                                                                                    (Var
                                                                                      "imm5"
                                                                                      (FTy
                                                                                        5))))))))
                                                              (Const
                                                                "ReservedInstruction"
                                                                CTy"instruction")))
                                                          ((Bop And
                                                              (Mop Not
                                                                bVar"b'4")
                                                              (Bop And
                                                                (Mop Not
                                                                  bVar"b'1")
                                                                (Mop Not
                                                                  bVar"b'0")))
                                                            (Call "ArithR"
                                                              CTy"instruction"
                                                              (Call "AND"
                                                                CTy"ArithR"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rs"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rd"
                                                                           (FTy
                                                                             5)))))))
                                                          ((Bop And
                                                              (Mop Not
                                                                bVar"b'4")
                                                              (Bop And
                                                                (Mop Not
                                                                  bVar"b'1")
                                                                bVar"b'0"))
                                                            (Call "ArithR"
                                                              CTy"instruction"
                                                              (Call "OR"
                                                                CTy"ArithR"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rs"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rd"
                                                                           (FTy
                                                                             5)))))))
                                                          ((Bop And
                                                              (Mop Not
                                                                bVar"b'4")
                                                              (Bop And
                                                                bVar"b'1"
                                                                (Mop Not
                                                                  bVar"b'0")))
                                                            (Call "ArithR"
                                                              CTy"instruction"
                                                              (Call "XOR"
                                                                CTy"ArithR"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rs"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rd"
                                                                           (FTy
                                                                             5)))))))
                                                          ((Bop And
                                                              (Mop Not
                                                                bVar"b'4")
                                                              (Bop And
                                                                bVar"b'1"
                                                                bVar"b'0"))
                                                            (Call "ArithR"
                                                              CTy"instruction"
                                                              (Call "NOR"
                                                                CTy"ArithR"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rs"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rd"
                                                                           (FTy
                                                                             5)))))))
                                                          ((Bop And
                                                              bVar"b'4"
                                                              (Bop And
                                                                (Mop Not
                                                                  bVar"b'1")
                                                                (Mop Not
                                                                  bVar"b'0")))
                                                            (Call "Trap"
                                                              CTy"instruction"
                                                              (Call "TEQ"
                                                                CTy"Trap"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rs"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5)))))))
                                                          ((Bop And
                                                              bVar"b'4"
                                                              (Bop And
                                                                bVar"b'1"
                                                                (Mop Not
                                                                  bVar"b'0")))
                                                            (Call "Trap"
                                                              CTy"instruction"
                                                              (Call "TNE"
                                                                CTy"Trap"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rs"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5))))))))
                                                   (Const
                                                     "ReservedInstruction"
                                                     CTy"instruction")))
                                               (bVar"b'4"
                                                 (ITB
                                                   (sqbkt ((Bop And
                                                              (Mop Not
                                                                bVar"b'3")
                                                              (Bop And
                                                                (Mop Not
                                                                  bVar"b'1")
                                                                (Mop Not
                                                                  bVar"b'0")))
                                                            (Call "Trap"
                                                              CTy"instruction"
                                                              (Call "TGE"
                                                                CTy"Trap"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rs"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5)))))))
                                                          ((Bop And
                                                              (Mop Not
                                                                bVar"b'3")
                                                              (Bop And
                                                                (Mop Not
                                                                  bVar"b'1")
                                                                bVar"b'0"))
                                                            (Call "Trap"
                                                              CTy"instruction"
                                                              (Call "TGEU"
                                                                CTy"Trap"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rs"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5)))))))
                                                          ((Bop And
                                                              (Mop Not
                                                                bVar"b'3")
                                                              (Bop And
                                                                bVar"b'1"
                                                                (Mop Not
                                                                  bVar"b'0")))
                                                            (Call "Trap"
                                                              CTy"instruction"
                                                              (Call "TLT"
                                                                CTy"Trap"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rs"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5)))))))
                                                          ((Bop And
                                                              (Mop Not
                                                                bVar"b'3")
                                                              (Bop And
                                                                bVar"b'1"
                                                                bVar"b'0"))
                                                            (Call "Trap"
                                                              CTy"instruction"
                                                              (Call "TLTU"
                                                                CTy"Trap"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rs"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5)))))))
                                                          ((Bop And
                                                              bVar"b'3"
                                                              (Bop And
                                                                (Mop Not
                                                                  bVar"b'1")
                                                                (Mop Not
                                                                  bVar"b'0")))
                                                            (Call "Shift"
                                                              CTy"instruction"
                                                              (Call "DSLL"
                                                                CTy"Shift"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rd"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "imm5"
                                                                           (FTy
                                                                             5)))))))
                                                          ((Bop And
                                                              bVar"b'3"
                                                              (Bop And
                                                                bVar"b'1"
                                                                (Mop Not
                                                                  bVar"b'0")))
                                                            (Call "Shift"
                                                              CTy"instruction"
                                                              (Call "DSRL"
                                                                CTy"Shift"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rd"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "imm5"
                                                                           (FTy
                                                                             5)))))))
                                                          ((Bop And
                                                              bVar"b'3"
                                                              (Bop And
                                                                bVar"b'1"
                                                                bVar"b'0"))
                                                            (Call "Shift"
                                                              CTy"instruction"
                                                              (Call "DSRA"
                                                                CTy"Shift"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rd"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "imm5"
                                                                           (FTy
                                                                             5))))))))
                                                   (Const
                                                     "ReservedInstruction"
                                                     CTy"instruction")))
                                               ((Bop And
                                                   (Mop Not bVar"b'3")
                                                   (Bop And
                                                     (Mop Not bVar"b'1")
                                                     (Mop Not bVar"b'0")))
                                                 (Call "ArithR"
                                                   CTy"instruction"
                                                   (Call "ADD" CTy"ArithR"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var "rd"
                                                                (FTy 5)))))))
                                               ((Bop And
                                                   (Mop Not bVar"b'3")
                                                   (Bop And
                                                     (Mop Not bVar"b'1")
                                                     bVar"b'0"))
                                                 (Call "ArithR"
                                                   CTy"instruction"
                                                   (Call "ADDU"
                                                     CTy"ArithR"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var "rd"
                                                                (FTy 5)))))))
                                               ((Bop And
                                                   (Mop Not bVar"b'3")
                                                   (Bop And bVar"b'1"
                                                     (Mop Not bVar"b'0")))
                                                 (Call "ArithR"
                                                   CTy"instruction"
                                                   (Call "SUB" CTy"ArithR"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var "rd"
                                                                (FTy 5)))))))
                                               ((Bop And
                                                   (Mop Not bVar"b'3")
                                                   (Bop And bVar"b'1"
                                                     bVar"b'0"))
                                                 (Call "ArithR"
                                                   CTy"instruction"
                                                   (Call "SUBU"
                                                     CTy"ArithR"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var "rd"
                                                                (FTy 5)))))))
                                               ((Bop And bVar"b'3"
                                                   (Bop And bVar"b'1"
                                                     (Mop Not bVar"b'0")))
                                                 (Call "ArithR"
                                                   CTy"instruction"
                                                   (Call "SLT" CTy"ArithR"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var "rd"
                                                                (FTy 5)))))))
                                               ((Bop And bVar"b'3"
                                                   (Bop And bVar"b'1"
                                                     bVar"b'0"))
                                                 (Call "ArithR"
                                                   CTy"instruction"
                                                   (Call "SLTU"
                                                     CTy"ArithR"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var "rd"
                                                                (FTy 5))))))))
                                        (Const "ReservedInstruction"
                                          CTy"instruction")))
                                    (bVar"b'3"
                                      (ITB
                                        (sqbkt (bVar"b'2"
                                                 (ITB
                                                   (sqbkt ((Bop And
                                                              (Mop Not
                                                                bVar"b'4")
                                                              (Bop And
                                                                (Mop Not
                                                                  bVar"b'1")
                                                                (Mop Not
                                                                  bVar"b'0")))
                                                            (Const
                                                              "SYSCALL"
                                                              CTy"instruction"))
                                                          ((Bop And
                                                              (Mop Not
                                                                bVar"b'4")
                                                              (Bop And
                                                                (Mop Not
                                                                  bVar"b'1")
                                                                bVar"b'0"))
                                                            (Const "BREAK"
                                                              CTy"instruction"))
                                                          ((Bop And
                                                              (Mop Not
                                                                bVar"b'4")
                                                              (Bop And
                                                                bVar"b'1"
                                                                bVar"b'0"))
                                                            (Call "SYNC"
                                                              CTy"instruction"
                                                              (Var "imm5"
                                                                (FTy 5))))
                                                          ((Bop And
                                                              bVar"b'4"
                                                              (Bop And
                                                                (Mop Not
                                                                  bVar"b'1")
                                                                (Mop Not
                                                                  bVar"b'0")))
                                                            (Call
                                                              "MultDiv"
                                                              CTy"instruction"
                                                              (Call
                                                                "DMULT"
                                                                CTy"MultDiv"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rs"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5)))))))
                                                          ((Bop And
                                                              bVar"b'4"
                                                              (Bop And
                                                                (Mop Not
                                                                  bVar"b'1")
                                                                bVar"b'0"))
                                                            (Call
                                                              "MultDiv"
                                                              CTy"instruction"
                                                              (Call
                                                                "DMULTU"
                                                                CTy"MultDiv"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rs"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5)))))))
                                                          ((Bop And
                                                              bVar"b'4"
                                                              (Bop And
                                                                bVar"b'1"
                                                                (Mop Not
                                                                  bVar"b'0")))
                                                            (Call
                                                              "MultDiv"
                                                              CTy"instruction"
                                                              (Call "DDIV"
                                                                CTy"MultDiv"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rs"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5)))))))
                                                          ((Bop And
                                                              bVar"b'4"
                                                              (Bop And
                                                                bVar"b'1"
                                                                bVar"b'0"))
                                                            (Call
                                                              "MultDiv"
                                                              CTy"instruction"
                                                              (Call
                                                                "DDIVU"
                                                                CTy"MultDiv"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rs"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5))))))))
                                                   (Const
                                                     "ReservedInstruction"
                                                     CTy"instruction")))
                                               ((Bop And
                                                   (Mop Not bVar"b'4")
                                                   (Bop And
                                                     (Mop Not bVar"b'1")
                                                     (Mop Not bVar"b'0")))
                                                 (Call "Branch"
                                                   CTy"instruction"
                                                   (Call "JR" CTy"Branch"
                                                     (Var "rs" (FTy 5)))))
                                               ((Bop And
                                                   (Mop Not bVar"b'4")
                                                   (Bop And
                                                     (Mop Not bVar"b'1")
                                                     bVar"b'0"))
                                                 (Call "Branch"
                                                   CTy"instruction"
                                                   (Call "JALR"
                                                     CTy"Branch"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rd"
                                                                (FTy 5)))))))
                                               ((Bop And bVar"b'4"
                                                   (Bop And
                                                     (Mop Not bVar"b'1")
                                                     (Mop Not bVar"b'0")))
                                                 (Call "MultDiv"
                                                   CTy"instruction"
                                                   (Call "MULT"
                                                     CTy"MultDiv"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5)))))))
                                               ((Bop And bVar"b'4"
                                                   (Bop And
                                                     (Mop Not bVar"b'1")
                                                     bVar"b'0"))
                                                 (Call "MultDiv"
                                                   CTy"instruction"
                                                   (Call "MULTU"
                                                     CTy"MultDiv"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5)))))))
                                               ((Bop And bVar"b'4"
                                                   (Bop And bVar"b'1"
                                                     (Mop Not bVar"b'0")))
                                                 (Call "MultDiv"
                                                   CTy"instruction"
                                                   (Call "DIV"
                                                     CTy"MultDiv"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5)))))))
                                               ((Bop And bVar"b'4"
                                                   (Bop And bVar"b'1"
                                                     bVar"b'0"))
                                                 (Call "MultDiv"
                                                   CTy"instruction"
                                                   (Call "DIVU"
                                                     CTy"MultDiv"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))))))))
                                        (Const "ReservedInstruction"
                                          CTy"instruction")))
                                    (bVar"b'4"
                                      (ITB
                                        (sqbkt ((Bop And
                                                   (Mop Not bVar"b'2")
                                                   (Bop And
                                                     (Mop Not bVar"b'1")
                                                     (Mop Not bVar"b'0")))
                                                 (Call "MultDiv"
                                                   CTy"instruction"
                                                   (Call "MFHI"
                                                     CTy"MultDiv"
                                                     (Var "rd" (FTy 5)))))
                                               ((Bop And
                                                   (Mop Not bVar"b'2")
                                                   (Bop And
                                                     (Mop Not bVar"b'1")
                                                     bVar"b'0"))
                                                 (Call "MultDiv"
                                                   CTy"instruction"
                                                   (Call "MTHI"
                                                     CTy"MultDiv"
                                                     (Var "rd" (FTy 5)))))
                                               ((Bop And
                                                   (Mop Not bVar"b'2")
                                                   (Bop And bVar"b'1"
                                                     (Mop Not bVar"b'0")))
                                                 (Call "MultDiv"
                                                   CTy"instruction"
                                                   (Call "MFLO"
                                                     CTy"MultDiv"
                                                     (Var "rs" (FTy 5)))))
                                               ((Bop And
                                                   (Mop Not bVar"b'2")
                                                   (Bop And bVar"b'1"
                                                     bVar"b'0"))
                                                 (Call "MultDiv"
                                                   CTy"instruction"
                                                   (Call "MTLO"
                                                     CTy"MultDiv"
                                                     (Var "rs" (FTy 5)))))
                                               ((Bop And bVar"b'2"
                                                   (Bop And
                                                     (Mop Not bVar"b'1")
                                                     (Mop Not bVar"b'0")))
                                                 (Call "Shift"
                                                   CTy"instruction"
                                                   (Call "DSLLV"
                                                     CTy"Shift"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var "rd"
                                                                (FTy 5)))))))
                                               ((Bop And bVar"b'2"
                                                   (Bop And bVar"b'1"
                                                     (Mop Not bVar"b'0")))
                                                 (Call "Shift"
                                                   CTy"instruction"
                                                   (Call "DSRLV"
                                                     CTy"Shift"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var "rd"
                                                                (FTy 5)))))))
                                               ((Bop And bVar"b'2"
                                                   (Bop And bVar"b'1"
                                                     bVar"b'0"))
                                                 (Call "Shift"
                                                   CTy"instruction"
                                                   (Call "DSRAV"
                                                     CTy"Shift"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var "rd"
                                                                (FTy 5))))))))
                                        (Const "ReservedInstruction"
                                          CTy"instruction")))
                                    ((Bop And (Mop Not bVar"b'2")
                                        (Bop And (Mop Not bVar"b'1")
                                          (Mop Not bVar"b'0")))
                                      (Call "Shift" CTy"instruction"
                                        (Call "SLL" CTy"Shift"
                                          (TP
                                            (sqbkt (Var "rt" (FTy 5))
                                                   (Var "rd" (FTy 5))
                                                   (Var "imm5" (FTy 5)))))))
                                    ((Bop And (Mop Not bVar"b'2")
                                        (Bop And bVar"b'1"
                                          (Mop Not bVar"b'0")))
                                      (Call "Shift" CTy"instruction"
                                        (Call "SRL" CTy"Shift"
                                          (TP
                                            (sqbkt (Var "rt" (FTy 5))
                                                   (Var "rd" (FTy 5))
                                                   (Var "imm5" (FTy 5)))))))
                                    ((Bop And (Mop Not bVar"b'2")
                                        (Bop And bVar"b'1" bVar"b'0"))
                                      (Call "Shift" CTy"instruction"
                                        (Call "SRA" CTy"Shift"
                                          (TP
                                            (sqbkt (Var "rt" (FTy 5))
                                                   (Var "rd" (FTy 5))
                                                   (Var "imm5" (FTy 5)))))))
                                    ((Bop And bVar"b'2"
                                        (Bop And (Mop Not bVar"b'1")
                                          (Mop Not bVar"b'0")))
                                      (Call "Shift" CTy"instruction"
                                        (Call "SLLV" CTy"Shift"
                                          (TP
                                            (sqbkt (Var "rs" (FTy 5))
                                                   (Var "rt" (FTy 5))
                                                   (Var "rd" (FTy 5)))))))
                                    ((Bop And bVar"b'2"
                                        (Bop And bVar"b'1"
                                          (Mop Not bVar"b'0")))
                                      (Call "Shift" CTy"instruction"
                                        (Call "SRLV" CTy"Shift"
                                          (TP
                                            (sqbkt (Var "rs" (FTy 5))
                                                   (Var "rt" (FTy 5))
                                                   (Var "rd" (FTy 5)))))))
                                    ((Bop And bVar"b'2"
                                        (Bop And bVar"b'1" bVar"b'0"))
                                      (Call "Shift" CTy"instruction"
                                        (Call "SRAV" CTy"Shift"
                                          (TP
                                            (sqbkt (Var "rs" (FTy 5))
                                                   (Var "rt" (FTy 5))
                                                   (Var "rd" (FTy 5))))))))
                             (Const "ReservedInstruction"
                               CTy"instruction"))))))))
               ((Bop And (Mop Not bVar"b'30")
                   (Bop And (Mop Not bVar"b'27") bVar"b'26"))
                 (Let (Var "rs" (FTy 5))
                   (EX (Var "w" F32) (LN 25) (LN 21) (FTy 5))
                   (Let (Var "immediate" F16)
                     (EX (Var "w" F32) (LN 15) (LN 0) F16)
                     (Let
                       (TP
                         (sqbkt bVar"b'4" bVar"b'3" bVar"b'2" bVar"b'1"
                                bVar"b'0"))
                       (BL 5 (EX (Var "w" F32) (LN 20) (LN 16) (FTy 5)))
                       (ITB
                         (sqbkt (bVar"b'1"
                                  (ITB
                                    (sqbkt ((Bop And (Mop Not bVar"b'4")
                                               (Bop And
                                                 (Mop Not bVar"b'3")
                                                 (Bop And
                                                   (Mop Not bVar"b'2")
                                                   (Mop Not bVar"b'0"))))
                                             (Call "Branch"
                                               CTy"instruction"
                                               (Call "BLTZL" CTy"Branch"
                                                 (TP
                                                   (sqbkt (Var "rs"
                                                            (FTy 5))
                                                          (Var "immediate"
                                                            F16))))))
                                           ((Bop And (Mop Not bVar"b'4")
                                               (Bop And
                                                 (Mop Not bVar"b'3")
                                                 (Bop And
                                                   (Mop Not bVar"b'2")
                                                   bVar"b'0")))
                                             (Call "Branch"
                                               CTy"instruction"
                                               (Call "BGEZL" CTy"Branch"
                                                 (TP
                                                   (sqbkt (Var "rs"
                                                            (FTy 5))
                                                          (Var "immediate"
                                                            F16))))))
                                           ((Bop And (Mop Not bVar"b'4")
                                               (Bop And bVar"b'3"
                                                 (Bop And
                                                   (Mop Not bVar"b'2")
                                                   (Mop Not bVar"b'0"))))
                                             (Call "Trap" CTy"instruction"
                                               (Call "TLTI" CTy"Trap"
                                                 (TP
                                                   (sqbkt (Var "rs"
                                                            (FTy 5))
                                                          (Var "immediate"
                                                            F16))))))
                                           ((Bop And (Mop Not bVar"b'4")
                                               (Bop And bVar"b'3"
                                                 (Bop And
                                                   (Mop Not bVar"b'2")
                                                   bVar"b'0")))
                                             (Call "Trap" CTy"instruction"
                                               (Call "TLTIU" CTy"Trap"
                                                 (TP
                                                   (sqbkt (Var "rs"
                                                            (FTy 5))
                                                          (Var "immediate"
                                                            F16))))))
                                           ((Bop And (Mop Not bVar"b'4")
                                               (Bop And bVar"b'3"
                                                 (Bop And bVar"b'2"
                                                   (Mop Not bVar"b'0"))))
                                             (Call "Trap" CTy"instruction"
                                               (Call "TNEI" CTy"Trap"
                                                 (TP
                                                   (sqbkt (Var "rs"
                                                            (FTy 5))
                                                          (Var "immediate"
                                                            F16))))))
                                           ((Bop And bVar"b'4"
                                               (Bop And
                                                 (Mop Not bVar"b'3")
                                                 (Bop And
                                                   (Mop Not bVar"b'2")
                                                   (Mop Not bVar"b'0"))))
                                             (Call "Branch"
                                               CTy"instruction"
                                               (Call "BLTZALL" CTy"Branch"
                                                 (TP
                                                   (sqbkt (Var "rs"
                                                            (FTy 5))
                                                          (Var "immediate"
                                                            F16))))))
                                           ((Bop And bVar"b'4"
                                               (Bop And
                                                 (Mop Not bVar"b'3")
                                                 (Bop And
                                                   (Mop Not bVar"b'2")
                                                   bVar"b'0")))
                                             (Call "Branch"
                                               CTy"instruction"
                                               (Call "BGEZALL" CTy"Branch"
                                                 (TP
                                                   (sqbkt (Var "rs"
                                                            (FTy 5))
                                                          (Var "immediate"
                                                            F16)))))))
                                    (Const "ReservedInstruction"
                                      CTy"instruction")))
                                ((Bop And (Mop Not bVar"b'4")
                                    (Bop And (Mop Not bVar"b'3")
                                      (Bop And (Mop Not bVar"b'2")
                                        (Mop Not bVar"b'0"))))
                                  (Call "Branch" CTy"instruction"
                                    (Call "BLTZ" CTy"Branch"
                                      (TP
                                        (sqbkt (Var "rs" (FTy 5))
                                               (Var "immediate" F16))))))
                                ((Bop And (Mop Not bVar"b'4")
                                    (Bop And (Mop Not bVar"b'3")
                                      (Bop And (Mop Not bVar"b'2")
                                        bVar"b'0")))
                                  (Call "Branch" CTy"instruction"
                                    (Call "BGEZ" CTy"Branch"
                                      (TP
                                        (sqbkt (Var "rs" (FTy 5))
                                               (Var "immediate" F16))))))
                                ((Bop And (Mop Not bVar"b'4")
                                    (Bop And bVar"b'3"
                                      (Bop And (Mop Not bVar"b'2")
                                        (Mop Not bVar"b'0"))))
                                  (Call "Trap" CTy"instruction"
                                    (Call "TGEI" CTy"Trap"
                                      (TP
                                        (sqbkt (Var "rs" (FTy 5))
                                               (Var "immediate" F16))))))
                                ((Bop And (Mop Not bVar"b'4")
                                    (Bop And bVar"b'3"
                                      (Bop And (Mop Not bVar"b'2")
                                        bVar"b'0")))
                                  (Call "Trap" CTy"instruction"
                                    (Call "TGEIU" CTy"Trap"
                                      (TP
                                        (sqbkt (Var "rs" (FTy 5))
                                               (Var "immediate" F16))))))
                                ((Bop And (Mop Not bVar"b'4")
                                    (Bop And bVar"b'3"
                                      (Bop And bVar"b'2"
                                        (Mop Not bVar"b'0"))))
                                  (Call "Trap" CTy"instruction"
                                    (Call "TEQI" CTy"Trap"
                                      (TP
                                        (sqbkt (Var "rs" (FTy 5))
                                               (Var "immediate" F16))))))
                                ((Bop And bVar"b'4"
                                    (Bop And (Mop Not bVar"b'3")
                                      (Bop And (Mop Not bVar"b'2")
                                        (Mop Not bVar"b'0"))))
                                  (Call "Branch" CTy"instruction"
                                    (Call "BLTZAL" CTy"Branch"
                                      (TP
                                        (sqbkt (Var "rs" (FTy 5))
                                               (Var "immediate" F16))))))
                                ((Bop And bVar"b'4"
                                    (Bop And (Mop Not bVar"b'3")
                                      (Bop And (Mop Not bVar"b'2")
                                        bVar"b'0")))
                                  (Call "Branch" CTy"instruction"
                                    (Call "BGEZAL" CTy"Branch"
                                      (TP
                                        (sqbkt (Var "rs" (FTy 5))
                                               (Var "immediate" F16)))))))
                         (Const "ReservedInstruction" CTy"instruction"))))))
               ((Bop And (Mop Not bVar"b'30")
                   (Bop And bVar"b'27" (Mop Not bVar"b'26")))
                 (Call "Branch" CTy"instruction"
                   (Call "J" CTy"Branch"
                     (EX (Var "w" F32) (LN 25) (LN 0) (FTy 26)))))
               ((Bop And (Mop Not bVar"b'30")
                   (Bop And bVar"b'27" bVar"b'26"))
                 (Call "Branch" CTy"instruction"
                   (Call "JAL" CTy"Branch"
                     (EX (Var "w" F32) (LN 25) (LN 0) (FTy 26)))))
               ((Bop And bVar"b'30"
                   (Bop And (Mop Not bVar"b'27")
                     (Bop And (Mop Not bVar"b'26")
                       (Bop And (Mop Not bVar"b'10")
                         (Bop And (Mop Not bVar"b'9")
                           (Bop And (Mop Not bVar"b'8")
                             (Bop And (Mop Not bVar"b'7")
                               (Bop And (Mop Not bVar"b'6")
                                 (Bop And (Mop Not bVar"b'5")
                                   (Bop And (Mop Not bVar"b'4")
                                     (Mop Not bVar"b'3")))))))))))
                 (Let (Var "sel" (FTy 3))
                   (EX (Var "w" F32) (LN 2) (LN 0) (FTy 3))
                   (Let (Var "rt" (FTy 5))
                     (EX (Var "w" F32) (LN 20) (LN 16) (FTy 5))
                     (Let (Var "rd" (FTy 5))
                       (EX (Var "w" F32) (LN 15) (LN 11) (FTy 5))
                       (Let
                         (TP
                           (sqbkt bVar"b'4" bVar"b'3" bVar"b'2" bVar"b'1"
                                  bVar"b'0"))
                         (BL 5 (EX (Var "w" F32) (LN 25) (LN 21) (FTy 5)))
                         (ITE
                           (Bop And (Mop Not bVar"b'4")
                             (Bop And (Mop Not bVar"b'3")
                               (Mop Not bVar"b'1")))
                           (ITB
                             (sqbkt ((Bop And (Mop Not bVar"b'2")
                                        (Mop Not bVar"b'0"))
                                      (Call "CP" CTy"instruction"
                                        (Call "MFC0" CTy"CP"
                                          (TP
                                            (sqbkt (Var "rt" (FTy 5))
                                                   (Var "rd" (FTy 5))
                                                   (Var "sel" (FTy 3)))))))
                                    ((Bop And (Mop Not bVar"b'2")
                                        bVar"b'0")
                                      (Call "CP" CTy"instruction"
                                        (Call "DMFC0" CTy"CP"
                                          (TP
                                            (sqbkt (Var "rt" (FTy 5))
                                                   (Var "rd" (FTy 5))
                                                   (Var "sel" (FTy 3)))))))
                                    ((Bop And bVar"b'2"
                                        (Mop Not bVar"b'0"))
                                      (Call "CP" CTy"instruction"
                                        (Call "MTC0" CTy"CP"
                                          (TP
                                            (sqbkt (Var "rt" (FTy 5))
                                                   (Var "rd" (FTy 5))
                                                   (Var "sel" (FTy 3)))))))
                                    ((Bop And bVar"b'2" bVar"b'0")
                                      (Call "CP" CTy"instruction"
                                        (Call "DMTC0" CTy"CP"
                                          (TP
                                            (sqbkt (Var "rt" (FTy 5))
                                                   (Var "rd" (FTy 5))
                                                   (Var "sel" (FTy 3))))))))
                             (Const "ReservedInstruction"
                               CTy"instruction"))
                           (Const "ReservedInstruction" CTy"instruction"))))))))
        (Let (Var "rt" (FTy 5)) (EX (Var "w" F32) (LN 20) (LN 16) (FTy 5))
          (Let (Var "rs" (FTy 5))
            (EX (Var "w" F32) (LN 25) (LN 21) (FTy 5))
            (Let (Var "immediate" F16)
              (EX (Var "w" F32) (LN 15) (LN 0) F16)
              (Let
                (TP
                  (sqbkt bVar"b'5" bVar"b'4" bVar"b'3" bVar"b'2" bVar"b'1"
                         bVar"b'0"))
                (BL 6 (EX (Var "w" F32) (LN 31) (LN 26) (FTy 6)))
                (ITB
                  (sqbkt (bVar"b'5"
                           (ITB
                             (sqbkt (bVar"b'2"
                                      (ITB
                                        (sqbkt (bVar"b'3"
                                                 (ITB
                                                   (sqbkt ((Bop And
                                                              (Mop Not
                                                                bVar"b'4")
                                                              (Bop And
                                                                (Mop Not
                                                                  bVar"b'1")
                                                                (Mop Not
                                                                  bVar"b'0")))
                                                            (Call "Store"
                                                              CTy"instruction"
                                                              (Call "SDL"
                                                                CTy"Store"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rs"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "immediate"
                                                                           F16))))))
                                                          ((Bop And
                                                              (Mop Not
                                                                bVar"b'4")
                                                              (Bop And
                                                                (Mop Not
                                                                  bVar"b'1")
                                                                bVar"b'0"))
                                                            (Call "Store"
                                                              CTy"instruction"
                                                              (Call "SDR"
                                                                CTy"Store"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rs"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "immediate"
                                                                           F16))))))
                                                          ((Bop And
                                                              (Mop Not
                                                                bVar"b'4")
                                                              (Bop And
                                                                bVar"b'1"
                                                                (Mop Not
                                                                  bVar"b'0")))
                                                            (Call "Store"
                                                              CTy"instruction"
                                                              (Call "SWR"
                                                                CTy"Store"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rs"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "immediate"
                                                                           F16))))))
                                                          ((Bop And
                                                              bVar"b'4"
                                                              (Bop And
                                                                (Mop Not
                                                                  bVar"b'1")
                                                                (Mop Not
                                                                  bVar"b'0")))
                                                            (Call "Store"
                                                              CTy"instruction"
                                                              (Call "SCD"
                                                                CTy"Store"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rs"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "immediate"
                                                                           F16))))))
                                                          ((Bop And
                                                              bVar"b'4"
                                                              (Bop And
                                                                bVar"b'1"
                                                                bVar"b'0"))
                                                            (Call "Store"
                                                              CTy"instruction"
                                                              (Call "SD"
                                                                CTy"Store"
                                                                (TP
                                                                  (sqbkt (Var
                                                                           "rs"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "rt"
                                                                           (FTy
                                                                             5))
                                                                         (Var
                                                                           "immediate"
                                                                           F16)))))))
                                                   (Const
                                                     "ReservedInstruction"
                                                     CTy"instruction")))
                                               ((Bop And
                                                   (Mop Not bVar"b'4")
                                                   (Bop And
                                                     (Mop Not bVar"b'1")
                                                     (Mop Not bVar"b'0")))
                                                 (Call "Load"
                                                   CTy"instruction"
                                                   (Call "LBU" CTy"Load"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var
                                                                "immediate"
                                                                F16))))))
                                               ((Bop And
                                                   (Mop Not bVar"b'4")
                                                   (Bop And
                                                     (Mop Not bVar"b'1")
                                                     bVar"b'0"))
                                                 (Call "Load"
                                                   CTy"instruction"
                                                   (Call "LHU" CTy"Load"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var
                                                                "immediate"
                                                                F16))))))
                                               ((Bop And
                                                   (Mop Not bVar"b'4")
                                                   (Bop And bVar"b'1"
                                                     (Mop Not bVar"b'0")))
                                                 (Call "Load"
                                                   CTy"instruction"
                                                   (Call "LWR" CTy"Load"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var
                                                                "immediate"
                                                                F16))))))
                                               ((Bop And
                                                   (Mop Not bVar"b'4")
                                                   (Bop And bVar"b'1"
                                                     bVar"b'0"))
                                                 (Call "Load"
                                                   CTy"instruction"
                                                   (Call "LWU" CTy"Load"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var
                                                                "immediate"
                                                                F16))))))
                                               ((Bop And bVar"b'4"
                                                   (Bop And
                                                     (Mop Not bVar"b'1")
                                                     (Mop Not bVar"b'0")))
                                                 (Call "Load"
                                                   CTy"instruction"
                                                   (Call "LLD" CTy"Load"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var
                                                                "immediate"
                                                                F16))))))
                                               ((Bop And bVar"b'4"
                                                   (Bop And bVar"b'1"
                                                     bVar"b'0"))
                                                 (Call "Load"
                                                   CTy"instruction"
                                                   (Call "LD" CTy"Load"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var
                                                                "immediate"
                                                                F16)))))))
                                        (Const "ReservedInstruction"
                                          CTy"instruction")))
                                    (bVar"b'3"
                                      (ITB
                                        (sqbkt ((Bop And
                                                   (Mop Not bVar"b'4")
                                                   (Bop And
                                                     (Mop Not bVar"b'1")
                                                     (Mop Not bVar"b'0")))
                                                 (Call "Store"
                                                   CTy"instruction"
                                                   (Call "SB" CTy"Store"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var
                                                                "immediate"
                                                                F16))))))
                                               ((Bop And
                                                   (Mop Not bVar"b'4")
                                                   (Bop And
                                                     (Mop Not bVar"b'1")
                                                     bVar"b'0"))
                                                 (Call "Store"
                                                   CTy"instruction"
                                                   (Call "SH" CTy"Store"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var
                                                                "immediate"
                                                                F16))))))
                                               ((Bop And
                                                   (Mop Not bVar"b'4")
                                                   (Bop And bVar"b'1"
                                                     (Mop Not bVar"b'0")))
                                                 (Call "Store"
                                                   CTy"instruction"
                                                   (Call "SWL" CTy"Store"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var
                                                                "immediate"
                                                                F16))))))
                                               ((Bop And
                                                   (Mop Not bVar"b'4")
                                                   (Bop And bVar"b'1"
                                                     bVar"b'0"))
                                                 (Call "Store"
                                                   CTy"instruction"
                                                   (Call "SW" CTy"Store"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var
                                                                "immediate"
                                                                F16))))))
                                               ((Bop And bVar"b'4"
                                                   (Bop And
                                                     (Mop Not bVar"b'1")
                                                     (Mop Not bVar"b'0")))
                                                 (Call "Store"
                                                   CTy"instruction"
                                                   (Call "SC" CTy"Store"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var
                                                                "immediate"
                                                                F16)))))))
                                        (Const "ReservedInstruction"
                                          CTy"instruction")))
                                    ((Bop And (Mop Not bVar"b'4")
                                        (Bop And (Mop Not bVar"b'1")
                                          (Mop Not bVar"b'0")))
                                      (Call "Load" CTy"instruction"
                                        (Call "LB" CTy"Load"
                                          (TP
                                            (sqbkt (Var "rs" (FTy 5))
                                                   (Var "rt" (FTy 5))
                                                   (Var "immediate" F16))))))
                                    ((Bop And (Mop Not bVar"b'4")
                                        (Bop And (Mop Not bVar"b'1")
                                          bVar"b'0"))
                                      (Call "Load" CTy"instruction"
                                        (Call "LH" CTy"Load"
                                          (TP
                                            (sqbkt (Var "rs" (FTy 5))
                                                   (Var "rt" (FTy 5))
                                                   (Var "immediate" F16))))))
                                    ((Bop And (Mop Not bVar"b'4")
                                        (Bop And bVar"b'1"
                                          (Mop Not bVar"b'0")))
                                      (Call "Load" CTy"instruction"
                                        (Call "LWL" CTy"Load"
                                          (TP
                                            (sqbkt (Var "rs" (FTy 5))
                                                   (Var "rt" (FTy 5))
                                                   (Var "immediate" F16))))))
                                    ((Bop And (Mop Not bVar"b'4")
                                        (Bop And bVar"b'1" bVar"b'0"))
                                      (Call "Load" CTy"instruction"
                                        (Call "LW" CTy"Load"
                                          (TP
                                            (sqbkt (Var "rs" (FTy 5))
                                                   (Var "rt" (FTy 5))
                                                   (Var "immediate" F16))))))
                                    ((Bop And bVar"b'4"
                                        (Bop And (Mop Not bVar"b'1")
                                          (Mop Not bVar"b'0")))
                                      (Call "Load" CTy"instruction"
                                        (Call "LL" CTy"Load"
                                          (TP
                                            (sqbkt (Var "rs" (FTy 5))
                                                   (Var "rt" (FTy 5))
                                                   (Var "immediate" F16)))))))
                             (Const "ReservedInstruction"
                               CTy"instruction")))
                         (bVar"b'1"
                           (ITB
                             (sqbkt (bVar"b'0"
                                      (ITB
                                        (sqbkt ((Bop And
                                                   (Mop Not bVar"b'4")
                                                   (Bop And
                                                     (Mop Not bVar"b'3")
                                                     bVar"b'2"))
                                                 (Call "Branch"
                                                   CTy"instruction"
                                                   (Call "BGTZ"
                                                     CTy"Branch"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var
                                                                "immediate"
                                                                F16))))))
                                               ((Bop And
                                                   (Mop Not bVar"b'4")
                                                   (Bop And bVar"b'3"
                                                     (Mop Not bVar"b'2")))
                                                 (Call "ArithI"
                                                   CTy"instruction"
                                                   (Call "SLTIU"
                                                     CTy"ArithI"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var
                                                                "immediate"
                                                                F16))))))
                                               ((Bop And
                                                   (Mop Not bVar"b'4")
                                                   (Bop And bVar"b'3"
                                                     bVar"b'2"))
                                                 (Call "ArithI"
                                                   CTy"instruction"
                                                   (Call "LUI" CTy"ArithI"
                                                     (TP
                                                       (sqbkt (Var "rt"
                                                                (FTy 5))
                                                              (Var
                                                                "immediate"
                                                                F16))))))
                                               ((Bop And bVar"b'4"
                                                   (Bop And
                                                     (Mop Not bVar"b'3")
                                                     bVar"b'2"))
                                                 (Call "Branch"
                                                   CTy"instruction"
                                                   (Call "BGTZL"
                                                     CTy"Branch"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var
                                                                "immediate"
                                                                F16))))))
                                               ((Bop And bVar"b'4"
                                                   (Bop And bVar"b'3"
                                                     (Mop Not bVar"b'2")))
                                                 (Call "Load"
                                                   CTy"instruction"
                                                   (Call "LDR" CTy"Load"
                                                     (TP
                                                       (sqbkt (Var "rs"
                                                                (FTy 5))
                                                              (Var "rt"
                                                                (FTy 5))
                                                              (Var
                                                                "immediate"
                                                                F16)))))))
                                        (Const "ReservedInstruction"
                                          CTy"instruction")))
                                    ((Bop And (Mop Not bVar"b'4")
                                        (Bop And (Mop Not bVar"b'3")
                                          bVar"b'2"))
                                      (Call "Branch" CTy"instruction"
                                        (Call "BLEZ" CTy"Branch"
                                          (TP
                                            (sqbkt (Var "rs" (FTy 5))
                                                   (Var "immediate" F16))))))
                                    ((Bop And (Mop Not bVar"b'4")
                                        (Bop And bVar"b'3"
                                          (Mop Not bVar"b'2")))
                                      (Call "ArithI" CTy"instruction"
                                        (Call "SLTI" CTy"ArithI"
                                          (TP
                                            (sqbkt (Var "rs" (FTy 5))
                                                   (Var "rt" (FTy 5))
                                                   (Var "immediate" F16))))))
                                    ((Bop And (Mop Not bVar"b'4")
                                        (Bop And bVar"b'3" bVar"b'2"))
                                      (Call "ArithI" CTy"instruction"
                                        (Call "XORI" CTy"ArithI"
                                          (TP
                                            (sqbkt (Var "rs" (FTy 5))
                                                   (Var "rt" (FTy 5))
                                                   (Var "immediate" F16))))))
                                    ((Bop And bVar"b'4"
                                        (Bop And (Mop Not bVar"b'3")
                                          bVar"b'2"))
                                      (Call "Branch" CTy"instruction"
                                        (Call "BLEZL" CTy"Branch"
                                          (TP
                                            (sqbkt (Var "rs" (FTy 5))
                                                   (Var "immediate" F16))))))
                                    ((Bop And bVar"b'4"
                                        (Bop And bVar"b'3"
                                          (Mop Not bVar"b'2")))
                                      (Call "Load" CTy"instruction"
                                        (Call "LDL" CTy"Load"
                                          (TP
                                            (sqbkt (Var "rs" (FTy 5))
                                                   (Var "rt" (FTy 5))
                                                   (Var "immediate" F16)))))))
                             (Const "ReservedInstruction"
                               CTy"instruction")))
                         (bVar"b'0"
                           (ITB
                             (sqbkt ((Bop And (Mop Not bVar"b'4")
                                        (Bop And (Mop Not bVar"b'3")
                                          bVar"b'2"))
                                      (Call "Branch" CTy"instruction"
                                        (Call "BNE" CTy"Branch"
                                          (TP
                                            (sqbkt (Var "rs" (FTy 5))
                                                   (Var "rt" (FTy 5))
                                                   (Var "immediate" F16))))))
                                    ((Bop And (Mop Not bVar"b'4")
                                        (Bop And bVar"b'3"
                                          (Mop Not bVar"b'2")))
                                      (Call "ArithI" CTy"instruction"
                                        (Call "ADDIU" CTy"ArithI"
                                          (TP
                                            (sqbkt (Var "rs" (FTy 5))
                                                   (Var "rt" (FTy 5))
                                                   (Var "immediate" F16))))))
                                    ((Bop And (Mop Not bVar"b'4")
                                        (Bop And bVar"b'3" bVar"b'2"))
                                      (Call "ArithI" CTy"instruction"
                                        (Call "ORI" CTy"ArithI"
                                          (TP
                                            (sqbkt (Var "rs" (FTy 5))
                                                   (Var "rt" (FTy 5))
                                                   (Var "immediate" F16))))))
                                    ((Bop And bVar"b'4"
                                        (Bop And (Mop Not bVar"b'3")
                                          bVar"b'2"))
                                      (Call "Branch" CTy"instruction"
                                        (Call "BNEL" CTy"Branch"
                                          (TP
                                            (sqbkt (Var "rs" (FTy 5))
                                                   (Var "rt" (FTy 5))
                                                   (Var "immediate" F16))))))
                                    ((Bop And bVar"b'4"
                                        (Bop And bVar"b'3"
                                          (Mop Not bVar"b'2")))
                                      (Call "ArithI" CTy"instruction"
                                        (Call "DADDIU" CTy"ArithI"
                                          (TP
                                            (sqbkt (Var "rs" (FTy 5))
                                                   (Var "rt" (FTy 5))
                                                   (Var "immediate" F16)))))))
                             (Const "ReservedInstruction"
                               CTy"instruction")))
                         ((Bop And (Mop Not bVar"b'4")
                             (Bop And (Mop Not bVar"b'3") bVar"b'2"))
                           (Call "Branch" CTy"instruction"
                             (Call "BEQ" CTy"Branch"
                               (TP
                                 (sqbkt (Var "rs" (FTy 5))
                                        (Var "rt" (FTy 5))
                                        (Var "immediate" F16))))))
                         ((Bop And (Mop Not bVar"b'4")
                             (Bop And bVar"b'3" (Mop Not bVar"b'2")))
                           (Call "ArithI" CTy"instruction"
                             (Call "ADDI" CTy"ArithI"
                               (TP
                                 (sqbkt (Var "rs" (FTy 5))
                                        (Var "rt" (FTy 5))
                                        (Var "immediate" F16))))))
                         ((Bop And (Mop Not bVar"b'4")
                             (Bop And bVar"b'3" bVar"b'2"))
                           (Call "ArithI" CTy"instruction"
                             (Call "ANDI" CTy"ArithI"
                               (TP
                                 (sqbkt (Var "rs" (FTy 5))
                                        (Var "rt" (FTy 5))
                                        (Var "immediate" F16))))))
                         ((Bop And bVar"b'4"
                             (Bop And (Mop Not bVar"b'3") bVar"b'2"))
                           (Call "Branch" CTy"instruction"
                             (Call "BEQL" CTy"Branch"
                               (TP
                                 (sqbkt (Var "rs" (FTy 5))
                                        (Var "rt" (FTy 5))
                                        (Var "immediate" F16))))))
                         ((Bop And bVar"b'4"
                             (Bop And bVar"b'3" (Mop Not bVar"b'2")))
                           (Call "ArithI" CTy"instruction"
                             (Call "DADDI" CTy"ArithI"
                               (TP
                                 (sqbkt (Var "rs" (FTy 5))
                                        (Var "rt" (FTy 5))
                                        (Var "immediate" F16)))))))
                  (Const "ReservedInstruction" CTy"instruction")))))))
      (Let (Var "rt" (FTy 5)) (EX (Var "w" F32) (LN 20) (LN 16) (FTy 5))
        (Let (Var "rs" (FTy 5)) (EX (Var "w" F32) (LN 25) (LN 21) (FTy 5))
          (Let (Var "immediate" F16) (EX (Var "w" F32) (LN 15) (LN 0) F16)
            (Let
              (TP
                (sqbkt bVar"b'5" bVar"b'4" bVar"b'3" bVar"b'2" bVar"b'1"
                       bVar"b'0"))
              (BL 6 (EX (Var "w" F32) (LN 31) (LN 26) (FTy 6)))
              (ITB
                (sqbkt (bVar"b'5"
                         (ITB
                           (sqbkt (bVar"b'2"
                                    (ITB
                                      (sqbkt (bVar"b'3"
                                               (ITB
                                                 (sqbkt ((Bop And
                                                            (Mop Not
                                                              bVar"b'4")
                                                            (Bop And
                                                              (Mop Not
                                                                bVar"b'1")
                                                              (Mop Not
                                                                bVar"b'0")))
                                                          (Call "Store"
                                                            CTy"instruction"
                                                            (Call "SDL"
                                                              CTy"Store"
                                                              (TP
                                                                (sqbkt (Var
                                                                         "rs"
                                                                         (FTy
                                                                           5))
                                                                       (Var
                                                                         "rt"
                                                                         (FTy
                                                                           5))
                                                                       (Var
                                                                         "immediate"
                                                                         F16))))))
                                                        ((Bop And
                                                            (Mop Not
                                                              bVar"b'4")
                                                            (Bop And
                                                              (Mop Not
                                                                bVar"b'1")
                                                              bVar"b'0"))
                                                          (Call "Store"
                                                            CTy"instruction"
                                                            (Call "SDR"
                                                              CTy"Store"
                                                              (TP
                                                                (sqbkt (Var
                                                                         "rs"
                                                                         (FTy
                                                                           5))
                                                                       (Var
                                                                         "rt"
                                                                         (FTy
                                                                           5))
                                                                       (Var
                                                                         "immediate"
                                                                         F16))))))
                                                        ((Bop And
                                                            (Mop Not
                                                              bVar"b'4")
                                                            (Bop And
                                                              bVar"b'1"
                                                              (Mop Not
                                                                bVar"b'0")))
                                                          (Call "Store"
                                                            CTy"instruction"
                                                            (Call "SWR"
                                                              CTy"Store"
                                                              (TP
                                                                (sqbkt (Var
                                                                         "rs"
                                                                         (FTy
                                                                           5))
                                                                       (Var
                                                                         "rt"
                                                                         (FTy
                                                                           5))
                                                                       (Var
                                                                         "immediate"
                                                                         F16))))))
                                                        ((Bop And
                                                            bVar"b'4"
                                                            (Bop And
                                                              (Mop Not
                                                                bVar"b'1")
                                                              (Mop Not
                                                                bVar"b'0")))
                                                          (Call "Store"
                                                            CTy"instruction"
                                                            (Call "SCD"
                                                              CTy"Store"
                                                              (TP
                                                                (sqbkt (Var
                                                                         "rs"
                                                                         (FTy
                                                                           5))
                                                                       (Var
                                                                         "rt"
                                                                         (FTy
                                                                           5))
                                                                       (Var
                                                                         "immediate"
                                                                         F16))))))
                                                        ((Bop And
                                                            bVar"b'4"
                                                            (Bop And
                                                              bVar"b'1"
                                                              bVar"b'0"))
                                                          (Call "Store"
                                                            CTy"instruction"
                                                            (Call "SD"
                                                              CTy"Store"
                                                              (TP
                                                                (sqbkt (Var
                                                                         "rs"
                                                                         (FTy
                                                                           5))
                                                                       (Var
                                                                         "rt"
                                                                         (FTy
                                                                           5))
                                                                       (Var
                                                                         "immediate"
                                                                         F16)))))))
                                                 (Const
                                                   "ReservedInstruction"
                                                   CTy"instruction")))
                                             ((Bop And (Mop Not bVar"b'4")
                                                 (Bop And
                                                   (Mop Not bVar"b'1")
                                                   (Mop Not bVar"b'0")))
                                               (Call "Load"
                                                 CTy"instruction"
                                                 (Call "LBU" CTy"Load"
                                                   (TP
                                                     (sqbkt (Var "rs"
                                                              (FTy 5))
                                                            (Var "rt"
                                                              (FTy 5))
                                                            (Var
                                                              "immediate"
                                                              F16))))))
                                             ((Bop And (Mop Not bVar"b'4")
                                                 (Bop And
                                                   (Mop Not bVar"b'1")
                                                   bVar"b'0"))
                                               (Call "Load"
                                                 CTy"instruction"
                                                 (Call "LHU" CTy"Load"
                                                   (TP
                                                     (sqbkt (Var "rs"
                                                              (FTy 5))
                                                            (Var "rt"
                                                              (FTy 5))
                                                            (Var
                                                              "immediate"
                                                              F16))))))
                                             ((Bop And (Mop Not bVar"b'4")
                                                 (Bop And bVar"b'1"
                                                   (Mop Not bVar"b'0")))
                                               (Call "Load"
                                                 CTy"instruction"
                                                 (Call "LWR" CTy"Load"
                                                   (TP
                                                     (sqbkt (Var "rs"
                                                              (FTy 5))
                                                            (Var "rt"
                                                              (FTy 5))
                                                            (Var
                                                              "immediate"
                                                              F16))))))
                                             ((Bop And (Mop Not bVar"b'4")
                                                 (Bop And bVar"b'1"
                                                   bVar"b'0"))
                                               (Call "Load"
                                                 CTy"instruction"
                                                 (Call "LWU" CTy"Load"
                                                   (TP
                                                     (sqbkt (Var "rs"
                                                              (FTy 5))
                                                            (Var "rt"
                                                              (FTy 5))
                                                            (Var
                                                              "immediate"
                                                              F16))))))
                                             ((Bop And bVar"b'4"
                                                 (Bop And
                                                   (Mop Not bVar"b'1")
                                                   (Mop Not bVar"b'0")))
                                               (Call "Load"
                                                 CTy"instruction"
                                                 (Call "LLD" CTy"Load"
                                                   (TP
                                                     (sqbkt (Var "rs"
                                                              (FTy 5))
                                                            (Var "rt"
                                                              (FTy 5))
                                                            (Var
                                                              "immediate"
                                                              F16))))))
                                             ((Bop And bVar"b'4"
                                                 (Bop And bVar"b'1"
                                                   bVar"b'0"))
                                               (Call "Load"
                                                 CTy"instruction"
                                                 (Call "LD" CTy"Load"
                                                   (TP
                                                     (sqbkt (Var "rs"
                                                              (FTy 5))
                                                            (Var "rt"
                                                              (FTy 5))
                                                            (Var
                                                              "immediate"
                                                              F16)))))))
                                      (Const "ReservedInstruction"
                                        CTy"instruction")))
                                  (bVar"b'3"
                                    (ITB
                                      (sqbkt ((Bop And (Mop Not bVar"b'4")
                                                 (Bop And
                                                   (Mop Not bVar"b'1")
                                                   (Mop Not bVar"b'0")))
                                               (Call "Store"
                                                 CTy"instruction"
                                                 (Call "SB" CTy"Store"
                                                   (TP
                                                     (sqbkt (Var "rs"
                                                              (FTy 5))
                                                            (Var "rt"
                                                              (FTy 5))
                                                            (Var
                                                              "immediate"
                                                              F16))))))
                                             ((Bop And (Mop Not bVar"b'4")
                                                 (Bop And
                                                   (Mop Not bVar"b'1")
                                                   bVar"b'0"))
                                               (Call "Store"
                                                 CTy"instruction"
                                                 (Call "SH" CTy"Store"
                                                   (TP
                                                     (sqbkt (Var "rs"
                                                              (FTy 5))
                                                            (Var "rt"
                                                              (FTy 5))
                                                            (Var
                                                              "immediate"
                                                              F16))))))
                                             ((Bop And (Mop Not bVar"b'4")
                                                 (Bop And bVar"b'1"
                                                   (Mop Not bVar"b'0")))
                                               (Call "Store"
                                                 CTy"instruction"
                                                 (Call "SWL" CTy"Store"
                                                   (TP
                                                     (sqbkt (Var "rs"
                                                              (FTy 5))
                                                            (Var "rt"
                                                              (FTy 5))
                                                            (Var
                                                              "immediate"
                                                              F16))))))
                                             ((Bop And (Mop Not bVar"b'4")
                                                 (Bop And bVar"b'1"
                                                   bVar"b'0"))
                                               (Call "Store"
                                                 CTy"instruction"
                                                 (Call "SW" CTy"Store"
                                                   (TP
                                                     (sqbkt (Var "rs"
                                                              (FTy 5))
                                                            (Var "rt"
                                                              (FTy 5))
                                                            (Var
                                                              "immediate"
                                                              F16))))))
                                             ((Bop And bVar"b'4"
                                                 (Bop And
                                                   (Mop Not bVar"b'1")
                                                   (Mop Not bVar"b'0")))
                                               (Call "Store"
                                                 CTy"instruction"
                                                 (Call "SC" CTy"Store"
                                                   (TP
                                                     (sqbkt (Var "rs"
                                                              (FTy 5))
                                                            (Var "rt"
                                                              (FTy 5))
                                                            (Var
                                                              "immediate"
                                                              F16)))))))
                                      (Const "ReservedInstruction"
                                        CTy"instruction")))
                                  ((Bop And (Mop Not bVar"b'4")
                                      (Bop And (Mop Not bVar"b'1")
                                        (Mop Not bVar"b'0")))
                                    (Call "Load" CTy"instruction"
                                      (Call "LB" CTy"Load"
                                        (TP
                                          (sqbkt (Var "rs" (FTy 5))
                                                 (Var "rt" (FTy 5))
                                                 (Var "immediate" F16))))))
                                  ((Bop And (Mop Not bVar"b'4")
                                      (Bop And (Mop Not bVar"b'1")
                                        bVar"b'0"))
                                    (Call "Load" CTy"instruction"
                                      (Call "LH" CTy"Load"
                                        (TP
                                          (sqbkt (Var "rs" (FTy 5))
                                                 (Var "rt" (FTy 5))
                                                 (Var "immediate" F16))))))
                                  ((Bop And (Mop Not bVar"b'4")
                                      (Bop And bVar"b'1"
                                        (Mop Not bVar"b'0")))
                                    (Call "Load" CTy"instruction"
                                      (Call "LWL" CTy"Load"
                                        (TP
                                          (sqbkt (Var "rs" (FTy 5))
                                                 (Var "rt" (FTy 5))
                                                 (Var "immediate" F16))))))
                                  ((Bop And (Mop Not bVar"b'4")
                                      (Bop And bVar"b'1" bVar"b'0"))
                                    (Call "Load" CTy"instruction"
                                      (Call "LW" CTy"Load"
                                        (TP
                                          (sqbkt (Var "rs" (FTy 5))
                                                 (Var "rt" (FTy 5))
                                                 (Var "immediate" F16))))))
                                  ((Bop And bVar"b'4"
                                      (Bop And (Mop Not bVar"b'1")
                                        (Mop Not bVar"b'0")))
                                    (Call "Load" CTy"instruction"
                                      (Call "LL" CTy"Load"
                                        (TP
                                          (sqbkt (Var "rs" (FTy 5))
                                                 (Var "rt" (FTy 5))
                                                 (Var "immediate" F16)))))))
                           (Const "ReservedInstruction" CTy"instruction")))
                       (bVar"b'1"
                         (ITB
                           (sqbkt (bVar"b'0"
                                    (ITB
                                      (sqbkt ((Bop And (Mop Not bVar"b'4")
                                                 (Bop And
                                                   (Mop Not bVar"b'3")
                                                   bVar"b'2"))
                                               (Call "Branch"
                                                 CTy"instruction"
                                                 (Call "BGTZ" CTy"Branch"
                                                   (TP
                                                     (sqbkt (Var "rs"
                                                              (FTy 5))
                                                            (Var
                                                              "immediate"
                                                              F16))))))
                                             ((Bop And (Mop Not bVar"b'4")
                                                 (Bop And bVar"b'3"
                                                   (Mop Not bVar"b'2")))
                                               (Call "ArithI"
                                                 CTy"instruction"
                                                 (Call "SLTIU" CTy"ArithI"
                                                   (TP
                                                     (sqbkt (Var "rs"
                                                              (FTy 5))
                                                            (Var "rt"
                                                              (FTy 5))
                                                            (Var
                                                              "immediate"
                                                              F16))))))
                                             ((Bop And (Mop Not bVar"b'4")
                                                 (Bop And bVar"b'3"
                                                   bVar"b'2"))
                                               (Call "ArithI"
                                                 CTy"instruction"
                                                 (Call "LUI" CTy"ArithI"
                                                   (TP
                                                     (sqbkt (Var "rt"
                                                              (FTy 5))
                                                            (Var
                                                              "immediate"
                                                              F16))))))
                                             ((Bop And bVar"b'4"
                                                 (Bop And
                                                   (Mop Not bVar"b'3")
                                                   bVar"b'2"))
                                               (Call "Branch"
                                                 CTy"instruction"
                                                 (Call "BGTZL" CTy"Branch"
                                                   (TP
                                                     (sqbkt (Var "rs"
                                                              (FTy 5))
                                                            (Var
                                                              "immediate"
                                                              F16))))))
                                             ((Bop And bVar"b'4"
                                                 (Bop And bVar"b'3"
                                                   (Mop Not bVar"b'2")))
                                               (Call "Load"
                                                 CTy"instruction"
                                                 (Call "LDR" CTy"Load"
                                                   (TP
                                                     (sqbkt (Var "rs"
                                                              (FTy 5))
                                                            (Var "rt"
                                                              (FTy 5))
                                                            (Var
                                                              "immediate"
                                                              F16)))))))
                                      (Const "ReservedInstruction"
                                        CTy"instruction")))
                                  ((Bop And (Mop Not bVar"b'4")
                                      (Bop And (Mop Not bVar"b'3")
                                        bVar"b'2"))
                                    (Call "Branch" CTy"instruction"
                                      (Call "BLEZ" CTy"Branch"
                                        (TP
                                          (sqbkt (Var "rs" (FTy 5))
                                                 (Var "immediate" F16))))))
                                  ((Bop And (Mop Not bVar"b'4")
                                      (Bop And bVar"b'3"
                                        (Mop Not bVar"b'2")))
                                    (Call "ArithI" CTy"instruction"
                                      (Call "SLTI" CTy"ArithI"
                                        (TP
                                          (sqbkt (Var "rs" (FTy 5))
                                                 (Var "rt" (FTy 5))
                                                 (Var "immediate" F16))))))
                                  ((Bop And (Mop Not bVar"b'4")
                                      (Bop And bVar"b'3" bVar"b'2"))
                                    (Call "ArithI" CTy"instruction"
                                      (Call "XORI" CTy"ArithI"
                                        (TP
                                          (sqbkt (Var "rs" (FTy 5))
                                                 (Var "rt" (FTy 5))
                                                 (Var "immediate" F16))))))
                                  ((Bop And bVar"b'4"
                                      (Bop And (Mop Not bVar"b'3")
                                        bVar"b'2"))
                                    (Call "Branch" CTy"instruction"
                                      (Call "BLEZL" CTy"Branch"
                                        (TP
                                          (sqbkt (Var "rs" (FTy 5))
                                                 (Var "immediate" F16))))))
                                  ((Bop And bVar"b'4"
                                      (Bop And bVar"b'3"
                                        (Mop Not bVar"b'2")))
                                    (Call "Load" CTy"instruction"
                                      (Call "LDL" CTy"Load"
                                        (TP
                                          (sqbkt (Var "rs" (FTy 5))
                                                 (Var "rt" (FTy 5))
                                                 (Var "immediate" F16)))))))
                           (Const "ReservedInstruction" CTy"instruction")))
                       (bVar"b'0"
                         (ITB
                           (sqbkt ((Bop And (Mop Not bVar"b'4")
                                      (Bop And (Mop Not bVar"b'3")
                                        bVar"b'2"))
                                    (Call "Branch" CTy"instruction"
                                      (Call "BNE" CTy"Branch"
                                        (TP
                                          (sqbkt (Var "rs" (FTy 5))
                                                 (Var "rt" (FTy 5))
                                                 (Var "immediate" F16))))))
                                  ((Bop And (Mop Not bVar"b'4")
                                      (Bop And bVar"b'3"
                                        (Mop Not bVar"b'2")))
                                    (Call "ArithI" CTy"instruction"
                                      (Call "ADDIU" CTy"ArithI"
                                        (TP
                                          (sqbkt (Var "rs" (FTy 5))
                                                 (Var "rt" (FTy 5))
                                                 (Var "immediate" F16))))))
                                  ((Bop And (Mop Not bVar"b'4")
                                      (Bop And bVar"b'3" bVar"b'2"))
                                    (Call "ArithI" CTy"instruction"
                                      (Call "ORI" CTy"ArithI"
                                        (TP
                                          (sqbkt (Var "rs" (FTy 5))
                                                 (Var "rt" (FTy 5))
                                                 (Var "immediate" F16))))))
                                  ((Bop And bVar"b'4"
                                      (Bop And (Mop Not bVar"b'3")
                                        bVar"b'2"))
                                    (Call "Branch" CTy"instruction"
                                      (Call "BNEL" CTy"Branch"
                                        (TP
                                          (sqbkt (Var "rs" (FTy 5))
                                                 (Var "rt" (FTy 5))
                                                 (Var "immediate" F16))))))
                                  ((Bop And bVar"b'4"
                                      (Bop And bVar"b'3"
                                        (Mop Not bVar"b'2")))
                                    (Call "ArithI" CTy"instruction"
                                      (Call "DADDIU" CTy"ArithI"
                                        (TP
                                          (sqbkt (Var "rs" (FTy 5))
                                                 (Var "rt" (FTy 5))
                                                 (Var "immediate" F16)))))))
                           (Const "ReservedInstruction" CTy"instruction")))
                       ((Bop And (Mop Not bVar"b'4")
                           (Bop And (Mop Not bVar"b'3") bVar"b'2"))
                         (Call "Branch" CTy"instruction"
                           (Call "BEQ" CTy"Branch"
                             (TP
                               (sqbkt (Var "rs" (FTy 5))
                                      (Var "rt" (FTy 5))
                                      (Var "immediate" F16))))))
                       ((Bop And (Mop Not bVar"b'4")
                           (Bop And bVar"b'3" (Mop Not bVar"b'2")))
                         (Call "ArithI" CTy"instruction"
                           (Call "ADDI" CTy"ArithI"
                             (TP
                               (sqbkt (Var "rs" (FTy 5))
                                      (Var "rt" (FTy 5))
                                      (Var "immediate" F16))))))
                       ((Bop And (Mop Not bVar"b'4")
                           (Bop And bVar"b'3" bVar"b'2"))
                         (Call "ArithI" CTy"instruction"
                           (Call "ANDI" CTy"ArithI"
                             (TP
                               (sqbkt (Var "rs" (FTy 5))
                                      (Var "rt" (FTy 5))
                                      (Var "immediate" F16))))))
                       ((Bop And bVar"b'4"
                           (Bop And (Mop Not bVar"b'3") bVar"b'2"))
                         (Call "Branch" CTy"instruction"
                           (Call "BEQL" CTy"Branch"
                             (TP
                               (sqbkt (Var "rs" (FTy 5))
                                      (Var "rt" (FTy 5))
                                      (Var "immediate" F16))))))
                       ((Bop And bVar"b'4"
                           (Bop And bVar"b'3" (Mop Not bVar"b'2")))
                         (Call "ArithI" CTy"instruction"
                           (Call "DADDI" CTy"ArithI"
                             (TP
                               (sqbkt (Var "rs" (FTy 5))
                                      (Var "rt" (FTy 5))
                                      (Var "immediate" F16)))))))
                (Const "ReservedInstruction" CTy"instruction")))))))))


(Def "Fetch" qVar"state"
  (Let (Var "v" F64) (Dest "PC" F64 qVar"state")
    (Let (TP (sqbkt (Var "pAddr" F64) (Var "CCA" (FTy 3))))
      (Call "AddressTranslation" (PTy F64 (FTy 3))
        (TP
          (sqbkt (Var "v" F64) (LC "INSTRUCTION" CTy"IorD")
                 (LC "LOAD" CTy"LorS"))))
      (Let (Var "v0" (FTy 3))
        (Bop BXor (EX (Var "v" F64) (LN 2) (LN 0) (FTy 3))
          (CC(sqbkt (Mop Fst
                      (Apply (Const "BigEndianCPU" (ATy qTy (PTy F1 qTy)))
                        qVar"state")) (LW 0 2))))
        (TP
          (sqbkt (EX
                   (Mop Fst
                     (Apply
                       (Call "LoadMemory" (ATy qTy (PTy F64 qTy))
                         (TP
                           (sqbkt (Var "CCA" (FTy 3))
                                  (Const "WORD" (FTy 3)) (Var "pAddr" F64)
                                  (Var "v" F64)
                                  (LC "INSTRUCTION" CTy"IorD"))))
                       qVar"state"))
                   (Bop Add (LN 31)
                     (Bop Mul (LN 8) (Mop (Cast nTy) (Var "v0" (FTy 3)))))
                   (Bop Mul (LN 8) (Mop (Cast nTy) (Var "v0" (FTy 3))))
                   F32) qVar"state"))))))


(Def "Next" qVar"state"
  (Let qVar"s"
    (Mop Snd
      (Apply
        (Call "Run" (ATy qTy (PTy uTy qTy))
          (Call "Decode" CTy"instruction"
            (Mop Fst
              (Apply (Const "Fetch" (ATy qTy (PTy F32 qTy))) qVar"state"))))
        (Rupd "BranchStatus" (TP (sqbkt qVar"state" (LO F64))))))
    (Let qVar"s"
      (CS (Dest "BranchStatus" (OTy F64) qVar"state")
        (sqbkt ((Mop Some (Var "addr" F64))
                 (ITE (Mop IsSome (Dest "BranchStatus" (OTy F64) qVar"s"))
                   (Mop Snd
                     (Apply
                       (Call "raise'exception" (ATy qTy (PTy uTy qTy))
                         (Call "UNPREDICTABLE" CTy"exception"
                           (LS"Branch follows branch"))) qVar"s"))
                   (Rupd "PC" (TP (sqbkt qVar"s" (Var "addr" F64))))))
               ((LO F64) qVar"s")))
      (Let qVar"s"
        (Rupd "PC"
          (TP (sqbkt qVar"s" (Bop Add (Dest "PC" F64 qVar"s") (LW 4 64)))))
        (TP
          (sqbkt LU
                 (Rupd "CP0"
                   (TP
                     (sqbkt qVar"s"
                            (Rupd "Count"
                              (TP
                                (sqbkt (Dest "CP0" CTy"CP0" qVar"s")
                                       (Bop Add
                                         (Dest "Count" F32
                                           (Dest "CP0" CTy"CP0" qVar"s"))
                                         (LW 1 32))))))))))))))
