(*Generated by Sail from riscv.*)
Require Import Sail2_instr_kinds.
Require Import Sail2_values.
Require Import Sail2_string.
Require Import Sail2_real.
Require Import Sail2_operators_mwords.
Require Import Sail2_prompt_monad.
Require Import Sail2_prompt.
Require Import Sail2_state.
Import ListNotations.
Definition bits (n : Z) : Type := mword n.

Inductive regfp  :=
  | RFull : string -> regfp
  | RSlice : (string * {n : Z & ArithFact (n >= 0)} * {n : Z & ArithFact (n >= 0)}) -> regfp
  | RSliceBit : (string * {n : Z & ArithFact (n >= 0)}) -> regfp
  | RField : (string * string) -> regfp.
Arguments regfp : clear implicits.

Definition regfps  : Type := list regfp.

Inductive niafp  :=
  | NIAFP_successor : unit -> niafp
  | NIAFP_concrete_address : bits 64 -> niafp
  | NIAFP_indirect_address : unit -> niafp.
Arguments niafp : clear implicits.

Definition niafps  : Type := list niafp.

Inductive diafp  :=
  | DIAFP_none : unit -> diafp | DIAFP_concrete : bits 64 -> diafp | DIAFP_reg : regfp -> diafp.
Arguments diafp : clear implicits.

Inductive a64_barrier_domain := A64_FullShare | A64_InnerShare | A64_OuterShare | A64_NonShare.
Scheme Equality for a64_barrier_domain.
Instance Decidable_eq_a64_barrier_domain :
forall (x y : a64_barrier_domain), Decidable (x = y) :=
Decidable_eq_from_dec a64_barrier_domain_eq_dec.

Inductive a64_barrier_type := A64_barrier_all | A64_barrier_LD | A64_barrier_ST.
Scheme Equality for a64_barrier_type.
Instance Decidable_eq_a64_barrier_type :
forall (x y : a64_barrier_type), Decidable (x = y) :=
Decidable_eq_from_dec a64_barrier_type_eq_dec.

Inductive cache_op_kind :=
  Cache_op_D_IVAC
  | Cache_op_D_ISW
  | Cache_op_D_CSW
  | Cache_op_D_CISW
  | Cache_op_D_ZVA
  | Cache_op_D_CVAC
  | Cache_op_D_CVAU
  | Cache_op_D_CIVAC
  | Cache_op_I_IALLUIS
  | Cache_op_I_IALLU
  | Cache_op_I_IVAU.
Scheme Equality for cache_op_kind.
Instance Decidable_eq_cache_op_kind :
forall (x y : cache_op_kind), Decidable (x = y) :=
Decidable_eq_from_dec cache_op_kind_eq_dec.

Definition xlen  : Z := 64.
Hint Unfold xlen : sail.

Definition xlen_bytes  : Z := 8.
Hint Unfold xlen_bytes : sail.

Definition xlenbits  : Type := bits 64.

Definition mem_meta  : Type := unit.

Definition max_mem_access  : Z := 16.
Hint Unfold max_mem_access : sail.

Definition half  : Type := bits 16.

Definition word  : Type := bits 32.

Definition regidx  : Type := bits 5.

Definition cregidx  : Type := bits 3.

Definition csreg  : Type := bits 12.

Definition regno (n : Z)`{ArithFact (0 <= n /\ n < 32)} : Type := Z.

Definition opcode  : Type := bits 7.

Definition imm12  : Type := bits 12.

Definition imm20  : Type := bits 20.

Definition amo  : Type := bits 1.

Inductive Architecture := RV32 | RV64 | RV128.
Scheme Equality for Architecture.
Instance Decidable_eq_Architecture :
forall (x y : Architecture), Decidable (x = y) :=
Decidable_eq_from_dec Architecture_eq_dec.

Definition arch_xlen  : Type := bits 2.

Definition priv_level  : Type := bits 2.

Inductive Privilege := User | Supervisor | Machine.
Scheme Equality for Privilege.
Instance Decidable_eq_Privilege :
forall (x y : Privilege), Decidable (x = y) :=
Decidable_eq_from_dec Privilege_eq_dec.

Inductive amoop := AMOSWAP | AMOADD | AMOXOR | AMOAND | AMOOR | AMOMIN | AMOMAX | AMOMINU | AMOMAXU.
Scheme Equality for amoop.
Instance Decidable_eq_amoop :
forall (x y : amoop), Decidable (x = y) :=
Decidable_eq_from_dec amoop_eq_dec.

Inductive bop := RISCV_BEQ | RISCV_BNE | RISCV_BLT | RISCV_BGE | RISCV_BLTU | RISCV_BGEU.
Scheme Equality for bop.
Instance Decidable_eq_bop :
forall (x y : bop), Decidable (x = y) :=
Decidable_eq_from_dec bop_eq_dec.

Inductive csrop := CSRRW | CSRRS | CSRRC.
Scheme Equality for csrop.
Instance Decidable_eq_csrop :
forall (x y : csrop), Decidable (x = y) :=
Decidable_eq_from_dec csrop_eq_dec.

Inductive iop := RISCV_ADDI | RISCV_SLTI | RISCV_SLTIU | RISCV_XORI | RISCV_ORI | RISCV_ANDI.
Scheme Equality for iop.
Instance Decidable_eq_iop :
forall (x y : iop), Decidable (x = y) :=
Decidable_eq_from_dec iop_eq_dec.

Inductive rop :=
  RISCV_ADD
  | RISCV_SUB
  | RISCV_SLL
  | RISCV_SLT
  | RISCV_SLTU
  | RISCV_XOR
  | RISCV_SRL
  | RISCV_SRA
  | RISCV_OR
  | RISCV_AND.
Scheme Equality for rop.
Instance Decidable_eq_rop :
forall (x y : rop), Decidable (x = y) :=
Decidable_eq_from_dec rop_eq_dec.

Inductive ropw := RISCV_ADDW | RISCV_SUBW | RISCV_SLLW | RISCV_SRLW | RISCV_SRAW.
Scheme Equality for ropw.
Instance Decidable_eq_ropw :
forall (x y : ropw), Decidable (x = y) :=
Decidable_eq_from_dec ropw_eq_dec.

Inductive sop := RISCV_SLLI | RISCV_SRLI | RISCV_SRAI.
Scheme Equality for sop.
Instance Decidable_eq_sop :
forall (x y : sop), Decidable (x = y) :=
Decidable_eq_from_dec sop_eq_dec.

Inductive sopw := RISCV_SLLIW | RISCV_SRLIW | RISCV_SRAIW.
Scheme Equality for sopw.
Instance Decidable_eq_sopw :
forall (x y : sopw), Decidable (x = y) :=
Decidable_eq_from_dec sopw_eq_dec.

Inductive uop := RISCV_LUI | RISCV_AUIPC.
Scheme Equality for uop.
Instance Decidable_eq_uop :
forall (x y : uop), Decidable (x = y) :=
Decidable_eq_from_dec uop_eq_dec.

Inductive word_width := BYTE | HALF | WORD | DOUBLE.
Scheme Equality for word_width.
Instance Decidable_eq_word_width :
forall (x y : word_width), Decidable (x = y) :=
Decidable_eq_from_dec word_width_eq_dec.

Inductive ast  :=
  | UTYPE : (bits 20 * regidx * uop) -> ast
  | RISCV_JAL : (bits 21 * regidx) -> ast
  | RISCV_JALR : (bits 12 * regidx * regidx) -> ast
  | BTYPE : (bits 13 * regidx * regidx * bop) -> ast
  | ITYPE : (bits 12 * regidx * regidx * iop) -> ast
  | SHIFTIOP : (bits 6 * regidx * regidx * sop) -> ast
  | RTYPE : (regidx * regidx * regidx * rop) -> ast
  | LOAD : (bits 12 * regidx * regidx * bool * word_width * bool * bool) -> ast
  | STORE : (bits 12 * regidx * regidx * word_width * bool * bool) -> ast
  | ADDIW : (bits 12 * regidx * regidx) -> ast
  | SHIFTW : (bits 5 * regidx * regidx * sop) -> ast
  | RTYPEW : (regidx * regidx * regidx * ropw) -> ast
  | SHIFTIWOP : (bits 5 * regidx * regidx * sopw) -> ast
  | FENCE : (bits 4 * bits 4) -> ast
  | FENCE_TSO : (bits 4 * bits 4) -> ast
  | FENCEI : unit -> ast
  | ECALL : unit -> ast
  | MRET : unit -> ast
  | SRET : unit -> ast
  | EBREAK : unit -> ast
  | WFI : unit -> ast
  | SFENCE_VMA : (regidx * regidx) -> ast
  | LOADRES : (bool * bool * regidx * word_width * regidx) -> ast
  | STORECON : (bool * bool * regidx * regidx * word_width * regidx) -> ast
  | AMO : (amoop * bool * bool * regidx * regidx * word_width * regidx) -> ast
  | C_NOP : unit -> ast
  | C_ADDI4SPN : (cregidx * bits 8) -> ast
  | C_LW : (bits 5 * cregidx * cregidx) -> ast
  | C_LD : (bits 5 * cregidx * cregidx) -> ast
  | C_SW : (bits 5 * cregidx * cregidx) -> ast
  | C_SD : (bits 5 * cregidx * cregidx) -> ast
  | C_ADDI : (bits 6 * regidx) -> ast
  | C_JAL : bits 11 -> ast
  | C_ADDIW : (bits 6 * regidx) -> ast
  | C_LI : (bits 6 * regidx) -> ast
  | C_ADDI16SP : bits 6 -> ast
  | C_LUI : (bits 6 * regidx) -> ast
  | C_SRLI : (bits 6 * cregidx) -> ast
  | C_SRAI : (bits 6 * cregidx) -> ast
  | C_ANDI : (bits 6 * cregidx) -> ast
  | C_SUB : (cregidx * cregidx) -> ast
  | C_XOR : (cregidx * cregidx) -> ast
  | C_OR : (cregidx * cregidx) -> ast
  | C_AND : (cregidx * cregidx) -> ast
  | C_SUBW : (cregidx * cregidx) -> ast
  | C_ADDW : (cregidx * cregidx) -> ast
  | C_J : bits 11 -> ast
  | C_BEQZ : (bits 8 * cregidx) -> ast
  | C_BNEZ : (bits 8 * cregidx) -> ast
  | C_SLLI : (bits 6 * regidx) -> ast
  | C_LWSP : (bits 6 * regidx) -> ast
  | C_LDSP : (bits 6 * regidx) -> ast
  | C_SWSP : (bits 6 * regidx) -> ast
  | C_SDSP : (bits 6 * regidx) -> ast
  | C_JR : regidx -> ast
  | C_JALR : regidx -> ast
  | C_MV : (regidx * regidx) -> ast
  | C_EBREAK : unit -> ast
  | C_ADD : (regidx * regidx) -> ast
  | MUL : (regidx * regidx * regidx * bool * bool * bool) -> ast
  | DIV : (regidx * regidx * regidx * bool) -> ast
  | REM : (regidx * regidx * regidx * bool) -> ast
  | MULW : (regidx * regidx * regidx) -> ast
  | DIVW : (regidx * regidx * regidx * bool) -> ast
  | REMW : (regidx * regidx * regidx * bool) -> ast
  | CSR : (bits 12 * regidx * regidx * bool * csrop) -> ast
  | URET : unit -> ast
  | ILLEGAL : word -> ast
  | C_ILLEGAL : half -> ast.
Arguments ast : clear implicits.

Inductive Retired := RETIRE_SUCCESS | RETIRE_FAIL.
Scheme Equality for Retired.
Instance Decidable_eq_Retired :
forall (x y : Retired), Decidable (x = y) :=
Decidable_eq_from_dec Retired_eq_dec.

Inductive AccessType := Read | Write | ReadWrite | Execute.
Scheme Equality for AccessType.
Instance Decidable_eq_AccessType :
forall (x y : AccessType), Decidable (x = y) :=
Decidable_eq_from_dec AccessType_eq_dec.

Definition exc_code  : Type := bits 8.

Inductive InterruptType :=
  I_U_Software
  | I_S_Software
  | I_M_Software
  | I_U_Timer
  | I_S_Timer
  | I_M_Timer
  | I_U_External
  | I_S_External
  | I_M_External.
Scheme Equality for InterruptType.
Instance Decidable_eq_InterruptType :
forall (x y : InterruptType), Decidable (x = y) :=
Decidable_eq_from_dec InterruptType_eq_dec.

Inductive ExceptionType :=
  E_Fetch_Addr_Align
  | E_Fetch_Access_Fault
  | E_Illegal_Instr
  | E_Breakpoint
  | E_Load_Addr_Align
  | E_Load_Access_Fault
  | E_SAMO_Addr_Align
  | E_SAMO_Access_Fault
  | E_U_EnvCall
  | E_S_EnvCall
  | E_Reserved_10
  | E_M_EnvCall
  | E_Fetch_Page_Fault
  | E_Load_Page_Fault
  | E_Reserved_14
  | E_SAMO_Page_Fault
  | E_CHERI.
Scheme Equality for ExceptionType.
Instance Decidable_eq_ExceptionType :
forall (x y : ExceptionType), Decidable (x = y) :=
Decidable_eq_from_dec ExceptionType_eq_dec.

Inductive exception  :=
  | Error_not_implemented : string -> exception | Error_internal_error : unit -> exception.
Arguments exception : clear implicits.

Definition tv_mode  : Type := bits 2.

Inductive TrapVectorMode := TV_Direct | TV_Vector | TV_Reserved.
Scheme Equality for TrapVectorMode.
Instance Decidable_eq_TrapVectorMode :
forall (x y : TrapVectorMode), Decidable (x = y) :=
Decidable_eq_from_dec TrapVectorMode_eq_dec.

Definition ext_status  : Type := bits 2.

Inductive ExtStatus := Off | Initial | Clean | Dirty.
Scheme Equality for ExtStatus.
Instance Decidable_eq_ExtStatus :
forall (x y : ExtStatus), Decidable (x = y) :=
Decidable_eq_from_dec ExtStatus_eq_dec.

Definition satp_mode  : Type := bits 4.

Inductive SATPMode := Sbare | Sv32 | Sv39 | Sv48.
Scheme Equality for SATPMode.
Instance Decidable_eq_SATPMode :
forall (x y : SATPMode), Decidable (x = y) :=
Decidable_eq_from_dec SATPMode_eq_dec.

Definition csrRW  : Type := bits 2.

Definition regtype  : Type := xlenbits.

Record Misa  := { Misa_Misa_chunk_0 : mword 64; }.
Arguments Misa : clear implicits.
Notation "{[ r 'with' 'Misa_Misa_chunk_0' := e ]}" := {| Misa_Misa_chunk_0 := e |} (only parsing).

Record SV48_PTE  := { SV48_PTE_SV48_PTE_chunk_0 : mword 64; }.
Arguments SV48_PTE : clear implicits.
Notation "{[ r 'with' 'SV48_PTE_SV48_PTE_chunk_0' := e ]}" :=
  {| SV48_PTE_SV48_PTE_chunk_0 := e |} (only parsing).

Record PTE_Bits  := { PTE_Bits_PTE_Bits_chunk_0 : mword 8; }.
Arguments PTE_Bits : clear implicits.
Notation "{[ r 'with' 'PTE_Bits_PTE_Bits_chunk_0' := e ]}" :=
  {| PTE_Bits_PTE_Bits_chunk_0 := e |} (only parsing).

Record Pmpcfg_ent  := { Pmpcfg_ent_Pmpcfg_ent_chunk_0 : mword 8; }.
Arguments Pmpcfg_ent : clear implicits.
Notation "{[ r 'with' 'Pmpcfg_ent_Pmpcfg_ent_chunk_0' := e ]}" :=
  {| Pmpcfg_ent_Pmpcfg_ent_chunk_0 := e |} (only parsing).

Record Mstatus  := { Mstatus_Mstatus_chunk_0 : mword 64; }.
Arguments Mstatus : clear implicits.
Notation "{[ r 'with' 'Mstatus_Mstatus_chunk_0' := e ]}" :=
  {| Mstatus_Mstatus_chunk_0 := e |} (only parsing).

Record Sstatus  := { Sstatus_Sstatus_chunk_0 : mword 64; }.
Arguments Sstatus : clear implicits.
Notation "{[ r 'with' 'Sstatus_Sstatus_chunk_0' := e ]}" :=
  {| Sstatus_Sstatus_chunk_0 := e |} (only parsing).

Record Ustatus  := { Ustatus_Ustatus_chunk_0 : mword 64; }.
Arguments Ustatus : clear implicits.
Notation "{[ r 'with' 'Ustatus_Ustatus_chunk_0' := e ]}" :=
  {| Ustatus_Ustatus_chunk_0 := e |} (only parsing).

Record Minterrupts  := { Minterrupts_Minterrupts_chunk_0 : mword 64; }.
Arguments Minterrupts : clear implicits.
Notation "{[ r 'with' 'Minterrupts_Minterrupts_chunk_0' := e ]}" :=
  {| Minterrupts_Minterrupts_chunk_0 := e |} (only parsing).

Record Sinterrupts  := { Sinterrupts_Sinterrupts_chunk_0 : mword 64; }.
Arguments Sinterrupts : clear implicits.
Notation "{[ r 'with' 'Sinterrupts_Sinterrupts_chunk_0' := e ]}" :=
  {| Sinterrupts_Sinterrupts_chunk_0 := e |} (only parsing).

Record Uinterrupts  := { Uinterrupts_Uinterrupts_chunk_0 : mword 64; }.
Arguments Uinterrupts : clear implicits.
Notation "{[ r 'with' 'Uinterrupts_Uinterrupts_chunk_0' := e ]}" :=
  {| Uinterrupts_Uinterrupts_chunk_0 := e |} (only parsing).

Record Medeleg  := { Medeleg_Medeleg_chunk_0 : mword 64; }.
Arguments Medeleg : clear implicits.
Notation "{[ r 'with' 'Medeleg_Medeleg_chunk_0' := e ]}" :=
  {| Medeleg_Medeleg_chunk_0 := e |} (only parsing).

Record Sedeleg  := { Sedeleg_Sedeleg_chunk_0 : mword 64; }.
Arguments Sedeleg : clear implicits.
Notation "{[ r 'with' 'Sedeleg_Sedeleg_chunk_0' := e ]}" :=
  {| Sedeleg_Sedeleg_chunk_0 := e |} (only parsing).

Record Mtvec  := { Mtvec_Mtvec_chunk_0 : mword 64; }.
Arguments Mtvec : clear implicits.
Notation "{[ r 'with' 'Mtvec_Mtvec_chunk_0' := e ]}" :=
  {| Mtvec_Mtvec_chunk_0 := e |} (only parsing).

Record Satp32  := { Satp32_Satp32_chunk_0 : mword 32; }.
Arguments Satp32 : clear implicits.
Notation "{[ r 'with' 'Satp32_Satp32_chunk_0' := e ]}" :=
  {| Satp32_Satp32_chunk_0 := e |} (only parsing).

Record Mcause  := { Mcause_Mcause_chunk_0 : mword 64; }.
Arguments Mcause : clear implicits.
Notation "{[ r 'with' 'Mcause_Mcause_chunk_0' := e ]}" :=
  {| Mcause_Mcause_chunk_0 := e |} (only parsing).

Record Counteren  := { Counteren_Counteren_chunk_0 : mword 32; }.
Arguments Counteren : clear implicits.
Notation "{[ r 'with' 'Counteren_Counteren_chunk_0' := e ]}" :=
  {| Counteren_Counteren_chunk_0 := e |} (only parsing).

Record Satp64  := { Satp64_Satp64_chunk_0 : mword 64; }.
Arguments Satp64 : clear implicits.
Notation "{[ r 'with' 'Satp64_Satp64_chunk_0' := e ]}" :=
  {| Satp64_Satp64_chunk_0 := e |} (only parsing).

Inductive PmpAddrMatchType := OFF | TOR | NA4 | NAPOT.
Scheme Equality for PmpAddrMatchType.
Instance Decidable_eq_PmpAddrMatchType :
forall (x y : PmpAddrMatchType), Decidable (x = y) :=
Decidable_eq_from_dec PmpAddrMatchType_eq_dec.

Definition pmp_addr_range  : Type := option ((xlenbits * xlenbits)).

Inductive pmpAddrMatch := PMP_NoMatch | PMP_PartialMatch | PMP_Match.
Scheme Equality for pmpAddrMatch.
Instance Decidable_eq_pmpAddrMatch :
forall (x y : pmpAddrMatch), Decidable (x = y) :=
Decidable_eq_from_dec pmpAddrMatch_eq_dec.

Inductive pmpMatch := PMP_Success | PMP_Continue | PMP_Fail.
Scheme Equality for pmpMatch.
Instance Decidable_eq_pmpMatch :
forall (x y : pmpMatch), Decidable (x = y) :=
Decidable_eq_from_dec pmpMatch_eq_dec.

Inductive Ext_FetchAddr_Check {a : Type} :=
  | Ext_FetchAddr_OK : xlenbits -> Ext_FetchAddr_Check
  | Ext_FetchAddr_Error : a -> Ext_FetchAddr_Check.
Arguments Ext_FetchAddr_Check : clear implicits.

Inductive Ext_ControlAddr_Check {a : Type} :=
  | Ext_ControlAddr_OK : xlenbits -> Ext_ControlAddr_Check
  | Ext_ControlAddr_Error : a -> Ext_ControlAddr_Check.
Arguments Ext_ControlAddr_Check : clear implicits.

Inductive Ext_DataAddr_Check {a : Type} :=
  | Ext_DataAddr_OK : xlenbits -> Ext_DataAddr_Check | Ext_DataAddr_Error : a -> Ext_DataAddr_Check.
Arguments Ext_DataAddr_Check : clear implicits.

Definition ext_fetch_addr_error  : Type := unit.

Definition ext_control_addr_error  : Type := unit.

Definition ext_data_addr_error  : Type := unit.

Definition ext_exception  : Type := unit.

Record sync_exception  :=
  { sync_exception_trap : ExceptionType;
    sync_exception_excinfo : option xlenbits;
    sync_exception_ext : option ext_exception; }.
Arguments sync_exception : clear implicits.
Notation "{[ r 'with' 'sync_exception_trap' := e ]}" := {|
  sync_exception_trap := e;
  sync_exception_excinfo := sync_exception_excinfo r;
  sync_exception_ext := sync_exception_ext r
  |}.
Notation "{[ r 'with' 'sync_exception_excinfo' := e ]}" := {|
  sync_exception_excinfo := e;
  sync_exception_trap := sync_exception_trap r;
  sync_exception_ext := sync_exception_ext r
  |}.
Notation "{[ r 'with' 'sync_exception_ext' := e ]}" := {|
  sync_exception_ext := e;
  sync_exception_trap := sync_exception_trap r;
  sync_exception_excinfo := sync_exception_excinfo r
  |}.

Inductive interrupt_set  :=
  | Ints_Pending : xlenbits -> interrupt_set
  | Ints_Delegated : xlenbits -> interrupt_set
  | Ints_Empty : unit -> interrupt_set.
Arguments interrupt_set : clear implicits.

Inductive ctl_result  :=
  | CTL_TRAP : sync_exception -> ctl_result
  | CTL_SRET : unit -> ctl_result
  | CTL_MRET : unit -> ctl_result
  | CTL_URET : unit -> ctl_result.
Arguments ctl_result : clear implicits.

Inductive MemoryOpResult {a : Type} :=
  | MemValue : a -> MemoryOpResult | MemException : ExceptionType -> MemoryOpResult.
Arguments MemoryOpResult : clear implicits.

Record htif_cmd  := { htif_cmd_htif_cmd_chunk_0 : mword 64; }.
Arguments htif_cmd : clear implicits.
Notation "{[ r 'with' 'htif_cmd_htif_cmd_chunk_0' := e ]}" :=
  {| htif_cmd_htif_cmd_chunk_0 := e |} (only parsing).

Definition pteAttribs  : Type := bits 8.

Inductive PTW_Error :=
  PTW_Access | PTW_Invalid_PTE | PTW_No_Permission | PTW_Misaligned | PTW_PTE_Update.
Scheme Equality for PTW_Error.
Instance Decidable_eq_PTW_Error :
forall (x y : PTW_Error), Decidable (x = y) :=
Decidable_eq_from_dec PTW_Error_eq_dec.

Definition vaddr32  : Type := bits 32.

Definition paddr32  : Type := bits 34.

Definition pte32  : Type := bits 32.

Definition asid32  : Type := bits 9.

Record SV32_Vaddr  := { SV32_Vaddr_SV32_Vaddr_chunk_0 : mword 32; }.
Arguments SV32_Vaddr : clear implicits.
Notation "{[ r 'with' 'SV32_Vaddr_SV32_Vaddr_chunk_0' := e ]}" :=
  {| SV32_Vaddr_SV32_Vaddr_chunk_0 := e |} (only parsing).

Record SV48_Vaddr  := { SV48_Vaddr_SV48_Vaddr_chunk_0 : mword 48; }.
Arguments SV48_Vaddr : clear implicits.
Notation "{[ r 'with' 'SV48_Vaddr_SV48_Vaddr_chunk_0' := e ]}" :=
  {| SV48_Vaddr_SV48_Vaddr_chunk_0 := e |} (only parsing).

Record SV48_Paddr  := { SV48_Paddr_SV48_Paddr_chunk_0 : mword 56; }.
Arguments SV48_Paddr : clear implicits.
Notation "{[ r 'with' 'SV48_Paddr_SV48_Paddr_chunk_0' := e ]}" :=
  {| SV48_Paddr_SV48_Paddr_chunk_0 := e |} (only parsing).

Record SV32_Paddr  := { SV32_Paddr_SV32_Paddr_chunk_0 : mword 34; }.
Arguments SV32_Paddr : clear implicits.
Notation "{[ r 'with' 'SV32_Paddr_SV32_Paddr_chunk_0' := e ]}" :=
  {| SV32_Paddr_SV32_Paddr_chunk_0 := e |} (only parsing).

Record SV32_PTE  := { SV32_PTE_SV32_PTE_chunk_0 : mword 32; }.
Arguments SV32_PTE : clear implicits.
Notation "{[ r 'with' 'SV32_PTE_SV32_PTE_chunk_0' := e ]}" :=
  {| SV32_PTE_SV32_PTE_chunk_0 := e |} (only parsing).

Definition paddr64  : Type := bits 56.

Definition pte64  : Type := bits 64.

Definition asid64  : Type := bits 16.

Definition vaddr39  : Type := bits 39.

Record SV39_Vaddr  := { SV39_Vaddr_SV39_Vaddr_chunk_0 : mword 39; }.
Arguments SV39_Vaddr : clear implicits.
Notation "{[ r 'with' 'SV39_Vaddr_SV39_Vaddr_chunk_0' := e ]}" :=
  {| SV39_Vaddr_SV39_Vaddr_chunk_0 := e |} (only parsing).

Record SV39_Paddr  := { SV39_Paddr_SV39_Paddr_chunk_0 : mword 56; }.
Arguments SV39_Paddr : clear implicits.
Notation "{[ r 'with' 'SV39_Paddr_SV39_Paddr_chunk_0' := e ]}" :=
  {| SV39_Paddr_SV39_Paddr_chunk_0 := e |} (only parsing).

Record SV39_PTE  := { SV39_PTE_SV39_PTE_chunk_0 : mword 64; }.
Arguments SV39_PTE : clear implicits.
Notation "{[ r 'with' 'SV39_PTE_SV39_PTE_chunk_0' := e ]}" :=
  {| SV39_PTE_SV39_PTE_chunk_0 := e |} (only parsing).

Definition vaddr48  : Type := bits 48.

Definition pte48  : Type := bits 64.

Inductive PTW_Result {paddr : Type} {pte : Type} :=
  | PTW_Success : (paddr * pte * paddr * {n : Z & ArithFact (n >= 0)} * bool) -> PTW_Result
  | PTW_Failure : PTW_Error -> PTW_Result.
Arguments PTW_Result : clear implicits.

Inductive TR_Result {paddr : Type} {failure : Type} :=
  | TR_Address : paddr -> TR_Result | TR_Failure : failure -> TR_Result.
Arguments TR_Result : clear implicits.

Record TLB_Entry {asidlen : Z} {valen : Z} {palen : Z} {ptelen : Z} :=
  { TLB_Entry_asid : bits asidlen;
    TLB_Entry_global : bool;
    TLB_Entry_vAddr : bits valen;
    TLB_Entry_pAddr : bits palen;
    TLB_Entry_vMatchMask : bits valen;
    TLB_Entry_vAddrMask : bits valen;
    TLB_Entry_pte : bits ptelen;
    TLB_Entry_pteAddr : bits palen;
    TLB_Entry_age : bits 64; }.
Arguments TLB_Entry : clear implicits.
Notation "{[ r 'with' 'TLB_Entry_asid' := e ]}" := {|
  TLB_Entry_asid := e;
  TLB_Entry_global := TLB_Entry_global r;
  TLB_Entry_vAddr := TLB_Entry_vAddr r;
  TLB_Entry_pAddr := TLB_Entry_pAddr r;
  TLB_Entry_vMatchMask := TLB_Entry_vMatchMask r;
  TLB_Entry_vAddrMask := TLB_Entry_vAddrMask r;
  TLB_Entry_pte := TLB_Entry_pte r;
  TLB_Entry_pteAddr := TLB_Entry_pteAddr r;
  TLB_Entry_age := TLB_Entry_age r
  |}.
Notation "{[ r 'with' 'TLB_Entry_global' := e ]}" := {|
  TLB_Entry_global := e;
  TLB_Entry_asid := TLB_Entry_asid r;
  TLB_Entry_vAddr := TLB_Entry_vAddr r;
  TLB_Entry_pAddr := TLB_Entry_pAddr r;
  TLB_Entry_vMatchMask := TLB_Entry_vMatchMask r;
  TLB_Entry_vAddrMask := TLB_Entry_vAddrMask r;
  TLB_Entry_pte := TLB_Entry_pte r;
  TLB_Entry_pteAddr := TLB_Entry_pteAddr r;
  TLB_Entry_age := TLB_Entry_age r
  |}.
Notation "{[ r 'with' 'TLB_Entry_vAddr' := e ]}" := {|
  TLB_Entry_vAddr := e;
  TLB_Entry_asid := TLB_Entry_asid r;
  TLB_Entry_global := TLB_Entry_global r;
  TLB_Entry_pAddr := TLB_Entry_pAddr r;
  TLB_Entry_vMatchMask := TLB_Entry_vMatchMask r;
  TLB_Entry_vAddrMask := TLB_Entry_vAddrMask r;
  TLB_Entry_pte := TLB_Entry_pte r;
  TLB_Entry_pteAddr := TLB_Entry_pteAddr r;
  TLB_Entry_age := TLB_Entry_age r
  |}.
Notation "{[ r 'with' 'TLB_Entry_pAddr' := e ]}" := {|
  TLB_Entry_pAddr := e;
  TLB_Entry_asid := TLB_Entry_asid r;
  TLB_Entry_global := TLB_Entry_global r;
  TLB_Entry_vAddr := TLB_Entry_vAddr r;
  TLB_Entry_vMatchMask := TLB_Entry_vMatchMask r;
  TLB_Entry_vAddrMask := TLB_Entry_vAddrMask r;
  TLB_Entry_pte := TLB_Entry_pte r;
  TLB_Entry_pteAddr := TLB_Entry_pteAddr r;
  TLB_Entry_age := TLB_Entry_age r
  |}.
Notation "{[ r 'with' 'TLB_Entry_vMatchMask' := e ]}" := {|
  TLB_Entry_vMatchMask := e;
  TLB_Entry_asid := TLB_Entry_asid r;
  TLB_Entry_global := TLB_Entry_global r;
  TLB_Entry_vAddr := TLB_Entry_vAddr r;
  TLB_Entry_pAddr := TLB_Entry_pAddr r;
  TLB_Entry_vAddrMask := TLB_Entry_vAddrMask r;
  TLB_Entry_pte := TLB_Entry_pte r;
  TLB_Entry_pteAddr := TLB_Entry_pteAddr r;
  TLB_Entry_age := TLB_Entry_age r
  |}.
Notation "{[ r 'with' 'TLB_Entry_vAddrMask' := e ]}" := {|
  TLB_Entry_vAddrMask := e;
  TLB_Entry_asid := TLB_Entry_asid r;
  TLB_Entry_global := TLB_Entry_global r;
  TLB_Entry_vAddr := TLB_Entry_vAddr r;
  TLB_Entry_pAddr := TLB_Entry_pAddr r;
  TLB_Entry_vMatchMask := TLB_Entry_vMatchMask r;
  TLB_Entry_pte := TLB_Entry_pte r;
  TLB_Entry_pteAddr := TLB_Entry_pteAddr r;
  TLB_Entry_age := TLB_Entry_age r
  |}.
Notation "{[ r 'with' 'TLB_Entry_pte' := e ]}" := {|
  TLB_Entry_pte := e;
  TLB_Entry_asid := TLB_Entry_asid r;
  TLB_Entry_global := TLB_Entry_global r;
  TLB_Entry_vAddr := TLB_Entry_vAddr r;
  TLB_Entry_pAddr := TLB_Entry_pAddr r;
  TLB_Entry_vMatchMask := TLB_Entry_vMatchMask r;
  TLB_Entry_vAddrMask := TLB_Entry_vAddrMask r;
  TLB_Entry_pteAddr := TLB_Entry_pteAddr r;
  TLB_Entry_age := TLB_Entry_age r
  |}.
Notation "{[ r 'with' 'TLB_Entry_pteAddr' := e ]}" := {|
  TLB_Entry_pteAddr := e;
  TLB_Entry_asid := TLB_Entry_asid r;
  TLB_Entry_global := TLB_Entry_global r;
  TLB_Entry_vAddr := TLB_Entry_vAddr r;
  TLB_Entry_pAddr := TLB_Entry_pAddr r;
  TLB_Entry_vMatchMask := TLB_Entry_vMatchMask r;
  TLB_Entry_vAddrMask := TLB_Entry_vAddrMask r;
  TLB_Entry_pte := TLB_Entry_pte r;
  TLB_Entry_age := TLB_Entry_age r
  |}.
Notation "{[ r 'with' 'TLB_Entry_age' := e ]}" := {|
  TLB_Entry_age := e;
  TLB_Entry_asid := TLB_Entry_asid r;
  TLB_Entry_global := TLB_Entry_global r;
  TLB_Entry_vAddr := TLB_Entry_vAddr r;
  TLB_Entry_pAddr := TLB_Entry_pAddr r;
  TLB_Entry_vMatchMask := TLB_Entry_vMatchMask r;
  TLB_Entry_vAddrMask := TLB_Entry_vAddrMask r;
  TLB_Entry_pte := TLB_Entry_pte r;
  TLB_Entry_pteAddr := TLB_Entry_pteAddr r
  |}.

Definition TLB39_Entry  : Type := TLB_Entry 16 39 56 64.

Definition TLB48_Entry  : Type := TLB_Entry 16 48 56 64.

Inductive register_value  :=
  | Regval_vector : (Z * bool * list register_value) -> register_value
  | Regval_list : list register_value -> register_value
  | Regval_option : option register_value -> register_value
  | Regval_Counteren : Counteren -> register_value
  | Regval_Mcause : Mcause -> register_value
  | Regval_Medeleg : Medeleg -> register_value
  | Regval_Minterrupts : Minterrupts -> register_value
  | Regval_Misa : Misa -> register_value
  | Regval_Mstatus : Mstatus -> register_value
  | Regval_Mtvec : Mtvec -> register_value
  | Regval_Pmpcfg_ent : Pmpcfg_ent -> register_value
  | Regval_Privilege : Privilege -> register_value
  | Regval_Sedeleg : Sedeleg -> register_value
  | Regval_Sinterrupts : Sinterrupts -> register_value
  | Regval_TLB_Entry_16_39_56_64 : TLB_Entry 16 39 56 64 -> register_value
  | Regval_TLB_Entry_16_48_56_64 : TLB_Entry 16 48 56 64 -> register_value
  | Regval_bit : bitU -> register_value
  | Regval_bitvector_32_dec : mword 32 -> register_value
  | Regval_bitvector_64_dec : mword 64 -> register_value
  | Regval_bool : bool -> register_value.
Arguments register_value : clear implicits.

Record regstate  :=
  { satp : mword 64;
    tlb48 : option (TLB_Entry 16 48 56 64);
    tlb39 : option (TLB_Entry 16 39 56 64);
    htif_exit_code : mword 64;
    htif_done : bool;
    htif_tohost : mword 64;
    mtimecmp : mword 64;
    utval : mword 64;
    ucause : Mcause;
    uepc : mword 64;
    uscratch : mword 64;
    utvec : Mtvec;
    pmpaddr15 : mword 64;
    pmpaddr14 : mword 64;
    pmpaddr13 : mword 64;
    pmpaddr12 : mword 64;
    pmpaddr11 : mword 64;
    pmpaddr10 : mword 64;
    pmpaddr9 : mword 64;
    pmpaddr8 : mword 64;
    pmpaddr7 : mword 64;
    pmpaddr6 : mword 64;
    pmpaddr5 : mword 64;
    pmpaddr4 : mword 64;
    pmpaddr3 : mword 64;
    pmpaddr2 : mword 64;
    pmpaddr1 : mword 64;
    pmpaddr0 : mword 64;
    pmp15cfg : Pmpcfg_ent;
    pmp14cfg : Pmpcfg_ent;
    pmp13cfg : Pmpcfg_ent;
    pmp12cfg : Pmpcfg_ent;
    pmp11cfg : Pmpcfg_ent;
    pmp10cfg : Pmpcfg_ent;
    pmp9cfg : Pmpcfg_ent;
    pmp8cfg : Pmpcfg_ent;
    pmp7cfg : Pmpcfg_ent;
    pmp6cfg : Pmpcfg_ent;
    pmp5cfg : Pmpcfg_ent;
    pmp4cfg : Pmpcfg_ent;
    pmp3cfg : Pmpcfg_ent;
    pmp2cfg : Pmpcfg_ent;
    pmp1cfg : Pmpcfg_ent;
    pmp0cfg : Pmpcfg_ent;
    tselect : mword 64;
    stval : mword 64;
    scause : Mcause;
    sepc : mword 64;
    sscratch : mword 64;
    stvec : Mtvec;
    sideleg : Sinterrupts;
    sedeleg : Sedeleg;
    mhartid : mword 64;
    marchid : mword 64;
    mimpid : mword 64;
    mvendorid : mword 32;
    minstret_written : bool;
    minstret : mword 64;
    mtime : mword 64;
    mcycle : mword 64;
    scounteren : Counteren;
    mcounteren : Counteren;
    mscratch : mword 64;
    mtval : mword 64;
    mepc : mword 64;
    mcause : Mcause;
    mtvec : Mtvec;
    medeleg : Medeleg;
    mideleg : Minterrupts;
    mie : Minterrupts;
    mip : Minterrupts;
    mstatus : Mstatus;
    misa : Misa;
    cur_inst : mword 64;
    cur_privilege : Privilege;
    x31 : mword 64;
    x30 : mword 64;
    x29 : mword 64;
    x28 : mword 64;
    x27 : mword 64;
    x26 : mword 64;
    x25 : mword 64;
    x24 : mword 64;
    x23 : mword 64;
    x22 : mword 64;
    x21 : mword 64;
    x20 : mword 64;
    x19 : mword 64;
    x18 : mword 64;
    x17 : mword 64;
    x16 : mword 64;
    x15 : mword 64;
    x14 : mword 64;
    x13 : mword 64;
    x12 : mword 64;
    x11 : mword 64;
    x10 : mword 64;
    x9 : mword 64;
    x8 : mword 64;
    x7 : mword 64;
    x6 : mword 64;
    x5 : mword 64;
    x4 : mword 64;
    x3 : mword 64;
    x2 : mword 64;
    x1 : mword 64;
    Xs : vec (mword 64) 32;
    instbits : mword 64;
    nextPC : mword 64;
    PC : mword 64; }.
Arguments regstate : clear implicits.
Notation "{[ r 'with' 'satp' := e ]}" := {|
  satp := e;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'tlb48' := e ]}" := {|
  tlb48 := e;
  satp := satp r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'tlb39' := e ]}" := {|
  tlb39 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'htif_exit_code' := e ]}" := {|
  htif_exit_code := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'htif_done' := e ]}" := {|
  htif_done := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'htif_tohost' := e ]}" := {|
  htif_tohost := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'mtimecmp' := e ]}" := {|
  mtimecmp := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'utval' := e ]}" := {|
  utval := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'ucause' := e ]}" := {|
  ucause := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'uepc' := e ]}" := {|
  uepc := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'uscratch' := e ]}" := {|
  uscratch := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'utvec' := e ]}" := {|
  utvec := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmpaddr15' := e ]}" := {|
  pmpaddr15 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmpaddr14' := e ]}" := {|
  pmpaddr14 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmpaddr13' := e ]}" := {|
  pmpaddr13 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmpaddr12' := e ]}" := {|
  pmpaddr12 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmpaddr11' := e ]}" := {|
  pmpaddr11 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmpaddr10' := e ]}" := {|
  pmpaddr10 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmpaddr9' := e ]}" := {|
  pmpaddr9 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmpaddr8' := e ]}" := {|
  pmpaddr8 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmpaddr7' := e ]}" := {|
  pmpaddr7 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmpaddr6' := e ]}" := {|
  pmpaddr6 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmpaddr5' := e ]}" := {|
  pmpaddr5 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmpaddr4' := e ]}" := {|
  pmpaddr4 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmpaddr3' := e ]}" := {|
  pmpaddr3 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmpaddr2' := e ]}" := {|
  pmpaddr2 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmpaddr1' := e ]}" := {|
  pmpaddr1 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmpaddr0' := e ]}" := {|
  pmpaddr0 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmp15cfg' := e ]}" := {|
  pmp15cfg := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmp14cfg' := e ]}" := {|
  pmp14cfg := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmp13cfg' := e ]}" := {|
  pmp13cfg := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmp12cfg' := e ]}" := {|
  pmp12cfg := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmp11cfg' := e ]}" := {|
  pmp11cfg := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmp10cfg' := e ]}" := {|
  pmp10cfg := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmp9cfg' := e ]}" := {|
  pmp9cfg := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmp8cfg' := e ]}" := {|
  pmp8cfg := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmp7cfg' := e ]}" := {|
  pmp7cfg := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmp6cfg' := e ]}" := {|
  pmp6cfg := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmp5cfg' := e ]}" := {|
  pmp5cfg := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmp4cfg' := e ]}" := {|
  pmp4cfg := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmp3cfg' := e ]}" := {|
  pmp3cfg := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmp2cfg' := e ]}" := {|
  pmp2cfg := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmp1cfg' := e ]}" := {|
  pmp1cfg := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'pmp0cfg' := e ]}" := {|
  pmp0cfg := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'tselect' := e ]}" := {|
  tselect := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'stval' := e ]}" := {|
  stval := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'scause' := e ]}" := {|
  scause := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'sepc' := e ]}" := {|
  sepc := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'sscratch' := e ]}" := {|
  sscratch := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'stvec' := e ]}" := {|
  stvec := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'sideleg' := e ]}" := {|
  sideleg := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'sedeleg' := e ]}" := {|
  sedeleg := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'mhartid' := e ]}" := {|
  mhartid := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'marchid' := e ]}" := {|
  marchid := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'mimpid' := e ]}" := {|
  mimpid := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'mvendorid' := e ]}" := {|
  mvendorid := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'minstret_written' := e ]}" := {|
  minstret_written := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'minstret' := e ]}" := {|
  minstret := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'mtime' := e ]}" := {|
  mtime := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'mcycle' := e ]}" := {|
  mcycle := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'scounteren' := e ]}" := {|
  scounteren := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'mcounteren' := e ]}" := {|
  mcounteren := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'mscratch' := e ]}" := {|
  mscratch := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'mtval' := e ]}" := {|
  mtval := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'mepc' := e ]}" := {|
  mepc := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'mcause' := e ]}" := {|
  mcause := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'mtvec' := e ]}" := {|
  mtvec := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'medeleg' := e ]}" := {|
  medeleg := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'mideleg' := e ]}" := {|
  mideleg := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'mie' := e ]}" := {|
  mie := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'mip' := e ]}" := {|
  mip := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'mstatus' := e ]}" := {|
  mstatus := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'misa' := e ]}" := {|
  misa := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'cur_inst' := e ]}" := {|
  cur_inst := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'cur_privilege' := e ]}" := {|
  cur_privilege := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x31' := e ]}" := {|
  x31 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x30' := e ]}" := {|
  x30 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x29' := e ]}" := {|
  x29 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x28' := e ]}" := {|
  x28 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x27' := e ]}" := {|
  x27 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x26' := e ]}" := {|
  x26 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x25' := e ]}" := {|
  x25 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x24' := e ]}" := {|
  x24 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x23' := e ]}" := {|
  x23 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x22' := e ]}" := {|
  x22 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x21' := e ]}" := {|
  x21 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x20' := e ]}" := {|
  x20 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x19' := e ]}" := {|
  x19 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x18' := e ]}" := {|
  x18 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x17' := e ]}" := {|
  x17 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x16' := e ]}" := {|
  x16 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x15' := e ]}" := {|
  x15 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x14' := e ]}" := {|
  x14 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x13' := e ]}" := {|
  x13 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x12' := e ]}" := {|
  x12 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x11' := e ]}" := {|
  x11 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x10' := e ]}" := {|
  x10 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x9' := e ]}" := {|
  x9 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x8' := e ]}" := {|
  x8 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x7' := e ]}" := {|
  x7 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x6' := e ]}" := {|
  x6 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x5' := e ]}" := {|
  x5 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x4' := e ]}" := {|
  x4 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x3' := e ]}" := {|
  x3 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x2' := e ]}" := {|
  x2 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'x1' := e ]}" := {|
  x1 := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'Xs' := e ]}" := {|
  Xs := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  instbits := instbits r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'instbits' := e ]}" := {|
  instbits := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  nextPC := nextPC r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'nextPC' := e ]}" := {|
  nextPC := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  PC := PC r
  |}.
Notation "{[ r 'with' 'PC' := e ]}" := {|
  PC := e;
  satp := satp r;
  tlb48 := tlb48 r;
  tlb39 := tlb39 r;
  htif_exit_code := htif_exit_code r;
  htif_done := htif_done r;
  htif_tohost := htif_tohost r;
  mtimecmp := mtimecmp r;
  utval := utval r;
  ucause := ucause r;
  uepc := uepc r;
  uscratch := uscratch r;
  utvec := utvec r;
  pmpaddr15 := pmpaddr15 r;
  pmpaddr14 := pmpaddr14 r;
  pmpaddr13 := pmpaddr13 r;
  pmpaddr12 := pmpaddr12 r;
  pmpaddr11 := pmpaddr11 r;
  pmpaddr10 := pmpaddr10 r;
  pmpaddr9 := pmpaddr9 r;
  pmpaddr8 := pmpaddr8 r;
  pmpaddr7 := pmpaddr7 r;
  pmpaddr6 := pmpaddr6 r;
  pmpaddr5 := pmpaddr5 r;
  pmpaddr4 := pmpaddr4 r;
  pmpaddr3 := pmpaddr3 r;
  pmpaddr2 := pmpaddr2 r;
  pmpaddr1 := pmpaddr1 r;
  pmpaddr0 := pmpaddr0 r;
  pmp15cfg := pmp15cfg r;
  pmp14cfg := pmp14cfg r;
  pmp13cfg := pmp13cfg r;
  pmp12cfg := pmp12cfg r;
  pmp11cfg := pmp11cfg r;
  pmp10cfg := pmp10cfg r;
  pmp9cfg := pmp9cfg r;
  pmp8cfg := pmp8cfg r;
  pmp7cfg := pmp7cfg r;
  pmp6cfg := pmp6cfg r;
  pmp5cfg := pmp5cfg r;
  pmp4cfg := pmp4cfg r;
  pmp3cfg := pmp3cfg r;
  pmp2cfg := pmp2cfg r;
  pmp1cfg := pmp1cfg r;
  pmp0cfg := pmp0cfg r;
  tselect := tselect r;
  stval := stval r;
  scause := scause r;
  sepc := sepc r;
  sscratch := sscratch r;
  stvec := stvec r;
  sideleg := sideleg r;
  sedeleg := sedeleg r;
  mhartid := mhartid r;
  marchid := marchid r;
  mimpid := mimpid r;
  mvendorid := mvendorid r;
  minstret_written := minstret_written r;
  minstret := minstret r;
  mtime := mtime r;
  mcycle := mcycle r;
  scounteren := scounteren r;
  mcounteren := mcounteren r;
  mscratch := mscratch r;
  mtval := mtval r;
  mepc := mepc r;
  mcause := mcause r;
  mtvec := mtvec r;
  medeleg := medeleg r;
  mideleg := mideleg r;
  mie := mie r;
  mip := mip r;
  mstatus := mstatus r;
  misa := misa r;
  cur_inst := cur_inst r;
  cur_privilege := cur_privilege r;
  x31 := x31 r;
  x30 := x30 r;
  x29 := x29 r;
  x28 := x28 r;
  x27 := x27 r;
  x26 := x26 r;
  x25 := x25 r;
  x24 := x24 r;
  x23 := x23 r;
  x22 := x22 r;
  x21 := x21 r;
  x20 := x20 r;
  x19 := x19 r;
  x18 := x18 r;
  x17 := x17 r;
  x16 := x16 r;
  x15 := x15 r;
  x14 := x14 r;
  x13 := x13 r;
  x12 := x12 r;
  x11 := x11 r;
  x10 := x10 r;
  x9 := x9 r;
  x8 := x8 r;
  x7 := x7 r;
  x6 := x6 r;
  x5 := x5 r;
  x4 := x4 r;
  x3 := x3 r;
  x2 := x2 r;
  x1 := x1 r;
  Xs := Xs r;
  instbits := instbits r;
  nextPC := nextPC r
  |}.



Definition Counteren_of_regval (merge_var : register_value) 
: option Counteren :=
   
   match merge_var with | Regval_Counteren (v) => Some (v) | _ => None end.

Definition regval_of_Counteren (v : Counteren)  : register_value :=  Regval_Counteren (v).

Definition Mcause_of_regval (merge_var : register_value) 
: option Mcause :=
   
   match merge_var with | Regval_Mcause (v) => Some (v) | _ => None end.

Definition regval_of_Mcause (v : Mcause)  : register_value :=  Regval_Mcause (v).

Definition Medeleg_of_regval (merge_var : register_value) 
: option Medeleg :=
   
   match merge_var with | Regval_Medeleg (v) => Some (v) | _ => None end.

Definition regval_of_Medeleg (v : Medeleg)  : register_value :=  Regval_Medeleg (v).

Definition Minterrupts_of_regval (merge_var : register_value) 
: option Minterrupts :=
   
   match merge_var with | Regval_Minterrupts (v) => Some (v) | _ => None end.

Definition regval_of_Minterrupts (v : Minterrupts)  : register_value :=  Regval_Minterrupts (v).

Definition Misa_of_regval (merge_var : register_value) 
: option Misa :=
   
   match merge_var with | Regval_Misa (v) => Some (v) | _ => None end.

Definition regval_of_Misa (v : Misa)  : register_value :=  Regval_Misa (v).

Definition Mstatus_of_regval (merge_var : register_value) 
: option Mstatus :=
   
   match merge_var with | Regval_Mstatus (v) => Some (v) | _ => None end.

Definition regval_of_Mstatus (v : Mstatus)  : register_value :=  Regval_Mstatus (v).

Definition Mtvec_of_regval (merge_var : register_value) 
: option Mtvec :=
   
   match merge_var with | Regval_Mtvec (v) => Some (v) | _ => None end.

Definition regval_of_Mtvec (v : Mtvec)  : register_value :=  Regval_Mtvec (v).

Definition Pmpcfg_ent_of_regval (merge_var : register_value) 
: option Pmpcfg_ent :=
   
   match merge_var with | Regval_Pmpcfg_ent (v) => Some (v) | _ => None end.

Definition regval_of_Pmpcfg_ent (v : Pmpcfg_ent)  : register_value :=  Regval_Pmpcfg_ent (v).

Definition Privilege_of_regval (merge_var : register_value) 
: option Privilege :=
   
   match merge_var with | Regval_Privilege (v) => Some (v) | _ => None end.

Definition regval_of_Privilege (v : Privilege)  : register_value :=  Regval_Privilege (v).

Definition Sedeleg_of_regval (merge_var : register_value) 
: option Sedeleg :=
   
   match merge_var with | Regval_Sedeleg (v) => Some (v) | _ => None end.

Definition regval_of_Sedeleg (v : Sedeleg)  : register_value :=  Regval_Sedeleg (v).

Definition Sinterrupts_of_regval (merge_var : register_value) 
: option Sinterrupts :=
   
   match merge_var with | Regval_Sinterrupts (v) => Some (v) | _ => None end.

Definition regval_of_Sinterrupts (v : Sinterrupts)  : register_value :=  Regval_Sinterrupts (v).

Definition TLB_Entry_16_39_56_64_of_regval (merge_var : register_value) 
: option (TLB_Entry 16 39 56 64) :=
   
   match merge_var with | Regval_TLB_Entry_16_39_56_64 (v) => Some (v) | _ => None end.

Definition regval_of_TLB_Entry_16_39_56_64 (v : TLB_Entry 16 39 56 64) 
: register_value :=
   
   Regval_TLB_Entry_16_39_56_64
     (v).

Definition TLB_Entry_16_48_56_64_of_regval (merge_var : register_value) 
: option (TLB_Entry 16 48 56 64) :=
   
   match merge_var with | Regval_TLB_Entry_16_48_56_64 (v) => Some (v) | _ => None end.

Definition regval_of_TLB_Entry_16_48_56_64 (v : TLB_Entry 16 48 56 64) 
: register_value :=
   
   Regval_TLB_Entry_16_48_56_64
     (v).

Definition bit_of_regval (merge_var : register_value) 
: option bitU :=
   
   match merge_var with | Regval_bit (v) => Some (v) | _ => None end.

Definition regval_of_bit (v : bitU)  : register_value :=  Regval_bit (v).

Definition bitvector_32_dec_of_regval (merge_var : register_value) 
: option (mword 32) :=
   
   match merge_var with | Regval_bitvector_32_dec (v) => Some (v) | _ => None end.

Definition regval_of_bitvector_32_dec (v : mword 32) 
: register_value :=
   
   Regval_bitvector_32_dec
     (v).

Definition bitvector_64_dec_of_regval (merge_var : register_value) 
: option (mword 64) :=
   
   match merge_var with | Regval_bitvector_64_dec (v) => Some (v) | _ => None end.

Definition regval_of_bitvector_64_dec (v : mword 64) 
: register_value :=
   
   Regval_bitvector_64_dec
     (v).

Definition bool_of_regval (merge_var : register_value) 
: option bool :=
   
   match merge_var with | Regval_bool (v) => Some (v) | _ => None end.

Definition regval_of_bool (v : bool)  : register_value :=  Regval_bool (v).



Definition vector_of_regval {a} n (of_regval : register_value -> option a) (rv : register_value) : option (vec a n) := match rv with
  | Regval_vector (n', _, v) => if n =? n' then map_bind (vec_of_list n) (just_list (List.map of_regval v)) else None
  | _ => None
end.

Definition regval_of_vector {a} (regval_of : a -> register_value) (size : Z) (is_inc : bool) (xs : vec a size) : register_value := Regval_vector (size, is_inc, List.map regval_of (list_of_vec xs)).

Definition list_of_regval {a} (of_regval : register_value -> option a) (rv : register_value) : option (list a) := match rv with
  | Regval_list v => just_list (List.map of_regval v)
  | _ => None
end.

Definition regval_of_list {a} (regval_of : a -> register_value) (xs : list a) : register_value := Regval_list (List.map regval_of xs).

Definition option_of_regval {a} (of_regval : register_value -> option a) (rv : register_value) : option (option a) := match rv with
  | Regval_option v => option_map of_regval v
  | _ => None
end.

Definition regval_of_option {a} (regval_of : a -> register_value) (v : option a) := Regval_option (option_map regval_of v).


Definition satp_ref := {|
  name := "satp";
  read_from := (fun s => s.(satp));
  write_to := (fun v s => ({[ s with satp := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition tlb48_ref := {|
  name := "tlb48";
  read_from := (fun s => s.(tlb48));
  write_to := (fun v s => ({[ s with tlb48 := v ]}));
  of_regval := (fun v => option_of_regval (fun v => TLB_Entry_16_48_56_64_of_regval v) v);
  regval_of := (fun v => regval_of_option (fun v => regval_of_TLB_Entry_16_48_56_64 v) v) |}.

Definition tlb39_ref := {|
  name := "tlb39";
  read_from := (fun s => s.(tlb39));
  write_to := (fun v s => ({[ s with tlb39 := v ]}));
  of_regval := (fun v => option_of_regval (fun v => TLB_Entry_16_39_56_64_of_regval v) v);
  regval_of := (fun v => regval_of_option (fun v => regval_of_TLB_Entry_16_39_56_64 v) v) |}.

Definition htif_exit_code_ref := {|
  name := "htif_exit_code";
  read_from := (fun s => s.(htif_exit_code));
  write_to := (fun v s => ({[ s with htif_exit_code := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition htif_done_ref := {|
  name := "htif_done";
  read_from := (fun s => s.(htif_done));
  write_to := (fun v s => ({[ s with htif_done := v ]}));
  of_regval := (fun v => bool_of_regval v);
  regval_of := (fun v => regval_of_bool v) |}.

Definition htif_tohost_ref := {|
  name := "htif_tohost";
  read_from := (fun s => s.(htif_tohost));
  write_to := (fun v s => ({[ s with htif_tohost := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition mtimecmp_ref := {|
  name := "mtimecmp";
  read_from := (fun s => s.(mtimecmp));
  write_to := (fun v s => ({[ s with mtimecmp := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition utval_ref := {|
  name := "utval";
  read_from := (fun s => s.(utval));
  write_to := (fun v s => ({[ s with utval := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition ucause_ref := {|
  name := "ucause";
  read_from := (fun s => s.(ucause));
  write_to := (fun v s => ({[ s with ucause := v ]}));
  of_regval := (fun v => Mcause_of_regval v);
  regval_of := (fun v => regval_of_Mcause v) |}.

Definition uepc_ref := {|
  name := "uepc";
  read_from := (fun s => s.(uepc));
  write_to := (fun v s => ({[ s with uepc := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition uscratch_ref := {|
  name := "uscratch";
  read_from := (fun s => s.(uscratch));
  write_to := (fun v s => ({[ s with uscratch := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition utvec_ref := {|
  name := "utvec";
  read_from := (fun s => s.(utvec));
  write_to := (fun v s => ({[ s with utvec := v ]}));
  of_regval := (fun v => Mtvec_of_regval v);
  regval_of := (fun v => regval_of_Mtvec v) |}.

Definition pmpaddr15_ref := {|
  name := "pmpaddr15";
  read_from := (fun s => s.(pmpaddr15));
  write_to := (fun v s => ({[ s with pmpaddr15 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition pmpaddr14_ref := {|
  name := "pmpaddr14";
  read_from := (fun s => s.(pmpaddr14));
  write_to := (fun v s => ({[ s with pmpaddr14 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition pmpaddr13_ref := {|
  name := "pmpaddr13";
  read_from := (fun s => s.(pmpaddr13));
  write_to := (fun v s => ({[ s with pmpaddr13 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition pmpaddr12_ref := {|
  name := "pmpaddr12";
  read_from := (fun s => s.(pmpaddr12));
  write_to := (fun v s => ({[ s with pmpaddr12 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition pmpaddr11_ref := {|
  name := "pmpaddr11";
  read_from := (fun s => s.(pmpaddr11));
  write_to := (fun v s => ({[ s with pmpaddr11 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition pmpaddr10_ref := {|
  name := "pmpaddr10";
  read_from := (fun s => s.(pmpaddr10));
  write_to := (fun v s => ({[ s with pmpaddr10 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition pmpaddr9_ref := {|
  name := "pmpaddr9";
  read_from := (fun s => s.(pmpaddr9));
  write_to := (fun v s => ({[ s with pmpaddr9 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition pmpaddr8_ref := {|
  name := "pmpaddr8";
  read_from := (fun s => s.(pmpaddr8));
  write_to := (fun v s => ({[ s with pmpaddr8 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition pmpaddr7_ref := {|
  name := "pmpaddr7";
  read_from := (fun s => s.(pmpaddr7));
  write_to := (fun v s => ({[ s with pmpaddr7 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition pmpaddr6_ref := {|
  name := "pmpaddr6";
  read_from := (fun s => s.(pmpaddr6));
  write_to := (fun v s => ({[ s with pmpaddr6 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition pmpaddr5_ref := {|
  name := "pmpaddr5";
  read_from := (fun s => s.(pmpaddr5));
  write_to := (fun v s => ({[ s with pmpaddr5 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition pmpaddr4_ref := {|
  name := "pmpaddr4";
  read_from := (fun s => s.(pmpaddr4));
  write_to := (fun v s => ({[ s with pmpaddr4 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition pmpaddr3_ref := {|
  name := "pmpaddr3";
  read_from := (fun s => s.(pmpaddr3));
  write_to := (fun v s => ({[ s with pmpaddr3 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition pmpaddr2_ref := {|
  name := "pmpaddr2";
  read_from := (fun s => s.(pmpaddr2));
  write_to := (fun v s => ({[ s with pmpaddr2 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition pmpaddr1_ref := {|
  name := "pmpaddr1";
  read_from := (fun s => s.(pmpaddr1));
  write_to := (fun v s => ({[ s with pmpaddr1 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition pmpaddr0_ref := {|
  name := "pmpaddr0";
  read_from := (fun s => s.(pmpaddr0));
  write_to := (fun v s => ({[ s with pmpaddr0 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition pmp15cfg_ref := {|
  name := "pmp15cfg";
  read_from := (fun s => s.(pmp15cfg));
  write_to := (fun v s => ({[ s with pmp15cfg := v ]}));
  of_regval := (fun v => Pmpcfg_ent_of_regval v);
  regval_of := (fun v => regval_of_Pmpcfg_ent v) |}.

Definition pmp14cfg_ref := {|
  name := "pmp14cfg";
  read_from := (fun s => s.(pmp14cfg));
  write_to := (fun v s => ({[ s with pmp14cfg := v ]}));
  of_regval := (fun v => Pmpcfg_ent_of_regval v);
  regval_of := (fun v => regval_of_Pmpcfg_ent v) |}.

Definition pmp13cfg_ref := {|
  name := "pmp13cfg";
  read_from := (fun s => s.(pmp13cfg));
  write_to := (fun v s => ({[ s with pmp13cfg := v ]}));
  of_regval := (fun v => Pmpcfg_ent_of_regval v);
  regval_of := (fun v => regval_of_Pmpcfg_ent v) |}.

Definition pmp12cfg_ref := {|
  name := "pmp12cfg";
  read_from := (fun s => s.(pmp12cfg));
  write_to := (fun v s => ({[ s with pmp12cfg := v ]}));
  of_regval := (fun v => Pmpcfg_ent_of_regval v);
  regval_of := (fun v => regval_of_Pmpcfg_ent v) |}.

Definition pmp11cfg_ref := {|
  name := "pmp11cfg";
  read_from := (fun s => s.(pmp11cfg));
  write_to := (fun v s => ({[ s with pmp11cfg := v ]}));
  of_regval := (fun v => Pmpcfg_ent_of_regval v);
  regval_of := (fun v => regval_of_Pmpcfg_ent v) |}.

Definition pmp10cfg_ref := {|
  name := "pmp10cfg";
  read_from := (fun s => s.(pmp10cfg));
  write_to := (fun v s => ({[ s with pmp10cfg := v ]}));
  of_regval := (fun v => Pmpcfg_ent_of_regval v);
  regval_of := (fun v => regval_of_Pmpcfg_ent v) |}.

Definition pmp9cfg_ref := {|
  name := "pmp9cfg";
  read_from := (fun s => s.(pmp9cfg));
  write_to := (fun v s => ({[ s with pmp9cfg := v ]}));
  of_regval := (fun v => Pmpcfg_ent_of_regval v);
  regval_of := (fun v => regval_of_Pmpcfg_ent v) |}.

Definition pmp8cfg_ref := {|
  name := "pmp8cfg";
  read_from := (fun s => s.(pmp8cfg));
  write_to := (fun v s => ({[ s with pmp8cfg := v ]}));
  of_regval := (fun v => Pmpcfg_ent_of_regval v);
  regval_of := (fun v => regval_of_Pmpcfg_ent v) |}.

Definition pmp7cfg_ref := {|
  name := "pmp7cfg";
  read_from := (fun s => s.(pmp7cfg));
  write_to := (fun v s => ({[ s with pmp7cfg := v ]}));
  of_regval := (fun v => Pmpcfg_ent_of_regval v);
  regval_of := (fun v => regval_of_Pmpcfg_ent v) |}.

Definition pmp6cfg_ref := {|
  name := "pmp6cfg";
  read_from := (fun s => s.(pmp6cfg));
  write_to := (fun v s => ({[ s with pmp6cfg := v ]}));
  of_regval := (fun v => Pmpcfg_ent_of_regval v);
  regval_of := (fun v => regval_of_Pmpcfg_ent v) |}.

Definition pmp5cfg_ref := {|
  name := "pmp5cfg";
  read_from := (fun s => s.(pmp5cfg));
  write_to := (fun v s => ({[ s with pmp5cfg := v ]}));
  of_regval := (fun v => Pmpcfg_ent_of_regval v);
  regval_of := (fun v => regval_of_Pmpcfg_ent v) |}.

Definition pmp4cfg_ref := {|
  name := "pmp4cfg";
  read_from := (fun s => s.(pmp4cfg));
  write_to := (fun v s => ({[ s with pmp4cfg := v ]}));
  of_regval := (fun v => Pmpcfg_ent_of_regval v);
  regval_of := (fun v => regval_of_Pmpcfg_ent v) |}.

Definition pmp3cfg_ref := {|
  name := "pmp3cfg";
  read_from := (fun s => s.(pmp3cfg));
  write_to := (fun v s => ({[ s with pmp3cfg := v ]}));
  of_regval := (fun v => Pmpcfg_ent_of_regval v);
  regval_of := (fun v => regval_of_Pmpcfg_ent v) |}.

Definition pmp2cfg_ref := {|
  name := "pmp2cfg";
  read_from := (fun s => s.(pmp2cfg));
  write_to := (fun v s => ({[ s with pmp2cfg := v ]}));
  of_regval := (fun v => Pmpcfg_ent_of_regval v);
  regval_of := (fun v => regval_of_Pmpcfg_ent v) |}.

Definition pmp1cfg_ref := {|
  name := "pmp1cfg";
  read_from := (fun s => s.(pmp1cfg));
  write_to := (fun v s => ({[ s with pmp1cfg := v ]}));
  of_regval := (fun v => Pmpcfg_ent_of_regval v);
  regval_of := (fun v => regval_of_Pmpcfg_ent v) |}.

Definition pmp0cfg_ref := {|
  name := "pmp0cfg";
  read_from := (fun s => s.(pmp0cfg));
  write_to := (fun v s => ({[ s with pmp0cfg := v ]}));
  of_regval := (fun v => Pmpcfg_ent_of_regval v);
  regval_of := (fun v => regval_of_Pmpcfg_ent v) |}.

Definition tselect_ref := {|
  name := "tselect";
  read_from := (fun s => s.(tselect));
  write_to := (fun v s => ({[ s with tselect := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition stval_ref := {|
  name := "stval";
  read_from := (fun s => s.(stval));
  write_to := (fun v s => ({[ s with stval := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition scause_ref := {|
  name := "scause";
  read_from := (fun s => s.(scause));
  write_to := (fun v s => ({[ s with scause := v ]}));
  of_regval := (fun v => Mcause_of_regval v);
  regval_of := (fun v => regval_of_Mcause v) |}.

Definition sepc_ref := {|
  name := "sepc";
  read_from := (fun s => s.(sepc));
  write_to := (fun v s => ({[ s with sepc := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition sscratch_ref := {|
  name := "sscratch";
  read_from := (fun s => s.(sscratch));
  write_to := (fun v s => ({[ s with sscratch := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition stvec_ref := {|
  name := "stvec";
  read_from := (fun s => s.(stvec));
  write_to := (fun v s => ({[ s with stvec := v ]}));
  of_regval := (fun v => Mtvec_of_regval v);
  regval_of := (fun v => regval_of_Mtvec v) |}.

Definition sideleg_ref := {|
  name := "sideleg";
  read_from := (fun s => s.(sideleg));
  write_to := (fun v s => ({[ s with sideleg := v ]}));
  of_regval := (fun v => Sinterrupts_of_regval v);
  regval_of := (fun v => regval_of_Sinterrupts v) |}.

Definition sedeleg_ref := {|
  name := "sedeleg";
  read_from := (fun s => s.(sedeleg));
  write_to := (fun v s => ({[ s with sedeleg := v ]}));
  of_regval := (fun v => Sedeleg_of_regval v);
  regval_of := (fun v => regval_of_Sedeleg v) |}.

Definition mhartid_ref := {|
  name := "mhartid";
  read_from := (fun s => s.(mhartid));
  write_to := (fun v s => ({[ s with mhartid := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition marchid_ref := {|
  name := "marchid";
  read_from := (fun s => s.(marchid));
  write_to := (fun v s => ({[ s with marchid := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition mimpid_ref := {|
  name := "mimpid";
  read_from := (fun s => s.(mimpid));
  write_to := (fun v s => ({[ s with mimpid := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition mvendorid_ref := {|
  name := "mvendorid";
  read_from := (fun s => s.(mvendorid));
  write_to := (fun v s => ({[ s with mvendorid := v ]}));
  of_regval := (fun v => bitvector_32_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_32_dec v) |}.

Definition minstret_written_ref := {|
  name := "minstret_written";
  read_from := (fun s => s.(minstret_written));
  write_to := (fun v s => ({[ s with minstret_written := v ]}));
  of_regval := (fun v => bool_of_regval v);
  regval_of := (fun v => regval_of_bool v) |}.

Definition minstret_ref := {|
  name := "minstret";
  read_from := (fun s => s.(minstret));
  write_to := (fun v s => ({[ s with minstret := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition mtime_ref := {|
  name := "mtime";
  read_from := (fun s => s.(mtime));
  write_to := (fun v s => ({[ s with mtime := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition mcycle_ref := {|
  name := "mcycle";
  read_from := (fun s => s.(mcycle));
  write_to := (fun v s => ({[ s with mcycle := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition scounteren_ref := {|
  name := "scounteren";
  read_from := (fun s => s.(scounteren));
  write_to := (fun v s => ({[ s with scounteren := v ]}));
  of_regval := (fun v => Counteren_of_regval v);
  regval_of := (fun v => regval_of_Counteren v) |}.

Definition mcounteren_ref := {|
  name := "mcounteren";
  read_from := (fun s => s.(mcounteren));
  write_to := (fun v s => ({[ s with mcounteren := v ]}));
  of_regval := (fun v => Counteren_of_regval v);
  regval_of := (fun v => regval_of_Counteren v) |}.

Definition mscratch_ref := {|
  name := "mscratch";
  read_from := (fun s => s.(mscratch));
  write_to := (fun v s => ({[ s with mscratch := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition mtval_ref := {|
  name := "mtval";
  read_from := (fun s => s.(mtval));
  write_to := (fun v s => ({[ s with mtval := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition mepc_ref := {|
  name := "mepc";
  read_from := (fun s => s.(mepc));
  write_to := (fun v s => ({[ s with mepc := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition mcause_ref := {|
  name := "mcause";
  read_from := (fun s => s.(mcause));
  write_to := (fun v s => ({[ s with mcause := v ]}));
  of_regval := (fun v => Mcause_of_regval v);
  regval_of := (fun v => regval_of_Mcause v) |}.

Definition mtvec_ref := {|
  name := "mtvec";
  read_from := (fun s => s.(mtvec));
  write_to := (fun v s => ({[ s with mtvec := v ]}));
  of_regval := (fun v => Mtvec_of_regval v);
  regval_of := (fun v => regval_of_Mtvec v) |}.

Definition medeleg_ref := {|
  name := "medeleg";
  read_from := (fun s => s.(medeleg));
  write_to := (fun v s => ({[ s with medeleg := v ]}));
  of_regval := (fun v => Medeleg_of_regval v);
  regval_of := (fun v => regval_of_Medeleg v) |}.

Definition mideleg_ref := {|
  name := "mideleg";
  read_from := (fun s => s.(mideleg));
  write_to := (fun v s => ({[ s with mideleg := v ]}));
  of_regval := (fun v => Minterrupts_of_regval v);
  regval_of := (fun v => regval_of_Minterrupts v) |}.

Definition mie_ref := {|
  name := "mie";
  read_from := (fun s => s.(mie));
  write_to := (fun v s => ({[ s with mie := v ]}));
  of_regval := (fun v => Minterrupts_of_regval v);
  regval_of := (fun v => regval_of_Minterrupts v) |}.

Definition mip_ref := {|
  name := "mip";
  read_from := (fun s => s.(mip));
  write_to := (fun v s => ({[ s with mip := v ]}));
  of_regval := (fun v => Minterrupts_of_regval v);
  regval_of := (fun v => regval_of_Minterrupts v) |}.

Definition mstatus_ref := {|
  name := "mstatus";
  read_from := (fun s => s.(mstatus));
  write_to := (fun v s => ({[ s with mstatus := v ]}));
  of_regval := (fun v => Mstatus_of_regval v);
  regval_of := (fun v => regval_of_Mstatus v) |}.

Definition misa_ref := {|
  name := "misa";
  read_from := (fun s => s.(misa));
  write_to := (fun v s => ({[ s with misa := v ]}));
  of_regval := (fun v => Misa_of_regval v);
  regval_of := (fun v => regval_of_Misa v) |}.

Definition cur_inst_ref := {|
  name := "cur_inst";
  read_from := (fun s => s.(cur_inst));
  write_to := (fun v s => ({[ s with cur_inst := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition cur_privilege_ref := {|
  name := "cur_privilege";
  read_from := (fun s => s.(cur_privilege));
  write_to := (fun v s => ({[ s with cur_privilege := v ]}));
  of_regval := (fun v => Privilege_of_regval v);
  regval_of := (fun v => regval_of_Privilege v) |}.

Definition x31_ref := {|
  name := "x31";
  read_from := (fun s => s.(x31));
  write_to := (fun v s => ({[ s with x31 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x30_ref := {|
  name := "x30";
  read_from := (fun s => s.(x30));
  write_to := (fun v s => ({[ s with x30 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x29_ref := {|
  name := "x29";
  read_from := (fun s => s.(x29));
  write_to := (fun v s => ({[ s with x29 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x28_ref := {|
  name := "x28";
  read_from := (fun s => s.(x28));
  write_to := (fun v s => ({[ s with x28 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x27_ref := {|
  name := "x27";
  read_from := (fun s => s.(x27));
  write_to := (fun v s => ({[ s with x27 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x26_ref := {|
  name := "x26";
  read_from := (fun s => s.(x26));
  write_to := (fun v s => ({[ s with x26 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x25_ref := {|
  name := "x25";
  read_from := (fun s => s.(x25));
  write_to := (fun v s => ({[ s with x25 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x24_ref := {|
  name := "x24";
  read_from := (fun s => s.(x24));
  write_to := (fun v s => ({[ s with x24 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x23_ref := {|
  name := "x23";
  read_from := (fun s => s.(x23));
  write_to := (fun v s => ({[ s with x23 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x22_ref := {|
  name := "x22";
  read_from := (fun s => s.(x22));
  write_to := (fun v s => ({[ s with x22 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x21_ref := {|
  name := "x21";
  read_from := (fun s => s.(x21));
  write_to := (fun v s => ({[ s with x21 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x20_ref := {|
  name := "x20";
  read_from := (fun s => s.(x20));
  write_to := (fun v s => ({[ s with x20 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x19_ref := {|
  name := "x19";
  read_from := (fun s => s.(x19));
  write_to := (fun v s => ({[ s with x19 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x18_ref := {|
  name := "x18";
  read_from := (fun s => s.(x18));
  write_to := (fun v s => ({[ s with x18 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x17_ref := {|
  name := "x17";
  read_from := (fun s => s.(x17));
  write_to := (fun v s => ({[ s with x17 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x16_ref := {|
  name := "x16";
  read_from := (fun s => s.(x16));
  write_to := (fun v s => ({[ s with x16 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x15_ref := {|
  name := "x15";
  read_from := (fun s => s.(x15));
  write_to := (fun v s => ({[ s with x15 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x14_ref := {|
  name := "x14";
  read_from := (fun s => s.(x14));
  write_to := (fun v s => ({[ s with x14 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x13_ref := {|
  name := "x13";
  read_from := (fun s => s.(x13));
  write_to := (fun v s => ({[ s with x13 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x12_ref := {|
  name := "x12";
  read_from := (fun s => s.(x12));
  write_to := (fun v s => ({[ s with x12 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x11_ref := {|
  name := "x11";
  read_from := (fun s => s.(x11));
  write_to := (fun v s => ({[ s with x11 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x10_ref := {|
  name := "x10";
  read_from := (fun s => s.(x10));
  write_to := (fun v s => ({[ s with x10 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x9_ref := {|
  name := "x9";
  read_from := (fun s => s.(x9));
  write_to := (fun v s => ({[ s with x9 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x8_ref := {|
  name := "x8";
  read_from := (fun s => s.(x8));
  write_to := (fun v s => ({[ s with x8 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x7_ref := {|
  name := "x7";
  read_from := (fun s => s.(x7));
  write_to := (fun v s => ({[ s with x7 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x6_ref := {|
  name := "x6";
  read_from := (fun s => s.(x6));
  write_to := (fun v s => ({[ s with x6 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x5_ref := {|
  name := "x5";
  read_from := (fun s => s.(x5));
  write_to := (fun v s => ({[ s with x5 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x4_ref := {|
  name := "x4";
  read_from := (fun s => s.(x4));
  write_to := (fun v s => ({[ s with x4 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x3_ref := {|
  name := "x3";
  read_from := (fun s => s.(x3));
  write_to := (fun v s => ({[ s with x3 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x2_ref := {|
  name := "x2";
  read_from := (fun s => s.(x2));
  write_to := (fun v s => ({[ s with x2 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition x1_ref := {|
  name := "x1";
  read_from := (fun s => s.(x1));
  write_to := (fun v s => ({[ s with x1 := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition Xs_ref := {|
  name := "Xs";
  read_from := (fun s => s.(Xs));
  write_to := (fun v s => ({[ s with Xs := v ]}));
  of_regval := (fun v => vector_of_regval 32 (fun v => bitvector_64_dec_of_regval v) v);
  regval_of := (fun v => regval_of_vector (fun v => regval_of_bitvector_64_dec v) 32 false v) |}.

Definition instbits_ref := {|
  name := "instbits";
  read_from := (fun s => s.(instbits));
  write_to := (fun v s => ({[ s with instbits := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition nextPC_ref := {|
  name := "nextPC";
  read_from := (fun s => s.(nextPC));
  write_to := (fun v s => ({[ s with nextPC := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Definition PC_ref := {|
  name := "PC";
  read_from := (fun s => s.(PC));
  write_to := (fun v s => ({[ s with PC := v ]}));
  of_regval := (fun v => bitvector_64_dec_of_regval v);
  regval_of := (fun v => regval_of_bitvector_64_dec v) |}.

Local Open Scope string.
Definition get_regval (reg_name : string) (s : regstate) : option register_value :=
  if string_dec reg_name "satp" then Some (satp_ref.(regval_of) (satp_ref.(read_from) s)) else
  if string_dec reg_name "tlb48" then Some (tlb48_ref.(regval_of) (tlb48_ref.(read_from) s)) else
  if string_dec reg_name "tlb39" then Some (tlb39_ref.(regval_of) (tlb39_ref.(read_from) s)) else
  if string_dec reg_name "htif_exit_code" then Some (htif_exit_code_ref.(regval_of) (htif_exit_code_ref.(read_from) s)) else
  if string_dec reg_name "htif_done" then Some (htif_done_ref.(regval_of) (htif_done_ref.(read_from) s)) else
  if string_dec reg_name "htif_tohost" then Some (htif_tohost_ref.(regval_of) (htif_tohost_ref.(read_from) s)) else
  if string_dec reg_name "mtimecmp" then Some (mtimecmp_ref.(regval_of) (mtimecmp_ref.(read_from) s)) else
  if string_dec reg_name "utval" then Some (utval_ref.(regval_of) (utval_ref.(read_from) s)) else
  if string_dec reg_name "ucause" then Some (ucause_ref.(regval_of) (ucause_ref.(read_from) s)) else
  if string_dec reg_name "uepc" then Some (uepc_ref.(regval_of) (uepc_ref.(read_from) s)) else
  if string_dec reg_name "uscratch" then Some (uscratch_ref.(regval_of) (uscratch_ref.(read_from) s)) else
  if string_dec reg_name "utvec" then Some (utvec_ref.(regval_of) (utvec_ref.(read_from) s)) else
  if string_dec reg_name "pmpaddr15" then Some (pmpaddr15_ref.(regval_of) (pmpaddr15_ref.(read_from) s)) else
  if string_dec reg_name "pmpaddr14" then Some (pmpaddr14_ref.(regval_of) (pmpaddr14_ref.(read_from) s)) else
  if string_dec reg_name "pmpaddr13" then Some (pmpaddr13_ref.(regval_of) (pmpaddr13_ref.(read_from) s)) else
  if string_dec reg_name "pmpaddr12" then Some (pmpaddr12_ref.(regval_of) (pmpaddr12_ref.(read_from) s)) else
  if string_dec reg_name "pmpaddr11" then Some (pmpaddr11_ref.(regval_of) (pmpaddr11_ref.(read_from) s)) else
  if string_dec reg_name "pmpaddr10" then Some (pmpaddr10_ref.(regval_of) (pmpaddr10_ref.(read_from) s)) else
  if string_dec reg_name "pmpaddr9" then Some (pmpaddr9_ref.(regval_of) (pmpaddr9_ref.(read_from) s)) else
  if string_dec reg_name "pmpaddr8" then Some (pmpaddr8_ref.(regval_of) (pmpaddr8_ref.(read_from) s)) else
  if string_dec reg_name "pmpaddr7" then Some (pmpaddr7_ref.(regval_of) (pmpaddr7_ref.(read_from) s)) else
  if string_dec reg_name "pmpaddr6" then Some (pmpaddr6_ref.(regval_of) (pmpaddr6_ref.(read_from) s)) else
  if string_dec reg_name "pmpaddr5" then Some (pmpaddr5_ref.(regval_of) (pmpaddr5_ref.(read_from) s)) else
  if string_dec reg_name "pmpaddr4" then Some (pmpaddr4_ref.(regval_of) (pmpaddr4_ref.(read_from) s)) else
  if string_dec reg_name "pmpaddr3" then Some (pmpaddr3_ref.(regval_of) (pmpaddr3_ref.(read_from) s)) else
  if string_dec reg_name "pmpaddr2" then Some (pmpaddr2_ref.(regval_of) (pmpaddr2_ref.(read_from) s)) else
  if string_dec reg_name "pmpaddr1" then Some (pmpaddr1_ref.(regval_of) (pmpaddr1_ref.(read_from) s)) else
  if string_dec reg_name "pmpaddr0" then Some (pmpaddr0_ref.(regval_of) (pmpaddr0_ref.(read_from) s)) else
  if string_dec reg_name "pmp15cfg" then Some (pmp15cfg_ref.(regval_of) (pmp15cfg_ref.(read_from) s)) else
  if string_dec reg_name "pmp14cfg" then Some (pmp14cfg_ref.(regval_of) (pmp14cfg_ref.(read_from) s)) else
  if string_dec reg_name "pmp13cfg" then Some (pmp13cfg_ref.(regval_of) (pmp13cfg_ref.(read_from) s)) else
  if string_dec reg_name "pmp12cfg" then Some (pmp12cfg_ref.(regval_of) (pmp12cfg_ref.(read_from) s)) else
  if string_dec reg_name "pmp11cfg" then Some (pmp11cfg_ref.(regval_of) (pmp11cfg_ref.(read_from) s)) else
  if string_dec reg_name "pmp10cfg" then Some (pmp10cfg_ref.(regval_of) (pmp10cfg_ref.(read_from) s)) else
  if string_dec reg_name "pmp9cfg" then Some (pmp9cfg_ref.(regval_of) (pmp9cfg_ref.(read_from) s)) else
  if string_dec reg_name "pmp8cfg" then Some (pmp8cfg_ref.(regval_of) (pmp8cfg_ref.(read_from) s)) else
  if string_dec reg_name "pmp7cfg" then Some (pmp7cfg_ref.(regval_of) (pmp7cfg_ref.(read_from) s)) else
  if string_dec reg_name "pmp6cfg" then Some (pmp6cfg_ref.(regval_of) (pmp6cfg_ref.(read_from) s)) else
  if string_dec reg_name "pmp5cfg" then Some (pmp5cfg_ref.(regval_of) (pmp5cfg_ref.(read_from) s)) else
  if string_dec reg_name "pmp4cfg" then Some (pmp4cfg_ref.(regval_of) (pmp4cfg_ref.(read_from) s)) else
  if string_dec reg_name "pmp3cfg" then Some (pmp3cfg_ref.(regval_of) (pmp3cfg_ref.(read_from) s)) else
  if string_dec reg_name "pmp2cfg" then Some (pmp2cfg_ref.(regval_of) (pmp2cfg_ref.(read_from) s)) else
  if string_dec reg_name "pmp1cfg" then Some (pmp1cfg_ref.(regval_of) (pmp1cfg_ref.(read_from) s)) else
  if string_dec reg_name "pmp0cfg" then Some (pmp0cfg_ref.(regval_of) (pmp0cfg_ref.(read_from) s)) else
  if string_dec reg_name "tselect" then Some (tselect_ref.(regval_of) (tselect_ref.(read_from) s)) else
  if string_dec reg_name "stval" then Some (stval_ref.(regval_of) (stval_ref.(read_from) s)) else
  if string_dec reg_name "scause" then Some (scause_ref.(regval_of) (scause_ref.(read_from) s)) else
  if string_dec reg_name "sepc" then Some (sepc_ref.(regval_of) (sepc_ref.(read_from) s)) else
  if string_dec reg_name "sscratch" then Some (sscratch_ref.(regval_of) (sscratch_ref.(read_from) s)) else
  if string_dec reg_name "stvec" then Some (stvec_ref.(regval_of) (stvec_ref.(read_from) s)) else
  if string_dec reg_name "sideleg" then Some (sideleg_ref.(regval_of) (sideleg_ref.(read_from) s)) else
  if string_dec reg_name "sedeleg" then Some (sedeleg_ref.(regval_of) (sedeleg_ref.(read_from) s)) else
  if string_dec reg_name "mhartid" then Some (mhartid_ref.(regval_of) (mhartid_ref.(read_from) s)) else
  if string_dec reg_name "marchid" then Some (marchid_ref.(regval_of) (marchid_ref.(read_from) s)) else
  if string_dec reg_name "mimpid" then Some (mimpid_ref.(regval_of) (mimpid_ref.(read_from) s)) else
  if string_dec reg_name "mvendorid" then Some (mvendorid_ref.(regval_of) (mvendorid_ref.(read_from) s)) else
  if string_dec reg_name "minstret_written" then Some (minstret_written_ref.(regval_of) (minstret_written_ref.(read_from) s)) else
  if string_dec reg_name "minstret" then Some (minstret_ref.(regval_of) (minstret_ref.(read_from) s)) else
  if string_dec reg_name "mtime" then Some (mtime_ref.(regval_of) (mtime_ref.(read_from) s)) else
  if string_dec reg_name "mcycle" then Some (mcycle_ref.(regval_of) (mcycle_ref.(read_from) s)) else
  if string_dec reg_name "scounteren" then Some (scounteren_ref.(regval_of) (scounteren_ref.(read_from) s)) else
  if string_dec reg_name "mcounteren" then Some (mcounteren_ref.(regval_of) (mcounteren_ref.(read_from) s)) else
  if string_dec reg_name "mscratch" then Some (mscratch_ref.(regval_of) (mscratch_ref.(read_from) s)) else
  if string_dec reg_name "mtval" then Some (mtval_ref.(regval_of) (mtval_ref.(read_from) s)) else
  if string_dec reg_name "mepc" then Some (mepc_ref.(regval_of) (mepc_ref.(read_from) s)) else
  if string_dec reg_name "mcause" then Some (mcause_ref.(regval_of) (mcause_ref.(read_from) s)) else
  if string_dec reg_name "mtvec" then Some (mtvec_ref.(regval_of) (mtvec_ref.(read_from) s)) else
  if string_dec reg_name "medeleg" then Some (medeleg_ref.(regval_of) (medeleg_ref.(read_from) s)) else
  if string_dec reg_name "mideleg" then Some (mideleg_ref.(regval_of) (mideleg_ref.(read_from) s)) else
  if string_dec reg_name "mie" then Some (mie_ref.(regval_of) (mie_ref.(read_from) s)) else
  if string_dec reg_name "mip" then Some (mip_ref.(regval_of) (mip_ref.(read_from) s)) else
  if string_dec reg_name "mstatus" then Some (mstatus_ref.(regval_of) (mstatus_ref.(read_from) s)) else
  if string_dec reg_name "misa" then Some (misa_ref.(regval_of) (misa_ref.(read_from) s)) else
  if string_dec reg_name "cur_inst" then Some (cur_inst_ref.(regval_of) (cur_inst_ref.(read_from) s)) else
  if string_dec reg_name "cur_privilege" then Some (cur_privilege_ref.(regval_of) (cur_privilege_ref.(read_from) s)) else
  if string_dec reg_name "x31" then Some (x31_ref.(regval_of) (x31_ref.(read_from) s)) else
  if string_dec reg_name "x30" then Some (x30_ref.(regval_of) (x30_ref.(read_from) s)) else
  if string_dec reg_name "x29" then Some (x29_ref.(regval_of) (x29_ref.(read_from) s)) else
  if string_dec reg_name "x28" then Some (x28_ref.(regval_of) (x28_ref.(read_from) s)) else
  if string_dec reg_name "x27" then Some (x27_ref.(regval_of) (x27_ref.(read_from) s)) else
  if string_dec reg_name "x26" then Some (x26_ref.(regval_of) (x26_ref.(read_from) s)) else
  if string_dec reg_name "x25" then Some (x25_ref.(regval_of) (x25_ref.(read_from) s)) else
  if string_dec reg_name "x24" then Some (x24_ref.(regval_of) (x24_ref.(read_from) s)) else
  if string_dec reg_name "x23" then Some (x23_ref.(regval_of) (x23_ref.(read_from) s)) else
  if string_dec reg_name "x22" then Some (x22_ref.(regval_of) (x22_ref.(read_from) s)) else
  if string_dec reg_name "x21" then Some (x21_ref.(regval_of) (x21_ref.(read_from) s)) else
  if string_dec reg_name "x20" then Some (x20_ref.(regval_of) (x20_ref.(read_from) s)) else
  if string_dec reg_name "x19" then Some (x19_ref.(regval_of) (x19_ref.(read_from) s)) else
  if string_dec reg_name "x18" then Some (x18_ref.(regval_of) (x18_ref.(read_from) s)) else
  if string_dec reg_name "x17" then Some (x17_ref.(regval_of) (x17_ref.(read_from) s)) else
  if string_dec reg_name "x16" then Some (x16_ref.(regval_of) (x16_ref.(read_from) s)) else
  if string_dec reg_name "x15" then Some (x15_ref.(regval_of) (x15_ref.(read_from) s)) else
  if string_dec reg_name "x14" then Some (x14_ref.(regval_of) (x14_ref.(read_from) s)) else
  if string_dec reg_name "x13" then Some (x13_ref.(regval_of) (x13_ref.(read_from) s)) else
  if string_dec reg_name "x12" then Some (x12_ref.(regval_of) (x12_ref.(read_from) s)) else
  if string_dec reg_name "x11" then Some (x11_ref.(regval_of) (x11_ref.(read_from) s)) else
  if string_dec reg_name "x10" then Some (x10_ref.(regval_of) (x10_ref.(read_from) s)) else
  if string_dec reg_name "x9" then Some (x9_ref.(regval_of) (x9_ref.(read_from) s)) else
  if string_dec reg_name "x8" then Some (x8_ref.(regval_of) (x8_ref.(read_from) s)) else
  if string_dec reg_name "x7" then Some (x7_ref.(regval_of) (x7_ref.(read_from) s)) else
  if string_dec reg_name "x6" then Some (x6_ref.(regval_of) (x6_ref.(read_from) s)) else
  if string_dec reg_name "x5" then Some (x5_ref.(regval_of) (x5_ref.(read_from) s)) else
  if string_dec reg_name "x4" then Some (x4_ref.(regval_of) (x4_ref.(read_from) s)) else
  if string_dec reg_name "x3" then Some (x3_ref.(regval_of) (x3_ref.(read_from) s)) else
  if string_dec reg_name "x2" then Some (x2_ref.(regval_of) (x2_ref.(read_from) s)) else
  if string_dec reg_name "x1" then Some (x1_ref.(regval_of) (x1_ref.(read_from) s)) else
  if string_dec reg_name "Xs" then Some (Xs_ref.(regval_of) (Xs_ref.(read_from) s)) else
  if string_dec reg_name "instbits" then Some (instbits_ref.(regval_of) (instbits_ref.(read_from) s)) else
  if string_dec reg_name "nextPC" then Some (nextPC_ref.(regval_of) (nextPC_ref.(read_from) s)) else
  if string_dec reg_name "PC" then Some (PC_ref.(regval_of) (PC_ref.(read_from) s)) else
  None.

Definition set_regval (reg_name : string) (v : register_value) (s : regstate) : option regstate :=
  if string_dec reg_name "satp" then option_map (fun v => satp_ref.(write_to) v s) (satp_ref.(of_regval) v) else
  if string_dec reg_name "tlb48" then option_map (fun v => tlb48_ref.(write_to) v s) (tlb48_ref.(of_regval) v) else
  if string_dec reg_name "tlb39" then option_map (fun v => tlb39_ref.(write_to) v s) (tlb39_ref.(of_regval) v) else
  if string_dec reg_name "htif_exit_code" then option_map (fun v => htif_exit_code_ref.(write_to) v s) (htif_exit_code_ref.(of_regval) v) else
  if string_dec reg_name "htif_done" then option_map (fun v => htif_done_ref.(write_to) v s) (htif_done_ref.(of_regval) v) else
  if string_dec reg_name "htif_tohost" then option_map (fun v => htif_tohost_ref.(write_to) v s) (htif_tohost_ref.(of_regval) v) else
  if string_dec reg_name "mtimecmp" then option_map (fun v => mtimecmp_ref.(write_to) v s) (mtimecmp_ref.(of_regval) v) else
  if string_dec reg_name "utval" then option_map (fun v => utval_ref.(write_to) v s) (utval_ref.(of_regval) v) else
  if string_dec reg_name "ucause" then option_map (fun v => ucause_ref.(write_to) v s) (ucause_ref.(of_regval) v) else
  if string_dec reg_name "uepc" then option_map (fun v => uepc_ref.(write_to) v s) (uepc_ref.(of_regval) v) else
  if string_dec reg_name "uscratch" then option_map (fun v => uscratch_ref.(write_to) v s) (uscratch_ref.(of_regval) v) else
  if string_dec reg_name "utvec" then option_map (fun v => utvec_ref.(write_to) v s) (utvec_ref.(of_regval) v) else
  if string_dec reg_name "pmpaddr15" then option_map (fun v => pmpaddr15_ref.(write_to) v s) (pmpaddr15_ref.(of_regval) v) else
  if string_dec reg_name "pmpaddr14" then option_map (fun v => pmpaddr14_ref.(write_to) v s) (pmpaddr14_ref.(of_regval) v) else
  if string_dec reg_name "pmpaddr13" then option_map (fun v => pmpaddr13_ref.(write_to) v s) (pmpaddr13_ref.(of_regval) v) else
  if string_dec reg_name "pmpaddr12" then option_map (fun v => pmpaddr12_ref.(write_to) v s) (pmpaddr12_ref.(of_regval) v) else
  if string_dec reg_name "pmpaddr11" then option_map (fun v => pmpaddr11_ref.(write_to) v s) (pmpaddr11_ref.(of_regval) v) else
  if string_dec reg_name "pmpaddr10" then option_map (fun v => pmpaddr10_ref.(write_to) v s) (pmpaddr10_ref.(of_regval) v) else
  if string_dec reg_name "pmpaddr9" then option_map (fun v => pmpaddr9_ref.(write_to) v s) (pmpaddr9_ref.(of_regval) v) else
  if string_dec reg_name "pmpaddr8" then option_map (fun v => pmpaddr8_ref.(write_to) v s) (pmpaddr8_ref.(of_regval) v) else
  if string_dec reg_name "pmpaddr7" then option_map (fun v => pmpaddr7_ref.(write_to) v s) (pmpaddr7_ref.(of_regval) v) else
  if string_dec reg_name "pmpaddr6" then option_map (fun v => pmpaddr6_ref.(write_to) v s) (pmpaddr6_ref.(of_regval) v) else
  if string_dec reg_name "pmpaddr5" then option_map (fun v => pmpaddr5_ref.(write_to) v s) (pmpaddr5_ref.(of_regval) v) else
  if string_dec reg_name "pmpaddr4" then option_map (fun v => pmpaddr4_ref.(write_to) v s) (pmpaddr4_ref.(of_regval) v) else
  if string_dec reg_name "pmpaddr3" then option_map (fun v => pmpaddr3_ref.(write_to) v s) (pmpaddr3_ref.(of_regval) v) else
  if string_dec reg_name "pmpaddr2" then option_map (fun v => pmpaddr2_ref.(write_to) v s) (pmpaddr2_ref.(of_regval) v) else
  if string_dec reg_name "pmpaddr1" then option_map (fun v => pmpaddr1_ref.(write_to) v s) (pmpaddr1_ref.(of_regval) v) else
  if string_dec reg_name "pmpaddr0" then option_map (fun v => pmpaddr0_ref.(write_to) v s) (pmpaddr0_ref.(of_regval) v) else
  if string_dec reg_name "pmp15cfg" then option_map (fun v => pmp15cfg_ref.(write_to) v s) (pmp15cfg_ref.(of_regval) v) else
  if string_dec reg_name "pmp14cfg" then option_map (fun v => pmp14cfg_ref.(write_to) v s) (pmp14cfg_ref.(of_regval) v) else
  if string_dec reg_name "pmp13cfg" then option_map (fun v => pmp13cfg_ref.(write_to) v s) (pmp13cfg_ref.(of_regval) v) else
  if string_dec reg_name "pmp12cfg" then option_map (fun v => pmp12cfg_ref.(write_to) v s) (pmp12cfg_ref.(of_regval) v) else
  if string_dec reg_name "pmp11cfg" then option_map (fun v => pmp11cfg_ref.(write_to) v s) (pmp11cfg_ref.(of_regval) v) else
  if string_dec reg_name "pmp10cfg" then option_map (fun v => pmp10cfg_ref.(write_to) v s) (pmp10cfg_ref.(of_regval) v) else
  if string_dec reg_name "pmp9cfg" then option_map (fun v => pmp9cfg_ref.(write_to) v s) (pmp9cfg_ref.(of_regval) v) else
  if string_dec reg_name "pmp8cfg" then option_map (fun v => pmp8cfg_ref.(write_to) v s) (pmp8cfg_ref.(of_regval) v) else
  if string_dec reg_name "pmp7cfg" then option_map (fun v => pmp7cfg_ref.(write_to) v s) (pmp7cfg_ref.(of_regval) v) else
  if string_dec reg_name "pmp6cfg" then option_map (fun v => pmp6cfg_ref.(write_to) v s) (pmp6cfg_ref.(of_regval) v) else
  if string_dec reg_name "pmp5cfg" then option_map (fun v => pmp5cfg_ref.(write_to) v s) (pmp5cfg_ref.(of_regval) v) else
  if string_dec reg_name "pmp4cfg" then option_map (fun v => pmp4cfg_ref.(write_to) v s) (pmp4cfg_ref.(of_regval) v) else
  if string_dec reg_name "pmp3cfg" then option_map (fun v => pmp3cfg_ref.(write_to) v s) (pmp3cfg_ref.(of_regval) v) else
  if string_dec reg_name "pmp2cfg" then option_map (fun v => pmp2cfg_ref.(write_to) v s) (pmp2cfg_ref.(of_regval) v) else
  if string_dec reg_name "pmp1cfg" then option_map (fun v => pmp1cfg_ref.(write_to) v s) (pmp1cfg_ref.(of_regval) v) else
  if string_dec reg_name "pmp0cfg" then option_map (fun v => pmp0cfg_ref.(write_to) v s) (pmp0cfg_ref.(of_regval) v) else
  if string_dec reg_name "tselect" then option_map (fun v => tselect_ref.(write_to) v s) (tselect_ref.(of_regval) v) else
  if string_dec reg_name "stval" then option_map (fun v => stval_ref.(write_to) v s) (stval_ref.(of_regval) v) else
  if string_dec reg_name "scause" then option_map (fun v => scause_ref.(write_to) v s) (scause_ref.(of_regval) v) else
  if string_dec reg_name "sepc" then option_map (fun v => sepc_ref.(write_to) v s) (sepc_ref.(of_regval) v) else
  if string_dec reg_name "sscratch" then option_map (fun v => sscratch_ref.(write_to) v s) (sscratch_ref.(of_regval) v) else
  if string_dec reg_name "stvec" then option_map (fun v => stvec_ref.(write_to) v s) (stvec_ref.(of_regval) v) else
  if string_dec reg_name "sideleg" then option_map (fun v => sideleg_ref.(write_to) v s) (sideleg_ref.(of_regval) v) else
  if string_dec reg_name "sedeleg" then option_map (fun v => sedeleg_ref.(write_to) v s) (sedeleg_ref.(of_regval) v) else
  if string_dec reg_name "mhartid" then option_map (fun v => mhartid_ref.(write_to) v s) (mhartid_ref.(of_regval) v) else
  if string_dec reg_name "marchid" then option_map (fun v => marchid_ref.(write_to) v s) (marchid_ref.(of_regval) v) else
  if string_dec reg_name "mimpid" then option_map (fun v => mimpid_ref.(write_to) v s) (mimpid_ref.(of_regval) v) else
  if string_dec reg_name "mvendorid" then option_map (fun v => mvendorid_ref.(write_to) v s) (mvendorid_ref.(of_regval) v) else
  if string_dec reg_name "minstret_written" then option_map (fun v => minstret_written_ref.(write_to) v s) (minstret_written_ref.(of_regval) v) else
  if string_dec reg_name "minstret" then option_map (fun v => minstret_ref.(write_to) v s) (minstret_ref.(of_regval) v) else
  if string_dec reg_name "mtime" then option_map (fun v => mtime_ref.(write_to) v s) (mtime_ref.(of_regval) v) else
  if string_dec reg_name "mcycle" then option_map (fun v => mcycle_ref.(write_to) v s) (mcycle_ref.(of_regval) v) else
  if string_dec reg_name "scounteren" then option_map (fun v => scounteren_ref.(write_to) v s) (scounteren_ref.(of_regval) v) else
  if string_dec reg_name "mcounteren" then option_map (fun v => mcounteren_ref.(write_to) v s) (mcounteren_ref.(of_regval) v) else
  if string_dec reg_name "mscratch" then option_map (fun v => mscratch_ref.(write_to) v s) (mscratch_ref.(of_regval) v) else
  if string_dec reg_name "mtval" then option_map (fun v => mtval_ref.(write_to) v s) (mtval_ref.(of_regval) v) else
  if string_dec reg_name "mepc" then option_map (fun v => mepc_ref.(write_to) v s) (mepc_ref.(of_regval) v) else
  if string_dec reg_name "mcause" then option_map (fun v => mcause_ref.(write_to) v s) (mcause_ref.(of_regval) v) else
  if string_dec reg_name "mtvec" then option_map (fun v => mtvec_ref.(write_to) v s) (mtvec_ref.(of_regval) v) else
  if string_dec reg_name "medeleg" then option_map (fun v => medeleg_ref.(write_to) v s) (medeleg_ref.(of_regval) v) else
  if string_dec reg_name "mideleg" then option_map (fun v => mideleg_ref.(write_to) v s) (mideleg_ref.(of_regval) v) else
  if string_dec reg_name "mie" then option_map (fun v => mie_ref.(write_to) v s) (mie_ref.(of_regval) v) else
  if string_dec reg_name "mip" then option_map (fun v => mip_ref.(write_to) v s) (mip_ref.(of_regval) v) else
  if string_dec reg_name "mstatus" then option_map (fun v => mstatus_ref.(write_to) v s) (mstatus_ref.(of_regval) v) else
  if string_dec reg_name "misa" then option_map (fun v => misa_ref.(write_to) v s) (misa_ref.(of_regval) v) else
  if string_dec reg_name "cur_inst" then option_map (fun v => cur_inst_ref.(write_to) v s) (cur_inst_ref.(of_regval) v) else
  if string_dec reg_name "cur_privilege" then option_map (fun v => cur_privilege_ref.(write_to) v s) (cur_privilege_ref.(of_regval) v) else
  if string_dec reg_name "x31" then option_map (fun v => x31_ref.(write_to) v s) (x31_ref.(of_regval) v) else
  if string_dec reg_name "x30" then option_map (fun v => x30_ref.(write_to) v s) (x30_ref.(of_regval) v) else
  if string_dec reg_name "x29" then option_map (fun v => x29_ref.(write_to) v s) (x29_ref.(of_regval) v) else
  if string_dec reg_name "x28" then option_map (fun v => x28_ref.(write_to) v s) (x28_ref.(of_regval) v) else
  if string_dec reg_name "x27" then option_map (fun v => x27_ref.(write_to) v s) (x27_ref.(of_regval) v) else
  if string_dec reg_name "x26" then option_map (fun v => x26_ref.(write_to) v s) (x26_ref.(of_regval) v) else
  if string_dec reg_name "x25" then option_map (fun v => x25_ref.(write_to) v s) (x25_ref.(of_regval) v) else
  if string_dec reg_name "x24" then option_map (fun v => x24_ref.(write_to) v s) (x24_ref.(of_regval) v) else
  if string_dec reg_name "x23" then option_map (fun v => x23_ref.(write_to) v s) (x23_ref.(of_regval) v) else
  if string_dec reg_name "x22" then option_map (fun v => x22_ref.(write_to) v s) (x22_ref.(of_regval) v) else
  if string_dec reg_name "x21" then option_map (fun v => x21_ref.(write_to) v s) (x21_ref.(of_regval) v) else
  if string_dec reg_name "x20" then option_map (fun v => x20_ref.(write_to) v s) (x20_ref.(of_regval) v) else
  if string_dec reg_name "x19" then option_map (fun v => x19_ref.(write_to) v s) (x19_ref.(of_regval) v) else
  if string_dec reg_name "x18" then option_map (fun v => x18_ref.(write_to) v s) (x18_ref.(of_regval) v) else
  if string_dec reg_name "x17" then option_map (fun v => x17_ref.(write_to) v s) (x17_ref.(of_regval) v) else
  if string_dec reg_name "x16" then option_map (fun v => x16_ref.(write_to) v s) (x16_ref.(of_regval) v) else
  if string_dec reg_name "x15" then option_map (fun v => x15_ref.(write_to) v s) (x15_ref.(of_regval) v) else
  if string_dec reg_name "x14" then option_map (fun v => x14_ref.(write_to) v s) (x14_ref.(of_regval) v) else
  if string_dec reg_name "x13" then option_map (fun v => x13_ref.(write_to) v s) (x13_ref.(of_regval) v) else
  if string_dec reg_name "x12" then option_map (fun v => x12_ref.(write_to) v s) (x12_ref.(of_regval) v) else
  if string_dec reg_name "x11" then option_map (fun v => x11_ref.(write_to) v s) (x11_ref.(of_regval) v) else
  if string_dec reg_name "x10" then option_map (fun v => x10_ref.(write_to) v s) (x10_ref.(of_regval) v) else
  if string_dec reg_name "x9" then option_map (fun v => x9_ref.(write_to) v s) (x9_ref.(of_regval) v) else
  if string_dec reg_name "x8" then option_map (fun v => x8_ref.(write_to) v s) (x8_ref.(of_regval) v) else
  if string_dec reg_name "x7" then option_map (fun v => x7_ref.(write_to) v s) (x7_ref.(of_regval) v) else
  if string_dec reg_name "x6" then option_map (fun v => x6_ref.(write_to) v s) (x6_ref.(of_regval) v) else
  if string_dec reg_name "x5" then option_map (fun v => x5_ref.(write_to) v s) (x5_ref.(of_regval) v) else
  if string_dec reg_name "x4" then option_map (fun v => x4_ref.(write_to) v s) (x4_ref.(of_regval) v) else
  if string_dec reg_name "x3" then option_map (fun v => x3_ref.(write_to) v s) (x3_ref.(of_regval) v) else
  if string_dec reg_name "x2" then option_map (fun v => x2_ref.(write_to) v s) (x2_ref.(of_regval) v) else
  if string_dec reg_name "x1" then option_map (fun v => x1_ref.(write_to) v s) (x1_ref.(of_regval) v) else
  if string_dec reg_name "Xs" then option_map (fun v => Xs_ref.(write_to) v s) (Xs_ref.(of_regval) v) else
  if string_dec reg_name "instbits" then option_map (fun v => instbits_ref.(write_to) v s) (instbits_ref.(of_regval) v) else
  if string_dec reg_name "nextPC" then option_map (fun v => nextPC_ref.(write_to) v s) (nextPC_ref.(of_regval) v) else
  if string_dec reg_name "PC" then option_map (fun v => PC_ref.(write_to) v s) (PC_ref.(of_regval) v) else
  None.

Definition register_accessors := (get_regval, set_regval).


Definition MR a r := monadR register_value a r exception.
Definition M a := monad register_value a exception.
