(*Generated by Sail from riscv.*)
Require Import Sail.Base.
Require Import Sail.Real.
Require Import riscv_types.
Require Import mem_metadata.
Require Import riscv_extras.
Import ListNotations.
Open Scope string.
Open Scope bool.
Open Scope Z.


Definition is_none {a : Type} (opt : option a) : bool :=
   match opt with | Some _ => false | None => true end.

Definition is_some {a : Type} (opt : option a) : bool :=
   match opt with | Some _ => true | None => false end.

Definition eq_unit (_ : unit) (_ : unit) : {_bool : bool & ArithFact (_bool)} := build_ex (true).

Definition neq_int (x : Z) (y : Z) : {_bool : bool & ArithFact (Bool.eqb (negb (x =? y)) _bool)} :=
   build_ex (negb (Z.eqb x y)).

Definition neq_bool (x : bool) (y : bool) : bool := negb (Bool.eqb x y).

Definition __id (x : Z) : {_retval : Z & ArithFact (_retval =? x)} := build_ex (x).

Definition _shl_int_general (m : Z) (n : Z) : Z :=
   if sumbool_of_bool (Z.geb n 0) then shl_int m n else shr_int m (Z.opp n).

Definition _shr_int_general (m : Z) (n : Z) : Z :=
   if sumbool_of_bool (Z.geb n 0) then shr_int m n else shl_int m (Z.opp n).

Definition fdiv_int (n : Z) (m : Z) : Z :=
   if sumbool_of_bool (andb (Z.ltb n 0) (Z.gtb m 0)) then Z.sub (Z.quot (Z.add n 1) m) 1
   else if sumbool_of_bool (andb (Z.gtb n 0) (Z.ltb m 0)) then Z.sub (Z.quot (Z.sub n 1) m) 1
   else Z.quot n m.

Definition fmod_int (n : Z) (m : Z) : Z := Z.sub n (Z.mul m (fdiv_int n m)).

Definition concat_str_bits {n : Z} (str : string) (x : mword n) : string :=
   String.append str (string_of_bits x).

Definition concat_str_dec (str : string) (x : Z) : string := String.append str (dec_str x).



Definition sail_mask {v0 : Z} (len : Z) (v : mword v0) `{ArithFact ((len >=? 0) && (v0 >=? 0))}
: mword len :=
   if sumbool_of_bool (Z.leb len (length_mword v)) then vector_truncate v len else zero_extend v len.

Definition sail_ones (n : Z) `{ArithFact (n >=? 0)} : mword n := not_vec (zeros n).

Definition slice_mask (n : Z) (i : Z) (l : Z) `{ArithFact (n >=? 0)} : mword n :=
   if sumbool_of_bool (Z.geb l n) then shiftl (sail_ones n) i
   else
     let one : bits n := sail_mask n ('b"1"  : bits 1) in
     shiftl (sub_vec (shiftl one l) one) i.

Definition read_kind_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 11))} : read_kind :=
   let l__292 := arg_ in
   if sumbool_of_bool (Z.eqb l__292 0) then Read_plain
   else if sumbool_of_bool (Z.eqb l__292 1) then Read_reserve
   else if sumbool_of_bool (Z.eqb l__292 2) then Read_acquire
   else if sumbool_of_bool (Z.eqb l__292 3) then Read_exclusive
   else if sumbool_of_bool (Z.eqb l__292 4) then Read_exclusive_acquire
   else if sumbool_of_bool (Z.eqb l__292 5) then Read_stream
   else if sumbool_of_bool (Z.eqb l__292 6) then Read_RISCV_acquire
   else if sumbool_of_bool (Z.eqb l__292 7) then Read_RISCV_strong_acquire
   else if sumbool_of_bool (Z.eqb l__292 8) then Read_RISCV_reserved
   else if sumbool_of_bool (Z.eqb l__292 9) then Read_RISCV_reserved_acquire
   else if sumbool_of_bool (Z.eqb l__292 10) then Read_RISCV_reserved_strong_acquire
   else Read_X86_locked.

Definition num_of_read_kind (arg_ : read_kind) : {e : Z & ArithFact ((0 <=? e) && (e <=? 11))} :=
   build_ex (
      match arg_ with
      | Read_plain => 0
      | Read_reserve => 1
      | Read_acquire => 2
      | Read_exclusive => 3
      | Read_exclusive_acquire => 4
      | Read_stream => 5
      | Read_RISCV_acquire => 6
      | Read_RISCV_strong_acquire => 7
      | Read_RISCV_reserved => 8
      | Read_RISCV_reserved_acquire => 9
      | Read_RISCV_reserved_strong_acquire => 10
      | Read_X86_locked => 11
      end
   ).

Definition write_kind_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 10))} : write_kind :=
   let l__282 := arg_ in
   if sumbool_of_bool (Z.eqb l__282 0) then Write_plain
   else if sumbool_of_bool (Z.eqb l__282 1) then Write_conditional
   else if sumbool_of_bool (Z.eqb l__282 2) then Write_release
   else if sumbool_of_bool (Z.eqb l__282 3) then Write_exclusive
   else if sumbool_of_bool (Z.eqb l__282 4) then Write_exclusive_release
   else if sumbool_of_bool (Z.eqb l__282 5) then Write_RISCV_release
   else if sumbool_of_bool (Z.eqb l__282 6) then Write_RISCV_strong_release
   else if sumbool_of_bool (Z.eqb l__282 7) then Write_RISCV_conditional
   else if sumbool_of_bool (Z.eqb l__282 8) then Write_RISCV_conditional_release
   else if sumbool_of_bool (Z.eqb l__282 9) then Write_RISCV_conditional_strong_release
   else Write_X86_locked.

Definition num_of_write_kind (arg_ : write_kind) : {e : Z & ArithFact ((0 <=? e) && (e <=? 10))} :=
   build_ex (
      match arg_ with
      | Write_plain => 0
      | Write_conditional => 1
      | Write_release => 2
      | Write_exclusive => 3
      | Write_exclusive_release => 4
      | Write_RISCV_release => 5
      | Write_RISCV_strong_release => 6
      | Write_RISCV_conditional => 7
      | Write_RISCV_conditional_release => 8
      | Write_RISCV_conditional_strong_release => 9
      | Write_X86_locked => 10
      end
   ).

Definition a64_barrier_domain_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 3))}
: a64_barrier_domain :=
   let l__279 := arg_ in
   if sumbool_of_bool (Z.eqb l__279 0) then A64_FullShare
   else if sumbool_of_bool (Z.eqb l__279 1) then A64_InnerShare
   else if sumbool_of_bool (Z.eqb l__279 2) then A64_OuterShare
   else A64_NonShare.

Definition num_of_a64_barrier_domain (arg_ : a64_barrier_domain)
: {e : Z & ArithFact ((0 <=? e) && (e <=? 3))} :=
   build_ex (
      match arg_ with
      | A64_FullShare => 0
      | A64_InnerShare => 1
      | A64_OuterShare => 2
      | A64_NonShare => 3
      end
   ).

Definition a64_barrier_type_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 2))}
: a64_barrier_type :=
   let l__277 := arg_ in
   if sumbool_of_bool (Z.eqb l__277 0) then A64_barrier_all
   else if sumbool_of_bool (Z.eqb l__277 1) then A64_barrier_LD
   else A64_barrier_ST.

Definition num_of_a64_barrier_type (arg_ : a64_barrier_type)
: {e : Z & ArithFact ((0 <=? e) && (e <=? 2))} :=
   build_ex (match arg_ with | A64_barrier_all => 0 | A64_barrier_LD => 1 | A64_barrier_ST => 2 end).

Definition trans_kind_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 2))} : trans_kind :=
   let l__275 := arg_ in
   if sumbool_of_bool (Z.eqb l__275 0) then Transaction_start
   else if sumbool_of_bool (Z.eqb l__275 1) then Transaction_commit
   else Transaction_abort.

Definition num_of_trans_kind (arg_ : trans_kind) : {e : Z & ArithFact ((0 <=? e) && (e <=? 2))} :=
   build_ex (
      match arg_ with
      | Transaction_start => 0
      | Transaction_commit => 1
      | Transaction_abort => 2
      end
   ).

Definition cache_op_kind_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 10))}
: cache_op_kind :=
   let l__265 := arg_ in
   if sumbool_of_bool (Z.eqb l__265 0) then Cache_op_D_IVAC
   else if sumbool_of_bool (Z.eqb l__265 1) then Cache_op_D_ISW
   else if sumbool_of_bool (Z.eqb l__265 2) then Cache_op_D_CSW
   else if sumbool_of_bool (Z.eqb l__265 3) then Cache_op_D_CISW
   else if sumbool_of_bool (Z.eqb l__265 4) then Cache_op_D_ZVA
   else if sumbool_of_bool (Z.eqb l__265 5) then Cache_op_D_CVAC
   else if sumbool_of_bool (Z.eqb l__265 6) then Cache_op_D_CVAU
   else if sumbool_of_bool (Z.eqb l__265 7) then Cache_op_D_CIVAC
   else if sumbool_of_bool (Z.eqb l__265 8) then Cache_op_I_IALLUIS
   else if sumbool_of_bool (Z.eqb l__265 9) then Cache_op_I_IALLU
   else Cache_op_I_IVAU.

Definition num_of_cache_op_kind (arg_ : cache_op_kind)
: {e : Z & ArithFact ((0 <=? e) && (e <=? 10))} :=
   build_ex (
      match arg_ with
      | Cache_op_D_IVAC => 0
      | Cache_op_D_ISW => 1
      | Cache_op_D_CSW => 2
      | Cache_op_D_CISW => 3
      | Cache_op_D_ZVA => 4
      | Cache_op_D_CVAC => 5
      | Cache_op_D_CVAU => 6
      | Cache_op_D_CIVAC => 7
      | Cache_op_I_IALLUIS => 8
      | Cache_op_I_IALLU => 9
      | Cache_op_I_IVAU => 10
      end
   ).

Definition not_bit (b : bitU) : bitU := if eq_bit b B1 then B0 else B1.

Definition neq_vec {n : Z} (x : mword n) (y : mword n) : bool := negb (eq_vec x y).



Definition string_of_bit (b : bitU) : M (string) :=
   (match b with | B0 => returnm "0b0" | B1 => returnm "0b1" | _ => exit tt  : M (string) end)
    : M (string).

Definition get_config_print_instr '(tt : unit) : bool := false.

Definition get_config_print_reg '(tt : unit) : bool := false.

Definition get_config_print_mem '(tt : unit) : bool := false.

Definition get_config_print_platform '(tt : unit) : bool := false.

Definition EXTS {n : Z} (m : Z) (v : mword n) `{ArithFact (m >=? n)} : mword m := sign_extend v m.

Definition EXTZ {n : Z} (m : Z) (v : mword n) `{ArithFact (m >=? n)} : mword m := zero_extend v m.

Definition zeros_implicit (n : Z) `{ArithFact (n >=? 0)} : mword n := zeros n.

Definition ones (n : Z) `{ArithFact (n >=? 0)} : mword n := sail_ones n.

Definition bool_to_bits (x : bool) : mword 1 :=
   if sumbool_of_bool x then 'b"1"  : mword 1 else 'b"0"  : mword 1.

Definition bit_to_bool (b : bitU) : M (bool) :=
   (match b with | B1 => returnm true | B0 => returnm false | _ => exit tt  : M (bool) end)
    : M (bool).

Definition to_bits (l : Z) (n : Z) `{ArithFact (l >=? 0)} : mword l := get_slice_int l n 0.

Definition zopz0zI_s {n : Z} (x : mword n) (y : mword n) `{ArithFact (n >? 0)} : bool :=
   Z.ltb (projT1 (sint x)) (projT1 (sint y)).

Definition zopz0zKzJ_s {n : Z} (x : mword n) (y : mword n) `{ArithFact (n >? 0)} : bool :=
   Z.geb (projT1 (sint x)) (projT1 (sint y)).

Definition zopz0zI_u {n : Z} (x : mword n) (y : mword n) : bool :=
   Z.ltb (projT1 (uint x)) (projT1 (uint y)).

Definition zopz0zKzJ_u {n : Z} (x : mword n) (y : mword n) : bool :=
   Z.geb (projT1 (uint x)) (projT1 (uint y)).

Definition zopz0zIzJ_u {n : Z} (x : mword n) (y : mword n) : bool :=
   Z.leb (projT1 (uint x)) (projT1 (uint y)).

Definition shift_right_arith64 (v : mword 64) (shift : mword 6) : mword 64 :=
   let v128 : bits 128 := EXTS 128 v in
   subrange_vec_dec (shift_bits_right v128 shift) 63 0.

Definition shift_right_arith32 (v : mword 32) (shift : mword 5) : mword 32 :=
   let v64 : bits 64 := EXTS 64 v in
   subrange_vec_dec (shift_bits_right v64 shift) 31 0.

Axiom spc_forwards_matches : forall  (_ : unit) , bool.

Axiom spc_backwards_matches : forall  (_ : string) , bool.

Axiom opt_spc_forwards_matches : forall  (_ : unit) , bool.

Axiom opt_spc_backwards_matches : forall  (_ : string) , bool.

Axiom def_spc_forwards_matches : forall  (_ : unit) , bool.

Axiom def_spc_backwards_matches : forall  (_ : string) , bool.

Axiom hex_bits_forwards : forall {n : Z} (_ : (Z * mword n)) , string.

Axiom hex_bits_backwards : forall {n : Z} (_ : string) , (Z * mword n).

Axiom hex_bits_forwards_matches : forall {n : Z} (_ : (Z * mword n)) , bool.

Axiom hex_bits_backwards_matches : forall  (_ : string) , bool.

Axiom hex_bits_matches_prefix : forall
{n : Z}
(_ : string)
,
option (((Z * mword n) * {n : Z & ArithFact (n >=? 0)})).

Fixpoint _rec_n_leading_spaces (s : string) (_reclimit : Z) (_acc : Acc (Zwf 0) _reclimit)
{struct _acc} : M ({n : Z & ArithFact (n >=? 0)}).
exact (
   assert_exp' (Z.geb _reclimit 0) "recursion limit reached" >>= fun _ =>
   let p0_ := s in
   (if generic_eq p0_ "" then returnm (build_ex 0)
    else
      let p0_ := string_take s 1 in
      (if generic_eq p0_ " " then
         (_rec_n_leading_spaces (string_drop s 1) (Z.sub _reclimit 1) (_limit_reduces _acc)) >>= fun '(existT _ w__0 _ : {n : Z & ArithFact (n >=?
           0)}) =>
         returnm (build_ex (Z.add 1 w__0))
       else returnm (build_ex 0))
       : M ({n : Z & ArithFact (n >=? 0)}))
    : M ({n : Z & ArithFact (n >=? 0)})
).
Defined.


Definition n_leading_spaces (s : string) : M ({n : Z & ArithFact (n >=? 0)}) :=
   (_rec_n_leading_spaces s ((projT1 (string_length s))  : Z) (Zwf_guarded _))
    : M ({n : Z & ArithFact (n >=? 0)}).

Definition spc_forwards '(tt : unit) : string := " ".

Definition spc_backwards (s : string) : unit := tt.

Definition spc_matches_prefix (s : string) : M (option ((unit * {n : Z & ArithFact (n >=? 0)}))) :=
   (n_leading_spaces s) >>= fun '(existT _ n _) =>
   let l__264 := n in
   returnm (if sumbool_of_bool (Z.eqb l__264 0) then None else Some (tt, build_ex n)).

Definition opt_spc_forwards '(tt : unit) : string := "".

Definition opt_spc_backwards (s : string) : unit := tt.

Definition opt_spc_matches_prefix (s : string) : M (option ((unit * {n : Z & ArithFact (n >=? 0)}))) :=
   (n_leading_spaces s) >>= fun '(existT _ w__0 _ : {n : Z & ArithFact (n >=? 0)}) =>
   returnm (Some (tt, build_ex w__0)).

Definition def_spc_forwards '(tt : unit) : string := " ".

Definition def_spc_backwards (s : string) : unit := tt.

Definition def_spc_matches_prefix (s : string) : M (option ((unit * {n : Z & ArithFact (n >=? 0)}))) :=
   (opt_spc_matches_prefix s)  : M (option ((unit * {n : Z & ArithFact (n >=? 0)}))).

Definition hex_bits_1_forwards_matches (bv : mword 1) : bool := true.

Definition hex_bits_1_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_1_matches_prefix s) with
         | Some (g__373, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_1_backwards (s : string) : M (mword 1) :=
   (match (hex_bits_1_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 49:2 - 51:3" >>= fun _ =>
          exit tt)
        : M (mword 1)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 49:2 - 51:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 1).

Definition hex_bits_2_forwards_matches (bv : mword 2) : bool := true.

Definition hex_bits_2_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_2_matches_prefix s) with
         | Some (g__372, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_2_backwards (s : string) : M (mword 2) :=
   (match (hex_bits_2_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 68:2 - 70:3" >>= fun _ =>
          exit tt)
        : M (mword 2)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 68:2 - 70:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 2).

Definition hex_bits_3_forwards_matches (bv : mword 3) : bool := true.

Definition hex_bits_3_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_3_matches_prefix s) with
         | Some (g__371, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_3_backwards (s : string) : M (mword 3) :=
   (match (hex_bits_3_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 87:2 - 89:3" >>= fun _ =>
          exit tt)
        : M (mword 3)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 87:2 - 89:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 3).

Definition hex_bits_4_forwards_matches (bv : mword 4) : bool := true.

Definition hex_bits_4_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_4_matches_prefix s) with
         | Some (g__370, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_4_backwards (s : string) : M (mword 4) :=
   (match (hex_bits_4_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 106:2 - 108:3" >>= fun _ =>
          exit tt)
        : M (mword 4)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 106:2 - 108:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 4).

Definition hex_bits_5_forwards_matches (bv : mword 5) : bool := true.

Definition hex_bits_5_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_5_matches_prefix s) with
         | Some (g__369, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_5_backwards (s : string) : M (mword 5) :=
   (match (hex_bits_5_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 125:2 - 127:3" >>= fun _ =>
          exit tt)
        : M (mword 5)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 125:2 - 127:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 5).

Definition hex_bits_6_forwards_matches (bv : mword 6) : bool := true.

Definition hex_bits_6_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_6_matches_prefix s) with
         | Some (g__368, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_6_backwards (s : string) : M (mword 6) :=
   (match (hex_bits_6_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 144:2 - 146:3" >>= fun _ =>
          exit tt)
        : M (mword 6)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 144:2 - 146:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 6).

Definition hex_bits_7_forwards_matches (bv : mword 7) : bool := true.

Definition hex_bits_7_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_7_matches_prefix s) with
         | Some (g__367, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_7_backwards (s : string) : M (mword 7) :=
   (match (hex_bits_7_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 163:2 - 165:3" >>= fun _ =>
          exit tt)
        : M (mword 7)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 163:2 - 165:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 7).

Definition hex_bits_8_forwards_matches (bv : mword 8) : bool := true.

Definition hex_bits_8_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_8_matches_prefix s) with
         | Some (g__366, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_8_backwards (s : string) : M (mword 8) :=
   (match (hex_bits_8_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 182:2 - 184:3" >>= fun _ =>
          exit tt)
        : M (mword 8)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 182:2 - 184:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 8).

Definition hex_bits_9_forwards_matches (bv : mword 9) : bool := true.

Definition hex_bits_9_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_9_matches_prefix s) with
         | Some (g__365, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_9_backwards (s : string) : M (mword 9) :=
   (match (hex_bits_9_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 201:2 - 203:3" >>= fun _ =>
          exit tt)
        : M (mword 9)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 201:2 - 203:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 9).

Definition hex_bits_10_forwards_matches (bv : mword 10) : bool := true.

Definition hex_bits_10_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_10_matches_prefix s) with
         | Some (g__364, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_10_backwards (s : string) : M (mword 10) :=
   (match (hex_bits_10_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 220:2 - 222:3" >>= fun _ =>
          exit tt)
        : M (mword 10)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 220:2 - 222:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 10).

Definition hex_bits_11_forwards_matches (bv : mword 11) : bool := true.

Definition hex_bits_11_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_11_matches_prefix s) with
         | Some (g__363, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_11_backwards (s : string) : M (mword 11) :=
   (match (hex_bits_11_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 239:2 - 241:3" >>= fun _ =>
          exit tt)
        : M (mword 11)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 239:2 - 241:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 11).

Definition hex_bits_12_forwards_matches (bv : mword 12) : bool := true.

Definition hex_bits_12_matches_prefix (s : string)
: option ((mword 12 * {n : Z & ArithFact (n >=? 0)})) :=
   None.

Definition hex_bits_12_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_12_matches_prefix s) with
         | Some (g__362, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_12_backwards (s : string) : M (mword 12) :=
   (match (hex_bits_12_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 262:2 - 264:3" >>= fun _ =>
          exit tt)
        : M (mword 12)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 262:2 - 264:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 12).

Definition hex_bits_13_forwards_matches (bv : mword 13) : bool := true.

Definition hex_bits_13_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_13_matches_prefix s) with
         | Some (g__361, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_13_backwards (s : string) : M (mword 13) :=
   (match (hex_bits_13_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 281:2 - 283:3" >>= fun _ =>
          exit tt)
        : M (mword 13)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 281:2 - 283:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 13).

Definition hex_bits_14_forwards_matches (bv : mword 14) : bool := true.

Definition hex_bits_14_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_14_matches_prefix s) with
         | Some (g__360, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_14_backwards (s : string) : M (mword 14) :=
   (match (hex_bits_14_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 300:2 - 302:3" >>= fun _ =>
          exit tt)
        : M (mword 14)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 300:2 - 302:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 14).

Definition hex_bits_15_forwards_matches (bv : mword 15) : bool := true.

Definition hex_bits_15_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_15_matches_prefix s) with
         | Some (g__359, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_15_backwards (s : string) : M (mword 15) :=
   (match (hex_bits_15_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 319:2 - 321:3" >>= fun _ =>
          exit tt)
        : M (mword 15)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 319:2 - 321:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 15).

Definition hex_bits_16_forwards_matches (bv : mword 16) : bool := true.

Definition hex_bits_16_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_16_matches_prefix s) with
         | Some (g__358, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_16_backwards (s : string) : M (mword 16) :=
   (match (hex_bits_16_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 338:2 - 340:3" >>= fun _ =>
          exit tt)
        : M (mword 16)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 338:2 - 340:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 16).

Definition hex_bits_17_forwards_matches (bv : mword 17) : bool := true.

Definition hex_bits_17_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_17_matches_prefix s) with
         | Some (g__357, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_17_backwards (s : string) : M (mword 17) :=
   (match (hex_bits_17_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 357:2 - 359:3" >>= fun _ =>
          exit tt)
        : M (mword 17)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 357:2 - 359:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 17).

Definition hex_bits_18_forwards_matches (bv : mword 18) : bool := true.

Definition hex_bits_18_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_18_matches_prefix s) with
         | Some (g__356, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_18_backwards (s : string) : M (mword 18) :=
   (match (hex_bits_18_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 376:2 - 378:3" >>= fun _ =>
          exit tt)
        : M (mword 18)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 376:2 - 378:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 18).

Definition hex_bits_19_forwards_matches (bv : mword 19) : bool := true.

Definition hex_bits_19_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_19_matches_prefix s) with
         | Some (g__355, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_19_backwards (s : string) : M (mword 19) :=
   (match (hex_bits_19_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 395:2 - 397:3" >>= fun _ =>
          exit tt)
        : M (mword 19)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 395:2 - 397:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 19).

Definition hex_bits_20_forwards_matches (bv : mword 20) : bool := true.

Definition hex_bits_20_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_20_matches_prefix s) with
         | Some (g__354, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_20_backwards (s : string) : M (mword 20) :=
   (match (hex_bits_20_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 414:2 - 416:3" >>= fun _ =>
          exit tt)
        : M (mword 20)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 414:2 - 416:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 20).

Definition hex_bits_21_forwards_matches (bv : mword 21) : bool := true.

Definition hex_bits_21_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_21_matches_prefix s) with
         | Some (g__353, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_21_backwards (s : string) : M (mword 21) :=
   (match (hex_bits_21_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 433:2 - 435:3" >>= fun _ =>
          exit tt)
        : M (mword 21)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 433:2 - 435:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 21).

Definition hex_bits_22_forwards_matches (bv : mword 22) : bool := true.

Definition hex_bits_22_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_22_matches_prefix s) with
         | Some (g__352, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_22_backwards (s : string) : M (mword 22) :=
   (match (hex_bits_22_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 452:2 - 454:3" >>= fun _ =>
          exit tt)
        : M (mword 22)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 452:2 - 454:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 22).

Definition hex_bits_23_forwards_matches (bv : mword 23) : bool := true.

Definition hex_bits_23_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_23_matches_prefix s) with
         | Some (g__351, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_23_backwards (s : string) : M (mword 23) :=
   (match (hex_bits_23_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 471:2 - 473:3" >>= fun _ =>
          exit tt)
        : M (mword 23)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 471:2 - 473:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 23).

Definition hex_bits_24_forwards_matches (bv : mword 24) : bool := true.

Definition hex_bits_24_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_24_matches_prefix s) with
         | Some (g__350, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_24_backwards (s : string) : M (mword 24) :=
   (match (hex_bits_24_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 490:2 - 492:3" >>= fun _ =>
          exit tt)
        : M (mword 24)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 490:2 - 492:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 24).

Definition hex_bits_25_forwards_matches (bv : mword 25) : bool := true.

Definition hex_bits_25_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_25_matches_prefix s) with
         | Some (g__349, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_25_backwards (s : string) : M (mword 25) :=
   (match (hex_bits_25_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 509:2 - 511:3" >>= fun _ =>
          exit tt)
        : M (mword 25)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 509:2 - 511:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 25).

Definition hex_bits_26_forwards_matches (bv : mword 26) : bool := true.

Definition hex_bits_26_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_26_matches_prefix s) with
         | Some (g__348, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_26_backwards (s : string) : M (mword 26) :=
   (match (hex_bits_26_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 528:2 - 530:3" >>= fun _ =>
          exit tt)
        : M (mword 26)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 528:2 - 530:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 26).

Definition hex_bits_27_forwards_matches (bv : mword 27) : bool := true.

Definition hex_bits_27_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_27_matches_prefix s) with
         | Some (g__347, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_27_backwards (s : string) : M (mword 27) :=
   (match (hex_bits_27_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 547:2 - 549:3" >>= fun _ =>
          exit tt)
        : M (mword 27)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 547:2 - 549:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 27).

Definition hex_bits_28_forwards_matches (bv : mword 28) : bool := true.

Definition hex_bits_28_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_28_matches_prefix s) with
         | Some (g__346, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_28_backwards (s : string) : M (mword 28) :=
   (match (hex_bits_28_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 566:2 - 568:3" >>= fun _ =>
          exit tt)
        : M (mword 28)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 566:2 - 568:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 28).

Definition hex_bits_29_forwards_matches (bv : mword 29) : bool := true.

Definition hex_bits_29_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_29_matches_prefix s) with
         | Some (g__345, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_29_backwards (s : string) : M (mword 29) :=
   (match (hex_bits_29_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 585:2 - 587:3" >>= fun _ =>
          exit tt)
        : M (mword 29)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 585:2 - 587:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 29).

Definition hex_bits_30_forwards_matches (bv : mword 30) : bool := true.

Definition hex_bits_30_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_30_matches_prefix s) with
         | Some (g__344, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_30_backwards (s : string) : M (mword 30) :=
   (match (hex_bits_30_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 604:2 - 606:3" >>= fun _ =>
          exit tt)
        : M (mword 30)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 604:2 - 606:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 30).

Definition hex_bits_31_forwards_matches (bv : mword 31) : bool := true.

Definition hex_bits_31_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_31_matches_prefix s) with
         | Some (g__343, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_31_backwards (s : string) : M (mword 31) :=
   (match (hex_bits_31_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 623:2 - 625:3" >>= fun _ =>
          exit tt)
        : M (mword 31)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 623:2 - 625:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 31).

Definition hex_bits_32_forwards_matches (bv : mword 32) : bool := true.

Definition hex_bits_32_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_32_matches_prefix s) with
         | Some (g__342, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_32_backwards (s : string) : M (mword 32) :=
   (match (hex_bits_32_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 642:2 - 644:3" >>= fun _ =>
          exit tt)
        : M (mword 32)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 642:2 - 644:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 32).

Definition hex_bits_33_forwards_matches (bv : mword 33) : bool := true.

Definition hex_bits_33_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_33_matches_prefix s) with
         | Some (g__341, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_33_backwards (s : string) : M (mword 33) :=
   (match (hex_bits_33_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 661:2 - 663:3" >>= fun _ =>
          exit tt)
        : M (mword 33)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 661:2 - 663:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 33).

Definition hex_bits_48_forwards_matches (bv : mword 48) : bool := true.

Definition hex_bits_48_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_48_matches_prefix s) with
         | Some (g__340, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_48_backwards (s : string) : M (mword 48) :=
   (match (hex_bits_48_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 680:2 - 682:3" >>= fun _ =>
          exit tt)
        : M (mword 48)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 680:2 - 682:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 48).

Definition hex_bits_64_forwards_matches (bv : mword 64) : bool := true.

Definition hex_bits_64_backwards_matches (s : string) : bool :=
   match s with
   | s =>
      if match (hex_bits_64_matches_prefix s) with
         | Some (g__339, existT _ n _) =>
            if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then true else false
         | _ => false
         end then
        true
      else false
   end.

Definition hex_bits_64_backwards (s : string) : M (mword 64) :=
   (match (hex_bits_64_matches_prefix s) with
    | Some (bv, existT _ n _) =>
       (if sumbool_of_bool (Z.eqb n (projT1 (string_length s))) then returnm bv
        else
          assert_exp' false "Pattern match failure at model/prelude_mapping.sail 699:2 - 701:3" >>= fun _ =>
          exit tt)
        : M (mword 64)
    | _ =>
       assert_exp' false "Pattern match failure at model/prelude_mapping.sail 699:2 - 701:3" >>= fun _ =>
       exit tt
    end)
    : M (mword 64).

Definition default_meta : mem_meta := tt.
Hint Unfold default_meta : sail.
Definition __WriteRAM_Meta (addr : mword 64) (width : Z) (meta : unit) : M (unit) := returnm tt.

Definition __ReadRAM_Meta (addr : mword 64) (width : Z) : M (unit) := returnm tt.



Definition write_ram_ea (wk : write_kind) (addr : mword 64) (width : Z)
`{ArithFact ((0 <? width) && (width <=? 16))}
: M (unit) :=
   (write_mem_ea wk 64 addr width)  : M (unit).



Axiom __TraceMemoryWrite : forall {m : Z} (n : Z) (_ : mword m) (_ : mword (8 * n)) , unit.

Axiom __TraceMemoryRead : forall {m : Z} (n : Z) (_ : mword m) (_ : mword (8 * n)) , unit.

Definition init_ext_ptw : ext_ptw := tt.
Hint Unfold init_ext_ptw : sail.
Definition ext_translate_exception (e : unit) : unit := e.

Definition ext_exc_type_to_bits (e : unit) : mword 8 := Ox"18"  : mword 8.

Definition num_of_ext_exc_type (e : unit) : {n : Z & ArithFact ((0 <=? n) && (n <? xlen))} :=
   build_ex (24).

Definition ext_exc_type_to_str (e : unit) : string := "extension-exception".

Definition xlen_val := 64.
Hint Unfold xlen_val : sail.
Definition xlen_max_unsigned := Z.sub (projT1 (pow2 64)) 1.
Hint Unfold xlen_max_unsigned : sail.
Definition xlen_max_signed := Z.sub (projT1 (pow2 (Z.sub 64 1))) 1.
Hint Unfold xlen_max_signed : sail.
Definition xlen_min_signed := Z.sub 0 (projT1 (pow2 (Z.sub 64 1))).
Hint Unfold xlen_min_signed : sail.
Definition regidx_to_regno (b : mword 5) : {n : Z & ArithFact ((0 <=? n) && (n <? 32))} :=
   build_ex (
      let r := projT1 (uint b) in
      r
   ).

Definition creg2reg_idx (creg : mword 3) : mword 5 := concat_vec ('b"01"  : mword 2) creg.

Definition zreg : regidx := 'b"00000"  : mword 5.
Hint Unfold zreg : sail.
Definition ra : regidx := 'b"00001"  : mword 5.
Hint Unfold ra : sail.
Definition sp : regidx := 'b"00010"  : mword 5.
Hint Unfold sp : sail.
Definition Architecture_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 2))} : Architecture :=
   let l__262 := arg_ in
   if sumbool_of_bool (Z.eqb l__262 0) then RV32
   else if sumbool_of_bool (Z.eqb l__262 1) then RV64
   else RV128.

Definition num_of_Architecture (arg_ : Architecture) : {e : Z & ArithFact ((0 <=? e) && (e <=? 2))} :=
   build_ex (match arg_ with | RV32 => 0 | RV64 => 1 | RV128 => 2 end).

Definition architecture (a : mword 2) : option Architecture :=
   let b__0 := a in
   if eq_vec b__0 ('b"01"  : mword 2) then Some RV32
   else if eq_vec b__0 ('b"10"  : mword 2) then Some RV64
   else if eq_vec b__0 ('b"11"  : mword 2) then Some RV128
   else None.

Definition arch_to_bits (a : Architecture) : mword 2 :=
   match a with
   | RV32 => 'b"01"  : mword 2
   | RV64 => 'b"10"  : mword 2
   | RV128 => 'b"11"  : mword 2
   end.

Definition Privilege_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 2))} : Privilege :=
   let l__260 := arg_ in
   if sumbool_of_bool (Z.eqb l__260 0) then User
   else if sumbool_of_bool (Z.eqb l__260 1) then Supervisor
   else Machine.

Definition num_of_Privilege (arg_ : Privilege) : {e : Z & ArithFact ((0 <=? e) && (e <=? 2))} :=
   build_ex (match arg_ with | User => 0 | Supervisor => 1 | Machine => 2 end).

Definition privLevel_to_bits (p : Privilege) : mword 2 :=
   match p with
   | User => 'b"00"  : mword 2
   | Supervisor => 'b"01"  : mword 2
   | Machine => 'b"11"  : mword 2
   end.

Definition privLevel_of_bits (p : mword 2) : M (Privilege) :=
   let b__0 := p in
   (if eq_vec b__0 ('b"00"  : mword 2) then returnm User
    else if eq_vec b__0 ('b"01"  : mword 2) then returnm Supervisor
    else if eq_vec b__0 ('b"11"  : mword 2) then returnm Machine
    else
      assert_exp' false "Pattern match failure at model/riscv_types.sail 78:2 - 82:3" >>= fun _ =>
      exit tt)
    : M (Privilege).

Definition privLevel_to_str (p : Privilege) : string :=
   match p with | User => "U" | Supervisor => "S" | Machine => "M" end.

Definition Retired_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 1))} : Retired :=
   let l__259 := arg_ in
   if sumbool_of_bool (Z.eqb l__259 0) then RETIRE_SUCCESS
   else RETIRE_FAIL.

Definition num_of_Retired (arg_ : Retired) : {e : Z & ArithFact ((0 <=? e) && (e <=? 1))} :=
   build_ex (match arg_ with | RETIRE_SUCCESS => 0 | RETIRE_FAIL => 1 end).

Definition word_width_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 3))} : word_width :=
   let l__256 := arg_ in
   if sumbool_of_bool (Z.eqb l__256 0) then BYTE
   else if sumbool_of_bool (Z.eqb l__256 1) then HALF
   else if sumbool_of_bool (Z.eqb l__256 2) then WORD
   else DOUBLE.

Definition num_of_word_width (arg_ : word_width) : {e : Z & ArithFact ((0 <=? e) && (e <=? 3))} :=
   build_ex (match arg_ with | BYTE => 0 | HALF => 1 | WORD => 2 | DOUBLE => 3 end).

Definition InterruptType_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 8))}
: InterruptType :=
   let l__248 := arg_ in
   if sumbool_of_bool (Z.eqb l__248 0) then I_U_Software
   else if sumbool_of_bool (Z.eqb l__248 1) then I_S_Software
   else if sumbool_of_bool (Z.eqb l__248 2) then I_M_Software
   else if sumbool_of_bool (Z.eqb l__248 3) then I_U_Timer
   else if sumbool_of_bool (Z.eqb l__248 4) then I_S_Timer
   else if sumbool_of_bool (Z.eqb l__248 5) then I_M_Timer
   else if sumbool_of_bool (Z.eqb l__248 6) then I_U_External
   else if sumbool_of_bool (Z.eqb l__248 7) then I_S_External
   else I_M_External.

Definition num_of_InterruptType (arg_ : InterruptType)
: {e : Z & ArithFact ((0 <=? e) && (e <=? 8))} :=
   build_ex (
      match arg_ with
      | I_U_Software => 0
      | I_S_Software => 1
      | I_M_Software => 2
      | I_U_Timer => 3
      | I_S_Timer => 4
      | I_M_Timer => 5
      | I_U_External => 6
      | I_S_External => 7
      | I_M_External => 8
      end
   ).

Definition interruptType_to_bits (i : InterruptType) : mword 8 :=
   match i with
   | I_U_Software => Ox"00"  : mword 8
   | I_S_Software => Ox"01"  : mword 8
   | I_M_Software => Ox"03"  : mword 8
   | I_U_Timer => Ox"04"  : mword 8
   | I_S_Timer => Ox"05"  : mword 8
   | I_M_Timer => Ox"07"  : mword 8
   | I_U_External => Ox"08"  : mword 8
   | I_S_External => Ox"09"  : mword 8
   | I_M_External => Ox"0B"  : mword 8
   end.

Definition exceptionType_to_bits (e : ExceptionType) : mword 8 :=
   match e with
   | E_Fetch_Addr_Align tt => Ox"00"  : mword 8
   | E_Fetch_Access_Fault tt => Ox"01"  : mword 8
   | E_Illegal_Instr tt => Ox"02"  : mword 8
   | E_Breakpoint tt => Ox"03"  : mword 8
   | E_Load_Addr_Align tt => Ox"04"  : mword 8
   | E_Load_Access_Fault tt => Ox"05"  : mword 8
   | E_SAMO_Addr_Align tt => Ox"06"  : mword 8
   | E_SAMO_Access_Fault tt => Ox"07"  : mword 8
   | E_U_EnvCall tt => Ox"08"  : mword 8
   | E_S_EnvCall tt => Ox"09"  : mword 8
   | E_Reserved_10 tt => Ox"0A"  : mword 8
   | E_M_EnvCall tt => Ox"0B"  : mword 8
   | E_Fetch_Page_Fault tt => Ox"0C"  : mword 8
   | E_Load_Page_Fault tt => Ox"0D"  : mword 8
   | E_Reserved_14 tt => Ox"0E"  : mword 8
   | E_SAMO_Page_Fault tt => Ox"0F"  : mword 8
   | E_Extension e => ext_exc_type_to_bits e
   end.

Definition num_of_ExceptionType (e : ExceptionType) : {n : Z & ArithFact ((0 <=? n) && (n <? xlen))} :=
   build_ex (
      match e with
      | E_Fetch_Addr_Align tt => 0
      | E_Fetch_Access_Fault tt => 1
      | E_Illegal_Instr tt => 2
      | E_Breakpoint tt => 3
      | E_Load_Addr_Align tt => 4
      | E_Load_Access_Fault tt => 5
      | E_SAMO_Addr_Align tt => 6
      | E_SAMO_Access_Fault tt => 7
      | E_U_EnvCall tt => 8
      | E_S_EnvCall tt => 9
      | E_Reserved_10 tt => 10
      | E_M_EnvCall tt => 11
      | E_Fetch_Page_Fault tt => 12
      | E_Load_Page_Fault tt => 13
      | E_Reserved_14 tt => 14
      | E_SAMO_Page_Fault tt => 15
      | E_Extension e => projT1 (num_of_ext_exc_type e)
      end
   ).

Definition exceptionType_to_str (e : ExceptionType) : string :=
   match e with
   | E_Fetch_Addr_Align tt => "misaligned-fetch"
   | E_Fetch_Access_Fault tt => "fetch-access-fault"
   | E_Illegal_Instr tt => "illegal-instruction"
   | E_Breakpoint tt => "breakpoint"
   | E_Load_Addr_Align tt => "misaligned-load"
   | E_Load_Access_Fault tt => "load-access-fault"
   | E_SAMO_Addr_Align tt => "misaliged-store/amo"
   | E_SAMO_Access_Fault tt => "store/amo-access-fault"
   | E_U_EnvCall tt => "u-call"
   | E_S_EnvCall tt => "s-call"
   | E_Reserved_10 tt => "reserved-0"
   | E_M_EnvCall tt => "m-call"
   | E_Fetch_Page_Fault tt => "fetch-page-fault"
   | E_Load_Page_Fault tt => "load-page-fault"
   | E_Reserved_14 tt => "reserved-1"
   | E_SAMO_Page_Fault tt => "store/amo-page-fault"
   | E_Extension e => ext_exc_type_to_str e
   end.

Definition not_implemented {a : Type} (message : string) : M (a) :=
   throw (Error_not_implemented message).

Definition internal_error {a : Type} (s : string) : M (a) :=
   assert_exp' false s >>= fun _ => exit tt.

Definition TrapVectorMode_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 2))}
: TrapVectorMode :=
   let l__246 := arg_ in
   if sumbool_of_bool (Z.eqb l__246 0) then TV_Direct
   else if sumbool_of_bool (Z.eqb l__246 1) then TV_Vector
   else TV_Reserved.

Definition num_of_TrapVectorMode (arg_ : TrapVectorMode)
: {e : Z & ArithFact ((0 <=? e) && (e <=? 2))} :=
   build_ex (match arg_ with | TV_Direct => 0 | TV_Vector => 1 | TV_Reserved => 2 end).

Definition trapVectorMode_of_bits (m : mword 2) : TrapVectorMode :=
   let b__0 := m in
   if eq_vec b__0 ('b"00"  : mword 2) then TV_Direct
   else if eq_vec b__0 ('b"01"  : mword 2) then TV_Vector
   else TV_Reserved.

Definition ExtStatus_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 3))} : ExtStatus :=
   let l__243 := arg_ in
   if sumbool_of_bool (Z.eqb l__243 0) then Off
   else if sumbool_of_bool (Z.eqb l__243 1) then Initial
   else if sumbool_of_bool (Z.eqb l__243 2) then Clean
   else Dirty.

Definition num_of_ExtStatus (arg_ : ExtStatus) : {e : Z & ArithFact ((0 <=? e) && (e <=? 3))} :=
   build_ex (match arg_ with | Off => 0 | Initial => 1 | Clean => 2 | Dirty => 3 end).

Definition extStatus_to_bits (e : ExtStatus) : mword 2 :=
   match e with
   | Off => 'b"00"  : mword 2
   | Initial => 'b"01"  : mword 2
   | Clean => 'b"10"  : mword 2
   | Dirty => 'b"11"  : mword 2
   end.

Definition extStatus_of_bits (e : mword 2) : M (ExtStatus) :=
   let b__0 := e in
   (if eq_vec b__0 ('b"00"  : mword 2) then returnm Off
    else if eq_vec b__0 ('b"01"  : mword 2) then returnm Initial
    else if eq_vec b__0 ('b"10"  : mword 2) then returnm Clean
    else if eq_vec b__0 ('b"11"  : mword 2) then returnm Dirty
    else
      assert_exp' false "Pattern match failure at model/riscv_types.sail 281:2 - 286:3" >>= fun _ =>
      exit tt)
    : M (ExtStatus).

Definition SATPMode_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 3))} : SATPMode :=
   let l__240 := arg_ in
   if sumbool_of_bool (Z.eqb l__240 0) then Sbare
   else if sumbool_of_bool (Z.eqb l__240 1) then Sv32
   else if sumbool_of_bool (Z.eqb l__240 2) then Sv39
   else Sv48.

Definition num_of_SATPMode (arg_ : SATPMode) : {e : Z & ArithFact ((0 <=? e) && (e <=? 3))} :=
   build_ex (match arg_ with | Sbare => 0 | Sv32 => 1 | Sv39 => 2 | Sv48 => 3 end).

Definition satp64Mode_of_bits (a : Architecture) (m : mword 4) : option SATPMode :=
   match (a, m) with
   | (g__338, b__0) =>
      if eq_vec b__0 (Ox"0"  : mword 4) then Some Sbare
      else
        match (g__338, b__0) with
        | (RV32, b__0) =>
           if eq_vec b__0 (Ox"1"  : mword 4) then Some Sv32
           else match (RV32, b__0) with | (_, _) => None end
        | (RV64, b__0) =>
           if eq_vec b__0 (Ox"8"  : mword 4) then Some Sv39
           else if eq_vec b__0 (Ox"9"  : mword 4) then Some Sv48
           else match (RV64, b__0) with | (_, _) => None end
        | (_, _) => None
        end
   end.

Definition uop_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 1))} : uop :=
   let l__239 := arg_ in
   if sumbool_of_bool (Z.eqb l__239 0) then RISCV_LUI
   else RISCV_AUIPC.

Definition num_of_uop (arg_ : uop) : {e : Z & ArithFact ((0 <=? e) && (e <=? 1))} :=
   build_ex (match arg_ with | RISCV_LUI => 0 | RISCV_AUIPC => 1 end).

Definition bop_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 5))} : bop :=
   let l__234 := arg_ in
   if sumbool_of_bool (Z.eqb l__234 0) then RISCV_BEQ
   else if sumbool_of_bool (Z.eqb l__234 1) then RISCV_BNE
   else if sumbool_of_bool (Z.eqb l__234 2) then RISCV_BLT
   else if sumbool_of_bool (Z.eqb l__234 3) then RISCV_BGE
   else if sumbool_of_bool (Z.eqb l__234 4) then RISCV_BLTU
   else RISCV_BGEU.

Definition num_of_bop (arg_ : bop) : {e : Z & ArithFact ((0 <=? e) && (e <=? 5))} :=
   build_ex (
      match arg_ with
      | RISCV_BEQ => 0
      | RISCV_BNE => 1
      | RISCV_BLT => 2
      | RISCV_BGE => 3
      | RISCV_BLTU => 4
      | RISCV_BGEU => 5
      end
   ).

Definition iop_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 5))} : iop :=
   let l__229 := arg_ in
   if sumbool_of_bool (Z.eqb l__229 0) then RISCV_ADDI
   else if sumbool_of_bool (Z.eqb l__229 1) then RISCV_SLTI
   else if sumbool_of_bool (Z.eqb l__229 2) then RISCV_SLTIU
   else if sumbool_of_bool (Z.eqb l__229 3) then RISCV_XORI
   else if sumbool_of_bool (Z.eqb l__229 4) then RISCV_ORI
   else RISCV_ANDI.

Definition num_of_iop (arg_ : iop) : {e : Z & ArithFact ((0 <=? e) && (e <=? 5))} :=
   build_ex (
      match arg_ with
      | RISCV_ADDI => 0
      | RISCV_SLTI => 1
      | RISCV_SLTIU => 2
      | RISCV_XORI => 3
      | RISCV_ORI => 4
      | RISCV_ANDI => 5
      end
   ).

Definition sop_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 2))} : sop :=
   let l__227 := arg_ in
   if sumbool_of_bool (Z.eqb l__227 0) then RISCV_SLLI
   else if sumbool_of_bool (Z.eqb l__227 1) then RISCV_SRLI
   else RISCV_SRAI.

Definition num_of_sop (arg_ : sop) : {e : Z & ArithFact ((0 <=? e) && (e <=? 2))} :=
   build_ex (match arg_ with | RISCV_SLLI => 0 | RISCV_SRLI => 1 | RISCV_SRAI => 2 end).

Definition rop_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 9))} : rop :=
   let l__218 := arg_ in
   if sumbool_of_bool (Z.eqb l__218 0) then RISCV_ADD
   else if sumbool_of_bool (Z.eqb l__218 1) then RISCV_SUB
   else if sumbool_of_bool (Z.eqb l__218 2) then RISCV_SLL
   else if sumbool_of_bool (Z.eqb l__218 3) then RISCV_SLT
   else if sumbool_of_bool (Z.eqb l__218 4) then RISCV_SLTU
   else if sumbool_of_bool (Z.eqb l__218 5) then RISCV_XOR
   else if sumbool_of_bool (Z.eqb l__218 6) then RISCV_SRL
   else if sumbool_of_bool (Z.eqb l__218 7) then RISCV_SRA
   else if sumbool_of_bool (Z.eqb l__218 8) then RISCV_OR
   else RISCV_AND.

Definition num_of_rop (arg_ : rop) : {e : Z & ArithFact ((0 <=? e) && (e <=? 9))} :=
   build_ex (
      match arg_ with
      | RISCV_ADD => 0
      | RISCV_SUB => 1
      | RISCV_SLL => 2
      | RISCV_SLT => 3
      | RISCV_SLTU => 4
      | RISCV_XOR => 5
      | RISCV_SRL => 6
      | RISCV_SRA => 7
      | RISCV_OR => 8
      | RISCV_AND => 9
      end
   ).

Definition ropw_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 4))} : ropw :=
   let l__214 := arg_ in
   if sumbool_of_bool (Z.eqb l__214 0) then RISCV_ADDW
   else if sumbool_of_bool (Z.eqb l__214 1) then RISCV_SUBW
   else if sumbool_of_bool (Z.eqb l__214 2) then RISCV_SLLW
   else if sumbool_of_bool (Z.eqb l__214 3) then RISCV_SRLW
   else RISCV_SRAW.

Definition num_of_ropw (arg_ : ropw) : {e : Z & ArithFact ((0 <=? e) && (e <=? 4))} :=
   build_ex (
      match arg_ with
      | RISCV_ADDW => 0
      | RISCV_SUBW => 1
      | RISCV_SLLW => 2
      | RISCV_SRLW => 3
      | RISCV_SRAW => 4
      end
   ).

Definition sopw_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 2))} : sopw :=
   let l__212 := arg_ in
   if sumbool_of_bool (Z.eqb l__212 0) then RISCV_SLLIW
   else if sumbool_of_bool (Z.eqb l__212 1) then RISCV_SRLIW
   else RISCV_SRAIW.

Definition num_of_sopw (arg_ : sopw) : {e : Z & ArithFact ((0 <=? e) && (e <=? 2))} :=
   build_ex (match arg_ with | RISCV_SLLIW => 0 | RISCV_SRLIW => 1 | RISCV_SRAIW => 2 end).

Definition amoop_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 8))} : amoop :=
   let l__204 := arg_ in
   if sumbool_of_bool (Z.eqb l__204 0) then AMOSWAP
   else if sumbool_of_bool (Z.eqb l__204 1) then AMOADD
   else if sumbool_of_bool (Z.eqb l__204 2) then AMOXOR
   else if sumbool_of_bool (Z.eqb l__204 3) then AMOAND
   else if sumbool_of_bool (Z.eqb l__204 4) then AMOOR
   else if sumbool_of_bool (Z.eqb l__204 5) then AMOMIN
   else if sumbool_of_bool (Z.eqb l__204 6) then AMOMAX
   else if sumbool_of_bool (Z.eqb l__204 7) then AMOMINU
   else AMOMAXU.

Definition num_of_amoop (arg_ : amoop) : {e : Z & ArithFact ((0 <=? e) && (e <=? 8))} :=
   build_ex (
      match arg_ with
      | AMOSWAP => 0
      | AMOADD => 1
      | AMOXOR => 2
      | AMOAND => 3
      | AMOOR => 4
      | AMOMIN => 5
      | AMOMAX => 6
      | AMOMINU => 7
      | AMOMAXU => 8
      end
   ).

Definition csrop_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 2))} : csrop :=
   let l__202 := arg_ in
   if sumbool_of_bool (Z.eqb l__202 0) then CSRRW
   else if sumbool_of_bool (Z.eqb l__202 1) then CSRRS
   else CSRRC.

Definition num_of_csrop (arg_ : csrop) : {e : Z & ArithFact ((0 <=? e) && (e <=? 2))} :=
   build_ex (match arg_ with | CSRRW => 0 | CSRRS => 1 | CSRRC => 2 end).

Definition sep_forwards (arg_ : unit) : string :=
   match arg_ with
   | tt =>
      string_append (opt_spc_forwards tt)
        (string_append "," (string_append (def_spc_forwards tt) ""))
   end.

Definition _s0_ (_s1_ : string) : M (option unit) :=
   (match _s1_ with
    | _s2_ =>
       (opt_spc_matches_prefix _s2_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
       (match w__0 with
        | Some (tt, existT _ _s3_ _) =>
           let _s4_ := string_drop _s2_ _s3_ in
           (if string_startswith _s4_ "," then
              (match (string_drop _s4_ (projT1 (string_length ","))) with
               | _s5_ =>
                  (def_spc_matches_prefix _s5_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                    0)})) =>
                  returnm (match w__1 with
                           | Some (tt, existT _ _s6_ _) =>
                              let p0_ := string_drop _s5_ _s6_ in
                              if generic_eq p0_ "" then Some tt
                              else None
                           | _ => None
                           end)
               end)
               : M (option unit)
            else returnm None)
            : M (option unit)
        | _ => returnm None
        end)
        : M (option unit)
    end)
    : M (option unit).

Definition sep_backwards (arg_ : string) : M (unit) :=
   let _s7_ := arg_ in
   (_s0_ _s7_) >>= fun w__0 : option unit =>
   (if match w__0 with | Some tt => true | _ => false end then
      (_s0_ _s7_) >>= fun w__1 : option unit =>
      (match w__1 with | Some tt => returnm tt | _ => exit tt  : M (unit) end)
       : M (unit)
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (unit).

Definition sep_forwards_matches (arg_ : unit) : bool := match arg_ with | tt => true end.

Definition _s8_ (_s9_ : string) : M (option unit) :=
   (match _s9_ with
    | _s10_ =>
       (opt_spc_matches_prefix _s10_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
       (match w__0 with
        | Some (tt, existT _ _s11_ _) =>
           let _s12_ := string_drop _s10_ _s11_ in
           (if string_startswith _s12_ "," then
              (match (string_drop _s12_ (projT1 (string_length ","))) with
               | _s13_ =>
                  (def_spc_matches_prefix _s13_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                    0)})) =>
                  returnm (match w__1 with
                           | Some (tt, existT _ _s14_ _) =>
                              let p0_ := string_drop _s13_ _s14_ in
                              if generic_eq p0_ "" then Some tt
                              else None
                           | _ => None
                           end)
               end)
               : M (option unit)
            else returnm None)
            : M (option unit)
        | _ => returnm None
        end)
        : M (option unit)
    end)
    : M (option unit).

Definition sep_backwards_matches (arg_ : string) : M (bool) :=
   let _s15_ := arg_ in
   (_s8_ _s15_) >>= fun w__0 : option unit =>
   (if match w__0 with | Some tt => true | _ => false end then
      (_s8_ _s15_) >>= fun w__1 : option unit =>
      (match w__1 with | Some tt => returnm true | _ => exit tt  : M (bool) end)
       : M (bool)
    else returnm false)
    : M (bool).

Definition _s16_ (_s17_ : string) : M (option string) :=
   (match _s17_ with
    | _s18_ =>
       (opt_spc_matches_prefix _s18_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
       (match w__0 with
        | Some (tt, existT _ _s19_ _) =>
           let _s20_ := string_drop _s18_ _s19_ in
           (if string_startswith _s20_ "," then
              (match (string_drop _s20_ (projT1 (string_length ","))) with
               | _s21_ =>
                  (def_spc_matches_prefix _s21_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                    0)})) =>
                  returnm (match w__1 with
                           | Some (tt, existT _ _s22_ _) =>
                              match (string_drop _s21_ _s22_) with | s_ => Some s_ end
                           | _ => None
                           end)
               end)
               : M (option string)
            else returnm None)
            : M (option string)
        | _ => returnm None
        end)
        : M (option string)
    end)
    : M (option string).

Definition sep_matches_prefix (arg_ : string) : M (option ((unit * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s23_ := arg_ in
   (_s16_ _s23_) >>= fun w__0 : option string =>
   (if match w__0 with | Some s_ => true | _ => false end then
      (_s16_ _s23_) >>= fun w__1 : option string =>
      (match w__1 with
       | Some s_ =>
          returnm (Some
                     (tt, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((unit * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((unit * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((unit * {n : Z & ArithFact (n >=? 0)}))).

Definition bool_bits_forwards (arg_ : bool) : mword 1 :=
   match arg_ with | true => 'b"1"  : mword 1 | false => 'b"0"  : mword 1 end.

Definition bool_bits_backwards (arg_ : mword 1) : M (bool) :=
   let b__0 := arg_ in
   (if eq_vec b__0 ('b"1"  : mword 1) then returnm true
    else if eq_vec b__0 ('b"0"  : mword 1) then returnm false
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (bool).

Definition bool_bits_forwards_matches (arg_ : bool) : bool :=
   match arg_ with | true => true | false => true end.

Definition bool_bits_backwards_matches (arg_ : mword 1) : bool :=
   let b__0 := arg_ in
   if eq_vec b__0 ('b"1"  : mword 1) then true
   else if eq_vec b__0 ('b"0"  : mword 1) then true
   else false.

Definition bool_not_bits_forwards (arg_ : bool) : mword 1 :=
   match arg_ with | true => 'b"0"  : mword 1 | false => 'b"1"  : mword 1 end.

Definition bool_not_bits_backwards (arg_ : mword 1) : M (bool) :=
   let b__0 := arg_ in
   (if eq_vec b__0 ('b"0"  : mword 1) then returnm true
    else if eq_vec b__0 ('b"1"  : mword 1) then returnm false
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (bool).

Definition bool_not_bits_forwards_matches (arg_ : bool) : bool :=
   match arg_ with | true => true | false => true end.

Definition bool_not_bits_backwards_matches (arg_ : mword 1) : bool :=
   let b__0 := arg_ in
   if eq_vec b__0 ('b"0"  : mword 1) then true
   else if eq_vec b__0 ('b"1"  : mword 1) then true
   else false.

Definition size_bits_forwards (arg_ : word_width) : mword 2 :=
   match arg_ with
   | BYTE => 'b"00"  : mword 2
   | HALF => 'b"01"  : mword 2
   | WORD => 'b"10"  : mword 2
   | DOUBLE => 'b"11"  : mword 2
   end.

Definition size_bits_backwards (arg_ : mword 2) : M (word_width) :=
   let b__0 := arg_ in
   (if eq_vec b__0 ('b"00"  : mword 2) then returnm BYTE
    else if eq_vec b__0 ('b"01"  : mword 2) then returnm HALF
    else if eq_vec b__0 ('b"10"  : mword 2) then returnm WORD
    else if eq_vec b__0 ('b"11"  : mword 2) then returnm DOUBLE
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (word_width).

Definition size_bits_forwards_matches (arg_ : word_width) : bool :=
   match arg_ with | BYTE => true | HALF => true | WORD => true | DOUBLE => true end.

Definition size_bits_backwards_matches (arg_ : mword 2) : bool :=
   let b__0 := arg_ in
   if eq_vec b__0 ('b"00"  : mword 2) then true
   else if eq_vec b__0 ('b"01"  : mword 2) then true
   else if eq_vec b__0 ('b"10"  : mword 2) then true
   else if eq_vec b__0 ('b"11"  : mword 2) then true
   else false.

Definition size_mnemonic_forwards (arg_ : word_width) : string :=
   match arg_ with | BYTE => "b" | HALF => "h" | WORD => "w" | DOUBLE => "d" end.

Definition size_mnemonic_backwards (arg_ : string) : M (word_width) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "b" then returnm BYTE
    else if generic_eq p0_ "h" then returnm HALF
    else if generic_eq p0_ "w" then returnm WORD
    else if generic_eq p0_ "d" then returnm DOUBLE
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (word_width).

Definition size_mnemonic_forwards_matches (arg_ : word_width) : bool :=
   match arg_ with | BYTE => true | HALF => true | WORD => true | DOUBLE => true end.

Definition size_mnemonic_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "b" then true
   else if generic_eq p0_ "h" then true
   else if generic_eq p0_ "w" then true
   else if generic_eq p0_ "d" then true
   else false.

Definition _s36_ (_s37_ : string) : option string :=
   let _s38_ := _s37_ in
   if string_startswith _s38_ "d" then
     match (string_drop _s38_ (projT1 (string_length "d"))) with | s_ => Some s_ end
   else None.

Definition _s32_ (_s33_ : string) : option string :=
   let _s34_ := _s33_ in
   if string_startswith _s34_ "w" then
     match (string_drop _s34_ (projT1 (string_length "w"))) with | s_ => Some s_ end
   else None.

Definition _s28_ (_s29_ : string) : option string :=
   let _s30_ := _s29_ in
   if string_startswith _s30_ "h" then
     match (string_drop _s30_ (projT1 (string_length "h"))) with | s_ => Some s_ end
   else None.

Definition _s24_ (_s25_ : string) : option string :=
   let _s26_ := _s25_ in
   if string_startswith _s26_ "b" then
     match (string_drop _s26_ (projT1 (string_length "b"))) with | s_ => Some s_ end
   else None.

Definition size_mnemonic_matches_prefix (arg_ : string)
: M (option ((word_width * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s27_ := arg_ in
   (if match (_s24_ _s27_) with | Some s_ => true | _ => false end then
      (match (_s24_ _s27_) with
       | Some s_ =>
          returnm (Some
                     (BYTE, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((word_width * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((word_width * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s28_ _s27_) with | Some s_ => true | _ => false end then
      (match (_s28_ _s27_) with
       | Some s_ =>
          returnm (Some
                     (HALF, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((word_width * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((word_width * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s32_ _s27_) with | Some s_ => true | _ => false end then
      (match (_s32_ _s27_) with
       | Some s_ =>
          returnm (Some
                     (WORD, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((word_width * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((word_width * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s36_ _s27_) with | Some s_ => true | _ => false end then
      (match (_s36_ _s27_) with
       | Some s_ =>
          returnm (Some
                     (DOUBLE, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((word_width * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((word_width * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((word_width * {n : Z & ArithFact (n >=? 0)}))).

Definition word_width_bytes (width : word_width)
: {s : Z & ArithFact ((s =? 1) || ((s =? 2) || ((s =? 4) || (s =? 8))))} :=
   build_ex (match width with | BYTE => 1 | HALF => 2 | WORD => 4 | DOUBLE => 8 end).

Definition Data : ext_access_type := tt.
Hint Unfold Data : sail.
Definition default_write_acc : ext_access_type := Data.
Hint Unfold default_write_acc : sail.
Definition accessType_to_str (a : AccessType unit) : string :=
   match a with | Read _ => "R" | Write _ => "W" | ReadWrite (_, _) => "RW" | Execute tt => "X" end.

Definition zero_reg : regtype := EXTZ 64 (Ox"0"  : mword 4).
Hint Unfold zero_reg : sail.
Definition RegStr (r : mword 64) : string := string_of_bits r.

Definition regval_from_reg (r : mword 64) : mword 64 := r.

Definition regval_into_reg (v : mword 64) : mword 64 := v.

Definition zero_freg : fregtype := EXTZ 64 (Ox"0"  : mword 4).
Hint Unfold zero_freg : sail.
Definition FRegStr (r : mword 64) : string := string_of_bits r.

Definition fregval_from_freg (r : mword 64) : mword 64 := r.

Definition fregval_into_freg (v : mword 64) : mword 64 := v.

Definition rounding_mode_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 5))}
: rounding_mode :=
   let l__197 := arg_ in
   if sumbool_of_bool (Z.eqb l__197 0) then RM_RNE
   else if sumbool_of_bool (Z.eqb l__197 1) then RM_RTZ
   else if sumbool_of_bool (Z.eqb l__197 2) then RM_RDN
   else if sumbool_of_bool (Z.eqb l__197 3) then RM_RUP
   else if sumbool_of_bool (Z.eqb l__197 4) then RM_RMM
   else RM_DYN.

Definition num_of_rounding_mode (arg_ : rounding_mode)
: {e : Z & ArithFact ((0 <=? e) && (e <=? 5))} :=
   build_ex (
      match arg_ with
      | RM_RNE => 0
      | RM_RTZ => 1
      | RM_RDN => 2
      | RM_RUP => 3
      | RM_RMM => 4
      | RM_DYN => 5
      end
   ).

Definition f_madd_op_S_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 3))} : f_madd_op_S :=
   let l__194 := arg_ in
   if sumbool_of_bool (Z.eqb l__194 0) then FMADD_S
   else if sumbool_of_bool (Z.eqb l__194 1) then FMSUB_S
   else if sumbool_of_bool (Z.eqb l__194 2) then FNMSUB_S
   else FNMADD_S.

Definition num_of_f_madd_op_S (arg_ : f_madd_op_S) : {e : Z & ArithFact ((0 <=? e) && (e <=? 3))} :=
   build_ex (match arg_ with | FMADD_S => 0 | FMSUB_S => 1 | FNMSUB_S => 2 | FNMADD_S => 3 end).

Definition f_bin_rm_op_S_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 3))}
: f_bin_rm_op_S :=
   let l__191 := arg_ in
   if sumbool_of_bool (Z.eqb l__191 0) then FADD_S
   else if sumbool_of_bool (Z.eqb l__191 1) then FSUB_S
   else if sumbool_of_bool (Z.eqb l__191 2) then FMUL_S
   else FDIV_S.

Definition num_of_f_bin_rm_op_S (arg_ : f_bin_rm_op_S)
: {e : Z & ArithFact ((0 <=? e) && (e <=? 3))} :=
   build_ex (match arg_ with | FADD_S => 0 | FSUB_S => 1 | FMUL_S => 2 | FDIV_S => 3 end).

Definition f_un_rm_op_S_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 8))} : f_un_rm_op_S :=
   let l__183 := arg_ in
   if sumbool_of_bool (Z.eqb l__183 0) then FSQRT_S
   else if sumbool_of_bool (Z.eqb l__183 1) then FCVT_W_S
   else if sumbool_of_bool (Z.eqb l__183 2) then FCVT_WU_S
   else if sumbool_of_bool (Z.eqb l__183 3) then FCVT_S_W
   else if sumbool_of_bool (Z.eqb l__183 4) then FCVT_S_WU
   else if sumbool_of_bool (Z.eqb l__183 5) then FCVT_L_S
   else if sumbool_of_bool (Z.eqb l__183 6) then FCVT_LU_S
   else if sumbool_of_bool (Z.eqb l__183 7) then FCVT_S_L
   else FCVT_S_LU.

Definition num_of_f_un_rm_op_S (arg_ : f_un_rm_op_S) : {e : Z & ArithFact ((0 <=? e) && (e <=? 8))} :=
   build_ex (
      match arg_ with
      | FSQRT_S => 0
      | FCVT_W_S => 1
      | FCVT_WU_S => 2
      | FCVT_S_W => 3
      | FCVT_S_WU => 4
      | FCVT_L_S => 5
      | FCVT_LU_S => 6
      | FCVT_S_L => 7
      | FCVT_S_LU => 8
      end
   ).

Definition f_un_op_S_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 2))} : f_un_op_S :=
   let l__181 := arg_ in
   if sumbool_of_bool (Z.eqb l__181 0) then FCLASS_S
   else if sumbool_of_bool (Z.eqb l__181 1) then FMV_X_W
   else FMV_W_X.

Definition num_of_f_un_op_S (arg_ : f_un_op_S) : {e : Z & ArithFact ((0 <=? e) && (e <=? 2))} :=
   build_ex (match arg_ with | FCLASS_S => 0 | FMV_X_W => 1 | FMV_W_X => 2 end).

Definition f_bin_op_S_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 7))} : f_bin_op_S :=
   let l__174 := arg_ in
   if sumbool_of_bool (Z.eqb l__174 0) then FSGNJ_S
   else if sumbool_of_bool (Z.eqb l__174 1) then FSGNJN_S
   else if sumbool_of_bool (Z.eqb l__174 2) then FSGNJX_S
   else if sumbool_of_bool (Z.eqb l__174 3) then FMIN_S
   else if sumbool_of_bool (Z.eqb l__174 4) then FMAX_S
   else if sumbool_of_bool (Z.eqb l__174 5) then FEQ_S
   else if sumbool_of_bool (Z.eqb l__174 6) then FLT_S
   else FLE_S.

Definition num_of_f_bin_op_S (arg_ : f_bin_op_S) : {e : Z & ArithFact ((0 <=? e) && (e <=? 7))} :=
   build_ex (
      match arg_ with
      | FSGNJ_S => 0
      | FSGNJN_S => 1
      | FSGNJX_S => 2
      | FMIN_S => 3
      | FMAX_S => 4
      | FEQ_S => 5
      | FLT_S => 6
      | FLE_S => 7
      end
   ).

Definition f_madd_op_D_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 3))} : f_madd_op_D :=
   let l__171 := arg_ in
   if sumbool_of_bool (Z.eqb l__171 0) then FMADD_D
   else if sumbool_of_bool (Z.eqb l__171 1) then FMSUB_D
   else if sumbool_of_bool (Z.eqb l__171 2) then FNMSUB_D
   else FNMADD_D.

Definition num_of_f_madd_op_D (arg_ : f_madd_op_D) : {e : Z & ArithFact ((0 <=? e) && (e <=? 3))} :=
   build_ex (match arg_ with | FMADD_D => 0 | FMSUB_D => 1 | FNMSUB_D => 2 | FNMADD_D => 3 end).

Definition f_bin_rm_op_D_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 3))}
: f_bin_rm_op_D :=
   let l__168 := arg_ in
   if sumbool_of_bool (Z.eqb l__168 0) then FADD_D
   else if sumbool_of_bool (Z.eqb l__168 1) then FSUB_D
   else if sumbool_of_bool (Z.eqb l__168 2) then FMUL_D
   else FDIV_D.

Definition num_of_f_bin_rm_op_D (arg_ : f_bin_rm_op_D)
: {e : Z & ArithFact ((0 <=? e) && (e <=? 3))} :=
   build_ex (match arg_ with | FADD_D => 0 | FSUB_D => 1 | FMUL_D => 2 | FDIV_D => 3 end).

Definition f_un_rm_op_D_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 10))}
: f_un_rm_op_D :=
   let l__158 := arg_ in
   if sumbool_of_bool (Z.eqb l__158 0) then FSQRT_D
   else if sumbool_of_bool (Z.eqb l__158 1) then FCVT_W_D
   else if sumbool_of_bool (Z.eqb l__158 2) then FCVT_WU_D
   else if sumbool_of_bool (Z.eqb l__158 3) then FCVT_D_W
   else if sumbool_of_bool (Z.eqb l__158 4) then FCVT_D_WU
   else if sumbool_of_bool (Z.eqb l__158 5) then FCVT_S_D
   else if sumbool_of_bool (Z.eqb l__158 6) then FCVT_D_S
   else if sumbool_of_bool (Z.eqb l__158 7) then FCVT_L_D
   else if sumbool_of_bool (Z.eqb l__158 8) then FCVT_LU_D
   else if sumbool_of_bool (Z.eqb l__158 9) then FCVT_D_L
   else FCVT_D_LU.

Definition num_of_f_un_rm_op_D (arg_ : f_un_rm_op_D) : {e : Z & ArithFact ((0 <=? e) && (e <=? 10))} :=
   build_ex (
      match arg_ with
      | FSQRT_D => 0
      | FCVT_W_D => 1
      | FCVT_WU_D => 2
      | FCVT_D_W => 3
      | FCVT_D_WU => 4
      | FCVT_S_D => 5
      | FCVT_D_S => 6
      | FCVT_L_D => 7
      | FCVT_LU_D => 8
      | FCVT_D_L => 9
      | FCVT_D_LU => 10
      end
   ).

Definition f_bin_op_D_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 7))} : f_bin_op_D :=
   let l__151 := arg_ in
   if sumbool_of_bool (Z.eqb l__151 0) then FSGNJ_D
   else if sumbool_of_bool (Z.eqb l__151 1) then FSGNJN_D
   else if sumbool_of_bool (Z.eqb l__151 2) then FSGNJX_D
   else if sumbool_of_bool (Z.eqb l__151 3) then FMIN_D
   else if sumbool_of_bool (Z.eqb l__151 4) then FMAX_D
   else if sumbool_of_bool (Z.eqb l__151 5) then FEQ_D
   else if sumbool_of_bool (Z.eqb l__151 6) then FLT_D
   else FLE_D.

Definition num_of_f_bin_op_D (arg_ : f_bin_op_D) : {e : Z & ArithFact ((0 <=? e) && (e <=? 7))} :=
   build_ex (
      match arg_ with
      | FSGNJ_D => 0
      | FSGNJN_D => 1
      | FSGNJX_D => 2
      | FMIN_D => 3
      | FMAX_D => 4
      | FEQ_D => 5
      | FLT_D => 6
      | FLE_D => 7
      end
   ).

Definition f_un_op_D_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 2))} : f_un_op_D :=
   let l__149 := arg_ in
   if sumbool_of_bool (Z.eqb l__149 0) then FCLASS_D
   else if sumbool_of_bool (Z.eqb l__149 1) then FMV_X_D
   else FMV_D_X.

Definition num_of_f_un_op_D (arg_ : f_un_op_D) : {e : Z & ArithFact ((0 <=? e) && (e <=? 2))} :=
   build_ex (match arg_ with | FCLASS_D => 0 | FMV_X_D => 1 | FMV_D_X => 2 end).

Definition rX (r : Z) `{ArithFact ((0 <=? r) && (r <? 32))} : M (mword 64) :=
   let l__117 := r in
   (if sumbool_of_bool (Z.eqb l__117 0) then returnm zero_reg
    else if sumbool_of_bool (Z.eqb l__117 1) then
      ((read_reg x1_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 2) then
      ((read_reg x2_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 3) then
      ((read_reg x3_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 4) then
      ((read_reg x4_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 5) then
      ((read_reg x5_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 6) then
      ((read_reg x6_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 7) then
      ((read_reg x7_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 8) then
      ((read_reg x8_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 9) then
      ((read_reg x9_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 10) then
      ((read_reg x10_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 11) then
      ((read_reg x11_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 12) then
      ((read_reg x12_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 13) then
      ((read_reg x13_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 14) then
      ((read_reg x14_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 15) then
      ((read_reg x15_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 16) then
      ((read_reg x16_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 17) then
      ((read_reg x17_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 18) then
      ((read_reg x18_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 19) then
      ((read_reg x19_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 20) then
      ((read_reg x20_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 21) then
      ((read_reg x21_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 22) then
      ((read_reg x22_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 23) then
      ((read_reg x23_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 24) then
      ((read_reg x24_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 25) then
      ((read_reg x25_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 26) then
      ((read_reg x26_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 27) then
      ((read_reg x27_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 28) then
      ((read_reg x28_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 29) then
      ((read_reg x29_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 30) then
      ((read_reg x30_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__117 31) then
      ((read_reg x31_ref)  : M (mword 64))
       : M (mword 64)
    else assert_exp' false "invalid register number" >>= fun _ => exit tt) >>= fun v : regtype =>
   returnm (regval_from_reg v).

Definition rvfi_wX (r : Z) (v : mword 64) `{ArithFact ((0 <=? r) && (r <? 32))} : unit := tt.

Definition wX (r : Z) (in_v : mword 64) `{ArithFact ((0 <=? r) && (r <? 32))} : M (unit) :=
   let v := regval_into_reg in_v in
   let l__85 := r in
   (if sumbool_of_bool (Z.eqb l__85 0) then returnm tt
    else if sumbool_of_bool (Z.eqb l__85 1) then write_reg x1_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 2) then write_reg x2_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 3) then write_reg x3_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 4) then write_reg x4_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 5) then write_reg x5_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 6) then write_reg x6_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 7) then write_reg x7_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 8) then write_reg x8_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 9) then write_reg x9_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 10) then write_reg x10_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 11) then write_reg x11_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 12) then write_reg x12_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 13) then write_reg x13_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 14) then write_reg x14_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 15) then write_reg x15_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 16) then write_reg x16_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 17) then write_reg x17_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 18) then write_reg x18_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 19) then write_reg x19_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 20) then write_reg x20_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 21) then write_reg x21_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 22) then write_reg x22_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 23) then write_reg x23_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 24) then write_reg x24_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 25) then write_reg x25_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 26) then write_reg x26_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 27) then write_reg x27_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 28) then write_reg x28_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 29) then write_reg x29_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 30) then write_reg x30_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__85 31) then write_reg x31_ref v  : M (unit)
    else assert_exp' false "invalid register number" >>= fun _ => exit tt) >>
   returnm (if sumbool_of_bool (projT1 (neq_int r 0)) then
              let '_ := (rvfi_wX r in_v)  : unit in
              if get_config_print_reg tt then
                print_endline
                  (String.append "x"
                     (String.append (string_of_int r) (String.append " <- " (RegStr v))))
              else tt
            else tt).

Definition rX_bits (i : mword 5) : M (mword 64) := (rX (projT1 (uint i)))  : M (mword 64).

Definition wX_bits (i : mword 5) (data : mword 64) : M (unit) :=
   (wX (projT1 (uint i)) data)  : M (unit).

Definition reg_name_abi (r : mword 5) : M (string) :=
   let b__0 := r in
   (if eq_vec b__0 ('b"00000"  : mword 5) then returnm "zero"
    else if eq_vec b__0 ('b"00001"  : mword 5) then returnm "ra"
    else if eq_vec b__0 ('b"00010"  : mword 5) then returnm "sp"
    else if eq_vec b__0 ('b"00011"  : mword 5) then returnm "gp"
    else if eq_vec b__0 ('b"00100"  : mword 5) then returnm "tp"
    else if eq_vec b__0 ('b"00101"  : mword 5) then returnm "t0"
    else if eq_vec b__0 ('b"00110"  : mword 5) then returnm "t1"
    else if eq_vec b__0 ('b"00111"  : mword 5) then returnm "t2"
    else if eq_vec b__0 ('b"01000"  : mword 5) then returnm "fp"
    else if eq_vec b__0 ('b"01001"  : mword 5) then returnm "s1"
    else if eq_vec b__0 ('b"01010"  : mword 5) then returnm "a0"
    else if eq_vec b__0 ('b"01011"  : mword 5) then returnm "a1"
    else if eq_vec b__0 ('b"01100"  : mword 5) then returnm "a2"
    else if eq_vec b__0 ('b"01101"  : mword 5) then returnm "a3"
    else if eq_vec b__0 ('b"01110"  : mword 5) then returnm "a4"
    else if eq_vec b__0 ('b"01111"  : mword 5) then returnm "a5"
    else if eq_vec b__0 ('b"10000"  : mword 5) then returnm "a6"
    else if eq_vec b__0 ('b"10001"  : mword 5) then returnm "a7"
    else if eq_vec b__0 ('b"10010"  : mword 5) then returnm "s2"
    else if eq_vec b__0 ('b"10011"  : mword 5) then returnm "s3"
    else if eq_vec b__0 ('b"10100"  : mword 5) then returnm "s4"
    else if eq_vec b__0 ('b"10101"  : mword 5) then returnm "s5"
    else if eq_vec b__0 ('b"10110"  : mword 5) then returnm "s6"
    else if eq_vec b__0 ('b"10111"  : mword 5) then returnm "s7"
    else if eq_vec b__0 ('b"11000"  : mword 5) then returnm "s8"
    else if eq_vec b__0 ('b"11001"  : mword 5) then returnm "s9"
    else if eq_vec b__0 ('b"11010"  : mword 5) then returnm "s10"
    else if eq_vec b__0 ('b"11011"  : mword 5) then returnm "s11"
    else if eq_vec b__0 ('b"11100"  : mword 5) then returnm "t3"
    else if eq_vec b__0 ('b"11101"  : mword 5) then returnm "t4"
    else if eq_vec b__0 ('b"11110"  : mword 5) then returnm "t5"
    else if eq_vec b__0 ('b"11111"  : mword 5) then returnm "t6"
    else
      assert_exp' false "Pattern match failure at model/riscv_regs.sail 154:2 - 187:3" >>= fun _ =>
      exit tt)
    : M (string).

Definition reg_name_forwards (arg_ : mword 5) : M (string) :=
   let b__0 := arg_ in
   (if eq_vec b__0 ('b"00000"  : mword 5) then returnm "zero"
    else if eq_vec b__0 ('b"00001"  : mword 5) then returnm "ra"
    else if eq_vec b__0 ('b"00010"  : mword 5) then returnm "sp"
    else if eq_vec b__0 ('b"00011"  : mword 5) then returnm "gp"
    else if eq_vec b__0 ('b"00100"  : mword 5) then returnm "tp"
    else if eq_vec b__0 ('b"00101"  : mword 5) then returnm "t0"
    else if eq_vec b__0 ('b"00110"  : mword 5) then returnm "t1"
    else if eq_vec b__0 ('b"00111"  : mword 5) then returnm "t2"
    else if eq_vec b__0 ('b"01000"  : mword 5) then returnm "fp"
    else if eq_vec b__0 ('b"01001"  : mword 5) then returnm "s1"
    else if eq_vec b__0 ('b"01010"  : mword 5) then returnm "a0"
    else if eq_vec b__0 ('b"01011"  : mword 5) then returnm "a1"
    else if eq_vec b__0 ('b"01100"  : mword 5) then returnm "a2"
    else if eq_vec b__0 ('b"01101"  : mword 5) then returnm "a3"
    else if eq_vec b__0 ('b"01110"  : mword 5) then returnm "a4"
    else if eq_vec b__0 ('b"01111"  : mword 5) then returnm "a5"
    else if eq_vec b__0 ('b"10000"  : mword 5) then returnm "a6"
    else if eq_vec b__0 ('b"10001"  : mword 5) then returnm "a7"
    else if eq_vec b__0 ('b"10010"  : mword 5) then returnm "s2"
    else if eq_vec b__0 ('b"10011"  : mword 5) then returnm "s3"
    else if eq_vec b__0 ('b"10100"  : mword 5) then returnm "s4"
    else if eq_vec b__0 ('b"10101"  : mword 5) then returnm "s5"
    else if eq_vec b__0 ('b"10110"  : mword 5) then returnm "s6"
    else if eq_vec b__0 ('b"10111"  : mword 5) then returnm "s7"
    else if eq_vec b__0 ('b"11000"  : mword 5) then returnm "s8"
    else if eq_vec b__0 ('b"11001"  : mword 5) then returnm "s9"
    else if eq_vec b__0 ('b"11010"  : mword 5) then returnm "s10"
    else if eq_vec b__0 ('b"11011"  : mword 5) then returnm "s11"
    else if eq_vec b__0 ('b"11100"  : mword 5) then returnm "t3"
    else if eq_vec b__0 ('b"11101"  : mword 5) then returnm "t4"
    else if eq_vec b__0 ('b"11110"  : mword 5) then returnm "t5"
    else if eq_vec b__0 ('b"11111"  : mword 5) then returnm "t6"
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (string).

Definition reg_name_backwards (arg_ : string) : M (mword 5) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "zero" then returnm ('b"00000"  : mword 5)
    else if generic_eq p0_ "ra" then returnm ('b"00001"  : mword 5)
    else if generic_eq p0_ "sp" then returnm ('b"00010"  : mword 5)
    else if generic_eq p0_ "gp" then returnm ('b"00011"  : mword 5)
    else if generic_eq p0_ "tp" then returnm ('b"00100"  : mword 5)
    else if generic_eq p0_ "t0" then returnm ('b"00101"  : mword 5)
    else if generic_eq p0_ "t1" then returnm ('b"00110"  : mword 5)
    else if generic_eq p0_ "t2" then returnm ('b"00111"  : mword 5)
    else if generic_eq p0_ "fp" then returnm ('b"01000"  : mword 5)
    else if generic_eq p0_ "s1" then returnm ('b"01001"  : mword 5)
    else if generic_eq p0_ "a0" then returnm ('b"01010"  : mword 5)
    else if generic_eq p0_ "a1" then returnm ('b"01011"  : mword 5)
    else if generic_eq p0_ "a2" then returnm ('b"01100"  : mword 5)
    else if generic_eq p0_ "a3" then returnm ('b"01101"  : mword 5)
    else if generic_eq p0_ "a4" then returnm ('b"01110"  : mword 5)
    else if generic_eq p0_ "a5" then returnm ('b"01111"  : mword 5)
    else if generic_eq p0_ "a6" then returnm ('b"10000"  : mword 5)
    else if generic_eq p0_ "a7" then returnm ('b"10001"  : mword 5)
    else if generic_eq p0_ "s2" then returnm ('b"10010"  : mword 5)
    else if generic_eq p0_ "s3" then returnm ('b"10011"  : mword 5)
    else if generic_eq p0_ "s4" then returnm ('b"10100"  : mword 5)
    else if generic_eq p0_ "s5" then returnm ('b"10101"  : mword 5)
    else if generic_eq p0_ "s6" then returnm ('b"10110"  : mword 5)
    else if generic_eq p0_ "s7" then returnm ('b"10111"  : mword 5)
    else if generic_eq p0_ "s8" then returnm ('b"11000"  : mword 5)
    else if generic_eq p0_ "s9" then returnm ('b"11001"  : mword 5)
    else if generic_eq p0_ "s10" then returnm ('b"11010"  : mword 5)
    else if generic_eq p0_ "s11" then returnm ('b"11011"  : mword 5)
    else if generic_eq p0_ "t3" then returnm ('b"11100"  : mword 5)
    else if generic_eq p0_ "t4" then returnm ('b"11101"  : mword 5)
    else if generic_eq p0_ "t5" then returnm ('b"11110"  : mword 5)
    else if generic_eq p0_ "t6" then returnm ('b"11111"  : mword 5)
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (mword 5).

Definition reg_name_forwards_matches (arg_ : mword 5) : bool :=
   let b__0 := arg_ in
   if eq_vec b__0 ('b"00000"  : mword 5) then true
   else if eq_vec b__0 ('b"00001"  : mword 5) then true
   else if eq_vec b__0 ('b"00010"  : mword 5) then true
   else if eq_vec b__0 ('b"00011"  : mword 5) then true
   else if eq_vec b__0 ('b"00100"  : mword 5) then true
   else if eq_vec b__0 ('b"00101"  : mword 5) then true
   else if eq_vec b__0 ('b"00110"  : mword 5) then true
   else if eq_vec b__0 ('b"00111"  : mword 5) then true
   else if eq_vec b__0 ('b"01000"  : mword 5) then true
   else if eq_vec b__0 ('b"01001"  : mword 5) then true
   else if eq_vec b__0 ('b"01010"  : mword 5) then true
   else if eq_vec b__0 ('b"01011"  : mword 5) then true
   else if eq_vec b__0 ('b"01100"  : mword 5) then true
   else if eq_vec b__0 ('b"01101"  : mword 5) then true
   else if eq_vec b__0 ('b"01110"  : mword 5) then true
   else if eq_vec b__0 ('b"01111"  : mword 5) then true
   else if eq_vec b__0 ('b"10000"  : mword 5) then true
   else if eq_vec b__0 ('b"10001"  : mword 5) then true
   else if eq_vec b__0 ('b"10010"  : mword 5) then true
   else if eq_vec b__0 ('b"10011"  : mword 5) then true
   else if eq_vec b__0 ('b"10100"  : mword 5) then true
   else if eq_vec b__0 ('b"10101"  : mword 5) then true
   else if eq_vec b__0 ('b"10110"  : mword 5) then true
   else if eq_vec b__0 ('b"10111"  : mword 5) then true
   else if eq_vec b__0 ('b"11000"  : mword 5) then true
   else if eq_vec b__0 ('b"11001"  : mword 5) then true
   else if eq_vec b__0 ('b"11010"  : mword 5) then true
   else if eq_vec b__0 ('b"11011"  : mword 5) then true
   else if eq_vec b__0 ('b"11100"  : mword 5) then true
   else if eq_vec b__0 ('b"11101"  : mword 5) then true
   else if eq_vec b__0 ('b"11110"  : mword 5) then true
   else if eq_vec b__0 ('b"11111"  : mword 5) then true
   else false.

Definition reg_name_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "zero" then true
   else if generic_eq p0_ "ra" then true
   else if generic_eq p0_ "sp" then true
   else if generic_eq p0_ "gp" then true
   else if generic_eq p0_ "tp" then true
   else if generic_eq p0_ "t0" then true
   else if generic_eq p0_ "t1" then true
   else if generic_eq p0_ "t2" then true
   else if generic_eq p0_ "fp" then true
   else if generic_eq p0_ "s1" then true
   else if generic_eq p0_ "a0" then true
   else if generic_eq p0_ "a1" then true
   else if generic_eq p0_ "a2" then true
   else if generic_eq p0_ "a3" then true
   else if generic_eq p0_ "a4" then true
   else if generic_eq p0_ "a5" then true
   else if generic_eq p0_ "a6" then true
   else if generic_eq p0_ "a7" then true
   else if generic_eq p0_ "s2" then true
   else if generic_eq p0_ "s3" then true
   else if generic_eq p0_ "s4" then true
   else if generic_eq p0_ "s5" then true
   else if generic_eq p0_ "s6" then true
   else if generic_eq p0_ "s7" then true
   else if generic_eq p0_ "s8" then true
   else if generic_eq p0_ "s9" then true
   else if generic_eq p0_ "s10" then true
   else if generic_eq p0_ "s11" then true
   else if generic_eq p0_ "t3" then true
   else if generic_eq p0_ "t4" then true
   else if generic_eq p0_ "t5" then true
   else if generic_eq p0_ "t6" then true
   else false.

Definition _s164_ (_s165_ : string) : option string :=
   let _s166_ := _s165_ in
   if string_startswith _s166_ "t6" then
     match (string_drop _s166_ (projT1 (string_length "t6"))) with | s_ => Some s_ end
   else None.

Definition _s160_ (_s161_ : string) : option string :=
   let _s162_ := _s161_ in
   if string_startswith _s162_ "t5" then
     match (string_drop _s162_ (projT1 (string_length "t5"))) with | s_ => Some s_ end
   else None.

Definition _s156_ (_s157_ : string) : option string :=
   let _s158_ := _s157_ in
   if string_startswith _s158_ "t4" then
     match (string_drop _s158_ (projT1 (string_length "t4"))) with | s_ => Some s_ end
   else None.

Definition _s152_ (_s153_ : string) : option string :=
   let _s154_ := _s153_ in
   if string_startswith _s154_ "t3" then
     match (string_drop _s154_ (projT1 (string_length "t3"))) with | s_ => Some s_ end
   else None.

Definition _s148_ (_s149_ : string) : option string :=
   let _s150_ := _s149_ in
   if string_startswith _s150_ "s11" then
     match (string_drop _s150_ (projT1 (string_length "s11"))) with | s_ => Some s_ end
   else None.

Definition _s144_ (_s145_ : string) : option string :=
   let _s146_ := _s145_ in
   if string_startswith _s146_ "s10" then
     match (string_drop _s146_ (projT1 (string_length "s10"))) with | s_ => Some s_ end
   else None.

Definition _s140_ (_s141_ : string) : option string :=
   let _s142_ := _s141_ in
   if string_startswith _s142_ "s9" then
     match (string_drop _s142_ (projT1 (string_length "s9"))) with | s_ => Some s_ end
   else None.

Definition _s136_ (_s137_ : string) : option string :=
   let _s138_ := _s137_ in
   if string_startswith _s138_ "s8" then
     match (string_drop _s138_ (projT1 (string_length "s8"))) with | s_ => Some s_ end
   else None.

Definition _s132_ (_s133_ : string) : option string :=
   let _s134_ := _s133_ in
   if string_startswith _s134_ "s7" then
     match (string_drop _s134_ (projT1 (string_length "s7"))) with | s_ => Some s_ end
   else None.

Definition _s128_ (_s129_ : string) : option string :=
   let _s130_ := _s129_ in
   if string_startswith _s130_ "s6" then
     match (string_drop _s130_ (projT1 (string_length "s6"))) with | s_ => Some s_ end
   else None.

Definition _s124_ (_s125_ : string) : option string :=
   let _s126_ := _s125_ in
   if string_startswith _s126_ "s5" then
     match (string_drop _s126_ (projT1 (string_length "s5"))) with | s_ => Some s_ end
   else None.

Definition _s120_ (_s121_ : string) : option string :=
   let _s122_ := _s121_ in
   if string_startswith _s122_ "s4" then
     match (string_drop _s122_ (projT1 (string_length "s4"))) with | s_ => Some s_ end
   else None.

Definition _s116_ (_s117_ : string) : option string :=
   let _s118_ := _s117_ in
   if string_startswith _s118_ "s3" then
     match (string_drop _s118_ (projT1 (string_length "s3"))) with | s_ => Some s_ end
   else None.

Definition _s112_ (_s113_ : string) : option string :=
   let _s114_ := _s113_ in
   if string_startswith _s114_ "s2" then
     match (string_drop _s114_ (projT1 (string_length "s2"))) with | s_ => Some s_ end
   else None.

Definition _s108_ (_s109_ : string) : option string :=
   let _s110_ := _s109_ in
   if string_startswith _s110_ "a7" then
     match (string_drop _s110_ (projT1 (string_length "a7"))) with | s_ => Some s_ end
   else None.

Definition _s104_ (_s105_ : string) : option string :=
   let _s106_ := _s105_ in
   if string_startswith _s106_ "a6" then
     match (string_drop _s106_ (projT1 (string_length "a6"))) with | s_ => Some s_ end
   else None.

Definition _s100_ (_s101_ : string) : option string :=
   let _s102_ := _s101_ in
   if string_startswith _s102_ "a5" then
     match (string_drop _s102_ (projT1 (string_length "a5"))) with | s_ => Some s_ end
   else None.

Definition _s96_ (_s97_ : string) : option string :=
   let _s98_ := _s97_ in
   if string_startswith _s98_ "a4" then
     match (string_drop _s98_ (projT1 (string_length "a4"))) with | s_ => Some s_ end
   else None.

Definition _s92_ (_s93_ : string) : option string :=
   let _s94_ := _s93_ in
   if string_startswith _s94_ "a3" then
     match (string_drop _s94_ (projT1 (string_length "a3"))) with | s_ => Some s_ end
   else None.

Definition _s88_ (_s89_ : string) : option string :=
   let _s90_ := _s89_ in
   if string_startswith _s90_ "a2" then
     match (string_drop _s90_ (projT1 (string_length "a2"))) with | s_ => Some s_ end
   else None.

Definition _s84_ (_s85_ : string) : option string :=
   let _s86_ := _s85_ in
   if string_startswith _s86_ "a1" then
     match (string_drop _s86_ (projT1 (string_length "a1"))) with | s_ => Some s_ end
   else None.

Definition _s80_ (_s81_ : string) : option string :=
   let _s82_ := _s81_ in
   if string_startswith _s82_ "a0" then
     match (string_drop _s82_ (projT1 (string_length "a0"))) with | s_ => Some s_ end
   else None.

Definition _s76_ (_s77_ : string) : option string :=
   let _s78_ := _s77_ in
   if string_startswith _s78_ "s1" then
     match (string_drop _s78_ (projT1 (string_length "s1"))) with | s_ => Some s_ end
   else None.

Definition _s72_ (_s73_ : string) : option string :=
   let _s74_ := _s73_ in
   if string_startswith _s74_ "fp" then
     match (string_drop _s74_ (projT1 (string_length "fp"))) with | s_ => Some s_ end
   else None.

Definition _s68_ (_s69_ : string) : option string :=
   let _s70_ := _s69_ in
   if string_startswith _s70_ "t2" then
     match (string_drop _s70_ (projT1 (string_length "t2"))) with | s_ => Some s_ end
   else None.

Definition _s64_ (_s65_ : string) : option string :=
   let _s66_ := _s65_ in
   if string_startswith _s66_ "t1" then
     match (string_drop _s66_ (projT1 (string_length "t1"))) with | s_ => Some s_ end
   else None.

Definition _s60_ (_s61_ : string) : option string :=
   let _s62_ := _s61_ in
   if string_startswith _s62_ "t0" then
     match (string_drop _s62_ (projT1 (string_length "t0"))) with | s_ => Some s_ end
   else None.

Definition _s56_ (_s57_ : string) : option string :=
   let _s58_ := _s57_ in
   if string_startswith _s58_ "tp" then
     match (string_drop _s58_ (projT1 (string_length "tp"))) with | s_ => Some s_ end
   else None.

Definition _s52_ (_s53_ : string) : option string :=
   let _s54_ := _s53_ in
   if string_startswith _s54_ "gp" then
     match (string_drop _s54_ (projT1 (string_length "gp"))) with | s_ => Some s_ end
   else None.

Definition _s48_ (_s49_ : string) : option string :=
   let _s50_ := _s49_ in
   if string_startswith _s50_ "sp" then
     match (string_drop _s50_ (projT1 (string_length "sp"))) with | s_ => Some s_ end
   else None.

Definition _s44_ (_s45_ : string) : option string :=
   let _s46_ := _s45_ in
   if string_startswith _s46_ "ra" then
     match (string_drop _s46_ (projT1 (string_length "ra"))) with | s_ => Some s_ end
   else None.

Definition _s40_ (_s41_ : string) : option string :=
   let _s42_ := _s41_ in
   if string_startswith _s42_ "zero" then
     match (string_drop _s42_ (projT1 (string_length "zero"))) with | s_ => Some s_ end
   else None.

Definition reg_name_matches_prefix (arg_ : string)
: M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s43_ := arg_ in
   (if match (_s40_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s40_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"00000"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s44_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s44_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"00001"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s48_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s48_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"00010"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s52_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s52_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"00011"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s56_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s56_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"00100"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s60_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s60_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"00101"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s64_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s64_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"00110"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s68_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s68_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"00111"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s72_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s72_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"01000"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s76_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s76_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"01001"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s80_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s80_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"01010"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s84_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s84_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"01011"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s88_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s88_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"01100"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s92_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s92_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"01101"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s96_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s96_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"01110"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s100_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s100_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"01111"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s104_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s104_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"10000"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s108_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s108_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"10001"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s112_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s112_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"10010"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s116_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s116_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"10011"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s120_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s120_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"10100"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s124_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s124_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"10101"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s128_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s128_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"10110"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s132_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s132_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"10111"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s136_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s136_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"11000"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s140_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s140_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"11001"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s144_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s144_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"11010"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s148_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s148_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"11011"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s152_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s152_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"11100"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s156_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s156_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"11101"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s160_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s160_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"11110"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s164_ _s43_) with | Some s_ => true | _ => false end then
      (match (_s164_ _s43_) with
       | Some s_ =>
          returnm (Some
                     ('b"11111"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)}))).

Definition creg_name_forwards (arg_ : mword 3) : M (string) :=
   let b__0 := arg_ in
   (if eq_vec b__0 ('b"000"  : mword 3) then returnm "s0"
    else if eq_vec b__0 ('b"001"  : mword 3) then returnm "s1"
    else if eq_vec b__0 ('b"010"  : mword 3) then returnm "a0"
    else if eq_vec b__0 ('b"011"  : mword 3) then returnm "a1"
    else if eq_vec b__0 ('b"100"  : mword 3) then returnm "a2"
    else if eq_vec b__0 ('b"101"  : mword 3) then returnm "a3"
    else if eq_vec b__0 ('b"110"  : mword 3) then returnm "a4"
    else if eq_vec b__0 ('b"111"  : mword 3) then returnm "a5"
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (string).

Definition creg_name_backwards (arg_ : string) : M (mword 3) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "s0" then returnm ('b"000"  : mword 3)
    else if generic_eq p0_ "s1" then returnm ('b"001"  : mword 3)
    else if generic_eq p0_ "a0" then returnm ('b"010"  : mword 3)
    else if generic_eq p0_ "a1" then returnm ('b"011"  : mword 3)
    else if generic_eq p0_ "a2" then returnm ('b"100"  : mword 3)
    else if generic_eq p0_ "a3" then returnm ('b"101"  : mword 3)
    else if generic_eq p0_ "a4" then returnm ('b"110"  : mword 3)
    else if generic_eq p0_ "a5" then returnm ('b"111"  : mword 3)
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (mword 3).

Definition creg_name_forwards_matches (arg_ : mword 3) : bool :=
   let b__0 := arg_ in
   if eq_vec b__0 ('b"000"  : mword 3) then true
   else if eq_vec b__0 ('b"001"  : mword 3) then true
   else if eq_vec b__0 ('b"010"  : mword 3) then true
   else if eq_vec b__0 ('b"011"  : mword 3) then true
   else if eq_vec b__0 ('b"100"  : mword 3) then true
   else if eq_vec b__0 ('b"101"  : mword 3) then true
   else if eq_vec b__0 ('b"110"  : mword 3) then true
   else if eq_vec b__0 ('b"111"  : mword 3) then true
   else false.

Definition creg_name_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "s0" then true
   else if generic_eq p0_ "s1" then true
   else if generic_eq p0_ "a0" then true
   else if generic_eq p0_ "a1" then true
   else if generic_eq p0_ "a2" then true
   else if generic_eq p0_ "a3" then true
   else if generic_eq p0_ "a4" then true
   else if generic_eq p0_ "a5" then true
   else false.

Definition _s196_ (_s197_ : string) : option string :=
   let _s198_ := _s197_ in
   if string_startswith _s198_ "a5" then
     match (string_drop _s198_ (projT1 (string_length "a5"))) with | s_ => Some s_ end
   else None.

Definition _s192_ (_s193_ : string) : option string :=
   let _s194_ := _s193_ in
   if string_startswith _s194_ "a4" then
     match (string_drop _s194_ (projT1 (string_length "a4"))) with | s_ => Some s_ end
   else None.

Definition _s188_ (_s189_ : string) : option string :=
   let _s190_ := _s189_ in
   if string_startswith _s190_ "a3" then
     match (string_drop _s190_ (projT1 (string_length "a3"))) with | s_ => Some s_ end
   else None.

Definition _s184_ (_s185_ : string) : option string :=
   let _s186_ := _s185_ in
   if string_startswith _s186_ "a2" then
     match (string_drop _s186_ (projT1 (string_length "a2"))) with | s_ => Some s_ end
   else None.

Definition _s180_ (_s181_ : string) : option string :=
   let _s182_ := _s181_ in
   if string_startswith _s182_ "a1" then
     match (string_drop _s182_ (projT1 (string_length "a1"))) with | s_ => Some s_ end
   else None.

Definition _s176_ (_s177_ : string) : option string :=
   let _s178_ := _s177_ in
   if string_startswith _s178_ "a0" then
     match (string_drop _s178_ (projT1 (string_length "a0"))) with | s_ => Some s_ end
   else None.

Definition _s172_ (_s173_ : string) : option string :=
   let _s174_ := _s173_ in
   if string_startswith _s174_ "s1" then
     match (string_drop _s174_ (projT1 (string_length "s1"))) with | s_ => Some s_ end
   else None.

Definition _s168_ (_s169_ : string) : option string :=
   let _s170_ := _s169_ in
   if string_startswith _s170_ "s0" then
     match (string_drop _s170_ (projT1 (string_length "s0"))) with | s_ => Some s_ end
   else None.

Definition creg_name_matches_prefix (arg_ : string)
: M (option ((mword 3 * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s171_ := arg_ in
   (if match (_s168_ _s171_) with | Some s_ => true | _ => false end then
      (match (_s168_ _s171_) with
       | Some s_ =>
          returnm (Some
                     ('b"000"
                      : mword 3, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 3 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 3 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s172_ _s171_) with | Some s_ => true | _ => false end then
      (match (_s172_ _s171_) with
       | Some s_ =>
          returnm (Some
                     ('b"001"
                      : mword 3, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 3 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 3 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s176_ _s171_) with | Some s_ => true | _ => false end then
      (match (_s176_ _s171_) with
       | Some s_ =>
          returnm (Some
                     ('b"010"
                      : mword 3, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 3 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 3 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s180_ _s171_) with | Some s_ => true | _ => false end then
      (match (_s180_ _s171_) with
       | Some s_ =>
          returnm (Some
                     ('b"011"
                      : mword 3, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 3 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 3 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s184_ _s171_) with | Some s_ => true | _ => false end then
      (match (_s184_ _s171_) with
       | Some s_ =>
          returnm (Some
                     ('b"100"
                      : mword 3, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 3 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 3 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s188_ _s171_) with | Some s_ => true | _ => false end then
      (match (_s188_ _s171_) with
       | Some s_ =>
          returnm (Some
                     ('b"101"
                      : mword 3, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 3 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 3 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s192_ _s171_) with | Some s_ => true | _ => false end then
      (match (_s192_ _s171_) with
       | Some s_ =>
          returnm (Some
                     ('b"110"
                      : mword 3, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 3 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 3 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s196_ _s171_) with | Some s_ => true | _ => false end then
      (match (_s196_ _s171_) with
       | Some s_ =>
          returnm (Some
                     ('b"111"
                      : mword 3, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 3 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 3 * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((mword 3 * {n : Z & ArithFact (n >=? 0)}))).

Definition init_base_regs '(tt : unit) : M (unit) :=
   write_reg x1_ref zero_reg >>
   write_reg x2_ref zero_reg >>
   write_reg x3_ref zero_reg >>
   write_reg x4_ref zero_reg >>
   write_reg x5_ref zero_reg >>
   write_reg x6_ref zero_reg >>
   write_reg x7_ref zero_reg >>
   write_reg x8_ref zero_reg >>
   write_reg x9_ref zero_reg >>
   write_reg x10_ref zero_reg >>
   write_reg x11_ref zero_reg >>
   write_reg x12_ref zero_reg >>
   write_reg x13_ref zero_reg >>
   write_reg x14_ref zero_reg >>
   write_reg x15_ref zero_reg >>
   write_reg x16_ref zero_reg >>
   write_reg x17_ref zero_reg >>
   write_reg x18_ref zero_reg >>
   write_reg x19_ref zero_reg >>
   write_reg x20_ref zero_reg >>
   write_reg x21_ref zero_reg >>
   write_reg x22_ref zero_reg >>
   write_reg x23_ref zero_reg >>
   write_reg x24_ref zero_reg >>
   write_reg x25_ref zero_reg >>
   write_reg x26_ref zero_reg >>
   write_reg x27_ref zero_reg >>
   write_reg x28_ref zero_reg >>
   write_reg x29_ref zero_reg >>
   write_reg x30_ref zero_reg >> write_reg x31_ref zero_reg  : M (unit).

Definition get_arch_pc '(tt : unit) : M (mword 64) :=
   ((read_reg PC_ref)  : M (mword 64))  : M (mword 64).

Definition get_next_pc '(tt : unit) : M (mword 64) :=
   ((read_reg nextPC_ref)  : M (mword 64))  : M (mword 64).

Definition set_next_pc (pc : mword 64) : M (unit) := write_reg nextPC_ref pc  : M (unit).

Definition tick_pc '(tt : unit) : M (unit) :=
   ((read_reg nextPC_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   write_reg PC_ref w__0
    : M (unit).

Definition Mk_Misa (v : mword 64) : Misa := {| Misa_Misa_chunk_0 := (subrange_vec_dec v 63 0) |}.

Definition _get_Misa_bits (v : Misa) : mword 64 := subrange_vec_dec v.(Misa_Misa_chunk_0) 63 0.

Definition _set_Misa_bits (r_ref : register_ref regstate register_value Misa) (v : mword 64)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 63 0 (subrange_vec_dec v 63 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_bits (v : Misa) (x : mword 64) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 63 0 (subrange_vec_dec x 63 0)) ]}.

Definition _get_Misa_MXL (v : Misa) : mword 2 := subrange_vec_dec v.(Misa_Misa_chunk_0) 63 62.

Definition _set_Misa_MXL (r_ref : register_ref regstate register_value Misa) (v : mword 2)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 63 62 (subrange_vec_dec v 1 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_MXL (v : Misa) (x : mword 2) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 63 62 (subrange_vec_dec x 1 0)) ]}.

Definition _get_Misa_Z (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 25 25.

Definition _set_Misa_Z (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 25 25 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_Z (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 25 25 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_Y (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 24 24.

Definition _set_Misa_Y (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 24 24 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_Y (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 24 24 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_X (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 23 23.

Definition _set_Misa_X (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 23 23 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_X (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 23 23 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_W (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 22 22.

Definition _set_Misa_W (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 22 22 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_W (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 22 22 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_V (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 21 21.

Definition _set_Misa_V (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 21 21 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_V (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 21 21 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_U (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 20 20.

Definition _set_Misa_U (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 20 20 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_U (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 20 20 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_T (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 19 19.

Definition _set_Misa_T (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 19 19 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_T (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 19 19 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_S (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 18 18.

Definition _set_Misa_S (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 18 18 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_S (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 18 18 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_R (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 17 17.

Definition _set_Misa_R (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 17 17 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_R (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 17 17 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_Q (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 16 16.

Definition _set_Misa_Q (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 16 16 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_Q (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 16 16 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_P (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 15 15.

Definition _set_Misa_P (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 15 15 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_P (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 15 15 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_O (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 14 14.

Definition _set_Misa_O (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 14 14 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_O (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 14 14 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_N (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 13 13.

Definition _set_Misa_N (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 13 13 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_N (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 13 13 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_M (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 12 12.

Definition _set_Misa_M (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 12 12 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_M (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 12 12 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_L (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 11 11.

Definition _set_Misa_L (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 11 11 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_L (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 11 11 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_K (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 10 10.

Definition _set_Misa_K (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 10 10 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_K (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 10 10 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_J (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 9 9.

Definition _set_Misa_J (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 9 9 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_J (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 9 9 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_I (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 8 8.

Definition _set_Misa_I (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 8 8 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_I (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 8 8 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_H (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 7 7.

Definition _set_Misa_H (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 7 7 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_H (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 7 7 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_G (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 6 6.

Definition _set_Misa_G (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 6 6 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_G (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 6 6 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_F (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 5 5.

Definition _set_Misa_F (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 5 5 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_F (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 5 5 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_E (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 4 4.

Definition _set_Misa_E (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 4 4 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_E (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 4 4 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_D (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 3 3.

Definition _set_Misa_D (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 3 3 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_D (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 3 3 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_C (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 2 2.

Definition _set_Misa_C (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 2 2 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_C (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 2 2 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_B (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 1 1.

Definition _set_Misa_B (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 1 1 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_B (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 1 1 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Misa_A (v : Misa) : mword 1 := subrange_vec_dec v.(Misa_Misa_chunk_0) 0 0.

Definition _set_Misa_A (r_ref : register_ref regstate register_value Misa) (v : mword 1) : M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Misa_Misa_chunk_0 :=
         (update_subrange_vec_dec r.(Misa_Misa_chunk_0) 0 0 (subrange_vec_dec v 0 0)) ]}
      : Misa in
   write_reg r_ref r
    : M (unit).

Definition _update_Misa_A (v : Misa) (x : mword 1) : Misa :=
   {[ v with
     Misa_Misa_chunk_0 :=
       (update_subrange_vec_dec v.(Misa_Misa_chunk_0) 0 0 (subrange_vec_dec x 0 0)) ]}.

Definition ext_veto_disable_C '(tt : unit) : M (bool) := returnm false.

Definition legalize_misa (m : Misa) (v : mword 64) : M (Misa) :=
   (if sys_enable_writable_misa tt then
      let v := Mk_Misa v in
      (or_boolM
         ((and_boolM (returnm ((eq_vec (_get_Misa_C v) ('b"0"  : mword 1))  : bool))
             ((or_boolM
                 (((read_reg nextPC_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
                  returnm ((eq_bit (access_vec_dec w__0 1) B1)  : bool))
                 ((ext_veto_disable_C tt)
                  : M (bool)))
              : M (bool)))
          : M (bool)) (returnm ((negb (sys_enable_rvc tt))  : bool))) >>= fun w__4 : bool =>
      let m := if sumbool_of_bool w__4 then m else _update_Misa_C m (_get_Misa_C v) in
      returnm (if orb (negb (sys_enable_fdext tt))
                    (andb (eq_vec (_get_Misa_D v) ('b"1"  : mword 1))
                       (eq_vec (_get_Misa_F v) ('b"0"  : mword 1))) then
                 m
               else _update_Misa_D (_update_Misa_F m (_get_Misa_F v)) (_get_Misa_D v))
    else returnm m)
    : M (Misa).

Definition haveAtomics '(tt : unit) : M (bool) :=
   read_reg misa_ref >>= fun w__0 : Misa => returnm (eq_vec (_get_Misa_A w__0) ('b"1"  : mword 1)).

Definition haveRVC '(tt : unit) : M (bool) :=
   read_reg misa_ref >>= fun w__0 : Misa => returnm (eq_vec (_get_Misa_C w__0) ('b"1"  : mword 1)).

Definition haveMulDiv '(tt : unit) : M (bool) :=
   read_reg misa_ref >>= fun w__0 : Misa => returnm (eq_vec (_get_Misa_M w__0) ('b"1"  : mword 1)).

Definition haveSupMode '(tt : unit) : M (bool) :=
   read_reg misa_ref >>= fun w__0 : Misa => returnm (eq_vec (_get_Misa_S w__0) ('b"1"  : mword 1)).

Definition haveUsrMode '(tt : unit) : M (bool) :=
   read_reg misa_ref >>= fun w__0 : Misa => returnm (eq_vec (_get_Misa_U w__0) ('b"1"  : mword 1)).

Definition haveNExt '(tt : unit) : M (bool) :=
   read_reg misa_ref >>= fun w__0 : Misa => returnm (eq_vec (_get_Misa_N w__0) ('b"1"  : mword 1)).

Definition Mk_Mstatush (v : mword 32) : Mstatush :=
   {| Mstatush_Mstatush_chunk_0 := (subrange_vec_dec v 31 0) |}.

Definition _get_Mstatush_bits (v : Mstatush) : mword 32 :=
   subrange_vec_dec v.(Mstatush_Mstatush_chunk_0) 31 0.

Definition _set_Mstatush_bits (r_ref : register_ref regstate register_value Mstatush) (v : mword 32)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatush_Mstatush_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatush_Mstatush_chunk_0) 31 0 (subrange_vec_dec v 31 0)) ]}
      : Mstatush in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatush_bits (v : Mstatush) (x : mword 32) : Mstatush :=
   {[ v with
     Mstatush_Mstatush_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatush_Mstatush_chunk_0) 31 0 (subrange_vec_dec x 31 0)) ]}.

Definition _get_Mstatush_MBE (v : Mstatush) : mword 1 :=
   subrange_vec_dec v.(Mstatush_Mstatush_chunk_0) 5 5.

Definition _set_Mstatush_MBE (r_ref : register_ref regstate register_value Mstatush) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatush_Mstatush_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatush_Mstatush_chunk_0) 5 5 (subrange_vec_dec v 0 0)) ]}
      : Mstatush in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatush_MBE (v : Mstatush) (x : mword 1) : Mstatush :=
   {[ v with
     Mstatush_Mstatush_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatush_Mstatush_chunk_0) 5 5 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Mstatush_SBE (v : Mstatush) : mword 1 :=
   subrange_vec_dec v.(Mstatush_Mstatush_chunk_0) 4 4.

Definition _set_Mstatush_SBE (r_ref : register_ref regstate register_value Mstatush) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatush_Mstatush_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatush_Mstatush_chunk_0) 4 4 (subrange_vec_dec v 0 0)) ]}
      : Mstatush in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatush_SBE (v : Mstatush) (x : mword 1) : Mstatush :=
   {[ v with
     Mstatush_Mstatush_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatush_Mstatush_chunk_0) 4 4 (subrange_vec_dec x 0 0)) ]}.

Definition Mk_Mstatus (v : mword 64) : Mstatus :=
   {| Mstatus_Mstatus_chunk_0 := (subrange_vec_dec v 63 0) |}.

Definition _get_Mstatus_bits (v : Mstatus) : mword 64 :=
   subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 63 0.

Definition _set_Mstatus_bits (r_ref : register_ref regstate register_value Mstatus) (v : mword 64)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatus_Mstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatus_Mstatus_chunk_0) 63 0 (subrange_vec_dec v 63 0)) ]}
      : Mstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatus_bits (v : Mstatus) (x : mword 64) : Mstatus :=
   {[ v with
     Mstatus_Mstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 63 0 (subrange_vec_dec x 63 0)) ]}.

Definition _get_Mstatus_SD (v : Mstatus) : mword 1 :=
   subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 63 63.

Definition _set_Mstatus_SD (r_ref : register_ref regstate register_value Mstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatus_Mstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatus_Mstatus_chunk_0) 63 63 (subrange_vec_dec v 0 0)) ]}
      : Mstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatus_SD (v : Mstatus) (x : mword 1) : Mstatus :=
   {[ v with
     Mstatus_Mstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 63 63 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Mstatus_TSR (v : Mstatus) : mword 1 :=
   subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 22 22.

Definition _set_Mstatus_TSR (r_ref : register_ref regstate register_value Mstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatus_Mstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatus_Mstatus_chunk_0) 22 22 (subrange_vec_dec v 0 0)) ]}
      : Mstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatus_TSR (v : Mstatus) (x : mword 1) : Mstatus :=
   {[ v with
     Mstatus_Mstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 22 22 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Mstatus_TW (v : Mstatus) : mword 1 :=
   subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 21 21.

Definition _set_Mstatus_TW (r_ref : register_ref regstate register_value Mstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatus_Mstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatus_Mstatus_chunk_0) 21 21 (subrange_vec_dec v 0 0)) ]}
      : Mstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatus_TW (v : Mstatus) (x : mword 1) : Mstatus :=
   {[ v with
     Mstatus_Mstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 21 21 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Mstatus_TVM (v : Mstatus) : mword 1 :=
   subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 20 20.

Definition _set_Mstatus_TVM (r_ref : register_ref regstate register_value Mstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatus_Mstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatus_Mstatus_chunk_0) 20 20 (subrange_vec_dec v 0 0)) ]}
      : Mstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatus_TVM (v : Mstatus) (x : mword 1) : Mstatus :=
   {[ v with
     Mstatus_Mstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 20 20 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Mstatus_MXR (v : Mstatus) : mword 1 :=
   subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 19 19.

Definition _set_Mstatus_MXR (r_ref : register_ref regstate register_value Mstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatus_Mstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatus_Mstatus_chunk_0) 19 19 (subrange_vec_dec v 0 0)) ]}
      : Mstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatus_MXR (v : Mstatus) (x : mword 1) : Mstatus :=
   {[ v with
     Mstatus_Mstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 19 19 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Mstatus_SUM (v : Mstatus) : mword 1 :=
   subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 18 18.

Definition _set_Mstatus_SUM (r_ref : register_ref regstate register_value Mstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatus_Mstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatus_Mstatus_chunk_0) 18 18 (subrange_vec_dec v 0 0)) ]}
      : Mstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatus_SUM (v : Mstatus) (x : mword 1) : Mstatus :=
   {[ v with
     Mstatus_Mstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 18 18 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Mstatus_MPRV (v : Mstatus) : mword 1 :=
   subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 17 17.

Definition _set_Mstatus_MPRV (r_ref : register_ref regstate register_value Mstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatus_Mstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatus_Mstatus_chunk_0) 17 17 (subrange_vec_dec v 0 0)) ]}
      : Mstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatus_MPRV (v : Mstatus) (x : mword 1) : Mstatus :=
   {[ v with
     Mstatus_Mstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 17 17 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Mstatus_XS (v : Mstatus) : mword 2 :=
   subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 16 15.

Definition _set_Mstatus_XS (r_ref : register_ref regstate register_value Mstatus) (v : mword 2)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatus_Mstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatus_Mstatus_chunk_0) 16 15 (subrange_vec_dec v 1 0)) ]}
      : Mstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatus_XS (v : Mstatus) (x : mword 2) : Mstatus :=
   {[ v with
     Mstatus_Mstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 16 15 (subrange_vec_dec x 1 0)) ]}.

Definition _get_Mstatus_FS (v : Mstatus) : mword 2 :=
   subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 14 13.

Definition _set_Mstatus_FS (r_ref : register_ref regstate register_value Mstatus) (v : mword 2)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatus_Mstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatus_Mstatus_chunk_0) 14 13 (subrange_vec_dec v 1 0)) ]}
      : Mstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatus_FS (v : Mstatus) (x : mword 2) : Mstatus :=
   {[ v with
     Mstatus_Mstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 14 13 (subrange_vec_dec x 1 0)) ]}.

Definition _get_Mstatus_MPP (v : Mstatus) : mword 2 :=
   subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 12 11.

Definition _set_Mstatus_MPP (r_ref : register_ref regstate register_value Mstatus) (v : mword 2)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatus_Mstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatus_Mstatus_chunk_0) 12 11 (subrange_vec_dec v 1 0)) ]}
      : Mstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatus_MPP (v : Mstatus) (x : mword 2) : Mstatus :=
   {[ v with
     Mstatus_Mstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 12 11 (subrange_vec_dec x 1 0)) ]}.

Definition _get_Mstatus_SPP (v : Mstatus) : mword 1 :=
   subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 8 8.

Definition _set_Mstatus_SPP (r_ref : register_ref regstate register_value Mstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatus_Mstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatus_Mstatus_chunk_0) 8 8 (subrange_vec_dec v 0 0)) ]}
      : Mstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatus_SPP (v : Mstatus) (x : mword 1) : Mstatus :=
   {[ v with
     Mstatus_Mstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 8 8 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Mstatus_MPIE (v : Mstatus) : mword 1 :=
   subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 7 7.

Definition _set_Mstatus_MPIE (r_ref : register_ref regstate register_value Mstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatus_Mstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatus_Mstatus_chunk_0) 7 7 (subrange_vec_dec v 0 0)) ]}
      : Mstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatus_MPIE (v : Mstatus) (x : mword 1) : Mstatus :=
   {[ v with
     Mstatus_Mstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 7 7 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Mstatus_SPIE (v : Mstatus) : mword 1 :=
   subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 5 5.

Definition _set_Mstatus_SPIE (r_ref : register_ref regstate register_value Mstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatus_Mstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatus_Mstatus_chunk_0) 5 5 (subrange_vec_dec v 0 0)) ]}
      : Mstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatus_SPIE (v : Mstatus) (x : mword 1) : Mstatus :=
   {[ v with
     Mstatus_Mstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 5 5 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Mstatus_UPIE (v : Mstatus) : mword 1 :=
   subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 4 4.

Definition _set_Mstatus_UPIE (r_ref : register_ref regstate register_value Mstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatus_Mstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatus_Mstatus_chunk_0) 4 4 (subrange_vec_dec v 0 0)) ]}
      : Mstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatus_UPIE (v : Mstatus) (x : mword 1) : Mstatus :=
   {[ v with
     Mstatus_Mstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 4 4 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Mstatus_MIE (v : Mstatus) : mword 1 :=
   subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 3 3.

Definition _set_Mstatus_MIE (r_ref : register_ref regstate register_value Mstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatus_Mstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatus_Mstatus_chunk_0) 3 3 (subrange_vec_dec v 0 0)) ]}
      : Mstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatus_MIE (v : Mstatus) (x : mword 1) : Mstatus :=
   {[ v with
     Mstatus_Mstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 3 3 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Mstatus_SIE (v : Mstatus) : mword 1 :=
   subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 1 1.

Definition _set_Mstatus_SIE (r_ref : register_ref regstate register_value Mstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatus_Mstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatus_Mstatus_chunk_0) 1 1 (subrange_vec_dec v 0 0)) ]}
      : Mstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatus_SIE (v : Mstatus) (x : mword 1) : Mstatus :=
   {[ v with
     Mstatus_Mstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 1 1 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Mstatus_UIE (v : Mstatus) : mword 1 :=
   subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 0 0.

Definition _set_Mstatus_UIE (r_ref : register_ref regstate register_value Mstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mstatus_Mstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Mstatus_Mstatus_chunk_0) 0 0 (subrange_vec_dec v 0 0)) ]}
      : Mstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Mstatus_UIE (v : Mstatus) (x : mword 1) : Mstatus :=
   {[ v with
     Mstatus_Mstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Mstatus_Mstatus_chunk_0) 0 0 (subrange_vec_dec x 0 0)) ]}.

Definition effectivePrivilege (t : AccessType unit) (m : Mstatus) (priv : Privilege) : M (Privilege) :=
   (if andb (generic_neq t (Execute tt)) (eq_vec (_get_Mstatus_MPRV m) ('b"1"  : mword 1)) then
      (privLevel_of_bits (_get_Mstatus_MPP m))
       : M (Privilege)
    else returnm priv)
    : M (Privilege).

Definition get_mstatus_SXL (m : Mstatus) : mword 2 := subrange_vec_dec (_get_Mstatus_bits m) 35 34.

Definition set_mstatus_SXL (m : Mstatus) (a : mword 2) : Mstatus :=
   let m := update_subrange_vec_dec (_get_Mstatus_bits m) 35 34 a in
   Mk_Mstatus m.

Definition get_mstatus_UXL (m : Mstatus) : mword 2 := subrange_vec_dec (_get_Mstatus_bits m) 33 32.

Definition set_mstatus_UXL (m : Mstatus) (a : mword 2) : Mstatus :=
   let m := update_subrange_vec_dec (_get_Mstatus_bits m) 33 32 a in
   Mk_Mstatus m.

Definition legalize_mstatus (o : Mstatus) (v : mword 64) : M (Mstatus) :=
   let m : Mstatus :=
     Mk_Mstatus
       (EXTZ 64
          (concat_vec (subrange_vec_dec v 22 11)
             (concat_vec ('b"00"  : mword 2)
                (concat_vec (subrange_vec_dec v 8 7)
                   (concat_vec ('b"0"  : mword 1)
                      (concat_vec (subrange_vec_dec v 5 3)
                         (concat_vec ('b"0"  : mword 1) (subrange_vec_dec v 1 0)))))))) in
   let m := _update_Mstatus_XS m (extStatus_to_bits Off) in
   (or_boolM
      ((extStatus_of_bits (_get_Mstatus_FS m)) >>= fun w__0 : ExtStatus =>
       returnm ((generic_eq w__0 Dirty)  : bool))
      ((extStatus_of_bits (_get_Mstatus_XS m)) >>= fun w__1 : ExtStatus =>
       returnm ((generic_eq w__1 Dirty)  : bool))) >>= fun dirty =>
   let m := _update_Mstatus_SD m (bool_to_bits dirty) in
   let m := set_mstatus_SXL m (get_mstatus_SXL o) in
   let m := set_mstatus_UXL m (get_mstatus_UXL o) in
   let m :=
     Mk_Mstatus
       (update_subrange_vec_dec (_get_Mstatus_bits m) 37 36 ('b"00"  : mword (37 - (36 - 1)))) in
   (haveNExt tt) >>= fun w__2 : bool =>
   let m :=
     if sumbool_of_bool (negb w__2) then
       let m := _update_Mstatus_UPIE m ('b"0"  : mword 1) in
       _update_Mstatus_UIE m ('b"0"  : mword 1)
     else m in
   (haveUsrMode tt) >>= fun w__3 : bool =>
   returnm (if sumbool_of_bool (negb w__3) then _update_Mstatus_MPRV m ('b"0"  : mword 1) else m).

Definition cur_Architecture '(tt : unit) : M (Architecture) :=
   read_reg cur_privilege_ref >>= fun w__0 : Privilege =>
   (match w__0 with
    | Machine => read_reg misa_ref >>= fun w__1 : Misa => returnm (_get_Misa_MXL w__1)
    | Supervisor => read_reg mstatus_ref >>= fun w__2 : Mstatus => returnm (get_mstatus_SXL w__2)
    | User => read_reg mstatus_ref >>= fun w__3 : Mstatus => returnm (get_mstatus_UXL w__3)
    end) >>= fun a : arch_xlen =>
   (match (architecture a) with
    | Some a => returnm a
    | None => (internal_error "Invalid current architecture")  : M (Architecture)
    end)
    : M (Architecture).

Definition in32BitMode '(tt : unit) : M (bool) :=
   (cur_Architecture tt) >>= fun w__0 : Architecture => returnm (generic_eq w__0 RV32).

Definition haveFExt '(tt : unit) : M (bool) :=
   (and_boolM
      (read_reg misa_ref >>= fun w__0 : Misa =>
       returnm ((eq_vec (_get_Misa_F w__0) ('b"1"  : mword 1))  : bool))
      (read_reg mstatus_ref >>= fun w__1 : Mstatus =>
       returnm ((neq_vec (_get_Mstatus_FS w__1) ('b"00"  : mword 2))  : bool)))
    : M (bool).

Definition haveDExt '(tt : unit) : M (bool) :=
   (and_boolM
      (read_reg misa_ref >>= fun w__0 : Misa =>
       returnm ((eq_vec (_get_Misa_D w__0) ('b"1"  : mword 1))  : bool))
      (read_reg mstatus_ref >>= fun w__1 : Mstatus =>
       returnm ((neq_vec (_get_Mstatus_FS w__1) ('b"00"  : mword 2))  : bool)))
    : M (bool).

Definition Mk_Minterrupts (v : mword 64) : Minterrupts :=
   {| Minterrupts_Minterrupts_chunk_0 := (subrange_vec_dec v 63 0) |}.

Definition _get_Minterrupts_bits (v : Minterrupts) : mword 64 :=
   subrange_vec_dec v.(Minterrupts_Minterrupts_chunk_0) 63 0.

Definition _set_Minterrupts_bits
(r_ref : register_ref regstate register_value Minterrupts) (v : mword 64)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Minterrupts_Minterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Minterrupts_Minterrupts_chunk_0) 63 0 (subrange_vec_dec v 63 0)) ]}
      : Minterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Minterrupts_bits (v : Minterrupts) (x : mword 64) : Minterrupts :=
   {[ v with
     Minterrupts_Minterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Minterrupts_Minterrupts_chunk_0) 63 0 (subrange_vec_dec x 63 0)) ]}.

Definition _get_Minterrupts_MEI (v : Minterrupts) : mword 1 :=
   subrange_vec_dec v.(Minterrupts_Minterrupts_chunk_0) 11 11.

Definition _set_Minterrupts_MEI
(r_ref : register_ref regstate register_value Minterrupts) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Minterrupts_Minterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Minterrupts_Minterrupts_chunk_0) 11 11 (subrange_vec_dec v 0 0)) ]}
      : Minterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Minterrupts_MEI (v : Minterrupts) (x : mword 1) : Minterrupts :=
   {[ v with
     Minterrupts_Minterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Minterrupts_Minterrupts_chunk_0) 11 11 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Minterrupts_SEI (v : Minterrupts) : mword 1 :=
   subrange_vec_dec v.(Minterrupts_Minterrupts_chunk_0) 9 9.

Definition _set_Minterrupts_SEI
(r_ref : register_ref regstate register_value Minterrupts) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Minterrupts_Minterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Minterrupts_Minterrupts_chunk_0) 9 9 (subrange_vec_dec v 0 0)) ]}
      : Minterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Minterrupts_SEI (v : Minterrupts) (x : mword 1) : Minterrupts :=
   {[ v with
     Minterrupts_Minterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Minterrupts_Minterrupts_chunk_0) 9 9 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Minterrupts_UEI (v : Minterrupts) : mword 1 :=
   subrange_vec_dec v.(Minterrupts_Minterrupts_chunk_0) 8 8.

Definition _set_Minterrupts_UEI
(r_ref : register_ref regstate register_value Minterrupts) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Minterrupts_Minterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Minterrupts_Minterrupts_chunk_0) 8 8 (subrange_vec_dec v 0 0)) ]}
      : Minterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Minterrupts_UEI (v : Minterrupts) (x : mword 1) : Minterrupts :=
   {[ v with
     Minterrupts_Minterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Minterrupts_Minterrupts_chunk_0) 8 8 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Minterrupts_MTI (v : Minterrupts) : mword 1 :=
   subrange_vec_dec v.(Minterrupts_Minterrupts_chunk_0) 7 7.

Definition _set_Minterrupts_MTI
(r_ref : register_ref regstate register_value Minterrupts) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Minterrupts_Minterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Minterrupts_Minterrupts_chunk_0) 7 7 (subrange_vec_dec v 0 0)) ]}
      : Minterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Minterrupts_MTI (v : Minterrupts) (x : mword 1) : Minterrupts :=
   {[ v with
     Minterrupts_Minterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Minterrupts_Minterrupts_chunk_0) 7 7 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Minterrupts_STI (v : Minterrupts) : mword 1 :=
   subrange_vec_dec v.(Minterrupts_Minterrupts_chunk_0) 5 5.

Definition _set_Minterrupts_STI
(r_ref : register_ref regstate register_value Minterrupts) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Minterrupts_Minterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Minterrupts_Minterrupts_chunk_0) 5 5 (subrange_vec_dec v 0 0)) ]}
      : Minterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Minterrupts_STI (v : Minterrupts) (x : mword 1) : Minterrupts :=
   {[ v with
     Minterrupts_Minterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Minterrupts_Minterrupts_chunk_0) 5 5 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Minterrupts_UTI (v : Minterrupts) : mword 1 :=
   subrange_vec_dec v.(Minterrupts_Minterrupts_chunk_0) 4 4.

Definition _set_Minterrupts_UTI
(r_ref : register_ref regstate register_value Minterrupts) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Minterrupts_Minterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Minterrupts_Minterrupts_chunk_0) 4 4 (subrange_vec_dec v 0 0)) ]}
      : Minterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Minterrupts_UTI (v : Minterrupts) (x : mword 1) : Minterrupts :=
   {[ v with
     Minterrupts_Minterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Minterrupts_Minterrupts_chunk_0) 4 4 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Minterrupts_MSI (v : Minterrupts) : mword 1 :=
   subrange_vec_dec v.(Minterrupts_Minterrupts_chunk_0) 3 3.

Definition _set_Minterrupts_MSI
(r_ref : register_ref regstate register_value Minterrupts) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Minterrupts_Minterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Minterrupts_Minterrupts_chunk_0) 3 3 (subrange_vec_dec v 0 0)) ]}
      : Minterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Minterrupts_MSI (v : Minterrupts) (x : mword 1) : Minterrupts :=
   {[ v with
     Minterrupts_Minterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Minterrupts_Minterrupts_chunk_0) 3 3 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Minterrupts_SSI (v : Minterrupts) : mword 1 :=
   subrange_vec_dec v.(Minterrupts_Minterrupts_chunk_0) 1 1.

Definition _set_Minterrupts_SSI
(r_ref : register_ref regstate register_value Minterrupts) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Minterrupts_Minterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Minterrupts_Minterrupts_chunk_0) 1 1 (subrange_vec_dec v 0 0)) ]}
      : Minterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Minterrupts_SSI (v : Minterrupts) (x : mword 1) : Minterrupts :=
   {[ v with
     Minterrupts_Minterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Minterrupts_Minterrupts_chunk_0) 1 1 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Minterrupts_USI (v : Minterrupts) : mword 1 :=
   subrange_vec_dec v.(Minterrupts_Minterrupts_chunk_0) 0 0.

Definition _set_Minterrupts_USI
(r_ref : register_ref regstate register_value Minterrupts) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Minterrupts_Minterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Minterrupts_Minterrupts_chunk_0) 0 0 (subrange_vec_dec v 0 0)) ]}
      : Minterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Minterrupts_USI (v : Minterrupts) (x : mword 1) : Minterrupts :=
   {[ v with
     Minterrupts_Minterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Minterrupts_Minterrupts_chunk_0) 0 0 (subrange_vec_dec x 0 0)) ]}.

Definition legalize_mip (o : Minterrupts) (v : mword 64) : M (Minterrupts) :=
   let v := Mk_Minterrupts v in
   let m := _update_Minterrupts_SEI o (_get_Minterrupts_SEI v) in
   let m := _update_Minterrupts_STI m (_get_Minterrupts_STI v) in
   let m := _update_Minterrupts_SSI m (_get_Minterrupts_SSI v) in
   (and_boolM ((haveUsrMode tt)  : M (bool)) ((haveNExt tt)  : M (bool))) >>= fun w__2 : bool =>
   returnm (if sumbool_of_bool w__2 then
              let m := _update_Minterrupts_UEI m (_get_Minterrupts_UEI v) in
              let m := _update_Minterrupts_UTI m (_get_Minterrupts_UTI v) in
              _update_Minterrupts_USI m (_get_Minterrupts_USI v)
            else m).

Definition legalize_mie (o : Minterrupts) (v : mword 64) : M (Minterrupts) :=
   let v := Mk_Minterrupts v in
   let m := _update_Minterrupts_MEI o (_get_Minterrupts_MEI v) in
   let m := _update_Minterrupts_MTI m (_get_Minterrupts_MTI v) in
   let m := _update_Minterrupts_MSI m (_get_Minterrupts_MSI v) in
   let m := _update_Minterrupts_SEI m (_get_Minterrupts_SEI v) in
   let m := _update_Minterrupts_STI m (_get_Minterrupts_STI v) in
   let m := _update_Minterrupts_SSI m (_get_Minterrupts_SSI v) in
   (and_boolM ((haveUsrMode tt)  : M (bool)) ((haveNExt tt)  : M (bool))) >>= fun w__2 : bool =>
   returnm (if sumbool_of_bool w__2 then
              let m := _update_Minterrupts_UEI m (_get_Minterrupts_UEI v) in
              let m := _update_Minterrupts_UTI m (_get_Minterrupts_UTI v) in
              _update_Minterrupts_USI m (_get_Minterrupts_USI v)
            else m).

Definition legalize_mideleg (o : Minterrupts) (v : mword 64) : Minterrupts :=
   let m := Mk_Minterrupts v in
   let m := _update_Minterrupts_MEI m ('b"0"  : mword 1) in
   let m := _update_Minterrupts_MTI m ('b"0"  : mword 1) in
   _update_Minterrupts_MSI m ('b"0"  : mword 1).

Definition Mk_Medeleg (v : mword 64) : Medeleg :=
   {| Medeleg_Medeleg_chunk_0 := (subrange_vec_dec v 63 0) |}.

Definition _get_Medeleg_bits (v : Medeleg) : mword 64 :=
   subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 63 0.

Definition _set_Medeleg_bits (r_ref : register_ref regstate register_value Medeleg) (v : mword 64)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Medeleg_Medeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Medeleg_Medeleg_chunk_0) 63 0 (subrange_vec_dec v 63 0)) ]}
      : Medeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Medeleg_bits (v : Medeleg) (x : mword 64) : Medeleg :=
   {[ v with
     Medeleg_Medeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 63 0 (subrange_vec_dec x 63 0)) ]}.

Definition _get_Medeleg_SAMO_Page_Fault (v : Medeleg) : mword 1 :=
   subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 15 15.

Definition _set_Medeleg_SAMO_Page_Fault
(r_ref : register_ref regstate register_value Medeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Medeleg_Medeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Medeleg_Medeleg_chunk_0) 15 15 (subrange_vec_dec v 0 0)) ]}
      : Medeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Medeleg_SAMO_Page_Fault (v : Medeleg) (x : mword 1) : Medeleg :=
   {[ v with
     Medeleg_Medeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 15 15 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Medeleg_Load_Page_Fault (v : Medeleg) : mword 1 :=
   subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 13 13.

Definition _set_Medeleg_Load_Page_Fault
(r_ref : register_ref regstate register_value Medeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Medeleg_Medeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Medeleg_Medeleg_chunk_0) 13 13 (subrange_vec_dec v 0 0)) ]}
      : Medeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Medeleg_Load_Page_Fault (v : Medeleg) (x : mword 1) : Medeleg :=
   {[ v with
     Medeleg_Medeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 13 13 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Medeleg_Fetch_Page_Fault (v : Medeleg) : mword 1 :=
   subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 12 12.

Definition _set_Medeleg_Fetch_Page_Fault
(r_ref : register_ref regstate register_value Medeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Medeleg_Medeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Medeleg_Medeleg_chunk_0) 12 12 (subrange_vec_dec v 0 0)) ]}
      : Medeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Medeleg_Fetch_Page_Fault (v : Medeleg) (x : mword 1) : Medeleg :=
   {[ v with
     Medeleg_Medeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 12 12 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Medeleg_MEnvCall (v : Medeleg) : mword 1 :=
   subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 10 10.

Definition _set_Medeleg_MEnvCall
(r_ref : register_ref regstate register_value Medeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Medeleg_Medeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Medeleg_Medeleg_chunk_0) 10 10 (subrange_vec_dec v 0 0)) ]}
      : Medeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Medeleg_MEnvCall (v : Medeleg) (x : mword 1) : Medeleg :=
   {[ v with
     Medeleg_Medeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 10 10 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Medeleg_SEnvCall (v : Medeleg) : mword 1 :=
   subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 9 9.

Definition _set_Medeleg_SEnvCall
(r_ref : register_ref regstate register_value Medeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Medeleg_Medeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Medeleg_Medeleg_chunk_0) 9 9 (subrange_vec_dec v 0 0)) ]}
      : Medeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Medeleg_SEnvCall (v : Medeleg) (x : mword 1) : Medeleg :=
   {[ v with
     Medeleg_Medeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 9 9 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Medeleg_UEnvCall (v : Medeleg) : mword 1 :=
   subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 8 8.

Definition _set_Medeleg_UEnvCall
(r_ref : register_ref regstate register_value Medeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Medeleg_Medeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Medeleg_Medeleg_chunk_0) 8 8 (subrange_vec_dec v 0 0)) ]}
      : Medeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Medeleg_UEnvCall (v : Medeleg) (x : mword 1) : Medeleg :=
   {[ v with
     Medeleg_Medeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 8 8 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Medeleg_SAMO_Access_Fault (v : Medeleg) : mword 1 :=
   subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 7 7.

Definition _set_Medeleg_SAMO_Access_Fault
(r_ref : register_ref regstate register_value Medeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Medeleg_Medeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Medeleg_Medeleg_chunk_0) 7 7 (subrange_vec_dec v 0 0)) ]}
      : Medeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Medeleg_SAMO_Access_Fault (v : Medeleg) (x : mword 1) : Medeleg :=
   {[ v with
     Medeleg_Medeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 7 7 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Medeleg_SAMO_Addr_Align (v : Medeleg) : mword 1 :=
   subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 6 6.

Definition _set_Medeleg_SAMO_Addr_Align
(r_ref : register_ref regstate register_value Medeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Medeleg_Medeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Medeleg_Medeleg_chunk_0) 6 6 (subrange_vec_dec v 0 0)) ]}
      : Medeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Medeleg_SAMO_Addr_Align (v : Medeleg) (x : mword 1) : Medeleg :=
   {[ v with
     Medeleg_Medeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 6 6 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Medeleg_Load_Access_Fault (v : Medeleg) : mword 1 :=
   subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 5 5.

Definition _set_Medeleg_Load_Access_Fault
(r_ref : register_ref regstate register_value Medeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Medeleg_Medeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Medeleg_Medeleg_chunk_0) 5 5 (subrange_vec_dec v 0 0)) ]}
      : Medeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Medeleg_Load_Access_Fault (v : Medeleg) (x : mword 1) : Medeleg :=
   {[ v with
     Medeleg_Medeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 5 5 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Medeleg_Load_Addr_Align (v : Medeleg) : mword 1 :=
   subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 4 4.

Definition _set_Medeleg_Load_Addr_Align
(r_ref : register_ref regstate register_value Medeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Medeleg_Medeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Medeleg_Medeleg_chunk_0) 4 4 (subrange_vec_dec v 0 0)) ]}
      : Medeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Medeleg_Load_Addr_Align (v : Medeleg) (x : mword 1) : Medeleg :=
   {[ v with
     Medeleg_Medeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 4 4 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Medeleg_Breakpoint (v : Medeleg) : mword 1 :=
   subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 3 3.

Definition _set_Medeleg_Breakpoint
(r_ref : register_ref regstate register_value Medeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Medeleg_Medeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Medeleg_Medeleg_chunk_0) 3 3 (subrange_vec_dec v 0 0)) ]}
      : Medeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Medeleg_Breakpoint (v : Medeleg) (x : mword 1) : Medeleg :=
   {[ v with
     Medeleg_Medeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 3 3 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Medeleg_Illegal_Instr (v : Medeleg) : mword 1 :=
   subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 2 2.

Definition _set_Medeleg_Illegal_Instr
(r_ref : register_ref regstate register_value Medeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Medeleg_Medeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Medeleg_Medeleg_chunk_0) 2 2 (subrange_vec_dec v 0 0)) ]}
      : Medeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Medeleg_Illegal_Instr (v : Medeleg) (x : mword 1) : Medeleg :=
   {[ v with
     Medeleg_Medeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 2 2 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Medeleg_Fetch_Access_Fault (v : Medeleg) : mword 1 :=
   subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 1 1.

Definition _set_Medeleg_Fetch_Access_Fault
(r_ref : register_ref regstate register_value Medeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Medeleg_Medeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Medeleg_Medeleg_chunk_0) 1 1 (subrange_vec_dec v 0 0)) ]}
      : Medeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Medeleg_Fetch_Access_Fault (v : Medeleg) (x : mword 1) : Medeleg :=
   {[ v with
     Medeleg_Medeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 1 1 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Medeleg_Fetch_Addr_Align (v : Medeleg) : mword 1 :=
   subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 0 0.

Definition _set_Medeleg_Fetch_Addr_Align
(r_ref : register_ref regstate register_value Medeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Medeleg_Medeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Medeleg_Medeleg_chunk_0) 0 0 (subrange_vec_dec v 0 0)) ]}
      : Medeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Medeleg_Fetch_Addr_Align (v : Medeleg) (x : mword 1) : Medeleg :=
   {[ v with
     Medeleg_Medeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Medeleg_Medeleg_chunk_0) 0 0 (subrange_vec_dec x 0 0)) ]}.

Definition legalize_medeleg (o : Medeleg) (v : mword 64) : Medeleg :=
   let m := Mk_Medeleg v in
   _update_Medeleg_MEnvCall m ('b"0"  : mword 1).

Definition Mk_Mtvec (v : mword 64) : Mtvec :=
   {| Mtvec_Mtvec_chunk_0 := (subrange_vec_dec v 63 0) |}.

Definition _get_Mtvec_bits (v : Mtvec) : mword 64 := subrange_vec_dec v.(Mtvec_Mtvec_chunk_0) 63 0.

Definition _set_Mtvec_bits (r_ref : register_ref regstate register_value Mtvec) (v : mword 64)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mtvec_Mtvec_chunk_0 :=
         (update_subrange_vec_dec r.(Mtvec_Mtvec_chunk_0) 63 0 (subrange_vec_dec v 63 0)) ]}
      : Mtvec in
   write_reg r_ref r
    : M (unit).

Definition _update_Mtvec_bits (v : Mtvec) (x : mword 64) : Mtvec :=
   {[ v with
     Mtvec_Mtvec_chunk_0 :=
       (update_subrange_vec_dec v.(Mtvec_Mtvec_chunk_0) 63 0 (subrange_vec_dec x 63 0)) ]}.

Definition _get_Mtvec_Base (v : Mtvec) : mword 62 := subrange_vec_dec v.(Mtvec_Mtvec_chunk_0) 63 2.

Definition _set_Mtvec_Base (r_ref : register_ref regstate register_value Mtvec) (v : mword 62)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mtvec_Mtvec_chunk_0 :=
         (update_subrange_vec_dec r.(Mtvec_Mtvec_chunk_0) 63 2 (subrange_vec_dec v 61 0)) ]}
      : Mtvec in
   write_reg r_ref r
    : M (unit).

Definition _update_Mtvec_Base (v : Mtvec) (x : mword 62) : Mtvec :=
   {[ v with
     Mtvec_Mtvec_chunk_0 :=
       (update_subrange_vec_dec v.(Mtvec_Mtvec_chunk_0) 63 2 (subrange_vec_dec x 61 0)) ]}.

Definition _get_Mtvec_Mode (v : Mtvec) : mword 2 := subrange_vec_dec v.(Mtvec_Mtvec_chunk_0) 1 0.

Definition _set_Mtvec_Mode (r_ref : register_ref regstate register_value Mtvec) (v : mword 2)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mtvec_Mtvec_chunk_0 :=
         (update_subrange_vec_dec r.(Mtvec_Mtvec_chunk_0) 1 0 (subrange_vec_dec v 1 0)) ]}
      : Mtvec in
   write_reg r_ref r
    : M (unit).

Definition _update_Mtvec_Mode (v : Mtvec) (x : mword 2) : Mtvec :=
   {[ v with
     Mtvec_Mtvec_chunk_0 :=
       (update_subrange_vec_dec v.(Mtvec_Mtvec_chunk_0) 1 0 (subrange_vec_dec x 1 0)) ]}.

Definition legalize_tvec (o : Mtvec) (v : mword 64) : Mtvec :=
   let v := Mk_Mtvec v in
   match (trapVectorMode_of_bits (_get_Mtvec_Mode v)) with
   | TV_Direct => v
   | TV_Vector => v
   | _ => _update_Mtvec_Mode v (_get_Mtvec_Mode o)
   end.

Definition Mk_Mcause (v : mword 64) : Mcause :=
   {| Mcause_Mcause_chunk_0 := (subrange_vec_dec v 63 0) |}.

Definition _get_Mcause_bits (v : Mcause) : mword 64 :=
   subrange_vec_dec v.(Mcause_Mcause_chunk_0) 63 0.

Definition _set_Mcause_bits (r_ref : register_ref regstate register_value Mcause) (v : mword 64)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mcause_Mcause_chunk_0 :=
         (update_subrange_vec_dec r.(Mcause_Mcause_chunk_0) 63 0 (subrange_vec_dec v 63 0)) ]}
      : Mcause in
   write_reg r_ref r
    : M (unit).

Definition _update_Mcause_bits (v : Mcause) (x : mword 64) : Mcause :=
   {[ v with
     Mcause_Mcause_chunk_0 :=
       (update_subrange_vec_dec v.(Mcause_Mcause_chunk_0) 63 0 (subrange_vec_dec x 63 0)) ]}.

Definition _get_Mcause_IsInterrupt (v : Mcause) : mword 1 :=
   subrange_vec_dec v.(Mcause_Mcause_chunk_0) 63 63.

Definition _set_Mcause_IsInterrupt
(r_ref : register_ref regstate register_value Mcause) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mcause_Mcause_chunk_0 :=
         (update_subrange_vec_dec r.(Mcause_Mcause_chunk_0) 63 63 (subrange_vec_dec v 0 0)) ]}
      : Mcause in
   write_reg r_ref r
    : M (unit).

Definition _update_Mcause_IsInterrupt (v : Mcause) (x : mword 1) : Mcause :=
   {[ v with
     Mcause_Mcause_chunk_0 :=
       (update_subrange_vec_dec v.(Mcause_Mcause_chunk_0) 63 63 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Mcause_Cause (v : Mcause) : mword 63 :=
   subrange_vec_dec v.(Mcause_Mcause_chunk_0) 62 0.

Definition _set_Mcause_Cause (r_ref : register_ref regstate register_value Mcause) (v : mword 63)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Mcause_Mcause_chunk_0 :=
         (update_subrange_vec_dec r.(Mcause_Mcause_chunk_0) 62 0 (subrange_vec_dec v 62 0)) ]}
      : Mcause in
   write_reg r_ref r
    : M (unit).

Definition _update_Mcause_Cause (v : Mcause) (x : mword 63) : Mcause :=
   {[ v with
     Mcause_Mcause_chunk_0 :=
       (update_subrange_vec_dec v.(Mcause_Mcause_chunk_0) 62 0 (subrange_vec_dec x 62 0)) ]}.

Definition tvec_addr (m : Mtvec) (c : Mcause) : option (mword 64) :=
   let base : xlenbits := concat_vec (_get_Mtvec_Base m) ('b"00"  : mword 2) in
   match (trapVectorMode_of_bits (_get_Mtvec_Mode m)) with
   | TV_Direct => Some base
   | TV_Vector =>
      if eq_vec (_get_Mcause_IsInterrupt c) ('b"1"  : mword 1) then
        Some (add_vec base (shiftl (EXTZ 64 (_get_Mcause_Cause c)) 2))
      else Some base
   | TV_Reserved => None
   end.

Definition legalize_xepc (v : mword 64) : M (mword 64) :=
   (or_boolM (returnm ((andb (sys_enable_writable_misa tt) (sys_enable_rvc tt))  : bool))
      (read_reg misa_ref >>= fun w__0 : Misa =>
       returnm ((eq_vec (_get_Misa_C w__0) ('b"1"  : mword 1))  : bool))) >>= fun w__1 : bool =>
   returnm (if sumbool_of_bool w__1 then update_vec_dec v 0 B0
            else and_vec v (EXTS 64 ('b"100"  : mword 3))).

Definition pc_alignment_mask '(tt : unit) : M (mword 64) :=
   read_reg misa_ref >>= fun w__0 : Misa =>
   returnm (not_vec
              (EXTZ 64
                 (if eq_vec (_get_Misa_C w__0) ('b"1"  : mword 1) then 'b"00"  : mword 2
                  else 'b"10"  : mword 2))).

Definition Mk_Counteren (v : mword 32) : Counteren :=
   {| Counteren_Counteren_chunk_0 := (subrange_vec_dec v 31 0) |}.

Definition _get_Counteren_bits (v : Counteren) : mword 32 :=
   subrange_vec_dec v.(Counteren_Counteren_chunk_0) 31 0.

Definition _set_Counteren_bits
(r_ref : register_ref regstate register_value Counteren) (v : mword 32)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Counteren_Counteren_chunk_0 :=
         (update_subrange_vec_dec r.(Counteren_Counteren_chunk_0) 31 0 (subrange_vec_dec v 31 0)) ]}
      : Counteren in
   write_reg r_ref r
    : M (unit).

Definition _update_Counteren_bits (v : Counteren) (x : mword 32) : Counteren :=
   {[ v with
     Counteren_Counteren_chunk_0 :=
       (update_subrange_vec_dec v.(Counteren_Counteren_chunk_0) 31 0 (subrange_vec_dec x 31 0)) ]}.

Definition _get_Counteren_HPM (v : Counteren) : mword 29 :=
   subrange_vec_dec v.(Counteren_Counteren_chunk_0) 31 3.

Definition _set_Counteren_HPM
(r_ref : register_ref regstate register_value Counteren) (v : mword 29)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Counteren_Counteren_chunk_0 :=
         (update_subrange_vec_dec r.(Counteren_Counteren_chunk_0) 31 3 (subrange_vec_dec v 28 0)) ]}
      : Counteren in
   write_reg r_ref r
    : M (unit).

Definition _update_Counteren_HPM (v : Counteren) (x : mword 29) : Counteren :=
   {[ v with
     Counteren_Counteren_chunk_0 :=
       (update_subrange_vec_dec v.(Counteren_Counteren_chunk_0) 31 3 (subrange_vec_dec x 28 0)) ]}.

Definition _get_Counteren_IR (v : Counteren) : mword 1 :=
   subrange_vec_dec v.(Counteren_Counteren_chunk_0) 2 2.

Definition _set_Counteren_IR (r_ref : register_ref regstate register_value Counteren) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Counteren_Counteren_chunk_0 :=
         (update_subrange_vec_dec r.(Counteren_Counteren_chunk_0) 2 2 (subrange_vec_dec v 0 0)) ]}
      : Counteren in
   write_reg r_ref r
    : M (unit).

Definition _update_Counteren_IR (v : Counteren) (x : mword 1) : Counteren :=
   {[ v with
     Counteren_Counteren_chunk_0 :=
       (update_subrange_vec_dec v.(Counteren_Counteren_chunk_0) 2 2 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Counteren_TM (v : Counteren) : mword 1 :=
   subrange_vec_dec v.(Counteren_Counteren_chunk_0) 1 1.

Definition _set_Counteren_TM (r_ref : register_ref regstate register_value Counteren) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Counteren_Counteren_chunk_0 :=
         (update_subrange_vec_dec r.(Counteren_Counteren_chunk_0) 1 1 (subrange_vec_dec v 0 0)) ]}
      : Counteren in
   write_reg r_ref r
    : M (unit).

Definition _update_Counteren_TM (v : Counteren) (x : mword 1) : Counteren :=
   {[ v with
     Counteren_Counteren_chunk_0 :=
       (update_subrange_vec_dec v.(Counteren_Counteren_chunk_0) 1 1 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Counteren_CY (v : Counteren) : mword 1 :=
   subrange_vec_dec v.(Counteren_Counteren_chunk_0) 0 0.

Definition _set_Counteren_CY (r_ref : register_ref regstate register_value Counteren) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Counteren_Counteren_chunk_0 :=
         (update_subrange_vec_dec r.(Counteren_Counteren_chunk_0) 0 0 (subrange_vec_dec v 0 0)) ]}
      : Counteren in
   write_reg r_ref r
    : M (unit).

Definition _update_Counteren_CY (v : Counteren) (x : mword 1) : Counteren :=
   {[ v with
     Counteren_Counteren_chunk_0 :=
       (update_subrange_vec_dec v.(Counteren_Counteren_chunk_0) 0 0 (subrange_vec_dec x 0 0)) ]}.

Definition legalize_mcounteren (c : Counteren) (v : mword 64) : Counteren :=
   let c := _update_Counteren_IR c (vec_of_bits [access_vec_dec v 2]  : mword 1) in
   let c := _update_Counteren_TM c (vec_of_bits [access_vec_dec v 1]  : mword 1) in
   _update_Counteren_CY c (vec_of_bits [access_vec_dec v 0]  : mword 1).

Definition legalize_scounteren (c : Counteren) (v : mword 64) : Counteren :=
   let c := _update_Counteren_IR c (vec_of_bits [access_vec_dec v 2]  : mword 1) in
   let c := _update_Counteren_TM c (vec_of_bits [access_vec_dec v 1]  : mword 1) in
   _update_Counteren_CY c (vec_of_bits [access_vec_dec v 0]  : mword 1).

Definition Mk_Counterin (v : mword 32) : Counterin :=
   {| Counterin_Counterin_chunk_0 := (subrange_vec_dec v 31 0) |}.

Definition _get_Counterin_bits (v : Counterin) : mword 32 :=
   subrange_vec_dec v.(Counterin_Counterin_chunk_0) 31 0.

Definition _set_Counterin_bits
(r_ref : register_ref regstate register_value Counterin) (v : mword 32)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Counterin_Counterin_chunk_0 :=
         (update_subrange_vec_dec r.(Counterin_Counterin_chunk_0) 31 0 (subrange_vec_dec v 31 0)) ]}
      : Counterin in
   write_reg r_ref r
    : M (unit).

Definition _update_Counterin_bits (v : Counterin) (x : mword 32) : Counterin :=
   {[ v with
     Counterin_Counterin_chunk_0 :=
       (update_subrange_vec_dec v.(Counterin_Counterin_chunk_0) 31 0 (subrange_vec_dec x 31 0)) ]}.

Definition _get_Counterin_IR (v : Counterin) : mword 1 :=
   subrange_vec_dec v.(Counterin_Counterin_chunk_0) 2 2.

Definition _set_Counterin_IR (r_ref : register_ref regstate register_value Counterin) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Counterin_Counterin_chunk_0 :=
         (update_subrange_vec_dec r.(Counterin_Counterin_chunk_0) 2 2 (subrange_vec_dec v 0 0)) ]}
      : Counterin in
   write_reg r_ref r
    : M (unit).

Definition _update_Counterin_IR (v : Counterin) (x : mword 1) : Counterin :=
   {[ v with
     Counterin_Counterin_chunk_0 :=
       (update_subrange_vec_dec v.(Counterin_Counterin_chunk_0) 2 2 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Counterin_CY (v : Counterin) : mword 1 :=
   subrange_vec_dec v.(Counterin_Counterin_chunk_0) 0 0.

Definition _set_Counterin_CY (r_ref : register_ref regstate register_value Counterin) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Counterin_Counterin_chunk_0 :=
         (update_subrange_vec_dec r.(Counterin_Counterin_chunk_0) 0 0 (subrange_vec_dec v 0 0)) ]}
      : Counterin in
   write_reg r_ref r
    : M (unit).

Definition _update_Counterin_CY (v : Counterin) (x : mword 1) : Counterin :=
   {[ v with
     Counterin_Counterin_chunk_0 :=
       (update_subrange_vec_dec v.(Counterin_Counterin_chunk_0) 0 0 (subrange_vec_dec x 0 0)) ]}.

Definition legalize_mcountinhibit (c : Counterin) (v : mword 64) : Counterin :=
   let c := _update_Counterin_IR c (vec_of_bits [access_vec_dec v 2]  : mword 1) in
   _update_Counterin_CY c (vec_of_bits [access_vec_dec v 0]  : mword 1).

Definition retire_instruction '(tt : unit) : M (unit) :=
   read_reg minstret_written_ref >>= fun w__0 : bool =>
   (if Bool.eqb w__0 true then write_reg minstret_written_ref false  : M (unit)
    else
    read_reg mcountinhibit_ref >>= fun w__1 : Counterin =>
    if eq_vec (_get_Counterin_IR w__1) ('b"0"  : mword 1) then
      ((read_reg minstret_ref)  : M (mword 64)) >>= fun w__2 : mword 64 =>
      write_reg minstret_ref (add_vec_int w__2 1)
       : M (unit)
    else returnm tt)
    : M (unit).

Definition Mk_Sstatus (v : mword 64) : Sstatus :=
   {| Sstatus_Sstatus_chunk_0 := (subrange_vec_dec v 63 0) |}.

Definition _get_Sstatus_bits (v : Sstatus) : mword 64 :=
   subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 63 0.

Definition _set_Sstatus_bits (r_ref : register_ref regstate register_value Sstatus) (v : mword 64)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sstatus_Sstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Sstatus_Sstatus_chunk_0) 63 0 (subrange_vec_dec v 63 0)) ]}
      : Sstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Sstatus_bits (v : Sstatus) (x : mword 64) : Sstatus :=
   {[ v with
     Sstatus_Sstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 63 0 (subrange_vec_dec x 63 0)) ]}.

Definition _get_Sstatus_SD (v : Sstatus) : mword 1 :=
   subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 63 63.

Definition _set_Sstatus_SD (r_ref : register_ref regstate register_value Sstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sstatus_Sstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Sstatus_Sstatus_chunk_0) 63 63 (subrange_vec_dec v 0 0)) ]}
      : Sstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Sstatus_SD (v : Sstatus) (x : mword 1) : Sstatus :=
   {[ v with
     Sstatus_Sstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 63 63 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Sstatus_MXR (v : Sstatus) : mword 1 :=
   subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 19 19.

Definition _set_Sstatus_MXR (r_ref : register_ref regstate register_value Sstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sstatus_Sstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Sstatus_Sstatus_chunk_0) 19 19 (subrange_vec_dec v 0 0)) ]}
      : Sstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Sstatus_MXR (v : Sstatus) (x : mword 1) : Sstatus :=
   {[ v with
     Sstatus_Sstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 19 19 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Sstatus_SUM (v : Sstatus) : mword 1 :=
   subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 18 18.

Definition _set_Sstatus_SUM (r_ref : register_ref regstate register_value Sstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sstatus_Sstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Sstatus_Sstatus_chunk_0) 18 18 (subrange_vec_dec v 0 0)) ]}
      : Sstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Sstatus_SUM (v : Sstatus) (x : mword 1) : Sstatus :=
   {[ v with
     Sstatus_Sstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 18 18 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Sstatus_XS (v : Sstatus) : mword 2 :=
   subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 16 15.

Definition _set_Sstatus_XS (r_ref : register_ref regstate register_value Sstatus) (v : mword 2)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sstatus_Sstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Sstatus_Sstatus_chunk_0) 16 15 (subrange_vec_dec v 1 0)) ]}
      : Sstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Sstatus_XS (v : Sstatus) (x : mword 2) : Sstatus :=
   {[ v with
     Sstatus_Sstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 16 15 (subrange_vec_dec x 1 0)) ]}.

Definition _get_Sstatus_FS (v : Sstatus) : mword 2 :=
   subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 14 13.

Definition _set_Sstatus_FS (r_ref : register_ref regstate register_value Sstatus) (v : mword 2)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sstatus_Sstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Sstatus_Sstatus_chunk_0) 14 13 (subrange_vec_dec v 1 0)) ]}
      : Sstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Sstatus_FS (v : Sstatus) (x : mword 2) : Sstatus :=
   {[ v with
     Sstatus_Sstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 14 13 (subrange_vec_dec x 1 0)) ]}.

Definition _get_Sstatus_SPP (v : Sstatus) : mword 1 :=
   subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 8 8.

Definition _set_Sstatus_SPP (r_ref : register_ref regstate register_value Sstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sstatus_Sstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Sstatus_Sstatus_chunk_0) 8 8 (subrange_vec_dec v 0 0)) ]}
      : Sstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Sstatus_SPP (v : Sstatus) (x : mword 1) : Sstatus :=
   {[ v with
     Sstatus_Sstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 8 8 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Sstatus_SPIE (v : Sstatus) : mword 1 :=
   subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 5 5.

Definition _set_Sstatus_SPIE (r_ref : register_ref regstate register_value Sstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sstatus_Sstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Sstatus_Sstatus_chunk_0) 5 5 (subrange_vec_dec v 0 0)) ]}
      : Sstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Sstatus_SPIE (v : Sstatus) (x : mword 1) : Sstatus :=
   {[ v with
     Sstatus_Sstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 5 5 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Sstatus_UPIE (v : Sstatus) : mword 1 :=
   subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 4 4.

Definition _set_Sstatus_UPIE (r_ref : register_ref regstate register_value Sstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sstatus_Sstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Sstatus_Sstatus_chunk_0) 4 4 (subrange_vec_dec v 0 0)) ]}
      : Sstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Sstatus_UPIE (v : Sstatus) (x : mword 1) : Sstatus :=
   {[ v with
     Sstatus_Sstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 4 4 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Sstatus_SIE (v : Sstatus) : mword 1 :=
   subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 1 1.

Definition _set_Sstatus_SIE (r_ref : register_ref regstate register_value Sstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sstatus_Sstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Sstatus_Sstatus_chunk_0) 1 1 (subrange_vec_dec v 0 0)) ]}
      : Sstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Sstatus_SIE (v : Sstatus) (x : mword 1) : Sstatus :=
   {[ v with
     Sstatus_Sstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 1 1 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Sstatus_UIE (v : Sstatus) : mword 1 :=
   subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 0 0.

Definition _set_Sstatus_UIE (r_ref : register_ref regstate register_value Sstatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sstatus_Sstatus_chunk_0 :=
         (update_subrange_vec_dec r.(Sstatus_Sstatus_chunk_0) 0 0 (subrange_vec_dec v 0 0)) ]}
      : Sstatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Sstatus_UIE (v : Sstatus) (x : mword 1) : Sstatus :=
   {[ v with
     Sstatus_Sstatus_chunk_0 :=
       (update_subrange_vec_dec v.(Sstatus_Sstatus_chunk_0) 0 0 (subrange_vec_dec x 0 0)) ]}.

Definition get_sstatus_UXL (s : Sstatus) : mword 2 :=
   let m := Mk_Mstatus (_get_Sstatus_bits s) in
   get_mstatus_UXL m.

Definition set_sstatus_UXL (s : Sstatus) (a : mword 2) : Sstatus :=
   let m := Mk_Mstatus (_get_Sstatus_bits s) in
   let m := set_mstatus_UXL m a in
   Mk_Sstatus (_get_Mstatus_bits m).

Definition lower_mstatus (m : Mstatus) : Sstatus :=
   let s := Mk_Sstatus (EXTZ 64 ('b"0"  : mword 1)) in
   let s := _update_Sstatus_SD s (_get_Mstatus_SD m) in
   let s := set_sstatus_UXL s (get_mstatus_UXL m) in
   let s := _update_Sstatus_MXR s (_get_Mstatus_MXR m) in
   let s := _update_Sstatus_SUM s (_get_Mstatus_SUM m) in
   let s := _update_Sstatus_XS s (_get_Mstatus_XS m) in
   let s := _update_Sstatus_FS s (_get_Mstatus_FS m) in
   let s := _update_Sstatus_SPP s (_get_Mstatus_SPP m) in
   let s := _update_Sstatus_SPIE s (_get_Mstatus_SPIE m) in
   let s := _update_Sstatus_UPIE s (_get_Mstatus_UPIE m) in
   let s := _update_Sstatus_SIE s (_get_Mstatus_SIE m) in
   _update_Sstatus_UIE s (_get_Mstatus_UIE m).

Definition lift_sstatus (m : Mstatus) (s : Sstatus) : M (Mstatus) :=
   let m := _update_Mstatus_MXR m (_get_Sstatus_MXR s) in
   let m := _update_Mstatus_SUM m (_get_Sstatus_SUM s) in
   let m := _update_Mstatus_XS m (_get_Sstatus_XS s) in
   let m := _update_Mstatus_FS m (_get_Sstatus_FS s) in
   (or_boolM
      ((extStatus_of_bits (_get_Mstatus_FS m)) >>= fun w__0 : ExtStatus =>
       returnm ((generic_eq w__0 Dirty)  : bool))
      ((extStatus_of_bits (_get_Mstatus_XS m)) >>= fun w__1 : ExtStatus =>
       returnm ((generic_eq w__1 Dirty)  : bool))) >>= fun dirty =>
   let m := _update_Mstatus_SD m (bool_to_bits dirty) in
   let m := _update_Mstatus_SPP m (_get_Sstatus_SPP s) in
   let m := _update_Mstatus_SPIE m (_get_Sstatus_SPIE s) in
   let m := _update_Mstatus_UPIE m (_get_Sstatus_UPIE s) in
   let m := _update_Mstatus_SIE m (_get_Sstatus_SIE s) in
   let m := _update_Mstatus_UIE m (_get_Sstatus_UIE s) in
   returnm m.

Definition legalize_sstatus (m : Mstatus) (v : mword 64) : M (Mstatus) :=
   (lift_sstatus m (Mk_Sstatus v)) >>= fun w__0 : Mstatus =>
   (legalize_mstatus m (_get_Mstatus_bits w__0))
    : M (Mstatus).

Definition Mk_Sedeleg (v : mword 64) : Sedeleg :=
   {| Sedeleg_Sedeleg_chunk_0 := (subrange_vec_dec v 63 0) |}.

Definition _get_Sedeleg_bits (v : Sedeleg) : mword 64 :=
   subrange_vec_dec v.(Sedeleg_Sedeleg_chunk_0) 63 0.

Definition _set_Sedeleg_bits (r_ref : register_ref regstate register_value Sedeleg) (v : mword 64)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sedeleg_Sedeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Sedeleg_Sedeleg_chunk_0) 63 0 (subrange_vec_dec v 63 0)) ]}
      : Sedeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Sedeleg_bits (v : Sedeleg) (x : mword 64) : Sedeleg :=
   {[ v with
     Sedeleg_Sedeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Sedeleg_Sedeleg_chunk_0) 63 0 (subrange_vec_dec x 63 0)) ]}.

Definition _get_Sedeleg_UEnvCall (v : Sedeleg) : mword 1 :=
   subrange_vec_dec v.(Sedeleg_Sedeleg_chunk_0) 8 8.

Definition _set_Sedeleg_UEnvCall
(r_ref : register_ref regstate register_value Sedeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sedeleg_Sedeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Sedeleg_Sedeleg_chunk_0) 8 8 (subrange_vec_dec v 0 0)) ]}
      : Sedeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Sedeleg_UEnvCall (v : Sedeleg) (x : mword 1) : Sedeleg :=
   {[ v with
     Sedeleg_Sedeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Sedeleg_Sedeleg_chunk_0) 8 8 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Sedeleg_SAMO_Access_Fault (v : Sedeleg) : mword 1 :=
   subrange_vec_dec v.(Sedeleg_Sedeleg_chunk_0) 7 7.

Definition _set_Sedeleg_SAMO_Access_Fault
(r_ref : register_ref regstate register_value Sedeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sedeleg_Sedeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Sedeleg_Sedeleg_chunk_0) 7 7 (subrange_vec_dec v 0 0)) ]}
      : Sedeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Sedeleg_SAMO_Access_Fault (v : Sedeleg) (x : mword 1) : Sedeleg :=
   {[ v with
     Sedeleg_Sedeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Sedeleg_Sedeleg_chunk_0) 7 7 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Sedeleg_SAMO_Addr_Align (v : Sedeleg) : mword 1 :=
   subrange_vec_dec v.(Sedeleg_Sedeleg_chunk_0) 6 6.

Definition _set_Sedeleg_SAMO_Addr_Align
(r_ref : register_ref regstate register_value Sedeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sedeleg_Sedeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Sedeleg_Sedeleg_chunk_0) 6 6 (subrange_vec_dec v 0 0)) ]}
      : Sedeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Sedeleg_SAMO_Addr_Align (v : Sedeleg) (x : mword 1) : Sedeleg :=
   {[ v with
     Sedeleg_Sedeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Sedeleg_Sedeleg_chunk_0) 6 6 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Sedeleg_Load_Access_Fault (v : Sedeleg) : mword 1 :=
   subrange_vec_dec v.(Sedeleg_Sedeleg_chunk_0) 5 5.

Definition _set_Sedeleg_Load_Access_Fault
(r_ref : register_ref regstate register_value Sedeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sedeleg_Sedeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Sedeleg_Sedeleg_chunk_0) 5 5 (subrange_vec_dec v 0 0)) ]}
      : Sedeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Sedeleg_Load_Access_Fault (v : Sedeleg) (x : mword 1) : Sedeleg :=
   {[ v with
     Sedeleg_Sedeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Sedeleg_Sedeleg_chunk_0) 5 5 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Sedeleg_Load_Addr_Align (v : Sedeleg) : mword 1 :=
   subrange_vec_dec v.(Sedeleg_Sedeleg_chunk_0) 4 4.

Definition _set_Sedeleg_Load_Addr_Align
(r_ref : register_ref regstate register_value Sedeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sedeleg_Sedeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Sedeleg_Sedeleg_chunk_0) 4 4 (subrange_vec_dec v 0 0)) ]}
      : Sedeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Sedeleg_Load_Addr_Align (v : Sedeleg) (x : mword 1) : Sedeleg :=
   {[ v with
     Sedeleg_Sedeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Sedeleg_Sedeleg_chunk_0) 4 4 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Sedeleg_Breakpoint (v : Sedeleg) : mword 1 :=
   subrange_vec_dec v.(Sedeleg_Sedeleg_chunk_0) 3 3.

Definition _set_Sedeleg_Breakpoint
(r_ref : register_ref regstate register_value Sedeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sedeleg_Sedeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Sedeleg_Sedeleg_chunk_0) 3 3 (subrange_vec_dec v 0 0)) ]}
      : Sedeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Sedeleg_Breakpoint (v : Sedeleg) (x : mword 1) : Sedeleg :=
   {[ v with
     Sedeleg_Sedeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Sedeleg_Sedeleg_chunk_0) 3 3 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Sedeleg_Illegal_Instr (v : Sedeleg) : mword 1 :=
   subrange_vec_dec v.(Sedeleg_Sedeleg_chunk_0) 2 2.

Definition _set_Sedeleg_Illegal_Instr
(r_ref : register_ref regstate register_value Sedeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sedeleg_Sedeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Sedeleg_Sedeleg_chunk_0) 2 2 (subrange_vec_dec v 0 0)) ]}
      : Sedeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Sedeleg_Illegal_Instr (v : Sedeleg) (x : mword 1) : Sedeleg :=
   {[ v with
     Sedeleg_Sedeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Sedeleg_Sedeleg_chunk_0) 2 2 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Sedeleg_Fetch_Access_Fault (v : Sedeleg) : mword 1 :=
   subrange_vec_dec v.(Sedeleg_Sedeleg_chunk_0) 1 1.

Definition _set_Sedeleg_Fetch_Access_Fault
(r_ref : register_ref regstate register_value Sedeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sedeleg_Sedeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Sedeleg_Sedeleg_chunk_0) 1 1 (subrange_vec_dec v 0 0)) ]}
      : Sedeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Sedeleg_Fetch_Access_Fault (v : Sedeleg) (x : mword 1) : Sedeleg :=
   {[ v with
     Sedeleg_Sedeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Sedeleg_Sedeleg_chunk_0) 1 1 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Sedeleg_Fetch_Addr_Align (v : Sedeleg) : mword 1 :=
   subrange_vec_dec v.(Sedeleg_Sedeleg_chunk_0) 0 0.

Definition _set_Sedeleg_Fetch_Addr_Align
(r_ref : register_ref regstate register_value Sedeleg) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sedeleg_Sedeleg_chunk_0 :=
         (update_subrange_vec_dec r.(Sedeleg_Sedeleg_chunk_0) 0 0 (subrange_vec_dec v 0 0)) ]}
      : Sedeleg in
   write_reg r_ref r
    : M (unit).

Definition _update_Sedeleg_Fetch_Addr_Align (v : Sedeleg) (x : mword 1) : Sedeleg :=
   {[ v with
     Sedeleg_Sedeleg_chunk_0 :=
       (update_subrange_vec_dec v.(Sedeleg_Sedeleg_chunk_0) 0 0 (subrange_vec_dec x 0 0)) ]}.

Definition legalize_sedeleg (s : Sedeleg) (v : mword 64) : Sedeleg :=
   Mk_Sedeleg (EXTZ 64 (subrange_vec_dec v 8 0)).

Definition Mk_Sinterrupts (v : mword 64) : Sinterrupts :=
   {| Sinterrupts_Sinterrupts_chunk_0 := (subrange_vec_dec v 63 0) |}.

Definition _get_Sinterrupts_bits (v : Sinterrupts) : mword 64 :=
   subrange_vec_dec v.(Sinterrupts_Sinterrupts_chunk_0) 63 0.

Definition _set_Sinterrupts_bits
(r_ref : register_ref regstate register_value Sinterrupts) (v : mword 64)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sinterrupts_Sinterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Sinterrupts_Sinterrupts_chunk_0) 63 0 (subrange_vec_dec v 63 0)) ]}
      : Sinterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Sinterrupts_bits (v : Sinterrupts) (x : mword 64) : Sinterrupts :=
   {[ v with
     Sinterrupts_Sinterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Sinterrupts_Sinterrupts_chunk_0) 63 0 (subrange_vec_dec x 63 0)) ]}.

Definition _get_Sinterrupts_SEI (v : Sinterrupts) : mword 1 :=
   subrange_vec_dec v.(Sinterrupts_Sinterrupts_chunk_0) 9 9.

Definition _set_Sinterrupts_SEI
(r_ref : register_ref regstate register_value Sinterrupts) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sinterrupts_Sinterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Sinterrupts_Sinterrupts_chunk_0) 9 9 (subrange_vec_dec v 0 0)) ]}
      : Sinterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Sinterrupts_SEI (v : Sinterrupts) (x : mword 1) : Sinterrupts :=
   {[ v with
     Sinterrupts_Sinterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Sinterrupts_Sinterrupts_chunk_0) 9 9 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Sinterrupts_UEI (v : Sinterrupts) : mword 1 :=
   subrange_vec_dec v.(Sinterrupts_Sinterrupts_chunk_0) 8 8.

Definition _set_Sinterrupts_UEI
(r_ref : register_ref regstate register_value Sinterrupts) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sinterrupts_Sinterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Sinterrupts_Sinterrupts_chunk_0) 8 8 (subrange_vec_dec v 0 0)) ]}
      : Sinterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Sinterrupts_UEI (v : Sinterrupts) (x : mword 1) : Sinterrupts :=
   {[ v with
     Sinterrupts_Sinterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Sinterrupts_Sinterrupts_chunk_0) 8 8 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Sinterrupts_STI (v : Sinterrupts) : mword 1 :=
   subrange_vec_dec v.(Sinterrupts_Sinterrupts_chunk_0) 5 5.

Definition _set_Sinterrupts_STI
(r_ref : register_ref regstate register_value Sinterrupts) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sinterrupts_Sinterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Sinterrupts_Sinterrupts_chunk_0) 5 5 (subrange_vec_dec v 0 0)) ]}
      : Sinterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Sinterrupts_STI (v : Sinterrupts) (x : mword 1) : Sinterrupts :=
   {[ v with
     Sinterrupts_Sinterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Sinterrupts_Sinterrupts_chunk_0) 5 5 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Sinterrupts_UTI (v : Sinterrupts) : mword 1 :=
   subrange_vec_dec v.(Sinterrupts_Sinterrupts_chunk_0) 4 4.

Definition _set_Sinterrupts_UTI
(r_ref : register_ref regstate register_value Sinterrupts) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sinterrupts_Sinterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Sinterrupts_Sinterrupts_chunk_0) 4 4 (subrange_vec_dec v 0 0)) ]}
      : Sinterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Sinterrupts_UTI (v : Sinterrupts) (x : mword 1) : Sinterrupts :=
   {[ v with
     Sinterrupts_Sinterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Sinterrupts_Sinterrupts_chunk_0) 4 4 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Sinterrupts_SSI (v : Sinterrupts) : mword 1 :=
   subrange_vec_dec v.(Sinterrupts_Sinterrupts_chunk_0) 1 1.

Definition _set_Sinterrupts_SSI
(r_ref : register_ref regstate register_value Sinterrupts) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sinterrupts_Sinterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Sinterrupts_Sinterrupts_chunk_0) 1 1 (subrange_vec_dec v 0 0)) ]}
      : Sinterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Sinterrupts_SSI (v : Sinterrupts) (x : mword 1) : Sinterrupts :=
   {[ v with
     Sinterrupts_Sinterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Sinterrupts_Sinterrupts_chunk_0) 1 1 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Sinterrupts_USI (v : Sinterrupts) : mword 1 :=
   subrange_vec_dec v.(Sinterrupts_Sinterrupts_chunk_0) 0 0.

Definition _set_Sinterrupts_USI
(r_ref : register_ref regstate register_value Sinterrupts) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Sinterrupts_Sinterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Sinterrupts_Sinterrupts_chunk_0) 0 0 (subrange_vec_dec v 0 0)) ]}
      : Sinterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Sinterrupts_USI (v : Sinterrupts) (x : mword 1) : Sinterrupts :=
   {[ v with
     Sinterrupts_Sinterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Sinterrupts_Sinterrupts_chunk_0) 0 0 (subrange_vec_dec x 0 0)) ]}.

Definition lower_mip (m : Minterrupts) (d : Minterrupts) : Sinterrupts :=
   let s : Sinterrupts := Mk_Sinterrupts (EXTZ 64 ('b"0"  : mword 1)) in
   let s := _update_Sinterrupts_SEI s (and_vec (_get_Minterrupts_SEI m) (_get_Minterrupts_SEI d)) in
   let s := _update_Sinterrupts_STI s (and_vec (_get_Minterrupts_STI m) (_get_Minterrupts_STI d)) in
   let s := _update_Sinterrupts_SSI s (and_vec (_get_Minterrupts_SSI m) (_get_Minterrupts_SSI d)) in
   let s := _update_Sinterrupts_UEI s (and_vec (_get_Minterrupts_UEI m) (_get_Minterrupts_UEI d)) in
   let s := _update_Sinterrupts_UTI s (and_vec (_get_Minterrupts_UTI m) (_get_Minterrupts_UTI d)) in
   _update_Sinterrupts_USI s (and_vec (_get_Minterrupts_USI m) (_get_Minterrupts_USI d)).

Definition lower_mie (m : Minterrupts) (d : Minterrupts) : Sinterrupts :=
   let s : Sinterrupts := Mk_Sinterrupts (EXTZ 64 ('b"0"  : mword 1)) in
   let s := _update_Sinterrupts_SEI s (and_vec (_get_Minterrupts_SEI m) (_get_Minterrupts_SEI d)) in
   let s := _update_Sinterrupts_STI s (and_vec (_get_Minterrupts_STI m) (_get_Minterrupts_STI d)) in
   let s := _update_Sinterrupts_SSI s (and_vec (_get_Minterrupts_SSI m) (_get_Minterrupts_SSI d)) in
   let s := _update_Sinterrupts_UEI s (and_vec (_get_Minterrupts_UEI m) (_get_Minterrupts_UEI d)) in
   let s := _update_Sinterrupts_UTI s (and_vec (_get_Minterrupts_UTI m) (_get_Minterrupts_UTI d)) in
   _update_Sinterrupts_USI s (and_vec (_get_Minterrupts_USI m) (_get_Minterrupts_USI d)).

Definition lift_sip (o : Minterrupts) (d : Minterrupts) (s : Sinterrupts) : M (Minterrupts) :=
   let m : Minterrupts := o in
   let m :=
     if eq_vec (_get_Minterrupts_SSI d) ('b"1"  : mword 1) then
       _update_Minterrupts_SSI m (_get_Sinterrupts_SSI s)
     else m in
   (haveNExt tt) >>= fun w__0 : bool =>
   returnm (if sumbool_of_bool w__0 then
              let m :=
                if eq_vec (_get_Minterrupts_UEI d) ('b"1"  : mword 1) then
                  _update_Minterrupts_UEI m (_get_Sinterrupts_UEI s)
                else m in
              if eq_vec (_get_Minterrupts_USI d) ('b"1"  : mword 1) then
                _update_Minterrupts_USI m (_get_Sinterrupts_USI s)
              else m
            else m).

Definition legalize_sip (m : Minterrupts) (d : Minterrupts) (v : mword 64) : M (Minterrupts) :=
   (lift_sip m d (Mk_Sinterrupts v))  : M (Minterrupts).

Definition lift_sie (o : Minterrupts) (d : Minterrupts) (s : Sinterrupts) : M (Minterrupts) :=
   let m : Minterrupts := o in
   let m :=
     if eq_vec (_get_Minterrupts_SEI d) ('b"1"  : mword 1) then
       _update_Minterrupts_SEI m (_get_Sinterrupts_SEI s)
     else m in
   let m :=
     if eq_vec (_get_Minterrupts_STI d) ('b"1"  : mword 1) then
       _update_Minterrupts_STI m (_get_Sinterrupts_STI s)
     else m in
   let m :=
     if eq_vec (_get_Minterrupts_SSI d) ('b"1"  : mword 1) then
       _update_Minterrupts_SSI m (_get_Sinterrupts_SSI s)
     else m in
   (haveNExt tt) >>= fun w__0 : bool =>
   returnm (if sumbool_of_bool w__0 then
              let m :=
                if eq_vec (_get_Minterrupts_UEI d) ('b"1"  : mword 1) then
                  _update_Minterrupts_UEI m (_get_Sinterrupts_UEI s)
                else m in
              let m :=
                if eq_vec (_get_Minterrupts_UTI d) ('b"1"  : mword 1) then
                  _update_Minterrupts_UTI m (_get_Sinterrupts_UTI s)
                else m in
              if eq_vec (_get_Minterrupts_USI d) ('b"1"  : mword 1) then
                _update_Minterrupts_USI m (_get_Sinterrupts_USI s)
              else m
            else m).

Definition legalize_sie (m : Minterrupts) (d : Minterrupts) (v : mword 64) : M (Minterrupts) :=
   (lift_sie m d (Mk_Sinterrupts v))  : M (Minterrupts).

Definition Mk_Satp64 (v : mword 64) : Satp64 :=
   {| Satp64_Satp64_chunk_0 := (subrange_vec_dec v 63 0) |}.

Definition _get_Satp64_bits (v : Satp64) : mword 64 :=
   subrange_vec_dec v.(Satp64_Satp64_chunk_0) 63 0.

Definition _set_Satp64_bits (r_ref : register_ref regstate register_value Satp64) (v : mword 64)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Satp64_Satp64_chunk_0 :=
         (update_subrange_vec_dec r.(Satp64_Satp64_chunk_0) 63 0 (subrange_vec_dec v 63 0)) ]}
      : Satp64 in
   write_reg r_ref r
    : M (unit).

Definition _update_Satp64_bits (v : Satp64) (x : mword 64) : Satp64 :=
   {[ v with
     Satp64_Satp64_chunk_0 :=
       (update_subrange_vec_dec v.(Satp64_Satp64_chunk_0) 63 0 (subrange_vec_dec x 63 0)) ]}.

Definition _get_Satp64_Mode (v : Satp64) : mword 4 :=
   subrange_vec_dec v.(Satp64_Satp64_chunk_0) 63 60.

Definition _set_Satp64_Mode (r_ref : register_ref regstate register_value Satp64) (v : mword 4)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Satp64_Satp64_chunk_0 :=
         (update_subrange_vec_dec r.(Satp64_Satp64_chunk_0) 63 60 (subrange_vec_dec v 3 0)) ]}
      : Satp64 in
   write_reg r_ref r
    : M (unit).

Definition _update_Satp64_Mode (v : Satp64) (x : mword 4) : Satp64 :=
   {[ v with
     Satp64_Satp64_chunk_0 :=
       (update_subrange_vec_dec v.(Satp64_Satp64_chunk_0) 63 60 (subrange_vec_dec x 3 0)) ]}.

Definition _get_Satp64_Asid (v : Satp64) : mword 16 :=
   subrange_vec_dec v.(Satp64_Satp64_chunk_0) 59 44.

Definition _set_Satp64_Asid (r_ref : register_ref regstate register_value Satp64) (v : mword 16)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Satp64_Satp64_chunk_0 :=
         (update_subrange_vec_dec r.(Satp64_Satp64_chunk_0) 59 44 (subrange_vec_dec v 15 0)) ]}
      : Satp64 in
   write_reg r_ref r
    : M (unit).

Definition _update_Satp64_Asid (v : Satp64) (x : mword 16) : Satp64 :=
   {[ v with
     Satp64_Satp64_chunk_0 :=
       (update_subrange_vec_dec v.(Satp64_Satp64_chunk_0) 59 44 (subrange_vec_dec x 15 0)) ]}.

Definition _get_Satp64_PPN (v : Satp64) : mword 44 :=
   subrange_vec_dec v.(Satp64_Satp64_chunk_0) 43 0.

Definition _set_Satp64_PPN (r_ref : register_ref regstate register_value Satp64) (v : mword 44)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Satp64_Satp64_chunk_0 :=
         (update_subrange_vec_dec r.(Satp64_Satp64_chunk_0) 43 0 (subrange_vec_dec v 43 0)) ]}
      : Satp64 in
   write_reg r_ref r
    : M (unit).

Definition _update_Satp64_PPN (v : Satp64) (x : mword 44) : Satp64 :=
   {[ v with
     Satp64_Satp64_chunk_0 :=
       (update_subrange_vec_dec v.(Satp64_Satp64_chunk_0) 43 0 (subrange_vec_dec x 43 0)) ]}.

Definition legalize_satp64 (a : Architecture) (o : mword 64) (v : mword 64) : mword 64 :=
   let s := Mk_Satp64 v in
   match (satp64Mode_of_bits a (_get_Satp64_Mode s)) with
   | None => o
   | Some Sv32 => o
   | Some _ => _get_Satp64_bits s
   end.

Definition Mk_Satp32 (v : mword 32) : Satp32 :=
   {| Satp32_Satp32_chunk_0 := (subrange_vec_dec v 31 0) |}.

Definition _get_Satp32_bits (v : Satp32) : mword 32 :=
   subrange_vec_dec v.(Satp32_Satp32_chunk_0) 31 0.

Definition _set_Satp32_bits (r_ref : register_ref regstate register_value Satp32) (v : mword 32)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Satp32_Satp32_chunk_0 :=
         (update_subrange_vec_dec r.(Satp32_Satp32_chunk_0) 31 0 (subrange_vec_dec v 31 0)) ]}
      : Satp32 in
   write_reg r_ref r
    : M (unit).

Definition _update_Satp32_bits (v : Satp32) (x : mword 32) : Satp32 :=
   {[ v with
     Satp32_Satp32_chunk_0 :=
       (update_subrange_vec_dec v.(Satp32_Satp32_chunk_0) 31 0 (subrange_vec_dec x 31 0)) ]}.

Definition _get_Satp32_Mode (v : Satp32) : mword 1 :=
   subrange_vec_dec v.(Satp32_Satp32_chunk_0) 31 31.

Definition _set_Satp32_Mode (r_ref : register_ref regstate register_value Satp32) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Satp32_Satp32_chunk_0 :=
         (update_subrange_vec_dec r.(Satp32_Satp32_chunk_0) 31 31 (subrange_vec_dec v 0 0)) ]}
      : Satp32 in
   write_reg r_ref r
    : M (unit).

Definition _update_Satp32_Mode (v : Satp32) (x : mword 1) : Satp32 :=
   {[ v with
     Satp32_Satp32_chunk_0 :=
       (update_subrange_vec_dec v.(Satp32_Satp32_chunk_0) 31 31 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Satp32_Asid (v : Satp32) : mword 9 :=
   subrange_vec_dec v.(Satp32_Satp32_chunk_0) 30 22.

Definition _set_Satp32_Asid (r_ref : register_ref regstate register_value Satp32) (v : mword 9)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Satp32_Satp32_chunk_0 :=
         (update_subrange_vec_dec r.(Satp32_Satp32_chunk_0) 30 22 (subrange_vec_dec v 8 0)) ]}
      : Satp32 in
   write_reg r_ref r
    : M (unit).

Definition _update_Satp32_Asid (v : Satp32) (x : mword 9) : Satp32 :=
   {[ v with
     Satp32_Satp32_chunk_0 :=
       (update_subrange_vec_dec v.(Satp32_Satp32_chunk_0) 30 22 (subrange_vec_dec x 8 0)) ]}.

Definition _get_Satp32_PPN (v : Satp32) : mword 22 :=
   subrange_vec_dec v.(Satp32_Satp32_chunk_0) 21 0.

Definition _set_Satp32_PPN (r_ref : register_ref regstate register_value Satp32) (v : mword 22)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Satp32_Satp32_chunk_0 :=
         (update_subrange_vec_dec r.(Satp32_Satp32_chunk_0) 21 0 (subrange_vec_dec v 21 0)) ]}
      : Satp32 in
   write_reg r_ref r
    : M (unit).

Definition _update_Satp32_PPN (v : Satp32) (x : mword 22) : Satp32 :=
   {[ v with
     Satp32_Satp32_chunk_0 :=
       (update_subrange_vec_dec v.(Satp32_Satp32_chunk_0) 21 0 (subrange_vec_dec x 21 0)) ]}.

Definition legalize_satp32 (a : Architecture) (o : mword 32) (v : mword 32) : mword 32 := v.

Definition PmpAddrMatchType_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 3))}
: PmpAddrMatchType :=
   let l__82 := arg_ in
   if sumbool_of_bool (Z.eqb l__82 0) then OFF
   else if sumbool_of_bool (Z.eqb l__82 1) then TOR
   else if sumbool_of_bool (Z.eqb l__82 2) then NA4
   else NAPOT.

Definition num_of_PmpAddrMatchType (arg_ : PmpAddrMatchType)
: {e : Z & ArithFact ((0 <=? e) && (e <=? 3))} :=
   build_ex (match arg_ with | OFF => 0 | TOR => 1 | NA4 => 2 | NAPOT => 3 end).

Definition pmpAddrMatchType_of_bits (bs : mword 2) : M (PmpAddrMatchType) :=
   let b__0 := bs in
   (if eq_vec b__0 ('b"00"  : mword 2) then returnm OFF
    else if eq_vec b__0 ('b"01"  : mword 2) then returnm TOR
    else if eq_vec b__0 ('b"10"  : mword 2) then returnm NA4
    else if eq_vec b__0 ('b"11"  : mword 2) then returnm NAPOT
    else
      assert_exp' false "Pattern match failure at model/riscv_pmp_regs.sail 7:2 - 12:3" >>= fun _ =>
      exit tt)
    : M (PmpAddrMatchType).

Definition pmpAddrMatchType_to_bits (bs : PmpAddrMatchType) : mword 2 :=
   match bs with
   | OFF => 'b"00"  : mword 2
   | TOR => 'b"01"  : mword 2
   | NA4 => 'b"10"  : mword 2
   | NAPOT => 'b"11"  : mword 2
   end.

Definition Mk_Pmpcfg_ent (v : mword 8) : Pmpcfg_ent :=
   {| Pmpcfg_ent_Pmpcfg_ent_chunk_0 := (subrange_vec_dec v 7 0) |}.

Definition _get_Pmpcfg_ent_bits (v : Pmpcfg_ent) : mword 8 :=
   subrange_vec_dec v.(Pmpcfg_ent_Pmpcfg_ent_chunk_0) 7 0.

Definition _set_Pmpcfg_ent_bits
(r_ref : register_ref regstate register_value Pmpcfg_ent) (v : mword 8)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Pmpcfg_ent_Pmpcfg_ent_chunk_0 :=
         (update_subrange_vec_dec r.(Pmpcfg_ent_Pmpcfg_ent_chunk_0) 7 0 (subrange_vec_dec v 7 0)) ]}
      : Pmpcfg_ent in
   write_reg r_ref r
    : M (unit).

Definition _update_Pmpcfg_ent_bits (v : Pmpcfg_ent) (x : mword 8) : Pmpcfg_ent :=
   {[ v with
     Pmpcfg_ent_Pmpcfg_ent_chunk_0 :=
       (update_subrange_vec_dec v.(Pmpcfg_ent_Pmpcfg_ent_chunk_0) 7 0 (subrange_vec_dec x 7 0)) ]}.

Definition _get_Pmpcfg_ent_L (v : Pmpcfg_ent) : mword 1 :=
   subrange_vec_dec v.(Pmpcfg_ent_Pmpcfg_ent_chunk_0) 7 7.

Definition _set_Pmpcfg_ent_L (r_ref : register_ref regstate register_value Pmpcfg_ent) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Pmpcfg_ent_Pmpcfg_ent_chunk_0 :=
         (update_subrange_vec_dec r.(Pmpcfg_ent_Pmpcfg_ent_chunk_0) 7 7 (subrange_vec_dec v 0 0)) ]}
      : Pmpcfg_ent in
   write_reg r_ref r
    : M (unit).

Definition _update_Pmpcfg_ent_L (v : Pmpcfg_ent) (x : mword 1) : Pmpcfg_ent :=
   {[ v with
     Pmpcfg_ent_Pmpcfg_ent_chunk_0 :=
       (update_subrange_vec_dec v.(Pmpcfg_ent_Pmpcfg_ent_chunk_0) 7 7 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Pmpcfg_ent_A (v : Pmpcfg_ent) : mword 2 :=
   subrange_vec_dec v.(Pmpcfg_ent_Pmpcfg_ent_chunk_0) 4 3.

Definition _set_Pmpcfg_ent_A (r_ref : register_ref regstate register_value Pmpcfg_ent) (v : mword 2)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Pmpcfg_ent_Pmpcfg_ent_chunk_0 :=
         (update_subrange_vec_dec r.(Pmpcfg_ent_Pmpcfg_ent_chunk_0) 4 3 (subrange_vec_dec v 1 0)) ]}
      : Pmpcfg_ent in
   write_reg r_ref r
    : M (unit).

Definition _update_Pmpcfg_ent_A (v : Pmpcfg_ent) (x : mword 2) : Pmpcfg_ent :=
   {[ v with
     Pmpcfg_ent_Pmpcfg_ent_chunk_0 :=
       (update_subrange_vec_dec v.(Pmpcfg_ent_Pmpcfg_ent_chunk_0) 4 3 (subrange_vec_dec x 1 0)) ]}.

Definition _get_Pmpcfg_ent_X (v : Pmpcfg_ent) : mword 1 :=
   subrange_vec_dec v.(Pmpcfg_ent_Pmpcfg_ent_chunk_0) 2 2.

Definition _set_Pmpcfg_ent_X (r_ref : register_ref regstate register_value Pmpcfg_ent) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Pmpcfg_ent_Pmpcfg_ent_chunk_0 :=
         (update_subrange_vec_dec r.(Pmpcfg_ent_Pmpcfg_ent_chunk_0) 2 2 (subrange_vec_dec v 0 0)) ]}
      : Pmpcfg_ent in
   write_reg r_ref r
    : M (unit).

Definition _update_Pmpcfg_ent_X (v : Pmpcfg_ent) (x : mword 1) : Pmpcfg_ent :=
   {[ v with
     Pmpcfg_ent_Pmpcfg_ent_chunk_0 :=
       (update_subrange_vec_dec v.(Pmpcfg_ent_Pmpcfg_ent_chunk_0) 2 2 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Pmpcfg_ent_W (v : Pmpcfg_ent) : mword 1 :=
   subrange_vec_dec v.(Pmpcfg_ent_Pmpcfg_ent_chunk_0) 1 1.

Definition _set_Pmpcfg_ent_W (r_ref : register_ref regstate register_value Pmpcfg_ent) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Pmpcfg_ent_Pmpcfg_ent_chunk_0 :=
         (update_subrange_vec_dec r.(Pmpcfg_ent_Pmpcfg_ent_chunk_0) 1 1 (subrange_vec_dec v 0 0)) ]}
      : Pmpcfg_ent in
   write_reg r_ref r
    : M (unit).

Definition _update_Pmpcfg_ent_W (v : Pmpcfg_ent) (x : mword 1) : Pmpcfg_ent :=
   {[ v with
     Pmpcfg_ent_Pmpcfg_ent_chunk_0 :=
       (update_subrange_vec_dec v.(Pmpcfg_ent_Pmpcfg_ent_chunk_0) 1 1 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Pmpcfg_ent_R (v : Pmpcfg_ent) : mword 1 :=
   subrange_vec_dec v.(Pmpcfg_ent_Pmpcfg_ent_chunk_0) 0 0.

Definition _set_Pmpcfg_ent_R (r_ref : register_ref regstate register_value Pmpcfg_ent) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Pmpcfg_ent_Pmpcfg_ent_chunk_0 :=
         (update_subrange_vec_dec r.(Pmpcfg_ent_Pmpcfg_ent_chunk_0) 0 0 (subrange_vec_dec v 0 0)) ]}
      : Pmpcfg_ent in
   write_reg r_ref r
    : M (unit).

Definition _update_Pmpcfg_ent_R (v : Pmpcfg_ent) (x : mword 1) : Pmpcfg_ent :=
   {[ v with
     Pmpcfg_ent_Pmpcfg_ent_chunk_0 :=
       (update_subrange_vec_dec v.(Pmpcfg_ent_Pmpcfg_ent_chunk_0) 0 0 (subrange_vec_dec x 0 0)) ]}.

Definition pmpReadCfgReg (n : Z) `{ArithFact ((0 <=? n) && (n <? 4))} : M (mword 64) :=
   let l__80 := n in
   (if sumbool_of_bool (Z.eqb l__80 0) then
      read_reg pmp7cfg_ref >>= fun w__0 : Pmpcfg_ent =>
      read_reg pmp6cfg_ref >>= fun w__1 : Pmpcfg_ent =>
      read_reg pmp5cfg_ref >>= fun w__2 : Pmpcfg_ent =>
      read_reg pmp4cfg_ref >>= fun w__3 : Pmpcfg_ent =>
      read_reg pmp3cfg_ref >>= fun w__4 : Pmpcfg_ent =>
      read_reg pmp2cfg_ref >>= fun w__5 : Pmpcfg_ent =>
      read_reg pmp1cfg_ref >>= fun w__6 : Pmpcfg_ent =>
      read_reg pmp0cfg_ref >>= fun w__7 : Pmpcfg_ent =>
      returnm (concat_vec (_get_Pmpcfg_ent_bits w__0)
                 (concat_vec (_get_Pmpcfg_ent_bits w__1)
                    (concat_vec (_get_Pmpcfg_ent_bits w__2)
                       (concat_vec (_get_Pmpcfg_ent_bits w__3)
                          (concat_vec (_get_Pmpcfg_ent_bits w__4)
                             (concat_vec (_get_Pmpcfg_ent_bits w__5)
                                (concat_vec (_get_Pmpcfg_ent_bits w__6) (_get_Pmpcfg_ent_bits w__7))))))))
    else if sumbool_of_bool (Z.eqb l__80 2) then
      read_reg pmp15cfg_ref >>= fun w__8 : Pmpcfg_ent =>
      read_reg pmp14cfg_ref >>= fun w__9 : Pmpcfg_ent =>
      read_reg pmp13cfg_ref >>= fun w__10 : Pmpcfg_ent =>
      read_reg pmp12cfg_ref >>= fun w__11 : Pmpcfg_ent =>
      read_reg pmp11cfg_ref >>= fun w__12 : Pmpcfg_ent =>
      read_reg pmp10cfg_ref >>= fun w__13 : Pmpcfg_ent =>
      read_reg pmp9cfg_ref >>= fun w__14 : Pmpcfg_ent =>
      read_reg pmp8cfg_ref >>= fun w__15 : Pmpcfg_ent =>
      returnm (concat_vec (_get_Pmpcfg_ent_bits w__8)
                 (concat_vec (_get_Pmpcfg_ent_bits w__9)
                    (concat_vec (_get_Pmpcfg_ent_bits w__10)
                       (concat_vec (_get_Pmpcfg_ent_bits w__11)
                          (concat_vec (_get_Pmpcfg_ent_bits w__12)
                             (concat_vec (_get_Pmpcfg_ent_bits w__13)
                                (concat_vec (_get_Pmpcfg_ent_bits w__14)
                                   (_get_Pmpcfg_ent_bits w__15))))))))
    else
      assert_exp' false "Pattern match failure at model/riscv_pmp_regs.sail 75:2 - 85:8" >>= fun _ =>
      exit tt)
    : M (mword 64).

Definition pmpLocked (cfg : Pmpcfg_ent) : bool := eq_vec (_get_Pmpcfg_ent_L cfg) ('b"1"  : mword 1).

Definition pmpTORLocked (cfg : Pmpcfg_ent) : M (bool) :=
   (and_boolM (returnm ((eq_vec (_get_Pmpcfg_ent_L cfg) ('b"1"  : mword 1))  : bool))
      ((pmpAddrMatchType_of_bits (_get_Pmpcfg_ent_A cfg)) >>= fun w__0 : PmpAddrMatchType =>
       returnm ((generic_eq w__0 TOR)  : bool)))
    : M (bool).

Definition pmpWriteCfg (cfg : Pmpcfg_ent) (v : mword 8) : Pmpcfg_ent :=
   if pmpLocked cfg then cfg else Mk_Pmpcfg_ent (and_vec v (Ox"9F"  : mword 8)).

Definition pmpWriteCfgReg (n : Z) (v : mword 64) `{ArithFact ((0 <=? n) && (n <? 4))} : M (unit) :=
   let l__78 := n in
   (if sumbool_of_bool (Z.eqb l__78 0) then
      read_reg pmp0cfg_ref >>= fun w__0 : Pmpcfg_ent =>
      write_reg pmp0cfg_ref (pmpWriteCfg w__0 (subrange_vec_dec v 7 0)) >>
      read_reg pmp1cfg_ref >>= fun w__1 : Pmpcfg_ent =>
      write_reg pmp1cfg_ref (pmpWriteCfg w__1 (subrange_vec_dec v 15 8)) >>
      read_reg pmp2cfg_ref >>= fun w__2 : Pmpcfg_ent =>
      write_reg pmp2cfg_ref (pmpWriteCfg w__2 (subrange_vec_dec v 23 16)) >>
      read_reg pmp3cfg_ref >>= fun w__3 : Pmpcfg_ent =>
      write_reg pmp3cfg_ref (pmpWriteCfg w__3 (subrange_vec_dec v 31 24)) >>
      read_reg pmp4cfg_ref >>= fun w__4 : Pmpcfg_ent =>
      write_reg pmp4cfg_ref (pmpWriteCfg w__4 (subrange_vec_dec v 39 32)) >>
      read_reg pmp5cfg_ref >>= fun w__5 : Pmpcfg_ent =>
      write_reg pmp5cfg_ref (pmpWriteCfg w__5 (subrange_vec_dec v 47 40)) >>
      read_reg pmp6cfg_ref >>= fun w__6 : Pmpcfg_ent =>
      write_reg pmp6cfg_ref (pmpWriteCfg w__6 (subrange_vec_dec v 55 48)) >>
      read_reg pmp7cfg_ref >>= fun w__7 : Pmpcfg_ent =>
      write_reg pmp7cfg_ref (pmpWriteCfg w__7 (subrange_vec_dec v 63 56))
       : M (unit)
    else if sumbool_of_bool (Z.eqb l__78 2) then
      read_reg pmp8cfg_ref >>= fun w__8 : Pmpcfg_ent =>
      write_reg pmp8cfg_ref (pmpWriteCfg w__8 (subrange_vec_dec v 7 0)) >>
      read_reg pmp9cfg_ref >>= fun w__9 : Pmpcfg_ent =>
      write_reg pmp9cfg_ref (pmpWriteCfg w__9 (subrange_vec_dec v 15 8)) >>
      read_reg pmp10cfg_ref >>= fun w__10 : Pmpcfg_ent =>
      write_reg pmp10cfg_ref (pmpWriteCfg w__10 (subrange_vec_dec v 23 16)) >>
      read_reg pmp11cfg_ref >>= fun w__11 : Pmpcfg_ent =>
      write_reg pmp11cfg_ref (pmpWriteCfg w__11 (subrange_vec_dec v 31 24)) >>
      read_reg pmp12cfg_ref >>= fun w__12 : Pmpcfg_ent =>
      write_reg pmp12cfg_ref (pmpWriteCfg w__12 (subrange_vec_dec v 39 32)) >>
      read_reg pmp13cfg_ref >>= fun w__13 : Pmpcfg_ent =>
      write_reg pmp13cfg_ref (pmpWriteCfg w__13 (subrange_vec_dec v 47 40)) >>
      read_reg pmp14cfg_ref >>= fun w__14 : Pmpcfg_ent =>
      write_reg pmp14cfg_ref (pmpWriteCfg w__14 (subrange_vec_dec v 55 48)) >>
      read_reg pmp15cfg_ref >>= fun w__15 : Pmpcfg_ent =>
      write_reg pmp15cfg_ref (pmpWriteCfg w__15 (subrange_vec_dec v 63 56))
       : M (unit)
    else
      assert_exp' false "Pattern match failure at model/riscv_pmp_regs.sail 101:2 - 144:8" >>= fun _ =>
      exit tt)
    : M (unit).

Definition pmpWriteAddr (locked : bool) (tor_locked : bool) (reg : mword 64) (v : mword 64)
: mword 64 :=
   if sumbool_of_bool (orb locked tor_locked) then reg else EXTZ 64 (subrange_vec_dec v 53 0).

Definition pmpAddrRange (cfg : Pmpcfg_ent) (pmpaddr : mword 64) (prev_pmpaddr : mword 64)
: M (option ((mword 64 * mword 64))) :=
   (pmpAddrMatchType_of_bits (_get_Pmpcfg_ent_A cfg)) >>= fun w__0 : PmpAddrMatchType =>
   returnm (match w__0 with
            | OFF => None
            | TOR => Some (shiftl prev_pmpaddr 2, shiftl pmpaddr 2)
            | NA4 =>
               let lo := shiftl pmpaddr 2 in
               Some (lo, add_vec_int lo 4)
            | NAPOT =>
               let mask := xor_vec pmpaddr (add_vec_int pmpaddr 1) in
               let lo := and_vec pmpaddr (not_vec mask) in
               let len := add_vec_int mask 1 in
               Some (shiftl lo 2, shiftl (add_vec lo len) 2)
            end).

Definition pmpCheckRWX (ent : Pmpcfg_ent) (acc : AccessType unit) : bool :=
   match acc with
   | Read _ => eq_vec (_get_Pmpcfg_ent_R ent) ('b"1"  : mword 1)
   | Write _ => eq_vec (_get_Pmpcfg_ent_W ent) ('b"1"  : mword 1)
   | ReadWrite _ =>
      andb (eq_vec (_get_Pmpcfg_ent_R ent) ('b"1"  : mword 1))
        (eq_vec (_get_Pmpcfg_ent_W ent) ('b"1"  : mword 1))
   | Execute tt => eq_vec (_get_Pmpcfg_ent_X ent) ('b"1"  : mword 1)
   end.

Definition pmpCheckPerms (ent : Pmpcfg_ent) (acc : AccessType unit) (priv : Privilege) : bool :=
   match priv with
   | Machine => if pmpLocked ent then pmpCheckRWX ent acc else true
   | _ => pmpCheckRWX ent acc
   end.

Definition pmpAddrMatch_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 2))} : pmpAddrMatch :=
   let l__76 := arg_ in
   if sumbool_of_bool (Z.eqb l__76 0) then PMP_NoMatch
   else if sumbool_of_bool (Z.eqb l__76 1) then PMP_PartialMatch
   else PMP_Match.

Definition num_of_pmpAddrMatch (arg_ : pmpAddrMatch) : {e : Z & ArithFact ((0 <=? e) && (e <=? 2))} :=
   build_ex (match arg_ with | PMP_NoMatch => 0 | PMP_PartialMatch => 1 | PMP_Match => 2 end).

Definition pmpMatchAddr (addr : mword 64) (width : mword 64) (rng : option ((mword 64 * mword 64)))
: pmpAddrMatch :=
   match rng with
   | None => PMP_NoMatch
   | Some (lo, hi) =>
      if zopz0zI_u hi lo then PMP_NoMatch
      else if orb (zopz0zIzJ_u (add_vec addr width) lo) (zopz0zIzJ_u hi addr) then PMP_NoMatch
      else if andb (zopz0zIzJ_u lo addr) (zopz0zIzJ_u (add_vec addr width) hi) then PMP_Match
      else PMP_PartialMatch
   end.

Definition pmpMatch_of_num (arg_ : Z) `{ArithFact ((0 <=? arg_) && (arg_ <=? 2))} : pmpMatch :=
   let l__74 := arg_ in
   if sumbool_of_bool (Z.eqb l__74 0) then PMP_Success
   else if sumbool_of_bool (Z.eqb l__74 1) then PMP_Continue
   else PMP_Fail.

Definition num_of_pmpMatch (arg_ : pmpMatch) : {e : Z & ArithFact ((0 <=? e) && (e <=? 2))} :=
   build_ex (match arg_ with | PMP_Success => 0 | PMP_Continue => 1 | PMP_Fail => 2 end).

Definition pmpMatchEntry
(addr : mword 64) (width : mword 64) (acc : AccessType unit) (priv : Privilege) (ent : Pmpcfg_ent)
(pmpaddr : mword 64) (prev_pmpaddr : mword 64)
: M (pmpMatch) :=
   (pmpAddrRange ent pmpaddr prev_pmpaddr) >>= fun rng =>
   returnm (match (pmpMatchAddr addr width rng) with
            | PMP_NoMatch => PMP_Continue
            | PMP_PartialMatch => PMP_Fail
            | PMP_Match => if pmpCheckPerms ent acc priv then PMP_Success else PMP_Fail
            end).

Definition pmpCheck (addr : mword 64) (width : Z) (acc : AccessType unit) (priv : Privilege)
`{ArithFact (width >? 0)}
: M (option ExceptionType) :=
   let width : xlenbits := to_bits 64 width in
   read_reg pmp0cfg_ref >>= fun w__0 : Pmpcfg_ent =>
   ((read_reg pmpaddr0_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   (pmpMatchEntry addr width acc priv w__0 w__1 (zeros_implicit 64)) >>= fun w__2 : pmpMatch =>
   (match w__2 with
    | PMP_Success => returnm true
    | PMP_Fail => returnm false
    | PMP_Continue =>
       read_reg pmp1cfg_ref >>= fun w__3 : Pmpcfg_ent =>
       ((read_reg pmpaddr1_ref)  : M (mword 64)) >>= fun w__4 : mword 64 =>
       ((read_reg pmpaddr0_ref)  : M (mword 64)) >>= fun w__5 : mword 64 =>
       (pmpMatchEntry addr width acc priv w__3 w__4 w__5) >>= fun w__6 : pmpMatch =>
       (match w__6 with
        | PMP_Success => returnm true
        | PMP_Fail => returnm false
        | PMP_Continue =>
           read_reg pmp2cfg_ref >>= fun w__7 : Pmpcfg_ent =>
           ((read_reg pmpaddr2_ref)  : M (mword 64)) >>= fun w__8 : mword 64 =>
           ((read_reg pmpaddr1_ref)  : M (mword 64)) >>= fun w__9 : mword 64 =>
           (pmpMatchEntry addr width acc priv w__7 w__8 w__9) >>= fun w__10 : pmpMatch =>
           (match w__10 with
            | PMP_Success => returnm true
            | PMP_Fail => returnm false
            | PMP_Continue =>
               read_reg pmp3cfg_ref >>= fun w__11 : Pmpcfg_ent =>
               ((read_reg pmpaddr3_ref)  : M (mword 64)) >>= fun w__12 : mword 64 =>
               ((read_reg pmpaddr2_ref)  : M (mword 64)) >>= fun w__13 : mword 64 =>
               (pmpMatchEntry addr width acc priv w__11 w__12 w__13) >>= fun w__14 : pmpMatch =>
               (match w__14 with
                | PMP_Success => returnm true
                | PMP_Fail => returnm false
                | PMP_Continue =>
                   read_reg pmp4cfg_ref >>= fun w__15 : Pmpcfg_ent =>
                   ((read_reg pmpaddr4_ref)  : M (mword 64)) >>= fun w__16 : mword 64 =>
                   ((read_reg pmpaddr3_ref)  : M (mword 64)) >>= fun w__17 : mword 64 =>
                   (pmpMatchEntry addr width acc priv w__15 w__16 w__17) >>= fun w__18 : pmpMatch =>
                   (match w__18 with
                    | PMP_Success => returnm true
                    | PMP_Fail => returnm false
                    | PMP_Continue =>
                       read_reg pmp5cfg_ref >>= fun w__19 : Pmpcfg_ent =>
                       ((read_reg pmpaddr5_ref)  : M (mword 64)) >>= fun w__20 : mword 64 =>
                       ((read_reg pmpaddr4_ref)  : M (mword 64)) >>= fun w__21 : mword 64 =>
                       (pmpMatchEntry addr width acc priv w__19 w__20 w__21) >>= fun w__22 : pmpMatch =>
                       (match w__22 with
                        | PMP_Success => returnm true
                        | PMP_Fail => returnm false
                        | PMP_Continue =>
                           read_reg pmp6cfg_ref >>= fun w__23 : Pmpcfg_ent =>
                           ((read_reg pmpaddr6_ref)  : M (mword 64)) >>= fun w__24 : mword 64 =>
                           ((read_reg pmpaddr5_ref)  : M (mword 64)) >>= fun w__25 : mword 64 =>
                           (pmpMatchEntry addr width acc priv w__23 w__24 w__25) >>= fun w__26 : pmpMatch =>
                           (match w__26 with
                            | PMP_Success => returnm true
                            | PMP_Fail => returnm false
                            | PMP_Continue =>
                               read_reg pmp7cfg_ref >>= fun w__27 : Pmpcfg_ent =>
                               ((read_reg pmpaddr7_ref)  : M (mword 64)) >>= fun w__28 : mword 64 =>
                               ((read_reg pmpaddr6_ref)  : M (mword 64)) >>= fun w__29 : mword 64 =>
                               (pmpMatchEntry addr width acc priv w__27 w__28 w__29) >>= fun w__30 : pmpMatch =>
                               (match w__30 with
                                | PMP_Success => returnm true
                                | PMP_Fail => returnm false
                                | PMP_Continue =>
                                   read_reg pmp8cfg_ref >>= fun w__31 : Pmpcfg_ent =>
                                   ((read_reg pmpaddr8_ref)  : M (mword 64)) >>= fun w__32 : mword 64 =>
                                   ((read_reg pmpaddr7_ref)  : M (mword 64)) >>= fun w__33 : mword 64 =>
                                   (pmpMatchEntry addr width acc priv w__31 w__32 w__33) >>= fun w__34 : pmpMatch =>
                                   (match w__34 with
                                    | PMP_Success => returnm true
                                    | PMP_Fail => returnm false
                                    | PMP_Continue =>
                                       read_reg pmp9cfg_ref >>= fun w__35 : Pmpcfg_ent =>
                                       ((read_reg pmpaddr9_ref)  : M (mword 64)) >>= fun w__36 : mword 64 =>
                                       ((read_reg pmpaddr8_ref)  : M (mword 64)) >>= fun w__37 : mword 64 =>
                                       (pmpMatchEntry addr width acc priv w__35 w__36 w__37) >>= fun w__38 : pmpMatch =>
                                       (match w__38 with
                                        | PMP_Success => returnm true
                                        | PMP_Fail => returnm false
                                        | PMP_Continue =>
                                           read_reg pmp10cfg_ref >>= fun w__39 : Pmpcfg_ent =>
                                           ((read_reg pmpaddr10_ref)  : M (mword 64)) >>= fun w__40 : mword 64 =>
                                           ((read_reg pmpaddr9_ref)  : M (mword 64)) >>= fun w__41 : mword 64 =>
                                           (pmpMatchEntry addr width acc priv w__39 w__40 w__41) >>= fun w__42 : pmpMatch =>
                                           (match w__42 with
                                            | PMP_Success => returnm true
                                            | PMP_Fail => returnm false
                                            | PMP_Continue =>
                                               read_reg pmp11cfg_ref >>= fun w__43 : Pmpcfg_ent =>
                                               ((read_reg pmpaddr11_ref)  : M (mword 64)) >>= fun w__44 : mword 64 =>
                                               ((read_reg pmpaddr10_ref)  : M (mword 64)) >>= fun w__45 : mword 64 =>
                                               (pmpMatchEntry addr width acc priv w__43 w__44 w__45) >>= fun w__46 : pmpMatch =>
                                               (match w__46 with
                                                | PMP_Success => returnm true
                                                | PMP_Fail => returnm false
                                                | PMP_Continue =>
                                                   read_reg pmp12cfg_ref >>= fun w__47 : Pmpcfg_ent =>
                                                   ((read_reg pmpaddr12_ref)  : M (mword 64)) >>= fun w__48 : mword 64 =>
                                                   ((read_reg pmpaddr11_ref)  : M (mword 64)) >>= fun w__49 : mword 64 =>
                                                   (pmpMatchEntry addr width acc priv w__47 w__48
                                                      w__49) >>= fun w__50 : pmpMatch =>
                                                   (match w__50 with
                                                    | PMP_Success => returnm true
                                                    | PMP_Fail => returnm false
                                                    | PMP_Continue =>
                                                       read_reg pmp13cfg_ref >>= fun w__51 : Pmpcfg_ent =>
                                                       ((read_reg pmpaddr13_ref)  : M (mword 64)) >>= fun w__52 : mword 64 =>
                                                       ((read_reg pmpaddr12_ref)  : M (mword 64)) >>= fun w__53 : mword 64 =>
                                                       (pmpMatchEntry addr width acc priv w__51
                                                          w__52 w__53) >>= fun w__54 : pmpMatch =>
                                                       (match w__54 with
                                                        | PMP_Success => returnm true
                                                        | PMP_Fail => returnm false
                                                        | PMP_Continue =>
                                                           read_reg pmp14cfg_ref >>= fun w__55 : Pmpcfg_ent =>
                                                           ((read_reg pmpaddr14_ref)  : M (mword 64)) >>= fun w__56 : mword 64 =>
                                                           ((read_reg pmpaddr13_ref)  : M (mword 64)) >>= fun w__57 : mword 64 =>
                                                           (pmpMatchEntry addr width acc priv w__55
                                                              w__56 w__57) >>= fun w__58 : pmpMatch =>
                                                           (match w__58 with
                                                            | PMP_Success => returnm true
                                                            | PMP_Fail => returnm false
                                                            | PMP_Continue =>
                                                               read_reg pmp15cfg_ref >>= fun w__59 : Pmpcfg_ent =>
                                                               ((read_reg pmpaddr15_ref)
                                                                 : M (mword 64)) >>= fun w__60 : mword 64 =>
                                                               ((read_reg pmpaddr14_ref)
                                                                 : M (mword 64)) >>= fun w__61 : mword 64 =>
                                                               (pmpMatchEntry addr width acc priv
                                                                  w__59 w__60 w__61) >>= fun w__62 : pmpMatch =>
                                                               returnm (match w__62 with
                                                                        | PMP_Success => true
                                                                        | PMP_Fail => false
                                                                        | PMP_Continue =>
                                                                           match priv with
                                                                           | Machine => true
                                                                           | _ => false
                                                                           end
                                                                        end)
                                                            end)
                                                            : M (bool)
                                                        end)
                                                        : M (bool)
                                                    end)
                                                    : M (bool)
                                                end)
                                                : M (bool)
                                            end)
                                            : M (bool)
                                        end)
                                        : M (bool)
                                    end)
                                    : M (bool)
                                end)
                                : M (bool)
                            end)
                            : M (bool)
                        end)
                        : M (bool)
                    end)
                    : M (bool)
                end)
                : M (bool)
            end)
            : M (bool)
        end)
        : M (bool)
    end) >>= fun check' : bool =>
   returnm (if sumbool_of_bool check' then None
            else
              match acc with
              | Read _ => Some (E_Load_Access_Fault tt)
              | Write _ => Some (E_SAMO_Access_Fault tt)
              | ReadWrite _ => Some (E_SAMO_Access_Fault tt)
              | Execute tt => Some (E_Fetch_Access_Fault tt)
              end).

Definition init_pmp '(tt : unit) : M (unit) :=
   read_reg pmp0cfg_ref >>= fun w__0 : Pmpcfg_ent =>
   write_reg pmp0cfg_ref (_update_Pmpcfg_ent_A w__0 (pmpAddrMatchType_to_bits OFF)) >>
   read_reg pmp1cfg_ref >>= fun w__1 : Pmpcfg_ent =>
   write_reg pmp1cfg_ref (_update_Pmpcfg_ent_A w__1 (pmpAddrMatchType_to_bits OFF)) >>
   read_reg pmp2cfg_ref >>= fun w__2 : Pmpcfg_ent =>
   write_reg pmp2cfg_ref (_update_Pmpcfg_ent_A w__2 (pmpAddrMatchType_to_bits OFF)) >>
   read_reg pmp3cfg_ref >>= fun w__3 : Pmpcfg_ent =>
   write_reg pmp3cfg_ref (_update_Pmpcfg_ent_A w__3 (pmpAddrMatchType_to_bits OFF)) >>
   read_reg pmp4cfg_ref >>= fun w__4 : Pmpcfg_ent =>
   write_reg pmp4cfg_ref (_update_Pmpcfg_ent_A w__4 (pmpAddrMatchType_to_bits OFF)) >>
   read_reg pmp5cfg_ref >>= fun w__5 : Pmpcfg_ent =>
   write_reg pmp5cfg_ref (_update_Pmpcfg_ent_A w__5 (pmpAddrMatchType_to_bits OFF)) >>
   read_reg pmp6cfg_ref >>= fun w__6 : Pmpcfg_ent =>
   write_reg pmp6cfg_ref (_update_Pmpcfg_ent_A w__6 (pmpAddrMatchType_to_bits OFF)) >>
   read_reg pmp7cfg_ref >>= fun w__7 : Pmpcfg_ent =>
   write_reg pmp7cfg_ref (_update_Pmpcfg_ent_A w__7 (pmpAddrMatchType_to_bits OFF)) >>
   read_reg pmp8cfg_ref >>= fun w__8 : Pmpcfg_ent =>
   write_reg pmp8cfg_ref (_update_Pmpcfg_ent_A w__8 (pmpAddrMatchType_to_bits OFF)) >>
   read_reg pmp9cfg_ref >>= fun w__9 : Pmpcfg_ent =>
   write_reg pmp9cfg_ref (_update_Pmpcfg_ent_A w__9 (pmpAddrMatchType_to_bits OFF)) >>
   read_reg pmp10cfg_ref >>= fun w__10 : Pmpcfg_ent =>
   write_reg pmp10cfg_ref (_update_Pmpcfg_ent_A w__10 (pmpAddrMatchType_to_bits OFF)) >>
   read_reg pmp11cfg_ref >>= fun w__11 : Pmpcfg_ent =>
   write_reg pmp11cfg_ref (_update_Pmpcfg_ent_A w__11 (pmpAddrMatchType_to_bits OFF)) >>
   read_reg pmp12cfg_ref >>= fun w__12 : Pmpcfg_ent =>
   write_reg pmp12cfg_ref (_update_Pmpcfg_ent_A w__12 (pmpAddrMatchType_to_bits OFF)) >>
   read_reg pmp13cfg_ref >>= fun w__13 : Pmpcfg_ent =>
   write_reg pmp13cfg_ref (_update_Pmpcfg_ent_A w__13 (pmpAddrMatchType_to_bits OFF)) >>
   read_reg pmp14cfg_ref >>= fun w__14 : Pmpcfg_ent =>
   write_reg pmp14cfg_ref (_update_Pmpcfg_ent_A w__14 (pmpAddrMatchType_to_bits OFF)) >>
   read_reg pmp15cfg_ref >>= fun w__15 : Pmpcfg_ent =>
   write_reg pmp15cfg_ref (_update_Pmpcfg_ent_A w__15 (pmpAddrMatchType_to_bits OFF))
    : M (unit).

Definition ext_init_regs '(tt : unit) : M (unit) := returnm tt.

Definition ext_rvfi_init '(tt : unit) : M (unit) :=
   ((read_reg x1_ref)  : M (mword 64)) >>= fun w__0 : mword 64 => write_reg x1_ref w__0  : M (unit).

Definition ext_check_CSR (csrno : mword 12) (p : Privilege) (isWrite : bool) : bool := true.

Definition ext_check_CSR_fail '(tt : unit) : unit := tt.

Definition ext_fetch_check_pc (start_pc : mword 64) (pc : mword 64) : Ext_FetchAddr_Check unit :=
   Ext_FetchAddr_OK pc.

Definition ext_handle_fetch_check_error (err : unit) : unit := tt.

Definition ext_control_check_addr (pc : mword 64) : Ext_ControlAddr_Check unit :=
   Ext_ControlAddr_OK pc.

Definition ext_control_check_pc (pc : mword 64) : Ext_ControlAddr_Check unit :=
   Ext_ControlAddr_OK pc.

Definition ext_handle_control_check_error (err : unit) : unit := tt.

Definition ext_data_get_addr
(base : mword 5) (offset : mword 64) (acc : AccessType unit) (width : word_width)
: M (Ext_DataAddr_Check unit) :=
   (rX_bits base) >>= fun w__0 : mword 64 =>
   let addr := add_vec w__0 offset in
   returnm (Ext_DataAddr_OK addr).

Definition ext_handle_data_check_error (err : unit) : unit := tt.

Definition ext_check_phys_mem_read
(access_type : AccessType unit) (paddr : mword 64) (size : Z) (aquire : bool) (release : bool)
(reserved : bool) (read_meta : bool) `{ArithFact ((0 <? size) && (size <=? 16))}
: Ext_PhysAddr_Check :=
   Ext_PhysAddr_OK tt.

Definition ext_check_phys_mem_write
(write_kind : write_kind) (paddr : mword 64) (size : Z) (data : mword (8 * size)) (metadata : unit)
`{ArithFact ((0 <? size) && (size <=? 16))}
: Ext_PhysAddr_Check :=
   Ext_PhysAddr_OK tt.

Definition Mk_Ustatus (v : mword 64) : Ustatus :=
   {| Ustatus_Ustatus_chunk_0 := (subrange_vec_dec v 63 0) |}.

Definition _get_Ustatus_bits (v : Ustatus) : mword 64 :=
   subrange_vec_dec v.(Ustatus_Ustatus_chunk_0) 63 0.

Definition _set_Ustatus_bits (r_ref : register_ref regstate register_value Ustatus) (v : mword 64)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Ustatus_Ustatus_chunk_0 :=
         (update_subrange_vec_dec r.(Ustatus_Ustatus_chunk_0) 63 0 (subrange_vec_dec v 63 0)) ]}
      : Ustatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Ustatus_bits (v : Ustatus) (x : mword 64) : Ustatus :=
   {[ v with
     Ustatus_Ustatus_chunk_0 :=
       (update_subrange_vec_dec v.(Ustatus_Ustatus_chunk_0) 63 0 (subrange_vec_dec x 63 0)) ]}.

Definition _get_Ustatus_UPIE (v : Ustatus) : mword 1 :=
   subrange_vec_dec v.(Ustatus_Ustatus_chunk_0) 4 4.

Definition _set_Ustatus_UPIE (r_ref : register_ref regstate register_value Ustatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Ustatus_Ustatus_chunk_0 :=
         (update_subrange_vec_dec r.(Ustatus_Ustatus_chunk_0) 4 4 (subrange_vec_dec v 0 0)) ]}
      : Ustatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Ustatus_UPIE (v : Ustatus) (x : mword 1) : Ustatus :=
   {[ v with
     Ustatus_Ustatus_chunk_0 :=
       (update_subrange_vec_dec v.(Ustatus_Ustatus_chunk_0) 4 4 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Ustatus_UIE (v : Ustatus) : mword 1 :=
   subrange_vec_dec v.(Ustatus_Ustatus_chunk_0) 0 0.

Definition _set_Ustatus_UIE (r_ref : register_ref regstate register_value Ustatus) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Ustatus_Ustatus_chunk_0 :=
         (update_subrange_vec_dec r.(Ustatus_Ustatus_chunk_0) 0 0 (subrange_vec_dec v 0 0)) ]}
      : Ustatus in
   write_reg r_ref r
    : M (unit).

Definition _update_Ustatus_UIE (v : Ustatus) (x : mword 1) : Ustatus :=
   {[ v with
     Ustatus_Ustatus_chunk_0 :=
       (update_subrange_vec_dec v.(Ustatus_Ustatus_chunk_0) 0 0 (subrange_vec_dec x 0 0)) ]}.

Definition lower_sstatus (s : Sstatus) : Ustatus :=
   let u := Mk_Ustatus (EXTZ 64 ('b"0"  : mword 1)) in
   let u := _update_Ustatus_UPIE u (_get_Sstatus_UPIE s) in
   _update_Ustatus_UIE u (_get_Sstatus_UIE s).

Definition lift_ustatus (s : Sstatus) (u : Ustatus) : Sstatus :=
   let s := _update_Sstatus_UPIE s (_get_Ustatus_UPIE u) in
   _update_Sstatus_UIE s (_get_Ustatus_UIE u).

Definition legalize_ustatus (m : Mstatus) (v : mword 64) : M (Mstatus) :=
   let u := Mk_Ustatus v in
   let s := lower_mstatus m in
   let s := lift_ustatus s u in
   lift_sstatus m s.

Definition Mk_Uinterrupts (v : mword 64) : Uinterrupts :=
   {| Uinterrupts_Uinterrupts_chunk_0 := (subrange_vec_dec v 63 0) |}.

Definition _get_Uinterrupts_bits (v : Uinterrupts) : mword 64 :=
   subrange_vec_dec v.(Uinterrupts_Uinterrupts_chunk_0) 63 0.

Definition _set_Uinterrupts_bits
(r_ref : register_ref regstate register_value Uinterrupts) (v : mword 64)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Uinterrupts_Uinterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Uinterrupts_Uinterrupts_chunk_0) 63 0 (subrange_vec_dec v 63 0)) ]}
      : Uinterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Uinterrupts_bits (v : Uinterrupts) (x : mword 64) : Uinterrupts :=
   {[ v with
     Uinterrupts_Uinterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Uinterrupts_Uinterrupts_chunk_0) 63 0 (subrange_vec_dec x 63 0)) ]}.

Definition _get_Uinterrupts_UEI (v : Uinterrupts) : mword 1 :=
   subrange_vec_dec v.(Uinterrupts_Uinterrupts_chunk_0) 8 8.

Definition _set_Uinterrupts_UEI
(r_ref : register_ref regstate register_value Uinterrupts) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Uinterrupts_Uinterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Uinterrupts_Uinterrupts_chunk_0) 8 8 (subrange_vec_dec v 0 0)) ]}
      : Uinterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Uinterrupts_UEI (v : Uinterrupts) (x : mword 1) : Uinterrupts :=
   {[ v with
     Uinterrupts_Uinterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Uinterrupts_Uinterrupts_chunk_0) 8 8 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Uinterrupts_UTI (v : Uinterrupts) : mword 1 :=
   subrange_vec_dec v.(Uinterrupts_Uinterrupts_chunk_0) 4 4.

Definition _set_Uinterrupts_UTI
(r_ref : register_ref regstate register_value Uinterrupts) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Uinterrupts_Uinterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Uinterrupts_Uinterrupts_chunk_0) 4 4 (subrange_vec_dec v 0 0)) ]}
      : Uinterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Uinterrupts_UTI (v : Uinterrupts) (x : mword 1) : Uinterrupts :=
   {[ v with
     Uinterrupts_Uinterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Uinterrupts_Uinterrupts_chunk_0) 4 4 (subrange_vec_dec x 0 0)) ]}.

Definition _get_Uinterrupts_USI (v : Uinterrupts) : mword 1 :=
   subrange_vec_dec v.(Uinterrupts_Uinterrupts_chunk_0) 0 0.

Definition _set_Uinterrupts_USI
(r_ref : register_ref regstate register_value Uinterrupts) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Uinterrupts_Uinterrupts_chunk_0 :=
         (update_subrange_vec_dec r.(Uinterrupts_Uinterrupts_chunk_0) 0 0 (subrange_vec_dec v 0 0)) ]}
      : Uinterrupts in
   write_reg r_ref r
    : M (unit).

Definition _update_Uinterrupts_USI (v : Uinterrupts) (x : mword 1) : Uinterrupts :=
   {[ v with
     Uinterrupts_Uinterrupts_chunk_0 :=
       (update_subrange_vec_dec v.(Uinterrupts_Uinterrupts_chunk_0) 0 0 (subrange_vec_dec x 0 0)) ]}.

Definition lower_sip (s : Sinterrupts) (d : Sinterrupts) : Uinterrupts :=
   let u : Uinterrupts := Mk_Uinterrupts (EXTZ 64 ('b"0"  : mword 1)) in
   let u := _update_Uinterrupts_UEI u (and_vec (_get_Sinterrupts_UEI s) (_get_Sinterrupts_UEI d)) in
   let u := _update_Uinterrupts_UTI u (and_vec (_get_Sinterrupts_UTI s) (_get_Sinterrupts_UTI d)) in
   _update_Uinterrupts_USI u (and_vec (_get_Sinterrupts_USI s) (_get_Sinterrupts_USI d)).

Definition lower_sie (s : Sinterrupts) (d : Sinterrupts) : Uinterrupts :=
   let u : Uinterrupts := Mk_Uinterrupts (EXTZ 64 ('b"0"  : mword 1)) in
   let u := _update_Uinterrupts_UEI u (and_vec (_get_Sinterrupts_UEI s) (_get_Sinterrupts_UEI d)) in
   let u := _update_Uinterrupts_UTI u (and_vec (_get_Sinterrupts_UTI s) (_get_Sinterrupts_UTI d)) in
   _update_Uinterrupts_USI u (and_vec (_get_Sinterrupts_USI s) (_get_Sinterrupts_USI d)).

Definition lift_uip (o : Sinterrupts) (d : Sinterrupts) (u : Uinterrupts) : Sinterrupts :=
   let s : Sinterrupts := o in
   if eq_vec (_get_Sinterrupts_USI d) ('b"1"  : mword 1) then
     _update_Sinterrupts_USI s (_get_Uinterrupts_USI u)
   else s.

Definition legalize_uip (s : Sinterrupts) (d : Sinterrupts) (v : mword 64) : Sinterrupts :=
   lift_uip s d (Mk_Uinterrupts v).

Definition lift_uie (o : Sinterrupts) (d : Sinterrupts) (u : Uinterrupts) : Sinterrupts :=
   let s : Sinterrupts := o in
   let s :=
     if eq_vec (_get_Sinterrupts_UEI d) ('b"1"  : mword 1) then
       _update_Sinterrupts_UEI s (_get_Uinterrupts_UEI u)
     else s in
   let s :=
     if eq_vec (_get_Sinterrupts_UTI d) ('b"1"  : mword 1) then
       _update_Sinterrupts_UTI s (_get_Uinterrupts_UTI u)
     else s in
   if eq_vec (_get_Sinterrupts_USI d) ('b"1"  : mword 1) then
     _update_Sinterrupts_USI s (_get_Uinterrupts_USI u)
   else s.

Definition legalize_uie (s : Sinterrupts) (d : Sinterrupts) (v : mword 64) : Sinterrupts :=
   lift_uie s d (Mk_Uinterrupts v).

Definition ext_check_xret_priv (p : Privilege) : bool := true.

Definition ext_fail_xret_priv '(tt : unit) : unit := tt.

Definition handle_trap_extension (p : Privilege) (pc : mword 64) (u : option unit) : unit := tt.

Definition prepare_trap_vector (p : Privilege) (cause : Mcause) : M (mword 64) :=
   (match p with
    | Machine => read_reg mtvec_ref  : M (Mtvec)
    | Supervisor => read_reg stvec_ref  : M (Mtvec)
    | User => read_reg utvec_ref  : M (Mtvec)
    end) >>= fun tvec : Mtvec =>
   (match (tvec_addr tvec cause) with
    | Some epc => returnm epc
    | None => (internal_error "Invalid tvec mode")  : M (mword 64)
    end)
    : M (mword 64).

Definition get_xret_target (p : Privilege) : M (mword 64) :=
   (match p with
    | Machine => ((read_reg mepc_ref)  : M (mword 64))  : M (mword 64)
    | Supervisor => ((read_reg sepc_ref)  : M (mword 64))  : M (mword 64)
    | User => ((read_reg uepc_ref)  : M (mword 64))  : M (mword 64)
    end)
    : M (mword 64).

Definition set_xret_target (p : Privilege) (value : mword 64) : M (mword 64) :=
   (legalize_xepc value) >>= fun target =>
   (match p with
    | Machine => write_reg mepc_ref target  : M (unit)
    | Supervisor => write_reg sepc_ref target  : M (unit)
    | User => write_reg uepc_ref target  : M (unit)
    end) >>
   returnm target.

Definition prepare_xret_target (p : Privilege) : M (mword 64) :=
   (get_xret_target p)  : M (mword 64).

Definition get_mtvec '(tt : unit) : M (mword 64) :=
   read_reg mtvec_ref >>= fun w__0 : Mtvec => returnm (_get_Mtvec_bits w__0).

Definition get_stvec '(tt : unit) : M (mword 64) :=
   read_reg stvec_ref >>= fun w__0 : Mtvec => returnm (_get_Mtvec_bits w__0).

Definition get_utvec '(tt : unit) : M (mword 64) :=
   read_reg utvec_ref >>= fun w__0 : Mtvec => returnm (_get_Mtvec_bits w__0).

Definition set_mtvec (value : mword 64) : M (mword 64) :=
   read_reg mtvec_ref >>= fun w__0 : Mtvec =>
   write_reg mtvec_ref (legalize_tvec w__0 value) >>
   read_reg mtvec_ref >>= fun w__1 : Mtvec => returnm (_get_Mtvec_bits w__1).

Definition set_stvec (value : mword 64) : M (mword 64) :=
   read_reg stvec_ref >>= fun w__0 : Mtvec =>
   write_reg stvec_ref (legalize_tvec w__0 value) >>
   read_reg stvec_ref >>= fun w__1 : Mtvec => returnm (_get_Mtvec_bits w__1).

Definition set_utvec (value : mword 64) : M (mword 64) :=
   read_reg utvec_ref >>= fun w__0 : Mtvec =>
   write_reg utvec_ref (legalize_tvec w__0 value) >>
   read_reg utvec_ref >>= fun w__1 : Mtvec => returnm (_get_Mtvec_bits w__1).

Definition update_softfloat_fflags (flags : mword 5) : M (unit) :=
   write_reg float_fflags_ref (zero_extend flags 64)  : M (unit).

Axiom extern_f32Add : forall  (_ : mword 3) (_ : mword 32) (_ : mword 32) , unit.

Definition riscv_f32Add (rm : mword 3) (v1 : mword 32) (v2 : mword 32) : M ((mword 5 * mword 32)) :=
   let '_ := (extern_f32Add rm v1 v2)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, subrange_vec_dec w__1 31 0).

Axiom extern_f32Sub : forall  (_ : mword 3) (_ : mword 32) (_ : mword 32) , unit.

Definition riscv_f32Sub (rm : mword 3) (v1 : mword 32) (v2 : mword 32) : M ((mword 5 * mword 32)) :=
   let '_ := (extern_f32Sub rm v1 v2)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, subrange_vec_dec w__1 31 0).

Axiom extern_f32Mul : forall  (_ : mword 3) (_ : mword 32) (_ : mword 32) , unit.

Definition riscv_f32Mul (rm : mword 3) (v1 : mword 32) (v2 : mword 32) : M ((mword 5 * mword 32)) :=
   let '_ := (extern_f32Mul rm v1 v2)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, subrange_vec_dec w__1 31 0).

Axiom extern_f32Div : forall  (_ : mword 3) (_ : mword 32) (_ : mword 32) , unit.

Definition riscv_f32Div (rm : mword 3) (v1 : mword 32) (v2 : mword 32) : M ((mword 5 * mword 32)) :=
   let '_ := (extern_f32Div rm v1 v2)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, subrange_vec_dec w__1 31 0).

Axiom extern_f64Add : forall  (_ : mword 3) (_ : mword 64) (_ : mword 64) , unit.

Definition riscv_f64Add (rm : mword 3) (v1 : mword 64) (v2 : mword 64) : M ((mword 5 * mword 64)) :=
   let '_ := (extern_f64Add rm v1 v2)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, w__1).

Axiom extern_f64Sub : forall  (_ : mword 3) (_ : mword 64) (_ : mword 64) , unit.

Definition riscv_f64Sub (rm : mword 3) (v1 : mword 64) (v2 : mword 64) : M ((mword 5 * mword 64)) :=
   let '_ := (extern_f64Sub rm v1 v2)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, w__1).

Axiom extern_f64Mul : forall  (_ : mword 3) (_ : mword 64) (_ : mword 64) , unit.

Definition riscv_f64Mul (rm : mword 3) (v1 : mword 64) (v2 : mword 64) : M ((mword 5 * mword 64)) :=
   let '_ := (extern_f64Mul rm v1 v2)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, w__1).

Axiom extern_f64Div : forall  (_ : mword 3) (_ : mword 64) (_ : mword 64) , unit.

Definition riscv_f64Div (rm : mword 3) (v1 : mword 64) (v2 : mword 64) : M ((mword 5 * mword 64)) :=
   let '_ := (extern_f64Div rm v1 v2)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, w__1).

Axiom extern_f32MulAdd : forall  (_ : mword 3) (_ : mword 32) (_ : mword 32) (_ : mword 32) , unit.

Definition riscv_f32MulAdd (rm : mword 3) (v1 : mword 32) (v2 : mword 32) (v3 : mword 32)
: M ((mword 5 * mword 32)) :=
   let '_ := (extern_f32MulAdd rm v1 v2 v3)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, subrange_vec_dec w__1 31 0).

Axiom extern_f64MulAdd : forall  (_ : mword 3) (_ : mword 64) (_ : mword 64) (_ : mword 64) , unit.

Definition riscv_f64MulAdd (rm : mword 3) (v1 : mword 64) (v2 : mword 64) (v3 : mword 64)
: M ((mword 5 * mword 64)) :=
   let '_ := (extern_f64MulAdd rm v1 v2 v3)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, w__1).

Axiom extern_f32Sqrt : forall  (_ : mword 3) (_ : mword 32) , unit.

Definition riscv_f32Sqrt (rm : mword 3) (v : mword 32) : M ((mword 5 * mword 32)) :=
   let '_ := (extern_f32Sqrt rm v)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, subrange_vec_dec w__1 31 0).

Axiom extern_f64Sqrt : forall  (_ : mword 3) (_ : mword 64) , unit.

Definition riscv_f64Sqrt (rm : mword 3) (v : mword 64) : M ((mword 5 * mword 64)) :=
   let '_ := (extern_f64Sqrt rm v)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, w__1).

Axiom extern_f32ToI32 : forall  (_ : mword 3) (_ : mword 32) , unit.

Definition riscv_f32ToI32 (rm : mword 3) (v : mword 32) : M ((mword 5 * mword 32)) :=
   let '_ := (extern_f32ToI32 rm v)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, subrange_vec_dec w__1 31 0).

Axiom extern_f32ToUi32 : forall  (_ : mword 3) (_ : mword 32) , unit.

Definition riscv_f32ToUi32 (rm : mword 3) (v : mword 32) : M ((mword 5 * mword 32)) :=
   let '_ := (extern_f32ToUi32 rm v)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, subrange_vec_dec w__1 31 0).

Axiom extern_i32ToF32 : forall  (_ : mword 3) (_ : mword 32) , unit.

Definition riscv_i32ToF32 (rm : mword 3) (v : mword 32) : M ((mword 5 * mword 32)) :=
   let '_ := (extern_i32ToF32 rm v)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, subrange_vec_dec w__1 31 0).

Axiom extern_ui32ToF32 : forall  (_ : mword 3) (_ : mword 32) , unit.

Definition riscv_ui32ToF32 (rm : mword 3) (v : mword 32) : M ((mword 5 * mword 32)) :=
   let '_ := (extern_ui32ToF32 rm v)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, subrange_vec_dec w__1 31 0).

Axiom extern_f32ToI64 : forall  (_ : mword 3) (_ : mword 32) , unit.

Definition riscv_f32ToI64 (rm : mword 3) (v : mword 32) : M ((mword 5 * mword 64)) :=
   let '_ := (extern_f32ToI64 rm v)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, w__1).

Axiom extern_f32ToUi64 : forall  (_ : mword 3) (_ : mword 32) , unit.

Definition riscv_f32ToUi64 (rm : mword 3) (v : mword 32) : M ((mword 5 * mword 64)) :=
   let '_ := (extern_f32ToUi64 rm v)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, w__1).

Axiom extern_i64ToF32 : forall  (_ : mword 3) (_ : mword 64) , unit.

Definition riscv_i64ToF32 (rm : mword 3) (v : mword 64) : M ((mword 5 * mword 32)) :=
   let '_ := (extern_i64ToF32 rm v)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, subrange_vec_dec w__1 31 0).

Axiom extern_ui64ToF32 : forall  (_ : mword 3) (_ : mword 64) , unit.

Definition riscv_ui64ToF32 (rm : mword 3) (v : mword 64) : M ((mword 5 * mword 32)) :=
   let '_ := (extern_ui64ToF32 rm v)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, subrange_vec_dec w__1 31 0).

Axiom extern_f64ToI32 : forall  (_ : mword 3) (_ : mword 64) , unit.

Definition riscv_f64ToI32 (rm : mword 3) (v : mword 64) : M ((mword 5 * mword 32)) :=
   let '_ := (extern_f64ToI32 rm v)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, subrange_vec_dec w__1 31 0).

Axiom extern_f64ToUi32 : forall  (_ : mword 3) (_ : mword 64) , unit.

Definition riscv_f64ToUi32 (rm : mword 3) (v : mword 64) : M ((mword 5 * mword 32)) :=
   let '_ := (extern_f64ToUi32 rm v)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, subrange_vec_dec w__1 31 0).

Axiom extern_i32ToF64 : forall  (_ : mword 3) (_ : mword 32) , unit.

Definition riscv_i32ToF64 (rm : mword 3) (v : mword 32) : M ((mword 5 * mword 64)) :=
   let '_ := (extern_i32ToF64 rm v)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, w__1).

Axiom extern_ui32ToF64 : forall  (_ : mword 3) (_ : mword 32) , unit.

Definition riscv_ui32ToF64 (rm : mword 3) (v : mword 32) : M ((mword 5 * mword 64)) :=
   let '_ := (extern_ui32ToF64 rm v)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, w__1).

Axiom extern_f64ToI64 : forall  (_ : mword 3) (_ : mword 64) , unit.

Definition riscv_f64ToI64 (rm : mword 3) (v : mword 64) : M ((mword 5 * mword 64)) :=
   let '_ := (extern_f64ToI64 rm v)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, w__1).

Axiom extern_f64ToUi64 : forall  (_ : mword 3) (_ : mword 64) , unit.

Definition riscv_f64ToUi64 (rm : mword 3) (v : mword 64) : M ((mword 5 * mword 64)) :=
   let '_ := (extern_f64ToUi64 rm v)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, w__1).

Axiom extern_i64ToF64 : forall  (_ : mword 3) (_ : mword 64) , unit.

Definition riscv_i64ToF64 (rm : mword 3) (v : mword 64) : M ((mword 5 * mword 64)) :=
   let '_ := (extern_i64ToF64 rm v)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, w__1).

Axiom extern_ui64ToF64 : forall  (_ : mword 3) (_ : mword 64) , unit.

Definition riscv_ui64ToF64 (rm : mword 3) (v : mword 64) : M ((mword 5 * mword 64)) :=
   let '_ := (extern_ui64ToF64 rm v)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, w__1).

Axiom extern_f32ToF64 : forall  (_ : mword 3) (_ : mword 32) , unit.

Definition riscv_f32ToF64 (rm : mword 3) (v : mword 32) : M ((mword 5 * mword 64)) :=
   let '_ := (extern_f32ToF64 rm v)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, w__1).

Axiom extern_f64ToF32 : forall  (_ : mword 3) (_ : mword 64) , unit.

Definition riscv_f64ToF32 (rm : mword 3) (v : mword 64) : M ((mword 5 * mword 32)) :=
   let '_ := (extern_f64ToF32 rm v)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, subrange_vec_dec w__1 31 0).

Axiom extern_f32Lt : forall  (_ : mword 32) (_ : mword 32) , unit.

Definition riscv_f32Lt (v1 : mword 32) (v2 : mword 32) : M ((mword 5 * mword 32)) :=
   let '_ := (extern_f32Lt v1 v2)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, subrange_vec_dec w__1 31 0).

Axiom extern_f32Le : forall  (_ : mword 32) (_ : mword 32) , unit.

Definition riscv_f32Le (v1 : mword 32) (v2 : mword 32) : M ((mword 5 * mword 32)) :=
   let '_ := (extern_f32Le v1 v2)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, subrange_vec_dec w__1 31 0).

Axiom extern_f32Eq : forall  (_ : mword 32) (_ : mword 32) , unit.

Definition riscv_f32Eq (v1 : mword 32) (v2 : mword 32) : M ((mword 5 * mword 32)) :=
   let '_ := (extern_f32Eq v1 v2)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, subrange_vec_dec w__1 31 0).

Axiom extern_f64Lt : forall  (_ : mword 64) (_ : mword 64) , unit.

Definition riscv_f64Lt (v1 : mword 64) (v2 : mword 64) : M ((mword 5 * mword 64)) :=
   let '_ := (extern_f64Lt v1 v2)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, w__1).

Axiom extern_f64Le : forall  (_ : mword 64) (_ : mword 64) , unit.

Definition riscv_f64Le (v1 : mword 64) (v2 : mword 64) : M ((mword 5 * mword 64)) :=
   let '_ := (extern_f64Le v1 v2)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, w__1).

Axiom extern_f64Eq : forall  (_ : mword 64) (_ : mword 64) , unit.

Definition riscv_f64Eq (v1 : mword 64) (v2 : mword 64) : M ((mword 5 * mword 64)) :=
   let '_ := (extern_f64Eq v1 v2)  : unit in
   ((read_reg float_fflags_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg float_result_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   returnm (subrange_vec_dec w__0 4 0, w__1).

Definition dirty_fd_context '(tt : unit) : M (unit) :=
   (_set_Mstatus_FS mstatus_ref (extStatus_to_bits Dirty)) >>
   (_set_Mstatus_SD mstatus_ref ('b"1"  : mword 1))
    : M (unit).

Definition rF (r : Z) `{ArithFact ((0 <=? r) && (r <? 32))} : M (mword 64) :=
   let l__42 := r in
   (if sumbool_of_bool (Z.eqb l__42 0) then ((read_reg f0_ref)  : M (mword 64))  : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 1) then ((read_reg f1_ref)  : M (mword 64))  : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 2) then ((read_reg f2_ref)  : M (mword 64))  : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 3) then ((read_reg f3_ref)  : M (mword 64))  : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 4) then ((read_reg f4_ref)  : M (mword 64))  : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 5) then ((read_reg f5_ref)  : M (mword 64))  : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 6) then ((read_reg f6_ref)  : M (mword 64))  : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 7) then ((read_reg f7_ref)  : M (mword 64))  : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 8) then ((read_reg f8_ref)  : M (mword 64))  : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 9) then ((read_reg f9_ref)  : M (mword 64))  : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 10) then
      ((read_reg f10_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 11) then
      ((read_reg f11_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 12) then
      ((read_reg f12_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 13) then
      ((read_reg f13_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 14) then
      ((read_reg f14_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 15) then
      ((read_reg f15_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 16) then
      ((read_reg f16_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 17) then
      ((read_reg f17_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 18) then
      ((read_reg f18_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 19) then
      ((read_reg f19_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 20) then
      ((read_reg f20_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 21) then
      ((read_reg f21_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 22) then
      ((read_reg f22_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 23) then
      ((read_reg f23_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 24) then
      ((read_reg f24_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 25) then
      ((read_reg f25_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 26) then
      ((read_reg f26_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 27) then
      ((read_reg f27_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 28) then
      ((read_reg f28_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 29) then
      ((read_reg f29_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 30) then
      ((read_reg f30_ref)  : M (mword 64))
       : M (mword 64)
    else if sumbool_of_bool (Z.eqb l__42 31) then
      ((read_reg f31_ref)  : M (mword 64))
       : M (mword 64)
    else assert_exp' false "invalid floating point register number" >>= fun _ => exit tt) >>= fun v : fregtype =>
   returnm (fregval_from_freg v).

Definition wF (r : Z) (in_v : mword 64) `{ArithFact ((0 <=? r) && (r <? 32))} : M (unit) :=
   let v := fregval_into_freg in_v in
   let l__10 := r in
   (if sumbool_of_bool (Z.eqb l__10 0) then write_reg f0_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 1) then write_reg f1_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 2) then write_reg f2_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 3) then write_reg f3_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 4) then write_reg f4_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 5) then write_reg f5_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 6) then write_reg f6_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 7) then write_reg f7_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 8) then write_reg f8_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 9) then write_reg f9_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 10) then write_reg f10_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 11) then write_reg f11_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 12) then write_reg f12_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 13) then write_reg f13_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 14) then write_reg f14_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 15) then write_reg f15_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 16) then write_reg f16_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 17) then write_reg f17_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 18) then write_reg f18_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 19) then write_reg f19_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 20) then write_reg f20_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 21) then write_reg f21_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 22) then write_reg f22_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 23) then write_reg f23_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 24) then write_reg f24_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 25) then write_reg f25_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 26) then write_reg f26_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 27) then write_reg f27_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 28) then write_reg f28_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 29) then write_reg f29_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 30) then write_reg f30_ref v  : M (unit)
    else if sumbool_of_bool (Z.eqb l__10 31) then write_reg f31_ref v  : M (unit)
    else assert_exp' false "invalid floating point register number" >>= fun _ => exit tt) >>
   (dirty_fd_context tt) >>
   returnm (if get_config_print_reg tt then
              print_endline
                (String.append "f"
                   (String.append (string_of_int r) (String.append " <- " (FRegStr v))))
            else tt).

Definition rF_bits (i : mword 5) : M (mword 64) := (rF (projT1 (uint i)))  : M (mword 64).

Definition wF_bits (i : mword 5) (data : mword 64) : M (unit) :=
   (wF (projT1 (uint i)) data)  : M (unit).

Definition freg_name_abi_forwards (arg_ : mword 5) : M (string) :=
   let b__0 := arg_ in
   (if eq_vec b__0 ('b"00000"  : mword 5) then returnm "ft0"
    else if eq_vec b__0 ('b"00001"  : mword 5) then returnm "ft1"
    else if eq_vec b__0 ('b"00010"  : mword 5) then returnm "ft2"
    else if eq_vec b__0 ('b"00011"  : mword 5) then returnm "ft3"
    else if eq_vec b__0 ('b"00100"  : mword 5) then returnm "ft4"
    else if eq_vec b__0 ('b"00101"  : mword 5) then returnm "ft5"
    else if eq_vec b__0 ('b"00110"  : mword 5) then returnm "ft6"
    else if eq_vec b__0 ('b"00111"  : mword 5) then returnm "ft7"
    else if eq_vec b__0 ('b"01000"  : mword 5) then returnm "fs0"
    else if eq_vec b__0 ('b"01001"  : mword 5) then returnm "fs1"
    else if eq_vec b__0 ('b"01010"  : mword 5) then returnm "fa0"
    else if eq_vec b__0 ('b"01011"  : mword 5) then returnm "fa1"
    else if eq_vec b__0 ('b"01100"  : mword 5) then returnm "fa2"
    else if eq_vec b__0 ('b"01101"  : mword 5) then returnm "fa3"
    else if eq_vec b__0 ('b"01110"  : mword 5) then returnm "fa4"
    else if eq_vec b__0 ('b"01111"  : mword 5) then returnm "fa5"
    else if eq_vec b__0 ('b"10000"  : mword 5) then returnm "fa6"
    else if eq_vec b__0 ('b"10001"  : mword 5) then returnm "fa7"
    else if eq_vec b__0 ('b"10010"  : mword 5) then returnm "fs2"
    else if eq_vec b__0 ('b"10011"  : mword 5) then returnm "fs3"
    else if eq_vec b__0 ('b"10100"  : mword 5) then returnm "fs4"
    else if eq_vec b__0 ('b"10101"  : mword 5) then returnm "fs5"
    else if eq_vec b__0 ('b"10110"  : mword 5) then returnm "fs6"
    else if eq_vec b__0 ('b"10111"  : mword 5) then returnm "fs7"
    else if eq_vec b__0 ('b"11000"  : mword 5) then returnm "fs8"
    else if eq_vec b__0 ('b"11001"  : mword 5) then returnm "fs9"
    else if eq_vec b__0 ('b"11010"  : mword 5) then returnm "fs10"
    else if eq_vec b__0 ('b"11011"  : mword 5) then returnm "fs11"
    else if eq_vec b__0 ('b"11100"  : mword 5) then returnm "ft8"
    else if eq_vec b__0 ('b"11101"  : mword 5) then returnm "ft9"
    else if eq_vec b__0 ('b"11110"  : mword 5) then returnm "ft10"
    else if eq_vec b__0 ('b"11111"  : mword 5) then returnm "ft11"
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (string).

Definition freg_name_abi_backwards (arg_ : string) : M (mword 5) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "ft0" then returnm ('b"00000"  : mword 5)
    else if generic_eq p0_ "ft1" then returnm ('b"00001"  : mword 5)
    else if generic_eq p0_ "ft2" then returnm ('b"00010"  : mword 5)
    else if generic_eq p0_ "ft3" then returnm ('b"00011"  : mword 5)
    else if generic_eq p0_ "ft4" then returnm ('b"00100"  : mword 5)
    else if generic_eq p0_ "ft5" then returnm ('b"00101"  : mword 5)
    else if generic_eq p0_ "ft6" then returnm ('b"00110"  : mword 5)
    else if generic_eq p0_ "ft7" then returnm ('b"00111"  : mword 5)
    else if generic_eq p0_ "fs0" then returnm ('b"01000"  : mword 5)
    else if generic_eq p0_ "fs1" then returnm ('b"01001"  : mword 5)
    else if generic_eq p0_ "fa0" then returnm ('b"01010"  : mword 5)
    else if generic_eq p0_ "fa1" then returnm ('b"01011"  : mword 5)
    else if generic_eq p0_ "fa2" then returnm ('b"01100"  : mword 5)
    else if generic_eq p0_ "fa3" then returnm ('b"01101"  : mword 5)
    else if generic_eq p0_ "fa4" then returnm ('b"01110"  : mword 5)
    else if generic_eq p0_ "fa5" then returnm ('b"01111"  : mword 5)
    else if generic_eq p0_ "fa6" then returnm ('b"10000"  : mword 5)
    else if generic_eq p0_ "fa7" then returnm ('b"10001"  : mword 5)
    else if generic_eq p0_ "fs2" then returnm ('b"10010"  : mword 5)
    else if generic_eq p0_ "fs3" then returnm ('b"10011"  : mword 5)
    else if generic_eq p0_ "fs4" then returnm ('b"10100"  : mword 5)
    else if generic_eq p0_ "fs5" then returnm ('b"10101"  : mword 5)
    else if generic_eq p0_ "fs6" then returnm ('b"10110"  : mword 5)
    else if generic_eq p0_ "fs7" then returnm ('b"10111"  : mword 5)
    else if generic_eq p0_ "fs8" then returnm ('b"11000"  : mword 5)
    else if generic_eq p0_ "fs9" then returnm ('b"11001"  : mword 5)
    else if generic_eq p0_ "fs10" then returnm ('b"11010"  : mword 5)
    else if generic_eq p0_ "fs11" then returnm ('b"11011"  : mword 5)
    else if generic_eq p0_ "ft8" then returnm ('b"11100"  : mword 5)
    else if generic_eq p0_ "ft9" then returnm ('b"11101"  : mword 5)
    else if generic_eq p0_ "ft10" then returnm ('b"11110"  : mword 5)
    else if generic_eq p0_ "ft11" then returnm ('b"11111"  : mword 5)
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (mword 5).

Definition freg_name_abi_forwards_matches (arg_ : mword 5) : bool :=
   let b__0 := arg_ in
   if eq_vec b__0 ('b"00000"  : mword 5) then true
   else if eq_vec b__0 ('b"00001"  : mword 5) then true
   else if eq_vec b__0 ('b"00010"  : mword 5) then true
   else if eq_vec b__0 ('b"00011"  : mword 5) then true
   else if eq_vec b__0 ('b"00100"  : mword 5) then true
   else if eq_vec b__0 ('b"00101"  : mword 5) then true
   else if eq_vec b__0 ('b"00110"  : mword 5) then true
   else if eq_vec b__0 ('b"00111"  : mword 5) then true
   else if eq_vec b__0 ('b"01000"  : mword 5) then true
   else if eq_vec b__0 ('b"01001"  : mword 5) then true
   else if eq_vec b__0 ('b"01010"  : mword 5) then true
   else if eq_vec b__0 ('b"01011"  : mword 5) then true
   else if eq_vec b__0 ('b"01100"  : mword 5) then true
   else if eq_vec b__0 ('b"01101"  : mword 5) then true
   else if eq_vec b__0 ('b"01110"  : mword 5) then true
   else if eq_vec b__0 ('b"01111"  : mword 5) then true
   else if eq_vec b__0 ('b"10000"  : mword 5) then true
   else if eq_vec b__0 ('b"10001"  : mword 5) then true
   else if eq_vec b__0 ('b"10010"  : mword 5) then true
   else if eq_vec b__0 ('b"10011"  : mword 5) then true
   else if eq_vec b__0 ('b"10100"  : mword 5) then true
   else if eq_vec b__0 ('b"10101"  : mword 5) then true
   else if eq_vec b__0 ('b"10110"  : mword 5) then true
   else if eq_vec b__0 ('b"10111"  : mword 5) then true
   else if eq_vec b__0 ('b"11000"  : mword 5) then true
   else if eq_vec b__0 ('b"11001"  : mword 5) then true
   else if eq_vec b__0 ('b"11010"  : mword 5) then true
   else if eq_vec b__0 ('b"11011"  : mword 5) then true
   else if eq_vec b__0 ('b"11100"  : mword 5) then true
   else if eq_vec b__0 ('b"11101"  : mword 5) then true
   else if eq_vec b__0 ('b"11110"  : mword 5) then true
   else if eq_vec b__0 ('b"11111"  : mword 5) then true
   else false.

Definition freg_name_abi_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "ft0" then true
   else if generic_eq p0_ "ft1" then true
   else if generic_eq p0_ "ft2" then true
   else if generic_eq p0_ "ft3" then true
   else if generic_eq p0_ "ft4" then true
   else if generic_eq p0_ "ft5" then true
   else if generic_eq p0_ "ft6" then true
   else if generic_eq p0_ "ft7" then true
   else if generic_eq p0_ "fs0" then true
   else if generic_eq p0_ "fs1" then true
   else if generic_eq p0_ "fa0" then true
   else if generic_eq p0_ "fa1" then true
   else if generic_eq p0_ "fa2" then true
   else if generic_eq p0_ "fa3" then true
   else if generic_eq p0_ "fa4" then true
   else if generic_eq p0_ "fa5" then true
   else if generic_eq p0_ "fa6" then true
   else if generic_eq p0_ "fa7" then true
   else if generic_eq p0_ "fs2" then true
   else if generic_eq p0_ "fs3" then true
   else if generic_eq p0_ "fs4" then true
   else if generic_eq p0_ "fs5" then true
   else if generic_eq p0_ "fs6" then true
   else if generic_eq p0_ "fs7" then true
   else if generic_eq p0_ "fs8" then true
   else if generic_eq p0_ "fs9" then true
   else if generic_eq p0_ "fs10" then true
   else if generic_eq p0_ "fs11" then true
   else if generic_eq p0_ "ft8" then true
   else if generic_eq p0_ "ft9" then true
   else if generic_eq p0_ "ft10" then true
   else if generic_eq p0_ "ft11" then true
   else false.

Definition _s324_ (_s325_ : string) : option string :=
   let _s326_ := _s325_ in
   if string_startswith _s326_ "ft11" then
     match (string_drop _s326_ (projT1 (string_length "ft11"))) with | s_ => Some s_ end
   else None.

Definition _s320_ (_s321_ : string) : option string :=
   let _s322_ := _s321_ in
   if string_startswith _s322_ "ft10" then
     match (string_drop _s322_ (projT1 (string_length "ft10"))) with | s_ => Some s_ end
   else None.

Definition _s316_ (_s317_ : string) : option string :=
   let _s318_ := _s317_ in
   if string_startswith _s318_ "ft9" then
     match (string_drop _s318_ (projT1 (string_length "ft9"))) with | s_ => Some s_ end
   else None.

Definition _s312_ (_s313_ : string) : option string :=
   let _s314_ := _s313_ in
   if string_startswith _s314_ "ft8" then
     match (string_drop _s314_ (projT1 (string_length "ft8"))) with | s_ => Some s_ end
   else None.

Definition _s308_ (_s309_ : string) : option string :=
   let _s310_ := _s309_ in
   if string_startswith _s310_ "fs11" then
     match (string_drop _s310_ (projT1 (string_length "fs11"))) with | s_ => Some s_ end
   else None.

Definition _s304_ (_s305_ : string) : option string :=
   let _s306_ := _s305_ in
   if string_startswith _s306_ "fs10" then
     match (string_drop _s306_ (projT1 (string_length "fs10"))) with | s_ => Some s_ end
   else None.

Definition _s300_ (_s301_ : string) : option string :=
   let _s302_ := _s301_ in
   if string_startswith _s302_ "fs9" then
     match (string_drop _s302_ (projT1 (string_length "fs9"))) with | s_ => Some s_ end
   else None.

Definition _s296_ (_s297_ : string) : option string :=
   let _s298_ := _s297_ in
   if string_startswith _s298_ "fs8" then
     match (string_drop _s298_ (projT1 (string_length "fs8"))) with | s_ => Some s_ end
   else None.

Definition _s292_ (_s293_ : string) : option string :=
   let _s294_ := _s293_ in
   if string_startswith _s294_ "fs7" then
     match (string_drop _s294_ (projT1 (string_length "fs7"))) with | s_ => Some s_ end
   else None.

Definition _s288_ (_s289_ : string) : option string :=
   let _s290_ := _s289_ in
   if string_startswith _s290_ "fs6" then
     match (string_drop _s290_ (projT1 (string_length "fs6"))) with | s_ => Some s_ end
   else None.

Definition _s284_ (_s285_ : string) : option string :=
   let _s286_ := _s285_ in
   if string_startswith _s286_ "fs5" then
     match (string_drop _s286_ (projT1 (string_length "fs5"))) with | s_ => Some s_ end
   else None.

Definition _s280_ (_s281_ : string) : option string :=
   let _s282_ := _s281_ in
   if string_startswith _s282_ "fs4" then
     match (string_drop _s282_ (projT1 (string_length "fs4"))) with | s_ => Some s_ end
   else None.

Definition _s276_ (_s277_ : string) : option string :=
   let _s278_ := _s277_ in
   if string_startswith _s278_ "fs3" then
     match (string_drop _s278_ (projT1 (string_length "fs3"))) with | s_ => Some s_ end
   else None.

Definition _s272_ (_s273_ : string) : option string :=
   let _s274_ := _s273_ in
   if string_startswith _s274_ "fs2" then
     match (string_drop _s274_ (projT1 (string_length "fs2"))) with | s_ => Some s_ end
   else None.

Definition _s268_ (_s269_ : string) : option string :=
   let _s270_ := _s269_ in
   if string_startswith _s270_ "fa7" then
     match (string_drop _s270_ (projT1 (string_length "fa7"))) with | s_ => Some s_ end
   else None.

Definition _s264_ (_s265_ : string) : option string :=
   let _s266_ := _s265_ in
   if string_startswith _s266_ "fa6" then
     match (string_drop _s266_ (projT1 (string_length "fa6"))) with | s_ => Some s_ end
   else None.

Definition _s260_ (_s261_ : string) : option string :=
   let _s262_ := _s261_ in
   if string_startswith _s262_ "fa5" then
     match (string_drop _s262_ (projT1 (string_length "fa5"))) with | s_ => Some s_ end
   else None.

Definition _s256_ (_s257_ : string) : option string :=
   let _s258_ := _s257_ in
   if string_startswith _s258_ "fa4" then
     match (string_drop _s258_ (projT1 (string_length "fa4"))) with | s_ => Some s_ end
   else None.

Definition _s252_ (_s253_ : string) : option string :=
   let _s254_ := _s253_ in
   if string_startswith _s254_ "fa3" then
     match (string_drop _s254_ (projT1 (string_length "fa3"))) with | s_ => Some s_ end
   else None.

Definition _s248_ (_s249_ : string) : option string :=
   let _s250_ := _s249_ in
   if string_startswith _s250_ "fa2" then
     match (string_drop _s250_ (projT1 (string_length "fa2"))) with | s_ => Some s_ end
   else None.

Definition _s244_ (_s245_ : string) : option string :=
   let _s246_ := _s245_ in
   if string_startswith _s246_ "fa1" then
     match (string_drop _s246_ (projT1 (string_length "fa1"))) with | s_ => Some s_ end
   else None.

Definition _s240_ (_s241_ : string) : option string :=
   let _s242_ := _s241_ in
   if string_startswith _s242_ "fa0" then
     match (string_drop _s242_ (projT1 (string_length "fa0"))) with | s_ => Some s_ end
   else None.

Definition _s236_ (_s237_ : string) : option string :=
   let _s238_ := _s237_ in
   if string_startswith _s238_ "fs1" then
     match (string_drop _s238_ (projT1 (string_length "fs1"))) with | s_ => Some s_ end
   else None.

Definition _s232_ (_s233_ : string) : option string :=
   let _s234_ := _s233_ in
   if string_startswith _s234_ "fs0" then
     match (string_drop _s234_ (projT1 (string_length "fs0"))) with | s_ => Some s_ end
   else None.

Definition _s228_ (_s229_ : string) : option string :=
   let _s230_ := _s229_ in
   if string_startswith _s230_ "ft7" then
     match (string_drop _s230_ (projT1 (string_length "ft7"))) with | s_ => Some s_ end
   else None.

Definition _s224_ (_s225_ : string) : option string :=
   let _s226_ := _s225_ in
   if string_startswith _s226_ "ft6" then
     match (string_drop _s226_ (projT1 (string_length "ft6"))) with | s_ => Some s_ end
   else None.

Definition _s220_ (_s221_ : string) : option string :=
   let _s222_ := _s221_ in
   if string_startswith _s222_ "ft5" then
     match (string_drop _s222_ (projT1 (string_length "ft5"))) with | s_ => Some s_ end
   else None.

Definition _s216_ (_s217_ : string) : option string :=
   let _s218_ := _s217_ in
   if string_startswith _s218_ "ft4" then
     match (string_drop _s218_ (projT1 (string_length "ft4"))) with | s_ => Some s_ end
   else None.

Definition _s212_ (_s213_ : string) : option string :=
   let _s214_ := _s213_ in
   if string_startswith _s214_ "ft3" then
     match (string_drop _s214_ (projT1 (string_length "ft3"))) with | s_ => Some s_ end
   else None.

Definition _s208_ (_s209_ : string) : option string :=
   let _s210_ := _s209_ in
   if string_startswith _s210_ "ft2" then
     match (string_drop _s210_ (projT1 (string_length "ft2"))) with | s_ => Some s_ end
   else None.

Definition _s204_ (_s205_ : string) : option string :=
   let _s206_ := _s205_ in
   if string_startswith _s206_ "ft1" then
     match (string_drop _s206_ (projT1 (string_length "ft1"))) with | s_ => Some s_ end
   else None.

Definition _s200_ (_s201_ : string) : option string :=
   let _s202_ := _s201_ in
   if string_startswith _s202_ "ft0" then
     match (string_drop _s202_ (projT1 (string_length "ft0"))) with | s_ => Some s_ end
   else None.

Definition freg_name_abi_matches_prefix (arg_ : string)
: M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s203_ := arg_ in
   (if match (_s200_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s200_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"00000"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s204_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s204_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"00001"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s208_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s208_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"00010"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s212_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s212_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"00011"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s216_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s216_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"00100"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s220_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s220_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"00101"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s224_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s224_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"00110"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s228_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s228_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"00111"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s232_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s232_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"01000"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s236_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s236_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"01001"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s240_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s240_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"01010"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s244_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s244_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"01011"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s248_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s248_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"01100"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s252_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s252_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"01101"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s256_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s256_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"01110"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s260_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s260_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"01111"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s264_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s264_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"10000"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s268_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s268_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"10001"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s272_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s272_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"10010"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s276_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s276_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"10011"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s280_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s280_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"10100"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s284_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s284_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"10101"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s288_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s288_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"10110"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s292_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s292_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"10111"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s296_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s296_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"11000"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s300_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s300_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"11001"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s304_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s304_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"11010"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s308_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s308_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"11011"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s312_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s312_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"11100"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s316_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s316_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"11101"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s320_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s320_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"11110"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s324_ _s203_) with | Some s_ => true | _ => false end then
      (match (_s324_ _s203_) with
       | Some s_ =>
          returnm (Some
                     ('b"11111"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)}))).

Definition freg_name_forwards (arg_ : mword 5) : M (string) :=
   let b__0 := arg_ in
   (if eq_vec b__0 ('b"00000"  : mword 5) then returnm "ft0"
    else if eq_vec b__0 ('b"00001"  : mword 5) then returnm "ft1"
    else if eq_vec b__0 ('b"00010"  : mword 5) then returnm "ft2"
    else if eq_vec b__0 ('b"00011"  : mword 5) then returnm "ft3"
    else if eq_vec b__0 ('b"00100"  : mword 5) then returnm "ft4"
    else if eq_vec b__0 ('b"00101"  : mword 5) then returnm "ft5"
    else if eq_vec b__0 ('b"00110"  : mword 5) then returnm "ft6"
    else if eq_vec b__0 ('b"00111"  : mword 5) then returnm "ft7"
    else if eq_vec b__0 ('b"01000"  : mword 5) then returnm "fs0"
    else if eq_vec b__0 ('b"01001"  : mword 5) then returnm "fs1"
    else if eq_vec b__0 ('b"01010"  : mword 5) then returnm "fa0"
    else if eq_vec b__0 ('b"01011"  : mword 5) then returnm "fa1"
    else if eq_vec b__0 ('b"01100"  : mword 5) then returnm "fa2"
    else if eq_vec b__0 ('b"01101"  : mword 5) then returnm "fa3"
    else if eq_vec b__0 ('b"01110"  : mword 5) then returnm "fa4"
    else if eq_vec b__0 ('b"01111"  : mword 5) then returnm "fa5"
    else if eq_vec b__0 ('b"10000"  : mword 5) then returnm "fa6"
    else if eq_vec b__0 ('b"10001"  : mword 5) then returnm "fa7"
    else if eq_vec b__0 ('b"10010"  : mword 5) then returnm "fs2"
    else if eq_vec b__0 ('b"10011"  : mword 5) then returnm "fs3"
    else if eq_vec b__0 ('b"10100"  : mword 5) then returnm "fs4"
    else if eq_vec b__0 ('b"10101"  : mword 5) then returnm "fs5"
    else if eq_vec b__0 ('b"10110"  : mword 5) then returnm "fs6"
    else if eq_vec b__0 ('b"10111"  : mword 5) then returnm "fs7"
    else if eq_vec b__0 ('b"11000"  : mword 5) then returnm "fs8"
    else if eq_vec b__0 ('b"11001"  : mword 5) then returnm "fs9"
    else if eq_vec b__0 ('b"11010"  : mword 5) then returnm "fs10"
    else if eq_vec b__0 ('b"11011"  : mword 5) then returnm "fs11"
    else if eq_vec b__0 ('b"11100"  : mword 5) then returnm "ft8"
    else if eq_vec b__0 ('b"11101"  : mword 5) then returnm "ft9"
    else if eq_vec b__0 ('b"11110"  : mword 5) then returnm "ft10"
    else if eq_vec b__0 ('b"11111"  : mword 5) then returnm "ft11"
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (string).

Definition freg_name_backwards (arg_ : string) : M (mword 5) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "ft0" then returnm ('b"00000"  : mword 5)
    else if generic_eq p0_ "ft1" then returnm ('b"00001"  : mword 5)
    else if generic_eq p0_ "ft2" then returnm ('b"00010"  : mword 5)
    else if generic_eq p0_ "ft3" then returnm ('b"00011"  : mword 5)
    else if generic_eq p0_ "ft4" then returnm ('b"00100"  : mword 5)
    else if generic_eq p0_ "ft5" then returnm ('b"00101"  : mword 5)
    else if generic_eq p0_ "ft6" then returnm ('b"00110"  : mword 5)
    else if generic_eq p0_ "ft7" then returnm ('b"00111"  : mword 5)
    else if generic_eq p0_ "fs0" then returnm ('b"01000"  : mword 5)
    else if generic_eq p0_ "fs1" then returnm ('b"01001"  : mword 5)
    else if generic_eq p0_ "fa0" then returnm ('b"01010"  : mword 5)
    else if generic_eq p0_ "fa1" then returnm ('b"01011"  : mword 5)
    else if generic_eq p0_ "fa2" then returnm ('b"01100"  : mword 5)
    else if generic_eq p0_ "fa3" then returnm ('b"01101"  : mword 5)
    else if generic_eq p0_ "fa4" then returnm ('b"01110"  : mword 5)
    else if generic_eq p0_ "fa5" then returnm ('b"01111"  : mword 5)
    else if generic_eq p0_ "fa6" then returnm ('b"10000"  : mword 5)
    else if generic_eq p0_ "fa7" then returnm ('b"10001"  : mword 5)
    else if generic_eq p0_ "fs2" then returnm ('b"10010"  : mword 5)
    else if generic_eq p0_ "fs3" then returnm ('b"10011"  : mword 5)
    else if generic_eq p0_ "fs4" then returnm ('b"10100"  : mword 5)
    else if generic_eq p0_ "fs5" then returnm ('b"10101"  : mword 5)
    else if generic_eq p0_ "fs6" then returnm ('b"10110"  : mword 5)
    else if generic_eq p0_ "fs7" then returnm ('b"10111"  : mword 5)
    else if generic_eq p0_ "fs8" then returnm ('b"11000"  : mword 5)
    else if generic_eq p0_ "fs9" then returnm ('b"11001"  : mword 5)
    else if generic_eq p0_ "fs10" then returnm ('b"11010"  : mword 5)
    else if generic_eq p0_ "fs11" then returnm ('b"11011"  : mword 5)
    else if generic_eq p0_ "ft8" then returnm ('b"11100"  : mword 5)
    else if generic_eq p0_ "ft9" then returnm ('b"11101"  : mword 5)
    else if generic_eq p0_ "ft10" then returnm ('b"11110"  : mword 5)
    else if generic_eq p0_ "ft11" then returnm ('b"11111"  : mword 5)
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (mword 5).

Definition freg_name_forwards_matches (arg_ : mword 5) : bool :=
   let b__0 := arg_ in
   if eq_vec b__0 ('b"00000"  : mword 5) then true
   else if eq_vec b__0 ('b"00001"  : mword 5) then true
   else if eq_vec b__0 ('b"00010"  : mword 5) then true
   else if eq_vec b__0 ('b"00011"  : mword 5) then true
   else if eq_vec b__0 ('b"00100"  : mword 5) then true
   else if eq_vec b__0 ('b"00101"  : mword 5) then true
   else if eq_vec b__0 ('b"00110"  : mword 5) then true
   else if eq_vec b__0 ('b"00111"  : mword 5) then true
   else if eq_vec b__0 ('b"01000"  : mword 5) then true
   else if eq_vec b__0 ('b"01001"  : mword 5) then true
   else if eq_vec b__0 ('b"01010"  : mword 5) then true
   else if eq_vec b__0 ('b"01011"  : mword 5) then true
   else if eq_vec b__0 ('b"01100"  : mword 5) then true
   else if eq_vec b__0 ('b"01101"  : mword 5) then true
   else if eq_vec b__0 ('b"01110"  : mword 5) then true
   else if eq_vec b__0 ('b"01111"  : mword 5) then true
   else if eq_vec b__0 ('b"10000"  : mword 5) then true
   else if eq_vec b__0 ('b"10001"  : mword 5) then true
   else if eq_vec b__0 ('b"10010"  : mword 5) then true
   else if eq_vec b__0 ('b"10011"  : mword 5) then true
   else if eq_vec b__0 ('b"10100"  : mword 5) then true
   else if eq_vec b__0 ('b"10101"  : mword 5) then true
   else if eq_vec b__0 ('b"10110"  : mword 5) then true
   else if eq_vec b__0 ('b"10111"  : mword 5) then true
   else if eq_vec b__0 ('b"11000"  : mword 5) then true
   else if eq_vec b__0 ('b"11001"  : mword 5) then true
   else if eq_vec b__0 ('b"11010"  : mword 5) then true
   else if eq_vec b__0 ('b"11011"  : mword 5) then true
   else if eq_vec b__0 ('b"11100"  : mword 5) then true
   else if eq_vec b__0 ('b"11101"  : mword 5) then true
   else if eq_vec b__0 ('b"11110"  : mword 5) then true
   else if eq_vec b__0 ('b"11111"  : mword 5) then true
   else false.

Definition freg_name_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "ft0" then true
   else if generic_eq p0_ "ft1" then true
   else if generic_eq p0_ "ft2" then true
   else if generic_eq p0_ "ft3" then true
   else if generic_eq p0_ "ft4" then true
   else if generic_eq p0_ "ft5" then true
   else if generic_eq p0_ "ft6" then true
   else if generic_eq p0_ "ft7" then true
   else if generic_eq p0_ "fs0" then true
   else if generic_eq p0_ "fs1" then true
   else if generic_eq p0_ "fa0" then true
   else if generic_eq p0_ "fa1" then true
   else if generic_eq p0_ "fa2" then true
   else if generic_eq p0_ "fa3" then true
   else if generic_eq p0_ "fa4" then true
   else if generic_eq p0_ "fa5" then true
   else if generic_eq p0_ "fa6" then true
   else if generic_eq p0_ "fa7" then true
   else if generic_eq p0_ "fs2" then true
   else if generic_eq p0_ "fs3" then true
   else if generic_eq p0_ "fs4" then true
   else if generic_eq p0_ "fs5" then true
   else if generic_eq p0_ "fs6" then true
   else if generic_eq p0_ "fs7" then true
   else if generic_eq p0_ "fs8" then true
   else if generic_eq p0_ "fs9" then true
   else if generic_eq p0_ "fs10" then true
   else if generic_eq p0_ "fs11" then true
   else if generic_eq p0_ "ft8" then true
   else if generic_eq p0_ "ft9" then true
   else if generic_eq p0_ "ft10" then true
   else if generic_eq p0_ "ft11" then true
   else false.

Definition _s452_ (_s453_ : string) : option string :=
   let _s454_ := _s453_ in
   if string_startswith _s454_ "ft11" then
     match (string_drop _s454_ (projT1 (string_length "ft11"))) with | s_ => Some s_ end
   else None.

Definition _s448_ (_s449_ : string) : option string :=
   let _s450_ := _s449_ in
   if string_startswith _s450_ "ft10" then
     match (string_drop _s450_ (projT1 (string_length "ft10"))) with | s_ => Some s_ end
   else None.

Definition _s444_ (_s445_ : string) : option string :=
   let _s446_ := _s445_ in
   if string_startswith _s446_ "ft9" then
     match (string_drop _s446_ (projT1 (string_length "ft9"))) with | s_ => Some s_ end
   else None.

Definition _s440_ (_s441_ : string) : option string :=
   let _s442_ := _s441_ in
   if string_startswith _s442_ "ft8" then
     match (string_drop _s442_ (projT1 (string_length "ft8"))) with | s_ => Some s_ end
   else None.

Definition _s436_ (_s437_ : string) : option string :=
   let _s438_ := _s437_ in
   if string_startswith _s438_ "fs11" then
     match (string_drop _s438_ (projT1 (string_length "fs11"))) with | s_ => Some s_ end
   else None.

Definition _s432_ (_s433_ : string) : option string :=
   let _s434_ := _s433_ in
   if string_startswith _s434_ "fs10" then
     match (string_drop _s434_ (projT1 (string_length "fs10"))) with | s_ => Some s_ end
   else None.

Definition _s428_ (_s429_ : string) : option string :=
   let _s430_ := _s429_ in
   if string_startswith _s430_ "fs9" then
     match (string_drop _s430_ (projT1 (string_length "fs9"))) with | s_ => Some s_ end
   else None.

Definition _s424_ (_s425_ : string) : option string :=
   let _s426_ := _s425_ in
   if string_startswith _s426_ "fs8" then
     match (string_drop _s426_ (projT1 (string_length "fs8"))) with | s_ => Some s_ end
   else None.

Definition _s420_ (_s421_ : string) : option string :=
   let _s422_ := _s421_ in
   if string_startswith _s422_ "fs7" then
     match (string_drop _s422_ (projT1 (string_length "fs7"))) with | s_ => Some s_ end
   else None.

Definition _s416_ (_s417_ : string) : option string :=
   let _s418_ := _s417_ in
   if string_startswith _s418_ "fs6" then
     match (string_drop _s418_ (projT1 (string_length "fs6"))) with | s_ => Some s_ end
   else None.

Definition _s412_ (_s413_ : string) : option string :=
   let _s414_ := _s413_ in
   if string_startswith _s414_ "fs5" then
     match (string_drop _s414_ (projT1 (string_length "fs5"))) with | s_ => Some s_ end
   else None.

Definition _s408_ (_s409_ : string) : option string :=
   let _s410_ := _s409_ in
   if string_startswith _s410_ "fs4" then
     match (string_drop _s410_ (projT1 (string_length "fs4"))) with | s_ => Some s_ end
   else None.

Definition _s404_ (_s405_ : string) : option string :=
   let _s406_ := _s405_ in
   if string_startswith _s406_ "fs3" then
     match (string_drop _s406_ (projT1 (string_length "fs3"))) with | s_ => Some s_ end
   else None.

Definition _s400_ (_s401_ : string) : option string :=
   let _s402_ := _s401_ in
   if string_startswith _s402_ "fs2" then
     match (string_drop _s402_ (projT1 (string_length "fs2"))) with | s_ => Some s_ end
   else None.

Definition _s396_ (_s397_ : string) : option string :=
   let _s398_ := _s397_ in
   if string_startswith _s398_ "fa7" then
     match (string_drop _s398_ (projT1 (string_length "fa7"))) with | s_ => Some s_ end
   else None.

Definition _s392_ (_s393_ : string) : option string :=
   let _s394_ := _s393_ in
   if string_startswith _s394_ "fa6" then
     match (string_drop _s394_ (projT1 (string_length "fa6"))) with | s_ => Some s_ end
   else None.

Definition _s388_ (_s389_ : string) : option string :=
   let _s390_ := _s389_ in
   if string_startswith _s390_ "fa5" then
     match (string_drop _s390_ (projT1 (string_length "fa5"))) with | s_ => Some s_ end
   else None.

Definition _s384_ (_s385_ : string) : option string :=
   let _s386_ := _s385_ in
   if string_startswith _s386_ "fa4" then
     match (string_drop _s386_ (projT1 (string_length "fa4"))) with | s_ => Some s_ end
   else None.

Definition _s380_ (_s381_ : string) : option string :=
   let _s382_ := _s381_ in
   if string_startswith _s382_ "fa3" then
     match (string_drop _s382_ (projT1 (string_length "fa3"))) with | s_ => Some s_ end
   else None.

Definition _s376_ (_s377_ : string) : option string :=
   let _s378_ := _s377_ in
   if string_startswith _s378_ "fa2" then
     match (string_drop _s378_ (projT1 (string_length "fa2"))) with | s_ => Some s_ end
   else None.

Definition _s372_ (_s373_ : string) : option string :=
   let _s374_ := _s373_ in
   if string_startswith _s374_ "fa1" then
     match (string_drop _s374_ (projT1 (string_length "fa1"))) with | s_ => Some s_ end
   else None.

Definition _s368_ (_s369_ : string) : option string :=
   let _s370_ := _s369_ in
   if string_startswith _s370_ "fa0" then
     match (string_drop _s370_ (projT1 (string_length "fa0"))) with | s_ => Some s_ end
   else None.

Definition _s364_ (_s365_ : string) : option string :=
   let _s366_ := _s365_ in
   if string_startswith _s366_ "fs1" then
     match (string_drop _s366_ (projT1 (string_length "fs1"))) with | s_ => Some s_ end
   else None.

Definition _s360_ (_s361_ : string) : option string :=
   let _s362_ := _s361_ in
   if string_startswith _s362_ "fs0" then
     match (string_drop _s362_ (projT1 (string_length "fs0"))) with | s_ => Some s_ end
   else None.

Definition _s356_ (_s357_ : string) : option string :=
   let _s358_ := _s357_ in
   if string_startswith _s358_ "ft7" then
     match (string_drop _s358_ (projT1 (string_length "ft7"))) with | s_ => Some s_ end
   else None.

Definition _s352_ (_s353_ : string) : option string :=
   let _s354_ := _s353_ in
   if string_startswith _s354_ "ft6" then
     match (string_drop _s354_ (projT1 (string_length "ft6"))) with | s_ => Some s_ end
   else None.

Definition _s348_ (_s349_ : string) : option string :=
   let _s350_ := _s349_ in
   if string_startswith _s350_ "ft5" then
     match (string_drop _s350_ (projT1 (string_length "ft5"))) with | s_ => Some s_ end
   else None.

Definition _s344_ (_s345_ : string) : option string :=
   let _s346_ := _s345_ in
   if string_startswith _s346_ "ft4" then
     match (string_drop _s346_ (projT1 (string_length "ft4"))) with | s_ => Some s_ end
   else None.

Definition _s340_ (_s341_ : string) : option string :=
   let _s342_ := _s341_ in
   if string_startswith _s342_ "ft3" then
     match (string_drop _s342_ (projT1 (string_length "ft3"))) with | s_ => Some s_ end
   else None.

Definition _s336_ (_s337_ : string) : option string :=
   let _s338_ := _s337_ in
   if string_startswith _s338_ "ft2" then
     match (string_drop _s338_ (projT1 (string_length "ft2"))) with | s_ => Some s_ end
   else None.

Definition _s332_ (_s333_ : string) : option string :=
   let _s334_ := _s333_ in
   if string_startswith _s334_ "ft1" then
     match (string_drop _s334_ (projT1 (string_length "ft1"))) with | s_ => Some s_ end
   else None.

Definition _s328_ (_s329_ : string) : option string :=
   let _s330_ := _s329_ in
   if string_startswith _s330_ "ft0" then
     match (string_drop _s330_ (projT1 (string_length "ft0"))) with | s_ => Some s_ end
   else None.

Definition freg_name_matches_prefix (arg_ : string)
: M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s331_ := arg_ in
   (if match (_s328_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s328_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"00000"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s332_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s332_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"00001"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s336_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s336_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"00010"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s340_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s340_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"00011"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s344_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s344_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"00100"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s348_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s348_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"00101"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s352_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s352_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"00110"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s356_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s356_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"00111"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s360_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s360_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"01000"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s364_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s364_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"01001"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s368_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s368_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"01010"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s372_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s372_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"01011"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s376_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s376_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"01100"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s380_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s380_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"01101"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s384_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s384_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"01110"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s388_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s388_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"01111"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s392_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s392_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"10000"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s396_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s396_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"10001"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s400_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s400_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"10010"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s404_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s404_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"10011"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s408_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s408_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"10100"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s412_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s412_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"10101"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s416_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s416_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"10110"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s420_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s420_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"10111"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s424_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s424_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"11000"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s428_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s428_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"11001"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s432_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s432_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"11010"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s436_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s436_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"11011"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s440_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s440_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"11100"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s444_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s444_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"11101"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s448_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s448_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"11110"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s452_ _s331_) with | Some s_ => true | _ => false end then
      (match (_s452_ _s331_) with
       | Some s_ =>
          returnm (Some
                     ('b"11111"
                      : mword 5, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((mword 5 * {n : Z & ArithFact (n >=? 0)}))).

Definition init_fdext_regs '(tt : unit) : M (unit) :=
   write_reg f0_ref zero_freg >>
   write_reg f1_ref zero_freg >>
   write_reg f2_ref zero_freg >>
   write_reg f3_ref zero_freg >>
   write_reg f4_ref zero_freg >>
   write_reg f5_ref zero_freg >>
   write_reg f6_ref zero_freg >>
   write_reg f7_ref zero_freg >>
   write_reg f8_ref zero_freg >>
   write_reg f9_ref zero_freg >>
   write_reg f10_ref zero_freg >>
   write_reg f11_ref zero_freg >>
   write_reg f12_ref zero_freg >>
   write_reg f13_ref zero_freg >>
   write_reg f14_ref zero_freg >>
   write_reg f15_ref zero_freg >>
   write_reg f16_ref zero_freg >>
   write_reg f17_ref zero_freg >>
   write_reg f18_ref zero_freg >>
   write_reg f19_ref zero_freg >>
   write_reg f20_ref zero_freg >>
   write_reg f21_ref zero_freg >>
   write_reg f22_ref zero_freg >>
   write_reg f23_ref zero_freg >>
   write_reg f24_ref zero_freg >>
   write_reg f25_ref zero_freg >>
   write_reg f26_ref zero_freg >>
   write_reg f27_ref zero_freg >>
   write_reg f28_ref zero_freg >>
   write_reg f29_ref zero_freg >>
   write_reg f30_ref zero_freg >> write_reg f31_ref zero_freg  : M (unit).

Definition Mk_Fcsr (v : mword 32) : Fcsr := {| Fcsr_Fcsr_chunk_0 := (subrange_vec_dec v 31 0) |}.

Definition _get_Fcsr_bits (v : Fcsr) : mword 32 := subrange_vec_dec v.(Fcsr_Fcsr_chunk_0) 31 0.

Definition _set_Fcsr_bits (r_ref : register_ref regstate register_value Fcsr) (v : mword 32)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Fcsr_Fcsr_chunk_0 :=
         (update_subrange_vec_dec r.(Fcsr_Fcsr_chunk_0) 31 0 (subrange_vec_dec v 31 0)) ]}
      : Fcsr in
   write_reg r_ref r
    : M (unit).

Definition _update_Fcsr_bits (v : Fcsr) (x : mword 32) : Fcsr :=
   {[ v with
     Fcsr_Fcsr_chunk_0 :=
       (update_subrange_vec_dec v.(Fcsr_Fcsr_chunk_0) 31 0 (subrange_vec_dec x 31 0)) ]}.

Definition _get_Fcsr_FRM (v : Fcsr) : mword 3 := subrange_vec_dec v.(Fcsr_Fcsr_chunk_0) 7 5.

Definition _set_Fcsr_FRM (r_ref : register_ref regstate register_value Fcsr) (v : mword 3)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Fcsr_Fcsr_chunk_0 :=
         (update_subrange_vec_dec r.(Fcsr_Fcsr_chunk_0) 7 5 (subrange_vec_dec v 2 0)) ]}
      : Fcsr in
   write_reg r_ref r
    : M (unit).

Definition _update_Fcsr_FRM (v : Fcsr) (x : mword 3) : Fcsr :=
   {[ v with
     Fcsr_Fcsr_chunk_0 :=
       (update_subrange_vec_dec v.(Fcsr_Fcsr_chunk_0) 7 5 (subrange_vec_dec x 2 0)) ]}.

Definition _get_Fcsr_FFLAGS (v : Fcsr) : mword 5 := subrange_vec_dec v.(Fcsr_Fcsr_chunk_0) 4 0.

Definition _set_Fcsr_FFLAGS (r_ref : register_ref regstate register_value Fcsr) (v : mword 5)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       Fcsr_Fcsr_chunk_0 :=
         (update_subrange_vec_dec r.(Fcsr_Fcsr_chunk_0) 4 0 (subrange_vec_dec v 4 0)) ]}
      : Fcsr in
   write_reg r_ref r
    : M (unit).

Definition _update_Fcsr_FFLAGS (v : Fcsr) (x : mword 5) : Fcsr :=
   {[ v with
     Fcsr_Fcsr_chunk_0 :=
       (update_subrange_vec_dec v.(Fcsr_Fcsr_chunk_0) 4 0 (subrange_vec_dec x 4 0)) ]}.

Definition ext_write_fcsr (frm : mword 3) (fflags : mword 5) : M (unit) :=
   (_set_Fcsr_FRM fcsr_ref frm) >>
   (_set_Fcsr_FFLAGS fcsr_ref fflags) >>
   (update_softfloat_fflags fflags) >> (dirty_fd_context tt)  : M (unit).

Definition write_fflags (fflags : mword 5) : M (unit) :=
   read_reg fcsr_ref >>= fun w__0 : Fcsr =>
   (if neq_vec (_get_Fcsr_FFLAGS w__0) fflags then (dirty_fd_context tt)  : M (unit)
    else returnm tt) >>
   (_set_Fcsr_FFLAGS fcsr_ref fflags)
    : M (unit).

Definition accrue_fflags (flags : mword 5) : M (unit) :=
   read_reg fcsr_ref >>= fun w__0 : Fcsr =>
   let f := or_vec (_get_Fcsr_FFLAGS w__0) flags in
   read_reg fcsr_ref >>= fun w__1 : Fcsr =>
   (if neq_vec (_get_Fcsr_FFLAGS w__1) f then
      (_set_Fcsr_FFLAGS fcsr_ref f) >>
      (update_softfloat_fflags f) >> (dirty_fd_context tt)  : M (unit)
    else returnm tt)
    : M (unit).

Definition csr_name_map_forwards (arg_ : mword 12) : string :=
   let b__0 := arg_ in
   if eq_vec b__0 (Ox"000"  : mword 12) then "ustatus"
   else if eq_vec b__0 (Ox"004"  : mword 12) then "uie"
   else if eq_vec b__0 (Ox"005"  : mword 12) then "utvec"
   else if eq_vec b__0 (Ox"040"  : mword 12) then "uscratch"
   else if eq_vec b__0 (Ox"041"  : mword 12) then "uepc"
   else if eq_vec b__0 (Ox"042"  : mword 12) then "ucause"
   else if eq_vec b__0 (Ox"043"  : mword 12) then "utval"
   else if eq_vec b__0 (Ox"044"  : mword 12) then "uip"
   else if eq_vec b__0 (Ox"001"  : mword 12) then "fflags"
   else if eq_vec b__0 (Ox"002"  : mword 12) then "frm"
   else if eq_vec b__0 (Ox"003"  : mword 12) then "fcsr"
   else if eq_vec b__0 (Ox"C00"  : mword 12) then "cycle"
   else if eq_vec b__0 (Ox"C01"  : mword 12) then "time"
   else if eq_vec b__0 (Ox"C02"  : mword 12) then "instret"
   else if eq_vec b__0 (Ox"C80"  : mword 12) then "cycleh"
   else if eq_vec b__0 (Ox"C81"  : mword 12) then "timeh"
   else if eq_vec b__0 (Ox"C82"  : mword 12) then "instreth"
   else if eq_vec b__0 (Ox"100"  : mword 12) then "sstatus"
   else if eq_vec b__0 (Ox"102"  : mword 12) then "sedeleg"
   else if eq_vec b__0 (Ox"103"  : mword 12) then "sideleg"
   else if eq_vec b__0 (Ox"104"  : mword 12) then "sie"
   else if eq_vec b__0 (Ox"105"  : mword 12) then "stvec"
   else if eq_vec b__0 (Ox"106"  : mword 12) then "scounteren"
   else if eq_vec b__0 (Ox"140"  : mword 12) then "sscratch"
   else if eq_vec b__0 (Ox"141"  : mword 12) then "sepc"
   else if eq_vec b__0 (Ox"142"  : mword 12) then "scause"
   else if eq_vec b__0 (Ox"143"  : mword 12) then "stval"
   else if eq_vec b__0 (Ox"144"  : mword 12) then "sip"
   else if eq_vec b__0 (Ox"180"  : mword 12) then "satp"
   else if eq_vec b__0 (Ox"F11"  : mword 12) then "mvendorid"
   else if eq_vec b__0 (Ox"F12"  : mword 12) then "marchid"
   else if eq_vec b__0 (Ox"F13"  : mword 12) then "mimpid"
   else if eq_vec b__0 (Ox"F14"  : mword 12) then "mhartid"
   else if eq_vec b__0 (Ox"300"  : mword 12) then "mstatus"
   else if eq_vec b__0 (Ox"301"  : mword 12) then "misa"
   else if eq_vec b__0 (Ox"302"  : mword 12) then "medeleg"
   else if eq_vec b__0 (Ox"303"  : mword 12) then "mideleg"
   else if eq_vec b__0 (Ox"304"  : mword 12) then "mie"
   else if eq_vec b__0 (Ox"305"  : mword 12) then "mtvec"
   else if eq_vec b__0 (Ox"306"  : mword 12) then "mcounteren"
   else if eq_vec b__0 (Ox"320"  : mword 12) then "mcountinhibit"
   else if eq_vec b__0 (Ox"340"  : mword 12) then "mscratch"
   else if eq_vec b__0 (Ox"341"  : mword 12) then "mepc"
   else if eq_vec b__0 (Ox"342"  : mword 12) then "mcause"
   else if eq_vec b__0 (Ox"343"  : mword 12) then "mtval"
   else if eq_vec b__0 (Ox"344"  : mword 12) then "mip"
   else if eq_vec b__0 (Ox"3A0"  : mword 12) then "pmpcfg0"
   else if eq_vec b__0 (Ox"3A1"  : mword 12) then "pmpcfg1"
   else if eq_vec b__0 (Ox"3A2"  : mword 12) then "pmpcfg2"
   else if eq_vec b__0 (Ox"3A3"  : mword 12) then "pmpcfg3"
   else if eq_vec b__0 (Ox"3B0"  : mword 12) then "pmpaddr0"
   else if eq_vec b__0 (Ox"3B1"  : mword 12) then "pmpaddr1"
   else if eq_vec b__0 (Ox"3B2"  : mword 12) then "pmpaddr2"
   else if eq_vec b__0 (Ox"3B3"  : mword 12) then "pmpaddr3"
   else if eq_vec b__0 (Ox"3B4"  : mword 12) then "pmpaddr4"
   else if eq_vec b__0 (Ox"3B5"  : mword 12) then "pmpaddr5"
   else if eq_vec b__0 (Ox"3B6"  : mword 12) then "pmpaddr6"
   else if eq_vec b__0 (Ox"3B7"  : mword 12) then "pmpaddr7"
   else if eq_vec b__0 (Ox"3B8"  : mword 12) then "pmpaddr8"
   else if eq_vec b__0 (Ox"3B9"  : mword 12) then "pmpaddr9"
   else if eq_vec b__0 (Ox"3BA"  : mword 12) then "pmpaddr10"
   else if eq_vec b__0 (Ox"3BB"  : mword 12) then "pmpaddr11"
   else if eq_vec b__0 (Ox"3BC"  : mword 12) then "pmpaddr12"
   else if eq_vec b__0 (Ox"3BD"  : mword 12) then "pmpaddr13"
   else if eq_vec b__0 (Ox"3BE"  : mword 12) then "pmpaddr14"
   else if eq_vec b__0 (Ox"3BF"  : mword 12) then "pmpaddr15"
   else if eq_vec b__0 (Ox"B00"  : mword 12) then "mcycle"
   else if eq_vec b__0 (Ox"B02"  : mword 12) then "minstret"
   else if eq_vec b__0 (Ox"B80"  : mword 12) then "mcycleh"
   else if eq_vec b__0 (Ox"B82"  : mword 12) then "minstreth"
   else if eq_vec b__0 (Ox"7A0"  : mword 12) then "tselect"
   else if eq_vec b__0 (Ox"7A1"  : mword 12) then "tdata1"
   else if eq_vec b__0 (Ox"7A2"  : mword 12) then "tdata2"
   else if eq_vec b__0 (Ox"7A3"  : mword 12) then "tdata3"
   else decimal_string_of_bits b__0.

Definition csr_name_map_backwards (arg_ : string) : M (mword 12) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "ustatus" then returnm (Ox"000"  : mword 12)
    else if generic_eq p0_ "uie" then returnm (Ox"004"  : mword 12)
    else if generic_eq p0_ "utvec" then returnm (Ox"005"  : mword 12)
    else if generic_eq p0_ "uscratch" then returnm (Ox"040"  : mword 12)
    else if generic_eq p0_ "uepc" then returnm (Ox"041"  : mword 12)
    else if generic_eq p0_ "ucause" then returnm (Ox"042"  : mword 12)
    else if generic_eq p0_ "utval" then returnm (Ox"043"  : mword 12)
    else if generic_eq p0_ "uip" then returnm (Ox"044"  : mword 12)
    else if generic_eq p0_ "fflags" then returnm (Ox"001"  : mword 12)
    else if generic_eq p0_ "frm" then returnm (Ox"002"  : mword 12)
    else if generic_eq p0_ "fcsr" then returnm (Ox"003"  : mword 12)
    else if generic_eq p0_ "cycle" then returnm (Ox"C00"  : mword 12)
    else if generic_eq p0_ "time" then returnm (Ox"C01"  : mword 12)
    else if generic_eq p0_ "instret" then returnm (Ox"C02"  : mword 12)
    else if generic_eq p0_ "cycleh" then returnm (Ox"C80"  : mword 12)
    else if generic_eq p0_ "timeh" then returnm (Ox"C81"  : mword 12)
    else if generic_eq p0_ "instreth" then returnm (Ox"C82"  : mword 12)
    else if generic_eq p0_ "sstatus" then returnm (Ox"100"  : mword 12)
    else if generic_eq p0_ "sedeleg" then returnm (Ox"102"  : mword 12)
    else if generic_eq p0_ "sideleg" then returnm (Ox"103"  : mword 12)
    else if generic_eq p0_ "sie" then returnm (Ox"104"  : mword 12)
    else if generic_eq p0_ "stvec" then returnm (Ox"105"  : mword 12)
    else if generic_eq p0_ "scounteren" then returnm (Ox"106"  : mword 12)
    else if generic_eq p0_ "sscratch" then returnm (Ox"140"  : mword 12)
    else if generic_eq p0_ "sepc" then returnm (Ox"141"  : mword 12)
    else if generic_eq p0_ "scause" then returnm (Ox"142"  : mword 12)
    else if generic_eq p0_ "stval" then returnm (Ox"143"  : mword 12)
    else if generic_eq p0_ "sip" then returnm (Ox"144"  : mword 12)
    else if generic_eq p0_ "satp" then returnm (Ox"180"  : mword 12)
    else if generic_eq p0_ "mvendorid" then returnm (Ox"F11"  : mword 12)
    else if generic_eq p0_ "marchid" then returnm (Ox"F12"  : mword 12)
    else if generic_eq p0_ "mimpid" then returnm (Ox"F13"  : mword 12)
    else if generic_eq p0_ "mhartid" then returnm (Ox"F14"  : mword 12)
    else if generic_eq p0_ "mstatus" then returnm (Ox"300"  : mword 12)
    else if generic_eq p0_ "misa" then returnm (Ox"301"  : mword 12)
    else if generic_eq p0_ "medeleg" then returnm (Ox"302"  : mword 12)
    else if generic_eq p0_ "mideleg" then returnm (Ox"303"  : mword 12)
    else if generic_eq p0_ "mie" then returnm (Ox"304"  : mword 12)
    else if generic_eq p0_ "mtvec" then returnm (Ox"305"  : mword 12)
    else if generic_eq p0_ "mcounteren" then returnm (Ox"306"  : mword 12)
    else if generic_eq p0_ "mcountinhibit" then returnm (Ox"320"  : mword 12)
    else if generic_eq p0_ "mscratch" then returnm (Ox"340"  : mword 12)
    else if generic_eq p0_ "mepc" then returnm (Ox"341"  : mword 12)
    else if generic_eq p0_ "mcause" then returnm (Ox"342"  : mword 12)
    else if generic_eq p0_ "mtval" then returnm (Ox"343"  : mword 12)
    else if generic_eq p0_ "mip" then returnm (Ox"344"  : mword 12)
    else if generic_eq p0_ "pmpcfg0" then returnm (Ox"3A0"  : mword 12)
    else if generic_eq p0_ "pmpcfg1" then returnm (Ox"3A1"  : mword 12)
    else if generic_eq p0_ "pmpcfg2" then returnm (Ox"3A2"  : mword 12)
    else if generic_eq p0_ "pmpcfg3" then returnm (Ox"3A3"  : mword 12)
    else if generic_eq p0_ "pmpaddr0" then returnm (Ox"3B0"  : mword 12)
    else if generic_eq p0_ "pmpaddr1" then returnm (Ox"3B1"  : mword 12)
    else if generic_eq p0_ "pmpaddr2" then returnm (Ox"3B2"  : mword 12)
    else if generic_eq p0_ "pmpaddr3" then returnm (Ox"3B3"  : mword 12)
    else if generic_eq p0_ "pmpaddr4" then returnm (Ox"3B4"  : mword 12)
    else if generic_eq p0_ "pmpaddr5" then returnm (Ox"3B5"  : mword 12)
    else if generic_eq p0_ "pmpaddr6" then returnm (Ox"3B6"  : mword 12)
    else if generic_eq p0_ "pmpaddr7" then returnm (Ox"3B7"  : mword 12)
    else if generic_eq p0_ "pmpaddr8" then returnm (Ox"3B8"  : mword 12)
    else if generic_eq p0_ "pmpaddr9" then returnm (Ox"3B9"  : mword 12)
    else if generic_eq p0_ "pmpaddr10" then returnm (Ox"3BA"  : mword 12)
    else if generic_eq p0_ "pmpaddr11" then returnm (Ox"3BB"  : mword 12)
    else if generic_eq p0_ "pmpaddr12" then returnm (Ox"3BC"  : mword 12)
    else if generic_eq p0_ "pmpaddr13" then returnm (Ox"3BD"  : mword 12)
    else if generic_eq p0_ "pmpaddr14" then returnm (Ox"3BE"  : mword 12)
    else if generic_eq p0_ "pmpaddr15" then returnm (Ox"3BF"  : mword 12)
    else if generic_eq p0_ "mcycle" then returnm (Ox"B00"  : mword 12)
    else if generic_eq p0_ "minstret" then returnm (Ox"B02"  : mword 12)
    else if generic_eq p0_ "mcycleh" then returnm (Ox"B80"  : mword 12)
    else if generic_eq p0_ "minstreth" then returnm (Ox"B82"  : mword 12)
    else if generic_eq p0_ "tselect" then returnm (Ox"7A0"  : mword 12)
    else if generic_eq p0_ "tdata1" then returnm (Ox"7A1"  : mword 12)
    else if generic_eq p0_ "tdata2" then returnm (Ox"7A2"  : mword 12)
    else if generic_eq p0_ "tdata3" then returnm (Ox"7A3"  : mword 12)
    else if hex_bits_12_backwards_matches p0_ then hex_bits_12_backwards p0_
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (mword 12).

Definition csr_name_map_forwards_matches (arg_ : mword 12) : bool :=
   let b__0 := arg_ in
   if eq_vec b__0 (Ox"000"  : mword 12) then true
   else if eq_vec b__0 (Ox"004"  : mword 12) then true
   else if eq_vec b__0 (Ox"005"  : mword 12) then true
   else if eq_vec b__0 (Ox"040"  : mword 12) then true
   else if eq_vec b__0 (Ox"041"  : mword 12) then true
   else if eq_vec b__0 (Ox"042"  : mword 12) then true
   else if eq_vec b__0 (Ox"043"  : mword 12) then true
   else if eq_vec b__0 (Ox"044"  : mword 12) then true
   else if eq_vec b__0 (Ox"001"  : mword 12) then true
   else if eq_vec b__0 (Ox"002"  : mword 12) then true
   else if eq_vec b__0 (Ox"003"  : mword 12) then true
   else if eq_vec b__0 (Ox"C00"  : mword 12) then true
   else if eq_vec b__0 (Ox"C01"  : mword 12) then true
   else if eq_vec b__0 (Ox"C02"  : mword 12) then true
   else if eq_vec b__0 (Ox"C80"  : mword 12) then true
   else if eq_vec b__0 (Ox"C81"  : mword 12) then true
   else if eq_vec b__0 (Ox"C82"  : mword 12) then true
   else if eq_vec b__0 (Ox"100"  : mword 12) then true
   else if eq_vec b__0 (Ox"102"  : mword 12) then true
   else if eq_vec b__0 (Ox"103"  : mword 12) then true
   else if eq_vec b__0 (Ox"104"  : mword 12) then true
   else if eq_vec b__0 (Ox"105"  : mword 12) then true
   else if eq_vec b__0 (Ox"106"  : mword 12) then true
   else if eq_vec b__0 (Ox"140"  : mword 12) then true
   else if eq_vec b__0 (Ox"141"  : mword 12) then true
   else if eq_vec b__0 (Ox"142"  : mword 12) then true
   else if eq_vec b__0 (Ox"143"  : mword 12) then true
   else if eq_vec b__0 (Ox"144"  : mword 12) then true
   else if eq_vec b__0 (Ox"180"  : mword 12) then true
   else if eq_vec b__0 (Ox"F11"  : mword 12) then true
   else if eq_vec b__0 (Ox"F12"  : mword 12) then true
   else if eq_vec b__0 (Ox"F13"  : mword 12) then true
   else if eq_vec b__0 (Ox"F14"  : mword 12) then true
   else if eq_vec b__0 (Ox"300"  : mword 12) then true
   else if eq_vec b__0 (Ox"301"  : mword 12) then true
   else if eq_vec b__0 (Ox"302"  : mword 12) then true
   else if eq_vec b__0 (Ox"303"  : mword 12) then true
   else if eq_vec b__0 (Ox"304"  : mword 12) then true
   else if eq_vec b__0 (Ox"305"  : mword 12) then true
   else if eq_vec b__0 (Ox"306"  : mword 12) then true
   else if eq_vec b__0 (Ox"320"  : mword 12) then true
   else if eq_vec b__0 (Ox"340"  : mword 12) then true
   else if eq_vec b__0 (Ox"341"  : mword 12) then true
   else if eq_vec b__0 (Ox"342"  : mword 12) then true
   else if eq_vec b__0 (Ox"343"  : mword 12) then true
   else if eq_vec b__0 (Ox"344"  : mword 12) then true
   else if eq_vec b__0 (Ox"3A0"  : mword 12) then true
   else if eq_vec b__0 (Ox"3A1"  : mword 12) then true
   else if eq_vec b__0 (Ox"3A2"  : mword 12) then true
   else if eq_vec b__0 (Ox"3A3"  : mword 12) then true
   else if eq_vec b__0 (Ox"3B0"  : mword 12) then true
   else if eq_vec b__0 (Ox"3B1"  : mword 12) then true
   else if eq_vec b__0 (Ox"3B2"  : mword 12) then true
   else if eq_vec b__0 (Ox"3B3"  : mword 12) then true
   else if eq_vec b__0 (Ox"3B4"  : mword 12) then true
   else if eq_vec b__0 (Ox"3B5"  : mword 12) then true
   else if eq_vec b__0 (Ox"3B6"  : mword 12) then true
   else if eq_vec b__0 (Ox"3B7"  : mword 12) then true
   else if eq_vec b__0 (Ox"3B8"  : mword 12) then true
   else if eq_vec b__0 (Ox"3B9"  : mword 12) then true
   else if eq_vec b__0 (Ox"3BA"  : mword 12) then true
   else if eq_vec b__0 (Ox"3BB"  : mword 12) then true
   else if eq_vec b__0 (Ox"3BC"  : mword 12) then true
   else if eq_vec b__0 (Ox"3BD"  : mword 12) then true
   else if eq_vec b__0 (Ox"3BE"  : mword 12) then true
   else if eq_vec b__0 (Ox"3BF"  : mword 12) then true
   else if eq_vec b__0 (Ox"B00"  : mword 12) then true
   else if eq_vec b__0 (Ox"B02"  : mword 12) then true
   else if eq_vec b__0 (Ox"B80"  : mword 12) then true
   else if eq_vec b__0 (Ox"B82"  : mword 12) then true
   else if eq_vec b__0 (Ox"7A0"  : mword 12) then true
   else if eq_vec b__0 (Ox"7A1"  : mword 12) then true
   else if eq_vec b__0 (Ox"7A2"  : mword 12) then true
   else if eq_vec b__0 (Ox"7A3"  : mword 12) then true
   else true.

Definition csr_name_map_backwards_matches (arg_ : string) : M (bool) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "ustatus" then returnm true
    else if generic_eq p0_ "uie" then returnm true
    else if generic_eq p0_ "utvec" then returnm true
    else if generic_eq p0_ "uscratch" then returnm true
    else if generic_eq p0_ "uepc" then returnm true
    else if generic_eq p0_ "ucause" then returnm true
    else if generic_eq p0_ "utval" then returnm true
    else if generic_eq p0_ "uip" then returnm true
    else if generic_eq p0_ "fflags" then returnm true
    else if generic_eq p0_ "frm" then returnm true
    else if generic_eq p0_ "fcsr" then returnm true
    else if generic_eq p0_ "cycle" then returnm true
    else if generic_eq p0_ "time" then returnm true
    else if generic_eq p0_ "instret" then returnm true
    else if generic_eq p0_ "cycleh" then returnm true
    else if generic_eq p0_ "timeh" then returnm true
    else if generic_eq p0_ "instreth" then returnm true
    else if generic_eq p0_ "sstatus" then returnm true
    else if generic_eq p0_ "sedeleg" then returnm true
    else if generic_eq p0_ "sideleg" then returnm true
    else if generic_eq p0_ "sie" then returnm true
    else if generic_eq p0_ "stvec" then returnm true
    else if generic_eq p0_ "scounteren" then returnm true
    else if generic_eq p0_ "sscratch" then returnm true
    else if generic_eq p0_ "sepc" then returnm true
    else if generic_eq p0_ "scause" then returnm true
    else if generic_eq p0_ "stval" then returnm true
    else if generic_eq p0_ "sip" then returnm true
    else if generic_eq p0_ "satp" then returnm true
    else if generic_eq p0_ "mvendorid" then returnm true
    else if generic_eq p0_ "marchid" then returnm true
    else if generic_eq p0_ "mimpid" then returnm true
    else if generic_eq p0_ "mhartid" then returnm true
    else if generic_eq p0_ "mstatus" then returnm true
    else if generic_eq p0_ "misa" then returnm true
    else if generic_eq p0_ "medeleg" then returnm true
    else if generic_eq p0_ "mideleg" then returnm true
    else if generic_eq p0_ "mie" then returnm true
    else if generic_eq p0_ "mtvec" then returnm true
    else if generic_eq p0_ "mcounteren" then returnm true
    else if generic_eq p0_ "mcountinhibit" then returnm true
    else if generic_eq p0_ "mscratch" then returnm true
    else if generic_eq p0_ "mepc" then returnm true
    else if generic_eq p0_ "mcause" then returnm true
    else if generic_eq p0_ "mtval" then returnm true
    else if generic_eq p0_ "mip" then returnm true
    else if generic_eq p0_ "pmpcfg0" then returnm true
    else if generic_eq p0_ "pmpcfg1" then returnm true
    else if generic_eq p0_ "pmpcfg2" then returnm true
    else if generic_eq p0_ "pmpcfg3" then returnm true
    else if generic_eq p0_ "pmpaddr0" then returnm true
    else if generic_eq p0_ "pmpaddr1" then returnm true
    else if generic_eq p0_ "pmpaddr2" then returnm true
    else if generic_eq p0_ "pmpaddr3" then returnm true
    else if generic_eq p0_ "pmpaddr4" then returnm true
    else if generic_eq p0_ "pmpaddr5" then returnm true
    else if generic_eq p0_ "pmpaddr6" then returnm true
    else if generic_eq p0_ "pmpaddr7" then returnm true
    else if generic_eq p0_ "pmpaddr8" then returnm true
    else if generic_eq p0_ "pmpaddr9" then returnm true
    else if generic_eq p0_ "pmpaddr10" then returnm true
    else if generic_eq p0_ "pmpaddr11" then returnm true
    else if generic_eq p0_ "pmpaddr12" then returnm true
    else if generic_eq p0_ "pmpaddr13" then returnm true
    else if generic_eq p0_ "pmpaddr14" then returnm true
    else if generic_eq p0_ "pmpaddr15" then returnm true
    else if generic_eq p0_ "mcycle" then returnm true
    else if generic_eq p0_ "minstret" then returnm true
    else if generic_eq p0_ "mcycleh" then returnm true
    else if generic_eq p0_ "minstreth" then returnm true
    else if generic_eq p0_ "tselect" then returnm true
    else if generic_eq p0_ "tdata1" then returnm true
    else if generic_eq p0_ "tdata2" then returnm true
    else if generic_eq p0_ "tdata3" then returnm true
    else if hex_bits_12_backwards_matches p0_ then
      (hex_bits_12_backwards p0_) >>= fun reg => returnm true
    else returnm false)
    : M (bool).

Definition _s752_ (_s753_ : string) : option ((mword 12 * string)) :=
   match _s753_ with
   | _s754_ =>
      match (hex_bits_12_matches_prefix _s754_) with
      | Some (reg, existT _ _s755_ _) =>
         match (string_drop _s754_ _s755_) with | s_ => Some (reg, s_) end
      | _ => None
      end
   end.

Definition _s748_ (_s749_ : string) : option string :=
   let _s750_ := _s749_ in
   if string_startswith _s750_ "tdata3" then
     match (string_drop _s750_ (projT1 (string_length "tdata3"))) with | s_ => Some s_ end
   else None.

Definition _s744_ (_s745_ : string) : option string :=
   let _s746_ := _s745_ in
   if string_startswith _s746_ "tdata2" then
     match (string_drop _s746_ (projT1 (string_length "tdata2"))) with | s_ => Some s_ end
   else None.

Definition _s740_ (_s741_ : string) : option string :=
   let _s742_ := _s741_ in
   if string_startswith _s742_ "tdata1" then
     match (string_drop _s742_ (projT1 (string_length "tdata1"))) with | s_ => Some s_ end
   else None.

Definition _s736_ (_s737_ : string) : option string :=
   let _s738_ := _s737_ in
   if string_startswith _s738_ "tselect" then
     match (string_drop _s738_ (projT1 (string_length "tselect"))) with | s_ => Some s_ end
   else None.

Definition _s732_ (_s733_ : string) : option string :=
   let _s734_ := _s733_ in
   if string_startswith _s734_ "minstreth" then
     match (string_drop _s734_ (projT1 (string_length "minstreth"))) with | s_ => Some s_ end
   else None.

Definition _s728_ (_s729_ : string) : option string :=
   let _s730_ := _s729_ in
   if string_startswith _s730_ "mcycleh" then
     match (string_drop _s730_ (projT1 (string_length "mcycleh"))) with | s_ => Some s_ end
   else None.

Definition _s724_ (_s725_ : string) : option string :=
   let _s726_ := _s725_ in
   if string_startswith _s726_ "minstret" then
     match (string_drop _s726_ (projT1 (string_length "minstret"))) with | s_ => Some s_ end
   else None.

Definition _s720_ (_s721_ : string) : option string :=
   let _s722_ := _s721_ in
   if string_startswith _s722_ "mcycle" then
     match (string_drop _s722_ (projT1 (string_length "mcycle"))) with | s_ => Some s_ end
   else None.

Definition _s716_ (_s717_ : string) : option string :=
   let _s718_ := _s717_ in
   if string_startswith _s718_ "pmpaddr15" then
     match (string_drop _s718_ (projT1 (string_length "pmpaddr15"))) with | s_ => Some s_ end
   else None.

Definition _s712_ (_s713_ : string) : option string :=
   let _s714_ := _s713_ in
   if string_startswith _s714_ "pmpaddr14" then
     match (string_drop _s714_ (projT1 (string_length "pmpaddr14"))) with | s_ => Some s_ end
   else None.

Definition _s708_ (_s709_ : string) : option string :=
   let _s710_ := _s709_ in
   if string_startswith _s710_ "pmpaddr13" then
     match (string_drop _s710_ (projT1 (string_length "pmpaddr13"))) with | s_ => Some s_ end
   else None.

Definition _s704_ (_s705_ : string) : option string :=
   let _s706_ := _s705_ in
   if string_startswith _s706_ "pmpaddr12" then
     match (string_drop _s706_ (projT1 (string_length "pmpaddr12"))) with | s_ => Some s_ end
   else None.

Definition _s700_ (_s701_ : string) : option string :=
   let _s702_ := _s701_ in
   if string_startswith _s702_ "pmpaddr11" then
     match (string_drop _s702_ (projT1 (string_length "pmpaddr11"))) with | s_ => Some s_ end
   else None.

Definition _s696_ (_s697_ : string) : option string :=
   let _s698_ := _s697_ in
   if string_startswith _s698_ "pmpaddr10" then
     match (string_drop _s698_ (projT1 (string_length "pmpaddr10"))) with | s_ => Some s_ end
   else None.

Definition _s692_ (_s693_ : string) : option string :=
   let _s694_ := _s693_ in
   if string_startswith _s694_ "pmpaddr9" then
     match (string_drop _s694_ (projT1 (string_length "pmpaddr9"))) with | s_ => Some s_ end
   else None.

Definition _s688_ (_s689_ : string) : option string :=
   let _s690_ := _s689_ in
   if string_startswith _s690_ "pmpaddr8" then
     match (string_drop _s690_ (projT1 (string_length "pmpaddr8"))) with | s_ => Some s_ end
   else None.

Definition _s684_ (_s685_ : string) : option string :=
   let _s686_ := _s685_ in
   if string_startswith _s686_ "pmpaddr7" then
     match (string_drop _s686_ (projT1 (string_length "pmpaddr7"))) with | s_ => Some s_ end
   else None.

Definition _s680_ (_s681_ : string) : option string :=
   let _s682_ := _s681_ in
   if string_startswith _s682_ "pmpaddr6" then
     match (string_drop _s682_ (projT1 (string_length "pmpaddr6"))) with | s_ => Some s_ end
   else None.

Definition _s676_ (_s677_ : string) : option string :=
   let _s678_ := _s677_ in
   if string_startswith _s678_ "pmpaddr5" then
     match (string_drop _s678_ (projT1 (string_length "pmpaddr5"))) with | s_ => Some s_ end
   else None.

Definition _s672_ (_s673_ : string) : option string :=
   let _s674_ := _s673_ in
   if string_startswith _s674_ "pmpaddr4" then
     match (string_drop _s674_ (projT1 (string_length "pmpaddr4"))) with | s_ => Some s_ end
   else None.

Definition _s668_ (_s669_ : string) : option string :=
   let _s670_ := _s669_ in
   if string_startswith _s670_ "pmpaddr3" then
     match (string_drop _s670_ (projT1 (string_length "pmpaddr3"))) with | s_ => Some s_ end
   else None.

Definition _s664_ (_s665_ : string) : option string :=
   let _s666_ := _s665_ in
   if string_startswith _s666_ "pmpaddr2" then
     match (string_drop _s666_ (projT1 (string_length "pmpaddr2"))) with | s_ => Some s_ end
   else None.

Definition _s660_ (_s661_ : string) : option string :=
   let _s662_ := _s661_ in
   if string_startswith _s662_ "pmpaddr1" then
     match (string_drop _s662_ (projT1 (string_length "pmpaddr1"))) with | s_ => Some s_ end
   else None.

Definition _s656_ (_s657_ : string) : option string :=
   let _s658_ := _s657_ in
   if string_startswith _s658_ "pmpaddr0" then
     match (string_drop _s658_ (projT1 (string_length "pmpaddr0"))) with | s_ => Some s_ end
   else None.

Definition _s652_ (_s653_ : string) : option string :=
   let _s654_ := _s653_ in
   if string_startswith _s654_ "pmpcfg3" then
     match (string_drop _s654_ (projT1 (string_length "pmpcfg3"))) with | s_ => Some s_ end
   else None.

Definition _s648_ (_s649_ : string) : option string :=
   let _s650_ := _s649_ in
   if string_startswith _s650_ "pmpcfg2" then
     match (string_drop _s650_ (projT1 (string_length "pmpcfg2"))) with | s_ => Some s_ end
   else None.

Definition _s644_ (_s645_ : string) : option string :=
   let _s646_ := _s645_ in
   if string_startswith _s646_ "pmpcfg1" then
     match (string_drop _s646_ (projT1 (string_length "pmpcfg1"))) with | s_ => Some s_ end
   else None.

Definition _s640_ (_s641_ : string) : option string :=
   let _s642_ := _s641_ in
   if string_startswith _s642_ "pmpcfg0" then
     match (string_drop _s642_ (projT1 (string_length "pmpcfg0"))) with | s_ => Some s_ end
   else None.

Definition _s636_ (_s637_ : string) : option string :=
   let _s638_ := _s637_ in
   if string_startswith _s638_ "mip" then
     match (string_drop _s638_ (projT1 (string_length "mip"))) with | s_ => Some s_ end
   else None.

Definition _s632_ (_s633_ : string) : option string :=
   let _s634_ := _s633_ in
   if string_startswith _s634_ "mtval" then
     match (string_drop _s634_ (projT1 (string_length "mtval"))) with | s_ => Some s_ end
   else None.

Definition _s628_ (_s629_ : string) : option string :=
   let _s630_ := _s629_ in
   if string_startswith _s630_ "mcause" then
     match (string_drop _s630_ (projT1 (string_length "mcause"))) with | s_ => Some s_ end
   else None.

Definition _s624_ (_s625_ : string) : option string :=
   let _s626_ := _s625_ in
   if string_startswith _s626_ "mepc" then
     match (string_drop _s626_ (projT1 (string_length "mepc"))) with | s_ => Some s_ end
   else None.

Definition _s620_ (_s621_ : string) : option string :=
   let _s622_ := _s621_ in
   if string_startswith _s622_ "mscratch" then
     match (string_drop _s622_ (projT1 (string_length "mscratch"))) with | s_ => Some s_ end
   else None.

Definition _s616_ (_s617_ : string) : option string :=
   let _s618_ := _s617_ in
   if string_startswith _s618_ "mcountinhibit" then
     match (string_drop _s618_ (projT1 (string_length "mcountinhibit"))) with | s_ => Some s_ end
   else None.

Definition _s612_ (_s613_ : string) : option string :=
   let _s614_ := _s613_ in
   if string_startswith _s614_ "mcounteren" then
     match (string_drop _s614_ (projT1 (string_length "mcounteren"))) with | s_ => Some s_ end
   else None.

Definition _s608_ (_s609_ : string) : option string :=
   let _s610_ := _s609_ in
   if string_startswith _s610_ "mtvec" then
     match (string_drop _s610_ (projT1 (string_length "mtvec"))) with | s_ => Some s_ end
   else None.

Definition _s604_ (_s605_ : string) : option string :=
   let _s606_ := _s605_ in
   if string_startswith _s606_ "mie" then
     match (string_drop _s606_ (projT1 (string_length "mie"))) with | s_ => Some s_ end
   else None.

Definition _s600_ (_s601_ : string) : option string :=
   let _s602_ := _s601_ in
   if string_startswith _s602_ "mideleg" then
     match (string_drop _s602_ (projT1 (string_length "mideleg"))) with | s_ => Some s_ end
   else None.

Definition _s596_ (_s597_ : string) : option string :=
   let _s598_ := _s597_ in
   if string_startswith _s598_ "medeleg" then
     match (string_drop _s598_ (projT1 (string_length "medeleg"))) with | s_ => Some s_ end
   else None.

Definition _s592_ (_s593_ : string) : option string :=
   let _s594_ := _s593_ in
   if string_startswith _s594_ "misa" then
     match (string_drop _s594_ (projT1 (string_length "misa"))) with | s_ => Some s_ end
   else None.

Definition _s588_ (_s589_ : string) : option string :=
   let _s590_ := _s589_ in
   if string_startswith _s590_ "mstatus" then
     match (string_drop _s590_ (projT1 (string_length "mstatus"))) with | s_ => Some s_ end
   else None.

Definition _s584_ (_s585_ : string) : option string :=
   let _s586_ := _s585_ in
   if string_startswith _s586_ "mhartid" then
     match (string_drop _s586_ (projT1 (string_length "mhartid"))) with | s_ => Some s_ end
   else None.

Definition _s580_ (_s581_ : string) : option string :=
   let _s582_ := _s581_ in
   if string_startswith _s582_ "mimpid" then
     match (string_drop _s582_ (projT1 (string_length "mimpid"))) with | s_ => Some s_ end
   else None.

Definition _s576_ (_s577_ : string) : option string :=
   let _s578_ := _s577_ in
   if string_startswith _s578_ "marchid" then
     match (string_drop _s578_ (projT1 (string_length "marchid"))) with | s_ => Some s_ end
   else None.

Definition _s572_ (_s573_ : string) : option string :=
   let _s574_ := _s573_ in
   if string_startswith _s574_ "mvendorid" then
     match (string_drop _s574_ (projT1 (string_length "mvendorid"))) with | s_ => Some s_ end
   else None.

Definition _s568_ (_s569_ : string) : option string :=
   let _s570_ := _s569_ in
   if string_startswith _s570_ "satp" then
     match (string_drop _s570_ (projT1 (string_length "satp"))) with | s_ => Some s_ end
   else None.

Definition _s564_ (_s565_ : string) : option string :=
   let _s566_ := _s565_ in
   if string_startswith _s566_ "sip" then
     match (string_drop _s566_ (projT1 (string_length "sip"))) with | s_ => Some s_ end
   else None.

Definition _s560_ (_s561_ : string) : option string :=
   let _s562_ := _s561_ in
   if string_startswith _s562_ "stval" then
     match (string_drop _s562_ (projT1 (string_length "stval"))) with | s_ => Some s_ end
   else None.

Definition _s556_ (_s557_ : string) : option string :=
   let _s558_ := _s557_ in
   if string_startswith _s558_ "scause" then
     match (string_drop _s558_ (projT1 (string_length "scause"))) with | s_ => Some s_ end
   else None.

Definition _s552_ (_s553_ : string) : option string :=
   let _s554_ := _s553_ in
   if string_startswith _s554_ "sepc" then
     match (string_drop _s554_ (projT1 (string_length "sepc"))) with | s_ => Some s_ end
   else None.

Definition _s548_ (_s549_ : string) : option string :=
   let _s550_ := _s549_ in
   if string_startswith _s550_ "sscratch" then
     match (string_drop _s550_ (projT1 (string_length "sscratch"))) with | s_ => Some s_ end
   else None.

Definition _s544_ (_s545_ : string) : option string :=
   let _s546_ := _s545_ in
   if string_startswith _s546_ "scounteren" then
     match (string_drop _s546_ (projT1 (string_length "scounteren"))) with | s_ => Some s_ end
   else None.

Definition _s540_ (_s541_ : string) : option string :=
   let _s542_ := _s541_ in
   if string_startswith _s542_ "stvec" then
     match (string_drop _s542_ (projT1 (string_length "stvec"))) with | s_ => Some s_ end
   else None.

Definition _s536_ (_s537_ : string) : option string :=
   let _s538_ := _s537_ in
   if string_startswith _s538_ "sie" then
     match (string_drop _s538_ (projT1 (string_length "sie"))) with | s_ => Some s_ end
   else None.

Definition _s532_ (_s533_ : string) : option string :=
   let _s534_ := _s533_ in
   if string_startswith _s534_ "sideleg" then
     match (string_drop _s534_ (projT1 (string_length "sideleg"))) with | s_ => Some s_ end
   else None.

Definition _s528_ (_s529_ : string) : option string :=
   let _s530_ := _s529_ in
   if string_startswith _s530_ "sedeleg" then
     match (string_drop _s530_ (projT1 (string_length "sedeleg"))) with | s_ => Some s_ end
   else None.

Definition _s524_ (_s525_ : string) : option string :=
   let _s526_ := _s525_ in
   if string_startswith _s526_ "sstatus" then
     match (string_drop _s526_ (projT1 (string_length "sstatus"))) with | s_ => Some s_ end
   else None.

Definition _s520_ (_s521_ : string) : option string :=
   let _s522_ := _s521_ in
   if string_startswith _s522_ "instreth" then
     match (string_drop _s522_ (projT1 (string_length "instreth"))) with | s_ => Some s_ end
   else None.

Definition _s516_ (_s517_ : string) : option string :=
   let _s518_ := _s517_ in
   if string_startswith _s518_ "timeh" then
     match (string_drop _s518_ (projT1 (string_length "timeh"))) with | s_ => Some s_ end
   else None.

Definition _s512_ (_s513_ : string) : option string :=
   let _s514_ := _s513_ in
   if string_startswith _s514_ "cycleh" then
     match (string_drop _s514_ (projT1 (string_length "cycleh"))) with | s_ => Some s_ end
   else None.

Definition _s508_ (_s509_ : string) : option string :=
   let _s510_ := _s509_ in
   if string_startswith _s510_ "instret" then
     match (string_drop _s510_ (projT1 (string_length "instret"))) with | s_ => Some s_ end
   else None.

Definition _s504_ (_s505_ : string) : option string :=
   let _s506_ := _s505_ in
   if string_startswith _s506_ "time" then
     match (string_drop _s506_ (projT1 (string_length "time"))) with | s_ => Some s_ end
   else None.

Definition _s500_ (_s501_ : string) : option string :=
   let _s502_ := _s501_ in
   if string_startswith _s502_ "cycle" then
     match (string_drop _s502_ (projT1 (string_length "cycle"))) with | s_ => Some s_ end
   else None.

Definition _s496_ (_s497_ : string) : option string :=
   let _s498_ := _s497_ in
   if string_startswith _s498_ "fcsr" then
     match (string_drop _s498_ (projT1 (string_length "fcsr"))) with | s_ => Some s_ end
   else None.

Definition _s492_ (_s493_ : string) : option string :=
   let _s494_ := _s493_ in
   if string_startswith _s494_ "frm" then
     match (string_drop _s494_ (projT1 (string_length "frm"))) with | s_ => Some s_ end
   else None.

Definition _s488_ (_s489_ : string) : option string :=
   let _s490_ := _s489_ in
   if string_startswith _s490_ "fflags" then
     match (string_drop _s490_ (projT1 (string_length "fflags"))) with | s_ => Some s_ end
   else None.

Definition _s484_ (_s485_ : string) : option string :=
   let _s486_ := _s485_ in
   if string_startswith _s486_ "uip" then
     match (string_drop _s486_ (projT1 (string_length "uip"))) with | s_ => Some s_ end
   else None.

Definition _s480_ (_s481_ : string) : option string :=
   let _s482_ := _s481_ in
   if string_startswith _s482_ "utval" then
     match (string_drop _s482_ (projT1 (string_length "utval"))) with | s_ => Some s_ end
   else None.

Definition _s476_ (_s477_ : string) : option string :=
   let _s478_ := _s477_ in
   if string_startswith _s478_ "ucause" then
     match (string_drop _s478_ (projT1 (string_length "ucause"))) with | s_ => Some s_ end
   else None.

Definition _s472_ (_s473_ : string) : option string :=
   let _s474_ := _s473_ in
   if string_startswith _s474_ "uepc" then
     match (string_drop _s474_ (projT1 (string_length "uepc"))) with | s_ => Some s_ end
   else None.

Definition _s468_ (_s469_ : string) : option string :=
   let _s470_ := _s469_ in
   if string_startswith _s470_ "uscratch" then
     match (string_drop _s470_ (projT1 (string_length "uscratch"))) with | s_ => Some s_ end
   else None.

Definition _s464_ (_s465_ : string) : option string :=
   let _s466_ := _s465_ in
   if string_startswith _s466_ "utvec" then
     match (string_drop _s466_ (projT1 (string_length "utvec"))) with | s_ => Some s_ end
   else None.

Definition _s460_ (_s461_ : string) : option string :=
   let _s462_ := _s461_ in
   if string_startswith _s462_ "uie" then
     match (string_drop _s462_ (projT1 (string_length "uie"))) with | s_ => Some s_ end
   else None.

Definition _s456_ (_s457_ : string) : option string :=
   let _s458_ := _s457_ in
   if string_startswith _s458_ "ustatus" then
     match (string_drop _s458_ (projT1 (string_length "ustatus"))) with | s_ => Some s_ end
   else None.

Definition csr_name_map_matches_prefix (arg_ : string)
: M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s459_ := arg_ in
   (if match (_s456_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s456_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"000"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s460_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s460_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"004"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s464_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s464_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"005"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s468_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s468_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"040"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s472_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s472_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"041"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s476_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s476_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"042"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s480_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s480_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"043"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s484_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s484_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"044"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s488_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s488_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"001"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s492_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s492_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"002"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s496_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s496_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"003"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s500_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s500_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"C00"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s504_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s504_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"C01"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s508_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s508_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"C02"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s512_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s512_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"C80"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s516_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s516_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"C81"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s520_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s520_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"C82"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s524_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s524_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"100"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s528_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s528_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"102"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s532_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s532_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"103"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s536_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s536_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"104"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s540_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s540_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"105"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s544_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s544_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"106"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s548_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s548_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"140"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s552_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s552_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"141"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s556_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s556_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"142"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s560_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s560_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"143"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s564_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s564_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"144"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s568_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s568_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"180"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s572_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s572_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"F11"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s576_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s576_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"F12"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s580_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s580_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"F13"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s584_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s584_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"F14"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s588_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s588_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"300"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s592_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s592_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"301"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s596_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s596_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"302"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s600_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s600_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"303"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s604_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s604_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"304"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s608_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s608_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"305"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s612_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s612_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"306"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s616_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s616_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"320"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s620_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s620_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"340"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s624_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s624_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"341"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s628_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s628_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"342"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s632_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s632_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"343"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s636_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s636_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"344"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s640_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s640_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"3A0"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s644_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s644_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"3A1"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s648_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s648_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"3A2"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s652_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s652_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"3A3"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s656_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s656_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"3B0"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s660_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s660_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"3B1"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s664_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s664_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"3B2"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s668_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s668_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"3B3"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s672_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s672_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"3B4"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s676_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s676_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"3B5"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s680_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s680_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"3B6"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s684_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s684_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"3B7"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s688_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s688_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"3B8"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s692_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s692_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"3B9"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s696_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s696_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"3BA"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s700_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s700_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"3BB"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s704_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s704_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"3BC"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s708_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s708_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"3BD"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s712_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s712_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"3BE"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s716_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s716_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"3BF"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s720_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s720_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"B00"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s724_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s724_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"B02"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s728_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s728_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"B80"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s732_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s732_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"B82"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s736_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s736_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"7A0"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s740_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s740_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"7A1"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s744_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s744_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"7A2"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s748_ _s459_) with | Some s_ => true | _ => false end then
      (match (_s748_ _s459_) with
       | Some s_ =>
          returnm (Some
                     (Ox"7A3"
                      : mword 12, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s752_ _s459_) with | Some (reg, s_) => true | _ => false end then
      (match (_s752_ _s459_) with
       | Some (reg, s_) =>
          returnm (Some
                     (reg, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((mword 12 * {n : Z & ArithFact (n >=? 0)}))).

Definition csr_name (csr : mword 12) : string := csr_name_map_forwards csr.

Definition ext_is_CSR_defined (b__0 : mword 12) (g__337 : Privilege) : M (bool) :=
   (if eq_vec b__0 (Ox"000"  : mword 12) then
      (and_boolM ((haveUsrMode tt)  : M (bool)) ((haveNExt tt)  : M (bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"004"  : mword 12) then
      (and_boolM ((haveUsrMode tt)  : M (bool)) ((haveNExt tt)  : M (bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"005"  : mword 12) then
      (and_boolM ((haveUsrMode tt)  : M (bool)) ((haveNExt tt)  : M (bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"040"  : mword 12) then
      (and_boolM ((haveUsrMode tt)  : M (bool)) ((haveNExt tt)  : M (bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"041"  : mword 12) then
      (and_boolM ((haveUsrMode tt)  : M (bool)) ((haveNExt tt)  : M (bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"042"  : mword 12) then
      (and_boolM ((haveUsrMode tt)  : M (bool)) ((haveNExt tt)  : M (bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"043"  : mword 12) then
      (and_boolM ((haveUsrMode tt)  : M (bool)) ((haveNExt tt)  : M (bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"044"  : mword 12) then
      (and_boolM ((haveUsrMode tt)  : M (bool)) ((haveNExt tt)  : M (bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"001"  : mword 12) then
      (or_boolM ((haveFExt tt)  : M (bool)) ((haveDExt tt)  : M (bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"002"  : mword 12) then
      (or_boolM ((haveFExt tt)  : M (bool)) ((haveDExt tt)  : M (bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"003"  : mword 12) then
      (or_boolM ((haveFExt tt)  : M (bool)) ((haveDExt tt)  : M (bool)))
       : M (bool)
    else returnm false)
    : M (bool).

Definition ext_read_CSR (b__0 : mword 12) : M (option (mword 64)) :=
   (if eq_vec b__0 (Ox"000"  : mword 12) then
      read_reg mstatus_ref >>= fun w__0 : Mstatus =>
      returnm (Some (_get_Ustatus_bits (lower_sstatus (lower_mstatus w__0))))
    else if eq_vec b__0 (Ox"004"  : mword 12) then
      read_reg mie_ref >>= fun w__1 : Minterrupts =>
      read_reg mideleg_ref >>= fun w__2 : Minterrupts =>
      read_reg sideleg_ref >>= fun w__3 : Sinterrupts =>
      returnm (Some (_get_Uinterrupts_bits (lower_sie (lower_mie w__1 w__2) w__3)))
    else if eq_vec b__0 (Ox"005"  : mword 12) then
      (get_utvec tt) >>= fun w__4 : mword 64 => returnm (Some w__4)
    else if eq_vec b__0 (Ox"040"  : mword 12) then
      ((read_reg uscratch_ref)  : M (mword 64)) >>= fun w__5 : mword 64 => returnm (Some w__5)
    else if eq_vec b__0 (Ox"041"  : mword 12) then
      (get_xret_target User) >>= fun w__6 : mword 64 =>
      (pc_alignment_mask tt) >>= fun w__7 : mword 64 => returnm (Some (and_vec w__6 w__7))
    else if eq_vec b__0 (Ox"042"  : mword 12) then
      read_reg ucause_ref >>= fun w__8 : Mcause => returnm (Some (_get_Mcause_bits w__8))
    else if eq_vec b__0 (Ox"043"  : mword 12) then
      ((read_reg utval_ref)  : M (mword 64)) >>= fun w__9 : mword 64 => returnm (Some w__9)
    else if eq_vec b__0 (Ox"044"  : mword 12) then
      read_reg mip_ref >>= fun w__10 : Minterrupts =>
      read_reg mideleg_ref >>= fun w__11 : Minterrupts =>
      read_reg sideleg_ref >>= fun w__12 : Sinterrupts =>
      returnm (Some (_get_Uinterrupts_bits (lower_sip (lower_mip w__10 w__11) w__12)))
    else if eq_vec b__0 (Ox"001"  : mword 12) then
      read_reg fcsr_ref >>= fun w__13 : Fcsr => returnm (Some (EXTZ 64 (_get_Fcsr_FFLAGS w__13)))
    else if eq_vec b__0 (Ox"002"  : mword 12) then
      read_reg fcsr_ref >>= fun w__14 : Fcsr => returnm (Some (EXTZ 64 (_get_Fcsr_FRM w__14)))
    else if eq_vec b__0 (Ox"003"  : mword 12) then
      read_reg fcsr_ref >>= fun w__15 : Fcsr => returnm (Some (EXTZ 64 (_get_Fcsr_bits w__15)))
    else returnm None)
    : M (option (mword 64)).

Definition ext_write_CSR (b__0 : mword 12) (value : mword 64) : M (option (mword 64)) :=
   (if eq_vec b__0 (Ox"000"  : mword 12) then
      read_reg mstatus_ref >>= fun w__0 : Mstatus =>
      (legalize_ustatus w__0 value) >>= fun w__1 : Mstatus =>
      write_reg mstatus_ref w__1 >>
      read_reg mstatus_ref >>= fun w__2 : Mstatus => returnm (Some (_get_Mstatus_bits w__2))
    else if eq_vec b__0 (Ox"004"  : mword 12) then
      read_reg mie_ref >>= fun w__3 : Minterrupts =>
      read_reg mideleg_ref >>= fun w__4 : Minterrupts =>
      read_reg sideleg_ref >>= fun w__5 : Sinterrupts =>
      let sie := legalize_uie (lower_mie w__3 w__4) w__5 value in
      read_reg mie_ref >>= fun w__6 : Minterrupts =>
      read_reg mideleg_ref >>= fun w__7 : Minterrupts =>
      (lift_sie w__6 w__7 sie) >>= fun w__8 : Minterrupts =>
      write_reg mie_ref w__8 >>
      read_reg mie_ref >>= fun w__9 : Minterrupts => returnm (Some (_get_Minterrupts_bits w__9))
    else if eq_vec b__0 (Ox"005"  : mword 12) then
      (set_utvec value) >>= fun w__10 : mword 64 => returnm (Some w__10)
    else if eq_vec b__0 (Ox"040"  : mword 12) then
      write_reg uscratch_ref value >>
      ((read_reg uscratch_ref)  : M (mword 64)) >>= fun w__11 : mword 64 => returnm (Some w__11)
    else if eq_vec b__0 (Ox"041"  : mword 12) then
      (set_xret_target User value) >>= fun w__12 : mword 64 => returnm (Some w__12)
    else if eq_vec b__0 (Ox"042"  : mword 12) then
      (_set_Mcause_bits ucause_ref value) >>
      read_reg ucause_ref >>= fun w__13 : Mcause => returnm (Some (_get_Mcause_bits w__13))
    else if eq_vec b__0 (Ox"043"  : mword 12) then
      write_reg utval_ref value >>
      ((read_reg utval_ref)  : M (mword 64)) >>= fun w__14 : mword 64 => returnm (Some w__14)
    else if eq_vec b__0 (Ox"044"  : mword 12) then
      read_reg mip_ref >>= fun w__15 : Minterrupts =>
      read_reg mideleg_ref >>= fun w__16 : Minterrupts =>
      read_reg sideleg_ref >>= fun w__17 : Sinterrupts =>
      let sip := legalize_uip (lower_mip w__15 w__16) w__17 value in
      read_reg mip_ref >>= fun w__18 : Minterrupts =>
      read_reg mideleg_ref >>= fun w__19 : Minterrupts =>
      (lift_sip w__18 w__19 sip) >>= fun w__20 : Minterrupts =>
      write_reg mip_ref w__20 >>
      read_reg mip_ref >>= fun w__21 : Minterrupts => returnm (Some (_get_Minterrupts_bits w__21))
    else if eq_vec b__0 (Ox"001"  : mword 12) then
      read_reg fcsr_ref >>= fun w__22 : Fcsr =>
      (ext_write_fcsr (_get_Fcsr_FRM w__22) (subrange_vec_dec value 4 0)) >>
      read_reg fcsr_ref >>= fun w__23 : Fcsr => returnm (Some (EXTZ 64 (_get_Fcsr_FFLAGS w__23)))
    else if eq_vec b__0 (Ox"002"  : mword 12) then
      read_reg fcsr_ref >>= fun w__24 : Fcsr =>
      (ext_write_fcsr (subrange_vec_dec value 2 0) (_get_Fcsr_FFLAGS w__24)) >>
      read_reg fcsr_ref >>= fun w__25 : Fcsr => returnm (Some (EXTZ 64 (_get_Fcsr_FRM w__25)))
    else if eq_vec b__0 (Ox"003"  : mword 12) then
      (ext_write_fcsr (subrange_vec_dec value 7 5) (subrange_vec_dec value 4 0)) >>
      read_reg fcsr_ref >>= fun w__26 : Fcsr => returnm (Some (EXTZ 64 (_get_Fcsr_bits w__26)))
    else returnm None)
    : M (option (mword 64)).

Definition csrAccess (csr : mword 12) : mword 2 := subrange_vec_dec csr 11 10.

Definition csrPriv (csr : mword 12) : mword 2 := subrange_vec_dec csr 9 8.

Definition is_CSR_defined (csr : mword 12) (p : Privilege) : M (bool) :=
   let b__0 := csr in
   (if eq_vec b__0 (Ox"F11"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"F12"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"F13"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"F14"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"300"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"301"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"302"  : mword 12) then
      (and_boolM (returnm ((generic_eq p Machine)  : bool))
         ((or_boolM ((haveSupMode tt)  : M (bool)) ((haveNExt tt)  : M (bool)))
          : M (bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"303"  : mword 12) then
      (and_boolM (returnm ((generic_eq p Machine)  : bool))
         ((or_boolM ((haveSupMode tt)  : M (bool)) ((haveNExt tt)  : M (bool)))
          : M (bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"304"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"305"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"306"  : mword 12) then
      (and_boolM (returnm ((generic_eq p Machine)  : bool)) ((haveUsrMode tt)  : M (bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"310"  : mword 12) then
      returnm (andb (generic_eq p Machine) (Z.eqb 64 32))
    else if eq_vec b__0 (Ox"320"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"340"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"341"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"342"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"343"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"344"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"3A0"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"3A1"  : mword 12) then
      returnm (andb (generic_eq p Machine) (Z.eqb 64 32))
    else if eq_vec b__0 (Ox"3A2"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"3A3"  : mword 12) then
      returnm (andb (generic_eq p Machine) (Z.eqb 64 32))
    else if eq_vec b__0 (Ox"3B0"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"3B1"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"3B2"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"3B3"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"3B4"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"3B5"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"3B6"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"3B7"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"3B8"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"3B9"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"3BA"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"3BB"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"3BC"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"3BD"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"3BE"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"3BF"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"B00"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"B02"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"B80"  : mword 12) then
      returnm (andb (generic_eq p Machine) (Z.eqb 64 32))
    else if eq_vec b__0 (Ox"B82"  : mword 12) then
      returnm (andb (generic_eq p Machine) (Z.eqb 64 32))
    else if eq_vec b__0 (Ox"7A0"  : mword 12) then returnm (generic_eq p Machine)
    else if eq_vec b__0 (Ox"100"  : mword 12) then
      (and_boolM ((haveSupMode tt)  : M (bool))
         (returnm ((orb (generic_eq p Machine) (generic_eq p Supervisor))  : bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"102"  : mword 12) then
      (and_boolM ((haveSupMode tt)  : M (bool))
         ((and_boolM ((haveNExt tt)  : M (bool))
             (returnm ((orb (generic_eq p Machine) (generic_eq p Supervisor))  : bool)))
          : M (bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"103"  : mword 12) then
      (and_boolM ((haveSupMode tt)  : M (bool))
         ((and_boolM ((haveNExt tt)  : M (bool))
             (returnm ((orb (generic_eq p Machine) (generic_eq p Supervisor))  : bool)))
          : M (bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"104"  : mword 12) then
      (and_boolM ((haveSupMode tt)  : M (bool))
         (returnm ((orb (generic_eq p Machine) (generic_eq p Supervisor))  : bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"105"  : mword 12) then
      (and_boolM ((haveSupMode tt)  : M (bool))
         (returnm ((orb (generic_eq p Machine) (generic_eq p Supervisor))  : bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"106"  : mword 12) then
      (and_boolM ((haveSupMode tt)  : M (bool))
         (returnm ((orb (generic_eq p Machine) (generic_eq p Supervisor))  : bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"140"  : mword 12) then
      (and_boolM ((haveSupMode tt)  : M (bool))
         (returnm ((orb (generic_eq p Machine) (generic_eq p Supervisor))  : bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"141"  : mword 12) then
      (and_boolM ((haveSupMode tt)  : M (bool))
         (returnm ((orb (generic_eq p Machine) (generic_eq p Supervisor))  : bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"142"  : mword 12) then
      (and_boolM ((haveSupMode tt)  : M (bool))
         (returnm ((orb (generic_eq p Machine) (generic_eq p Supervisor))  : bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"143"  : mword 12) then
      (and_boolM ((haveSupMode tt)  : M (bool))
         (returnm ((orb (generic_eq p Machine) (generic_eq p Supervisor))  : bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"144"  : mword 12) then
      (and_boolM ((haveSupMode tt)  : M (bool))
         (returnm ((orb (generic_eq p Machine) (generic_eq p Supervisor))  : bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"180"  : mword 12) then
      (and_boolM ((haveSupMode tt)  : M (bool))
         (returnm ((orb (generic_eq p Machine) (generic_eq p Supervisor))  : bool)))
       : M (bool)
    else if eq_vec b__0 (Ox"C00"  : mword 12) then (haveUsrMode tt)  : M (bool)
    else if eq_vec b__0 (Ox"C01"  : mword 12) then (haveUsrMode tt)  : M (bool)
    else if eq_vec b__0 (Ox"C02"  : mword 12) then (haveUsrMode tt)  : M (bool)
    else if eq_vec b__0 (Ox"C80"  : mword 12) then
      projT1_m
      ((and_boolMP (build_trivial_ex ((haveUsrMode tt)  : M (bool)))
          ((returnm (build_ex
            (projT1
            (build_ex
            (Z.eqb 64 32)
             : {_bool : bool & ArithFact (Bool.eqb (64 =? 32) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
            32) _bool)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
        (64 =? 32)) _bool = true)}))
       : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 && (64 =? 32)) _bool = true)}))
    else if eq_vec b__0 (Ox"C81"  : mword 12) then
      projT1_m
      ((and_boolMP (build_trivial_ex ((haveUsrMode tt)  : M (bool)))
          ((returnm (build_ex
            (projT1
            (build_ex
            (Z.eqb 64 32)
             : {_bool : bool & ArithFact (Bool.eqb (64 =? 32) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
            32) _bool)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
        (64 =? 32)) _bool = true)}))
       : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 && (64 =? 32)) _bool = true)}))
    else if eq_vec b__0 (Ox"C82"  : mword 12) then
      projT1_m
      ((and_boolMP (build_trivial_ex ((haveUsrMode tt)  : M (bool)))
          ((returnm (build_ex
            (projT1
            (build_ex
            (Z.eqb 64 32)
             : {_bool : bool & ArithFact (Bool.eqb (64 =? 32) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
            32) _bool)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
        (64 =? 32)) _bool = true)}))
       : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 && (64 =? 32)) _bool = true)}))
    else (ext_is_CSR_defined csr p)  : M (bool))
    : M (bool).

Definition check_CSR_access (csrrw : mword 2) (csrpr : mword 2) (p : Privilege) (isWrite : bool)
: bool :=
   andb (negb (andb (Bool.eqb isWrite true) (eq_vec csrrw ('b"11"  : mword 2))))
     (zopz0zKzJ_u (privLevel_to_bits p) csrpr).

Definition check_TVM_SATP (csr : mword 12) (p : Privilege) : M (bool) :=
   (and_boolM (returnm ((eq_vec csr (Ox"180"  : mword 12))  : bool))
      ((and_boolM (returnm ((generic_eq p Supervisor)  : bool))
          (read_reg mstatus_ref >>= fun w__0 : Mstatus =>
           returnm ((eq_vec (_get_Mstatus_TVM w__0) ('b"1"  : mword 1))  : bool)))
       : M (bool))) >>= fun w__2 : bool =>
   returnm (negb w__2).

Definition check_Counteren (csr : mword 12) (p : Privilege) : M (bool) :=
   (match (csr, p) with
    | (b__0, Supervisor) =>
       (if eq_vec b__0 (Ox"C00"  : mword 12) then
          read_reg mcounteren_ref >>= fun w__0 : Counteren =>
          returnm (eq_vec (_get_Counteren_CY w__0) ('b"1"  : mword 1))
        else if eq_vec b__0 (Ox"C01"  : mword 12) then
          read_reg mcounteren_ref >>= fun w__1 : Counteren =>
          returnm (eq_vec (_get_Counteren_TM w__1) ('b"1"  : mword 1))
        else if eq_vec b__0 (Ox"C02"  : mword 12) then
          read_reg mcounteren_ref >>= fun w__2 : Counteren =>
          returnm (eq_vec (_get_Counteren_IR w__2) ('b"1"  : mword 1))
        else
          returnm (match (b__0, Supervisor) with
                   | (_, _) =>
                      if andb (zopz0zIzJ_u (Ox"C03"  : mword 12) csr)
                           (zopz0zIzJ_u csr (Ox"C1F"  : mword 12)) then
                        false
                      else true
                   end))
        : M (bool)
    | (b__3, User) =>
       (if eq_vec b__3 (Ox"C00"  : mword 12) then
          (and_boolM
             (read_reg mcounteren_ref >>= fun w__6 : Counteren =>
              returnm ((eq_vec (_get_Counteren_CY w__6) ('b"1"  : mword 1))  : bool))
             ((or_boolM ((haveSupMode tt) >>= fun w__7 : bool => returnm ((negb w__7)  : bool))
                 (read_reg scounteren_ref >>= fun w__8 : Counteren =>
                  returnm ((eq_vec (_get_Counteren_CY w__8) ('b"1"  : mword 1))  : bool)))
              : M (bool)))
           : M (bool)
        else if eq_vec b__3 (Ox"C01"  : mword 12) then
          (and_boolM
             (read_reg mcounteren_ref >>= fun w__11 : Counteren =>
              returnm ((eq_vec (_get_Counteren_TM w__11) ('b"1"  : mword 1))  : bool))
             ((or_boolM ((haveSupMode tt) >>= fun w__12 : bool => returnm ((negb w__12)  : bool))
                 (read_reg scounteren_ref >>= fun w__13 : Counteren =>
                  returnm ((eq_vec (_get_Counteren_TM w__13) ('b"1"  : mword 1))  : bool)))
              : M (bool)))
           : M (bool)
        else if eq_vec b__3 (Ox"C02"  : mword 12) then
          (and_boolM
             (read_reg mcounteren_ref >>= fun w__16 : Counteren =>
              returnm ((eq_vec (_get_Counteren_IR w__16) ('b"1"  : mword 1))  : bool))
             ((or_boolM ((haveSupMode tt) >>= fun w__17 : bool => returnm ((negb w__17)  : bool))
                 (read_reg scounteren_ref >>= fun w__18 : Counteren =>
                  returnm ((eq_vec (_get_Counteren_IR w__18) ('b"1"  : mword 1))  : bool)))
              : M (bool)))
           : M (bool)
        else
          returnm (match (b__3, User) with
                   | (_, _) =>
                      if andb (zopz0zIzJ_u (Ox"C03"  : mword 12) csr)
                           (zopz0zIzJ_u csr (Ox"C1F"  : mword 12)) then
                        false
                      else true
                   end))
        : M (bool)
    | (_, _) =>
       returnm (if andb (zopz0zIzJ_u (Ox"C03"  : mword 12) csr)
                     (zopz0zIzJ_u csr (Ox"C1F"  : mword 12)) then
                  false
                else true)
    end)
    : M (bool).

Definition check_CSR (csr : mword 12) (p : Privilege) (isWrite : bool) : M (bool) :=
   (and_boolM ((is_CSR_defined csr p)  : M (bool))
      ((and_boolM (returnm ((check_CSR_access (csrAccess csr) (csrPriv csr) p isWrite)  : bool))
          ((and_boolM ((check_TVM_SATP csr p)  : M (bool)) ((check_Counteren csr p)  : M (bool)))
           : M (bool)))
       : M (bool)))
    : M (bool).

Axiom speculate_conditional : forall  (_ : unit) , M (bool).

Axiom load_reservation : forall  (_ : mword 64) , unit.

Axiom match_reservation : forall  (_ : mword 64) , bool.

Axiom cancel_reservation : forall  (_ : unit) , unit.

Definition exception_delegatee (e : ExceptionType) (p : Privilege) : M (Privilege) :=
   let idx := projT1 (num_of_ExceptionType e) in
   read_reg medeleg_ref >>= fun w__0 : Medeleg =>
   (bit_to_bool (access_vec_dec (_get_Medeleg_bits w__0) idx)) >>= fun super =>
   (haveSupMode tt) >>= fun w__1 : bool =>
   (if sumbool_of_bool w__1 then
      and_boolMP
        ((returnm (build_ex super)) : M ({_bool : bool & ArithFact (Bool.eqb super _bool)}))
        (build_trivial_ex
        ((and_boolM ((haveNExt tt)  : M (bool))
            (read_reg sedeleg_ref >>= fun w__3 : Sedeleg =>
             (bit_to_bool (access_vec_dec (_get_Sedeleg_bits w__3) idx))
              : M (bool)))
         : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (super && simp_0) _bool = true)})
    else
      and_boolMP
        ((returnm (build_ex super)) : M ({_bool : bool & ArithFact (Bool.eqb super _bool)}))
        (build_trivial_ex
        ((haveNExt tt)
         : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (super && simp_0) _bool = true)})) >>= fun '(existT _ user _) =>
   (and_boolMP (build_trivial_ex ((haveUsrMode tt)  : M (bool)))
      ((returnm (build_ex user)) : M ({_bool : bool & ArithFact (Bool.eqb user _bool)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (user &&
     simp_0) _bool = true)})) >>= fun '(existT _ w__10 _) =>
   (if sumbool_of_bool w__10 then returnm User
    else
      (and_boolMP (build_trivial_ex ((haveSupMode tt)  : M (bool)))
         ((returnm (build_ex super)) : M ({_bool : bool & ArithFact (Bool.eqb super _bool)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (super &&
        simp_0) _bool = true)})) >>= fun '(existT _ w__12 _) =>
      returnm (if sumbool_of_bool w__12 then Supervisor else Machine)) >>= fun deleg =>
   returnm (if zopz0zI_u (privLevel_to_bits deleg) (privLevel_to_bits p) then p else deleg).

Definition findPendingInterrupt (ip : mword 64) : option InterruptType :=
   let ip := Mk_Minterrupts ip in
   if eq_vec (_get_Minterrupts_MEI ip) ('b"1"  : mword 1) then Some I_M_External
   else if eq_vec (_get_Minterrupts_MSI ip) ('b"1"  : mword 1) then Some I_M_Software
   else if eq_vec (_get_Minterrupts_MTI ip) ('b"1"  : mword 1) then Some I_M_Timer
   else if eq_vec (_get_Minterrupts_SEI ip) ('b"1"  : mword 1) then Some I_S_External
   else if eq_vec (_get_Minterrupts_SSI ip) ('b"1"  : mword 1) then Some I_S_Software
   else if eq_vec (_get_Minterrupts_STI ip) ('b"1"  : mword 1) then Some I_S_Timer
   else if eq_vec (_get_Minterrupts_UEI ip) ('b"1"  : mword 1) then Some I_U_External
   else if eq_vec (_get_Minterrupts_USI ip) ('b"1"  : mword 1) then Some I_U_Software
   else if eq_vec (_get_Minterrupts_UTI ip) ('b"1"  : mword 1) then Some I_U_Timer
   else None.

Definition processPending
(xip : Minterrupts) (xie : Minterrupts) (xideleg : mword 64) (priv_enabled : bool)
: interrupt_set :=
   let effective_pend :=
     and_vec (_get_Minterrupts_bits xip) (and_vec (_get_Minterrupts_bits xie) (not_vec xideleg)) in
   let effective_delg := and_vec (_get_Minterrupts_bits xip) xideleg in
   if sumbool_of_bool (andb priv_enabled (neq_vec effective_pend (EXTZ 64 ('b"0"  : mword 1)))) then
     Ints_Pending effective_pend
   else if neq_vec effective_delg (EXTZ 64 ('b"0"  : mword 1)) then Ints_Delegated effective_delg
   else Ints_Empty tt.

Definition getPendingSet (priv : Privilege) : M (option ((mword 64 * Privilege))) :=
   (haveUsrMode tt) >>= fun w__0 : bool =>
   assert_exp' w__0 "no user mode: M/U or M/S/U system required" >>= fun _ =>
   read_reg mip_ref >>= fun w__1 : Minterrupts =>
   read_reg mie_ref >>= fun w__2 : Minterrupts =>
   let effective_pending := and_vec (_get_Minterrupts_bits w__1) (_get_Minterrupts_bits w__2) in
   (if eq_vec effective_pending (EXTZ 64 ('b"0"  : mword 1)) then returnm None
    else
      (or_boolM (returnm ((generic_neq priv Machine)  : bool))
         ((and_boolM (returnm ((generic_eq priv Machine)  : bool))
             (read_reg mstatus_ref >>= fun w__3 : Mstatus =>
              returnm ((eq_vec (_get_Mstatus_MIE w__3) ('b"1"  : mword 1))  : bool)))
          : M (bool))) >>= fun mIE =>
      (and_boolM ((haveSupMode tt)  : M (bool))
         ((or_boolM (returnm ((generic_eq priv User)  : bool))
             ((and_boolM (returnm ((generic_eq priv Supervisor)  : bool))
                 (read_reg mstatus_ref >>= fun w__6 : Mstatus =>
                  returnm ((eq_vec (_get_Mstatus_SIE w__6) ('b"1"  : mword 1))  : bool)))
              : M (bool)))
          : M (bool))) >>= fun sIE =>
      (and_boolM ((haveNExt tt)  : M (bool))
         ((and_boolM (returnm ((generic_eq priv User)  : bool))
             (read_reg mstatus_ref >>= fun w__10 : Mstatus =>
              returnm ((eq_vec (_get_Mstatus_UIE w__10) ('b"1"  : mword 1))  : bool)))
          : M (bool))) >>= fun uIE =>
      read_reg mip_ref >>= fun w__12 : Minterrupts =>
      read_reg mie_ref >>= fun w__13 : Minterrupts =>
      read_reg mideleg_ref >>= fun w__14 : Minterrupts =>
      (match (processPending w__12 w__13 (_get_Minterrupts_bits w__14) mIE) with
       | Ints_Empty tt => returnm None
       | Ints_Pending p =>
          let r := (p, Machine) in
          returnm (Some r)
       | Ints_Delegated d =>
          (haveSupMode tt) >>= fun w__15 : bool =>
          (if sumbool_of_bool (negb w__15) then
             returnm (if sumbool_of_bool uIE then
                        let r := (d, User) in
                        Some r
                      else None)
           else
             read_reg mie_ref >>= fun w__16 : Minterrupts =>
             read_reg sideleg_ref >>= fun w__17 : Sinterrupts =>
             returnm (match (processPending (Mk_Minterrupts d) w__16 (_get_Sinterrupts_bits w__17)
                               sIE) with
                      | Ints_Empty tt => None
                      | Ints_Pending p =>
                         let r := (p, Supervisor) in
                         Some r
                      | Ints_Delegated d =>
                         if sumbool_of_bool uIE then
                           let r := (d, User) in
                           Some r
                         else None
                      end))
           : M (option ((mword 64 * Privilege)))
       end)
       : M (option ((mword 64 * Privilege))))
    : M (option ((mword 64 * Privilege))).

Definition dispatchInterrupt (priv : Privilege) : M (option ((InterruptType * Privilege))) :=
   (or_boolM ((haveUsrMode tt) >>= fun w__0 : bool => returnm ((negb w__0)  : bool))
      ((and_boolM ((haveSupMode tt) >>= fun w__1 : bool => returnm ((negb w__1)  : bool))
          ((haveNExt tt) >>= fun w__2 : bool => returnm ((negb w__2)  : bool)))
       : M (bool))) >>= fun w__4 : bool =>
   (if sumbool_of_bool w__4 then
      assert_exp (generic_eq priv Machine) "invalid current privilege" >>
      read_reg mip_ref >>= fun w__5 : Minterrupts =>
      read_reg mie_ref >>= fun w__6 : Minterrupts =>
      let enabled_pending := and_vec (_get_Minterrupts_bits w__5) (_get_Minterrupts_bits w__6) in
      returnm (match (findPendingInterrupt enabled_pending) with
               | Some i =>
                  let r := (i, Machine) in
                  Some r
               | None => None
               end)
    else
      (getPendingSet priv) >>= fun w__7 : option ((mword 64 * Privilege)) =>
      returnm (match w__7 with
               | None => None
               | Some (ip, p) =>
                  match (findPendingInterrupt ip) with
                  | None => None
                  | Some i =>
                     let r := (i, p) in
                     Some r
                  end
               end))
    : M (option ((InterruptType * Privilege))).

Definition tval (excinfo : option (mword 64)) : mword 64 :=
   match excinfo with | Some e => e | None => EXTZ 64 ('b"0"  : mword 1) end.

Definition rvfi_trap '(tt : unit) : unit := tt.

Definition trap_handler
(del_priv : Privilege) (intr : bool) (c : mword 8) (pc : mword 64) (info : option (mword 64))
(ext : option unit)
: M (mword 64) :=
   let '_ := (rvfi_trap tt)  : unit in
   let '_ :=
     (if get_config_print_platform tt then
        print_endline
          (String.append "handling "
             (String.append (if sumbool_of_bool intr then "int#" else "exc#")
                (String.append (string_of_bits c)
                   (String.append " at priv "
                      (String.append (privLevel_to_str del_priv)
                         (String.append " with tval " (string_of_bits (tval info))))))))
      else tt)
      : unit in
   let '_ := (cancel_reservation tt)  : unit in
   (match del_priv with
    | Machine =>
       (_set_Mcause_IsInterrupt mcause_ref (bool_to_bits intr)) >>
       (_set_Mcause_Cause mcause_ref (EXTZ 63 c)) >>
       read_reg mstatus_ref >>= fun w__0 : Mstatus =>
       (_set_Mstatus_MPIE mstatus_ref (_get_Mstatus_MIE w__0)) >>
       (_set_Mstatus_MIE mstatus_ref ('b"0"  : mword 1)) >>
       read_reg cur_privilege_ref >>= fun w__1 : Privilege =>
       (_set_Mstatus_MPP mstatus_ref (privLevel_to_bits w__1)) >>
       write_reg mtval_ref (tval info) >>
       write_reg mepc_ref pc >>
       write_reg cur_privilege_ref del_priv >>
       let '_ := (handle_trap_extension del_priv pc ext)  : unit in
       (if get_config_print_reg tt then
          read_reg mstatus_ref >>= fun w__2 : Mstatus =>
          returnm (print_endline
                     (String.append "CSR mstatus <- " (string_of_bits (_get_Mstatus_bits w__2))))
        else returnm tt) >>
       read_reg mcause_ref >>= fun w__3 : Mcause =>
       (prepare_trap_vector del_priv w__3)
        : M (mword 64)
    | Supervisor =>
       (haveSupMode tt) >>= fun w__5 : bool =>
       assert_exp' w__5 "no supervisor mode present for delegation" >>= fun _ =>
       (_set_Mcause_IsInterrupt scause_ref (bool_to_bits intr)) >>
       (_set_Mcause_Cause scause_ref (EXTZ 63 c)) >>
       read_reg mstatus_ref >>= fun w__6 : Mstatus =>
       (_set_Mstatus_SPIE mstatus_ref (_get_Mstatus_SIE w__6)) >>
       (_set_Mstatus_SIE mstatus_ref ('b"0"  : mword 1)) >>
       read_reg cur_privilege_ref >>= fun w__7 : Privilege =>
       (match w__7 with
        | User => returnm ('b"0"  : mword 1)
        | Supervisor => returnm ('b"1"  : mword 1)
        | Machine => (internal_error "invalid privilege for s-mode trap")  : M (mword 1)
        end) >>= fun w__9 : mword 1 =>
       (_set_Mstatus_SPP mstatus_ref w__9) >>
       write_reg stval_ref (tval info) >>
       write_reg sepc_ref pc >>
       write_reg cur_privilege_ref del_priv >>
       let '_ := (handle_trap_extension del_priv pc ext)  : unit in
       (if get_config_print_reg tt then
          read_reg mstatus_ref >>= fun w__10 : Mstatus =>
          returnm (print_endline
                     (String.append "CSR mstatus <- " (string_of_bits (_get_Mstatus_bits w__10))))
        else returnm tt) >>
       read_reg scause_ref >>= fun w__11 : Mcause =>
       (prepare_trap_vector del_priv w__11)
        : M (mword 64)
    | User =>
       (haveUsrMode tt) >>= fun w__13 : bool =>
       assert_exp' w__13 "no user mode present for delegation" >>= fun _ =>
       (_set_Mcause_IsInterrupt ucause_ref (bool_to_bits intr)) >>
       (_set_Mcause_Cause ucause_ref (EXTZ 63 c)) >>
       read_reg mstatus_ref >>= fun w__14 : Mstatus =>
       (_set_Mstatus_UPIE mstatus_ref (_get_Mstatus_UIE w__14)) >>
       (_set_Mstatus_UIE mstatus_ref ('b"0"  : mword 1)) >>
       write_reg utval_ref (tval info) >>
       write_reg uepc_ref pc >>
       write_reg cur_privilege_ref del_priv >>
       let '_ := (handle_trap_extension del_priv pc ext)  : unit in
       (if get_config_print_reg tt then
          read_reg mstatus_ref >>= fun w__15 : Mstatus =>
          returnm (print_endline
                     (String.append "CSR mstatus <- " (string_of_bits (_get_Mstatus_bits w__15))))
        else returnm tt) >>
       read_reg ucause_ref >>= fun w__16 : Mcause =>
       (prepare_trap_vector del_priv w__16)
        : M (mword 64)
    end)
    : M (mword 64).

Definition exception_handler (cur_priv : Privilege) (ctl : ctl_result) (pc : mword 64)
: M (mword 64) :=
   (match (cur_priv, ctl) with
    | (_, CTL_TRAP e) =>
       (exception_delegatee e.(sync_exception_trap) cur_priv) >>= fun del_priv =>
       let '_ :=
         (if get_config_print_platform tt then
            print_endline
              (String.append "trapping from "
                 (String.append (privLevel_to_str cur_priv)
                    (String.append " to "
                       (String.append (privLevel_to_str del_priv)
                          (String.append " to handle "
                             (exceptionType_to_str e.(sync_exception_trap)))))))
          else tt)
          : unit in
       (trap_handler del_priv false (exceptionType_to_bits e.(sync_exception_trap)) pc
          e.(sync_exception_excinfo) e.(sync_exception_ext))
        : M (mword 64)
    | (_, CTL_MRET tt) =>
       read_reg cur_privilege_ref >>= fun prev_priv =>
       read_reg mstatus_ref >>= fun w__1 : Mstatus =>
       (_set_Mstatus_MIE mstatus_ref (_get_Mstatus_MPIE w__1)) >>
       (_set_Mstatus_MPIE mstatus_ref ('b"1"  : mword 1)) >>
       read_reg mstatus_ref >>= fun w__2 : Mstatus =>
       (privLevel_of_bits (_get_Mstatus_MPP w__2)) >>= fun w__3 : Privilege =>
       write_reg cur_privilege_ref w__3 >>
       (haveUsrMode tt) >>= fun w__4 : bool =>
       (_set_Mstatus_MPP mstatus_ref
          (privLevel_to_bits (if sumbool_of_bool w__4 then User else Machine))) >>
       read_reg cur_privilege_ref >>= fun w__5 : Privilege =>
       (if generic_neq w__5 Machine then
          (_set_Mstatus_MPRV mstatus_ref ('b"0"  : mword 1))
           : M (unit)
        else returnm tt) >>
       (if get_config_print_reg tt then
          read_reg mstatus_ref >>= fun w__6 : Mstatus =>
          returnm (print_endline
                     (String.append "CSR mstatus <- " (string_of_bits (_get_Mstatus_bits w__6))))
        else returnm tt) >>
       (if get_config_print_platform tt then
          read_reg cur_privilege_ref >>= fun w__7 : Privilege =>
          returnm (print_endline
                     (String.append "ret-ing from "
                        (String.append (privLevel_to_str prev_priv)
                           (String.append " to " (privLevel_to_str w__7)))))
        else returnm tt) >>
       let '_ := (cancel_reservation tt)  : unit in
       (prepare_xret_target Machine) >>= fun w__8 : mword 64 =>
       (pc_alignment_mask tt) >>= fun w__9 : mword 64 => returnm (and_vec w__8 w__9)
    | (_, CTL_SRET tt) =>
       read_reg cur_privilege_ref >>= fun prev_priv =>
       read_reg mstatus_ref >>= fun w__10 : Mstatus =>
       (_set_Mstatus_SIE mstatus_ref (_get_Mstatus_SPIE w__10)) >>
       (_set_Mstatus_SPIE mstatus_ref ('b"1"  : mword 1)) >>
       read_reg mstatus_ref >>= fun w__11 : Mstatus =>
       write_reg
         cur_privilege_ref
         (if eq_vec (_get_Mstatus_SPP w__11) ('b"1"  : mword 1) then Supervisor
          else User) >>
       (_set_Mstatus_SPP mstatus_ref ('b"0"  : mword 1)) >>
       read_reg cur_privilege_ref >>= fun w__12 : Privilege =>
       (if generic_neq w__12 Machine then
          (_set_Mstatus_MPRV mstatus_ref ('b"0"  : mword 1))
           : M (unit)
        else returnm tt) >>
       (if get_config_print_reg tt then
          read_reg mstatus_ref >>= fun w__13 : Mstatus =>
          returnm (print_endline
                     (String.append "CSR mstatus <- " (string_of_bits (_get_Mstatus_bits w__13))))
        else returnm tt) >>
       (if get_config_print_platform tt then
          read_reg cur_privilege_ref >>= fun w__14 : Privilege =>
          returnm (print_endline
                     (String.append "ret-ing from "
                        (String.append (privLevel_to_str prev_priv)
                           (String.append " to " (privLevel_to_str w__14)))))
        else returnm tt) >>
       let '_ := (cancel_reservation tt)  : unit in
       (prepare_xret_target Supervisor) >>= fun w__15 : mword 64 =>
       (pc_alignment_mask tt) >>= fun w__16 : mword 64 => returnm (and_vec w__15 w__16)
    | (_, CTL_URET tt) =>
       read_reg cur_privilege_ref >>= fun prev_priv =>
       read_reg mstatus_ref >>= fun w__17 : Mstatus =>
       (_set_Mstatus_UIE mstatus_ref (_get_Mstatus_UPIE w__17)) >>
       (_set_Mstatus_UPIE mstatus_ref ('b"1"  : mword 1)) >>
       write_reg cur_privilege_ref User >>
       (if get_config_print_reg tt then
          read_reg mstatus_ref >>= fun w__18 : Mstatus =>
          returnm (print_endline
                     (String.append "CSR mstatus <- " (string_of_bits (_get_Mstatus_bits w__18))))
        else returnm tt) >>
       (if get_config_print_platform tt then
          read_reg cur_privilege_ref >>= fun w__19 : Privilege =>
          returnm (print_endline
                     (String.append "ret-ing from "
                        (String.append (privLevel_to_str prev_priv)
                           (String.append " to " (privLevel_to_str w__19)))))
        else returnm tt) >>
       let '_ := (cancel_reservation tt)  : unit in
       (prepare_xret_target User) >>= fun w__20 : mword 64 =>
       (pc_alignment_mask tt) >>= fun w__21 : mword 64 => returnm (and_vec w__20 w__21)
    end)
    : M (mword 64).

Definition handle_mem_exception (addr : mword 64) (e : ExceptionType) : M (unit) :=
   let t : sync_exception :=
     {| sync_exception_trap := e; 
        sync_exception_excinfo := (Some addr); 
        sync_exception_ext := None |} in
   read_reg cur_privilege_ref >>= fun w__0 : Privilege =>
   ((read_reg PC_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   (exception_handler w__0 (CTL_TRAP t) w__1) >>= fun w__2 : mword 64 =>
   (set_next_pc w__2)
    : M (unit).

Definition handle_exception (e : ExceptionType) : M (unit) :=
   let t : sync_exception :=
     {| sync_exception_trap := e; 
        sync_exception_excinfo := None; 
        sync_exception_ext := None |} in
   read_reg cur_privilege_ref >>= fun w__0 : Privilege =>
   ((read_reg PC_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   (exception_handler w__0 (CTL_TRAP t) w__1) >>= fun w__2 : mword 64 =>
   (set_next_pc w__2)
    : M (unit).

Definition handle_interrupt (i : InterruptType) (del_priv : Privilege) : M (unit) :=
   ((read_reg PC_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   (trap_handler del_priv true (interruptType_to_bits i) w__0 None None) >>= fun w__1 : mword 64 =>
   (set_next_pc w__1)
    : M (unit).

Definition init_sys '(tt : unit) : M (unit) :=
   write_reg cur_privilege_ref Machine >>
   write_reg mhartid_ref (EXTZ 64 ('b"0"  : mword 1)) >>
   (_set_Misa_MXL misa_ref (arch_to_bits RV64)) >>
   (_set_Misa_A misa_ref ('b"1"  : mword 1)) >>
   (_set_Misa_C misa_ref (bool_to_bits (sys_enable_rvc tt))) >>
   (_set_Misa_I misa_ref ('b"1"  : mword 1)) >>
   (_set_Misa_M misa_ref ('b"1"  : mword 1)) >>
   (_set_Misa_U misa_ref ('b"1"  : mword 1)) >>
   (_set_Misa_S misa_ref ('b"1"  : mword 1)) >>
   (_set_Misa_F misa_ref (bool_to_bits (sys_enable_fdext tt))) >>
   (_set_Misa_D misa_ref (bool_to_bits (sys_enable_fdext tt))) >>
   read_reg mstatus_ref >>= fun w__0 : Mstatus =>
   read_reg misa_ref >>= fun w__1 : Misa =>
   write_reg mstatus_ref (set_mstatus_SXL w__0 (_get_Misa_MXL w__1)) >>
   read_reg mstatus_ref >>= fun w__2 : Mstatus =>
   read_reg misa_ref >>= fun w__3 : Misa =>
   write_reg mstatus_ref (set_mstatus_UXL w__2 (_get_Misa_MXL w__3)) >>
   (_set_Mstatus_SD mstatus_ref ('b"0"  : mword 1)) >>
   read_reg mstatus_ref >>= fun w__4 : Mstatus =>
   write_reg
     mstatus_ref
     (Mk_Mstatus
        (update_subrange_vec_dec (_get_Mstatus_bits w__4) 37 36 ('b"00"  : mword (37 - (36 - 1))))) >>
   (_set_Mstatush_bits mstatush_ref (EXTZ 32 ('b"0"  : mword 1))) >>
   (_set_Minterrupts_bits mip_ref (EXTZ 64 ('b"0"  : mword 1))) >>
   (_set_Minterrupts_bits mie_ref (EXTZ 64 ('b"0"  : mword 1))) >>
   (_set_Minterrupts_bits mideleg_ref (EXTZ 64 ('b"0"  : mword 1))) >>
   (_set_Medeleg_bits medeleg_ref (EXTZ 64 ('b"0"  : mword 1))) >>
   (_set_Mtvec_bits mtvec_ref (EXTZ 64 ('b"0"  : mword 1))) >>
   (_set_Mcause_bits mcause_ref (EXTZ 64 ('b"0"  : mword 1))) >>
   write_reg mepc_ref (EXTZ 64 ('b"0"  : mword 1)) >>
   write_reg mtval_ref (EXTZ 64 ('b"0"  : mword 1)) >>
   write_reg mscratch_ref (EXTZ 64 ('b"0"  : mword 1)) >>
   write_reg mcycle_ref (EXTZ 64 ('b"0"  : mword 1)) >>
   write_reg mtime_ref (EXTZ 64 ('b"0"  : mword 1)) >>
   (_set_Counteren_bits mcounteren_ref (EXTZ 32 ('b"0"  : mword 1))) >>
   write_reg minstret_ref (EXTZ 64 ('b"0"  : mword 1)) >>
   write_reg minstret_written_ref false >>
   (init_pmp tt) >>
   (if get_config_print_reg tt then
      read_reg mstatus_ref >>= fun w__5 : Mstatus =>
      returnm (print_endline
                 (String.append "CSR mstatus <- "
                    (String.append (string_of_bits (_get_Mstatus_bits w__5))
                       (String.append " (input: "
                          (String.append (string_of_bits ((EXTZ 64 ('b"0"  : mword 1))  : xlenbits))
                             ")")))))
    else returnm tt)
    : M (unit).

Definition MemoryOpResult_add_meta {t : Type} (r : MemoryOpResult t) (m : unit)
: MemoryOpResult ((t * unit)) :=
   match r with | MemValue v => MemValue (v, m) | MemException e => MemException e end.

Definition MemoryOpResult_drop_meta {t : Type} (r : MemoryOpResult ((t * unit))) : MemoryOpResult t :=
   match r with | MemValue (v, m) => MemValue v | MemException e => MemException e end.

Axiom elf_tohost : forall  (_ : unit) , Z.

Axiom elf_entry : forall  (_ : unit) , Z.

Axiom plat_ram_base : forall  (_ : unit) , mword 64.

Axiom plat_ram_size : forall  (_ : unit) , mword 64.

Axiom plat_enable_pmp : forall  (_ : unit) , bool.

Axiom plat_enable_dirty_update : forall  (_ : unit) , bool.

Axiom plat_enable_misaligned_access : forall  (_ : unit) , bool.

Axiom plat_mtval_has_illegal_inst_bits : forall  (_ : unit) , bool.

Axiom plat_rom_base : forall  (_ : unit) , mword 64.

Axiom plat_rom_size : forall  (_ : unit) , mword 64.

Axiom plat_clint_base : forall  (_ : unit) , mword 64.

Axiom plat_clint_size : forall  (_ : unit) , mword 64.

Definition plat_htif_tohost '(tt : unit) : mword 64 := to_bits 64 (elf_tohost tt).

Definition phys_mem_segments '(tt : unit) : list ((mword 64 * mword 64)) :=
   (plat_rom_base tt, plat_rom_size tt) :: (plat_ram_base tt, plat_ram_size tt) :: [].

Definition within_phys_mem (addr : mword 64) (width : Z) `{ArithFact (width <=? 16)} : bool :=
   let addr_int := projT1 (uint addr) in
   let ram_base_int := projT1 (uint (plat_ram_base tt)) in
   let rom_base_int := projT1 (uint (plat_rom_base tt)) in
   let ram_size_int := projT1 (uint (plat_ram_size tt)) in
   let rom_size_int := projT1 (uint (plat_rom_size tt)) in
   if sumbool_of_bool
     (andb (Z.leb ram_base_int addr_int)
        (Z.leb (Z.add addr_int (projT1 (__id width))) (Z.add ram_base_int ram_size_int))) then
     true
   else if sumbool_of_bool
     (andb (Z.leb rom_base_int addr_int)
        (Z.leb (Z.add addr_int (projT1 (__id width))) (Z.add rom_base_int rom_size_int))) then
     true
   else
     let '_ :=
       (print_endline
          (String.append "within_phys_mem: "
             (String.append (string_of_bits addr) " not within phys-mem:")))
        : unit in
     let '_ :=
       (print_endline (String.append "  plat_rom_base: " (string_of_bits (plat_rom_base tt))))
        : unit in
     let '_ :=
       (print_endline (String.append "  plat_rom_size: " (string_of_bits (plat_rom_size tt))))
        : unit in
     let '_ :=
       (print_endline (String.append "  plat_ram_base: " (string_of_bits (plat_ram_base tt))))
        : unit in
     let '_ :=
       (print_endline (String.append "  plat_ram_size: " (string_of_bits (plat_ram_size tt))))
        : unit in
     false.

Definition within_clint (addr : mword 64) (width : Z) `{ArithFact ((0 <? width) && (width <=? 16))}
: bool :=
   let addr_int := projT1 (uint addr) in
   let clint_base_int := projT1 (uint (plat_clint_base tt)) in
   let clint_size_int := projT1 (uint (plat_clint_size tt)) in
   andb (Z.leb clint_base_int addr_int)
     (Z.leb (Z.add addr_int (projT1 (__id width))) (Z.add clint_base_int clint_size_int)).

Definition within_htif_writable (addr : mword 64) (width : Z)
`{ArithFact ((0 <? width) && (width <=? 16))}
: bool :=
   orb (eq_vec (plat_htif_tohost tt) addr)
     (andb (eq_vec (add_vec_int (plat_htif_tohost tt) 4) addr) (Z.eqb width 4)).

Definition within_htif_readable (addr : mword 64) (width : Z)
`{ArithFact ((0 <? width) && (width <=? 16))}
: bool :=
   orb (eq_vec (plat_htif_tohost tt) addr)
     (andb (eq_vec (add_vec_int (plat_htif_tohost tt) 4) addr) (Z.eqb width 4)).

Axiom plat_insns_per_tick : forall  (_ : unit) , Z.

Definition MSIP_BASE : xlenbits := EXTZ 64 (Ox"00000"  : mword 20).
Hint Unfold MSIP_BASE : sail.
Definition MTIMECMP_BASE : xlenbits := EXTZ 64 (Ox"04000"  : mword 20).
Hint Unfold MTIMECMP_BASE : sail.
Definition MTIMECMP_BASE_HI : xlenbits := EXTZ 64 (Ox"04004"  : mword 20).
Hint Unfold MTIMECMP_BASE_HI : sail.
Definition MTIME_BASE : xlenbits := EXTZ 64 (Ox"0BFF8"  : mword 20).
Hint Unfold MTIME_BASE : sail.
Definition MTIME_BASE_HI : xlenbits := EXTZ 64 (Ox"0BFFC"  : mword 20).
Hint Unfold MTIME_BASE_HI : sail.
Definition clint_load (t : AccessType unit) (addr : mword 64) (width : Z) `{ArithFact (width >? 0)}
: M (MemoryOpResult (mword (8 * width))) :=
   let addr := sub_vec addr (plat_clint_base tt) in
   (if sumbool_of_bool
      (andb (eq_vec addr MSIP_BASE)
         (orb (Z.eqb (projT1 (__id width)) 8) (Z.eqb (projT1 (__id width)) 4))) then
      (if get_config_print_platform tt then
         read_reg mip_ref >>= fun w__0 : Minterrupts =>
         returnm (print_endline
                    (String.append "clint["
                       (String.append (string_of_bits addr)
                          (String.append "] -> " (string_of_bits (_get_Minterrupts_MSI w__0))))))
       else returnm tt) >>
      read_reg mip_ref >>= fun w__1 : Minterrupts =>
      returnm (MemValue (zero_extend (_get_Minterrupts_MSI w__1) (Z.mul 8 (projT1 (__id width)))))
    else if sumbool_of_bool (andb (eq_vec addr MTIMECMP_BASE) (Z.eqb (projT1 (__id width)) 4)) then
      (if get_config_print_platform tt then
         ((read_reg mtimecmp_ref)  : M (mword 64)) >>= fun w__2 : mword 64 =>
         returnm (print_endline
                    (String.append "clint<4>["
                       (String.append (string_of_bits addr)
                          (String.append "] -> " (string_of_bits (subrange_vec_dec w__2 31 0))))))
       else returnm tt) >>
      ((read_reg mtimecmp_ref)  : M (mword 64)) >>= fun w__3 : mword 64 =>
      returnm (MemValue (zero_extend (subrange_vec_dec w__3 31 0) _))
    else if sumbool_of_bool (andb (eq_vec addr MTIMECMP_BASE) (Z.eqb (projT1 (__id width)) 8)) then
      (if get_config_print_platform tt then
         ((read_reg mtimecmp_ref)  : M (mword 64)) >>= fun w__4 : mword 64 =>
         returnm (print_endline
                    (String.append "clint<8>["
                       (String.append (string_of_bits addr)
                          (String.append "] -> " (string_of_bits w__4)))))
       else returnm tt) >>
      ((read_reg mtimecmp_ref)  : M (mword 64)) >>= fun w__5 : mword 64 =>
      returnm (MemValue (zero_extend w__5 _))
    else if sumbool_of_bool
      (andb (eq_vec addr MTIMECMP_BASE_HI) (Z.eqb (projT1 (__id width)) 4)) then
      (if get_config_print_platform tt then
         ((read_reg mtimecmp_ref)  : M (mword 64)) >>= fun w__6 : mword 64 =>
         returnm (print_endline
                    (String.append "clint-hi<4>["
                       (String.append (string_of_bits addr)
                          (String.append "] -> " (string_of_bits (subrange_vec_dec w__6 63 32))))))
       else returnm tt) >>
      ((read_reg mtimecmp_ref)  : M (mword 64)) >>= fun w__7 : mword 64 =>
      returnm (MemValue (zero_extend (subrange_vec_dec w__7 63 32) _))
    else if sumbool_of_bool (andb (eq_vec addr MTIME_BASE) (Z.eqb (projT1 (__id width)) 4)) then
      (if get_config_print_platform tt then
         ((read_reg mtime_ref)  : M (mword 64)) >>= fun w__8 : mword 64 =>
         returnm (print_endline
                    (String.append "clint["
                       (String.append (string_of_bits addr)
                          (String.append "] -> " (string_of_bits w__8)))))
       else returnm tt) >>
      ((read_reg mtime_ref)  : M (mword 64)) >>= fun w__9 : mword 64 =>
      returnm (MemValue (zero_extend (subrange_vec_dec w__9 31 0) _))
    else if sumbool_of_bool (andb (eq_vec addr MTIME_BASE) (Z.eqb (projT1 (__id width)) 8)) then
      (if get_config_print_platform tt then
         ((read_reg mtime_ref)  : M (mword 64)) >>= fun w__10 : mword 64 =>
         returnm (print_endline
                    (String.append "clint["
                       (String.append (string_of_bits addr)
                          (String.append "] -> " (string_of_bits w__10)))))
       else returnm tt) >>
      ((read_reg mtime_ref)  : M (mword 64)) >>= fun w__11 : mword 64 =>
      returnm (MemValue (zero_extend w__11 _))
    else if sumbool_of_bool (andb (eq_vec addr MTIME_BASE_HI) (Z.eqb (projT1 (__id width)) 4)) then
      (if get_config_print_platform tt then
         ((read_reg mtime_ref)  : M (mword 64)) >>= fun w__12 : mword 64 =>
         returnm (print_endline
                    (String.append "clint["
                       (String.append (string_of_bits addr)
                          (String.append "] -> " (string_of_bits w__12)))))
       else returnm tt) >>
      ((read_reg mtime_ref)  : M (mword 64)) >>= fun w__13 : mword 64 =>
      returnm (MemValue (zero_extend (subrange_vec_dec w__13 63 32) _))
    else
      let '_ :=
        (if get_config_print_platform tt then
           print_endline
             (String.append "clint[" (String.append (string_of_bits addr) "] -> <not-mapped>"))
         else tt)
         : unit in
      returnm (match t with
               | Execute tt => MemException (E_Fetch_Access_Fault tt)
               | Read Data => MemException (E_Load_Access_Fault tt)
               | _ => MemException (E_SAMO_Access_Fault tt)
               end))
    : M (MemoryOpResult (mword (8 * width))).

Definition clint_dispatch '(tt : unit) : M (unit) :=
   (if get_config_print_platform tt then
      ((read_reg mtime_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
      returnm (print_endline (String.append "clint::tick mtime <- " (string_of_bits w__0)))
    else returnm tt) >>
   (_set_Minterrupts_MTI mip_ref ('b"0"  : mword 1)) >>
   ((read_reg mtimecmp_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   ((read_reg mtime_ref)  : M (mword 64)) >>= fun w__2 : mword 64 =>
   (if zopz0zIzJ_u w__1 w__2 then
      (if get_config_print_platform tt then
         ((read_reg mtime_ref)  : M (mword 64)) >>= fun w__3 : mword 64 =>
         returnm (print_endline
                    (String.append " clint timer pending at mtime " (string_of_bits w__3)))
       else returnm tt) >>
      (_set_Minterrupts_MTI mip_ref ('b"1"  : mword 1))
       : M (unit)
    else returnm tt)
    : M (unit).

Definition clint_store (addr : mword 64) (width : Z) (data : mword (8 * width))
`{ArithFact (width >? 0)}
: M (MemoryOpResult bool) :=
   let addr := sub_vec addr (plat_clint_base tt) in
   (if sumbool_of_bool
      (andb (eq_vec addr MSIP_BASE)
         (orb (Z.eqb (projT1 (__id width)) 8) (Z.eqb (projT1 (__id width)) 4))) then
      (if get_config_print_platform tt then
         (string_of_bit (access_vec_dec data 0)) >>= fun w__0 : string =>
         returnm (print_endline
                    (String.append "clint["
                       (String.append (string_of_bits addr)
                          (String.append "] <- "
                             (String.append (string_of_bits data)
                                (String.append " (mip.MSI <- " (String.append w__0 ")")))))))
       else returnm tt) >>
      (_set_Minterrupts_MSI mip_ref (vec_of_bits [access_vec_dec data 0]  : mword 1)) >>
      (clint_dispatch tt) >> returnm (MemValue true)
    else if sumbool_of_bool (andb (eq_vec addr MTIMECMP_BASE) (Z.eqb (projT1 (__id width)) 8)) then
      let '_ :=
        (if get_config_print_platform tt then
           print_endline
             (String.append "clint<8>["
                (String.append (string_of_bits addr)
                   (String.append "] <- " (String.append (string_of_bits data) " (mtimecmp)"))))
         else tt)
         : unit in
      write_reg mtimecmp_ref (zero_extend data 64) >> (clint_dispatch tt) >> returnm (MemValue true)
    else if sumbool_of_bool (andb (eq_vec addr MTIMECMP_BASE) (Z.eqb (projT1 (__id width)) 4)) then
      let '_ :=
        (if get_config_print_platform tt then
           print_endline
             (String.append "clint<4>["
                (String.append (string_of_bits addr)
                   (String.append "] <- " (String.append (string_of_bits data) " (mtimecmp)"))))
         else tt)
         : unit in
      ((read_reg mtimecmp_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
      write_reg mtimecmp_ref (update_subrange_vec_dec w__1 31 0 (zero_extend data 32)) >>
      (clint_dispatch tt) >> returnm (MemValue true)
    else if sumbool_of_bool
      (andb (eq_vec addr MTIMECMP_BASE_HI) (Z.eqb (projT1 (__id width)) 4)) then
      let '_ :=
        (if get_config_print_platform tt then
           print_endline
             (String.append "clint<4>["
                (String.append (string_of_bits addr)
                   (String.append "] <- " (String.append (string_of_bits data) " (mtimecmp)"))))
         else tt)
         : unit in
      ((read_reg mtimecmp_ref)  : M (mword 64)) >>= fun w__2 : mword 64 =>
      write_reg mtimecmp_ref (update_subrange_vec_dec w__2 63 32 (zero_extend data 32)) >>
      (clint_dispatch tt) >> returnm (MemValue true)
    else
      let '_ :=
        (if get_config_print_platform tt then
           print_endline
             (String.append "clint["
                (String.append (string_of_bits addr)
                   (String.append "] <- " (String.append (string_of_bits data) " (<unmapped>)"))))
         else tt)
         : unit in
      returnm (MemException (E_SAMO_Access_Fault tt)))
    : M (MemoryOpResult bool).

Definition tick_clock '(tt : unit) : M (unit) :=
   read_reg mcountinhibit_ref >>= fun w__0 : Counterin =>
   (if eq_vec (_get_Counterin_CY w__0) ('b"0"  : mword 1) then
      ((read_reg mcycle_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
      write_reg mcycle_ref (add_vec_int w__1 1)
       : M (unit)
    else returnm tt) >>
   ((read_reg mtime_ref)  : M (mword 64)) >>= fun w__2 : mword 64 =>
   write_reg mtime_ref (add_vec_int w__2 1) >> (clint_dispatch tt)  : M (unit).

Axiom plat_term_write : forall  (_ : mword 8) , unit.

Axiom plat_term_read : forall  (_ : unit) , mword 8.

Definition Mk_htif_cmd (v : mword 64) : htif_cmd :=
   {| htif_cmd_htif_cmd_chunk_0 := (subrange_vec_dec v 63 0) |}.

Definition _get_htif_cmd_bits (v : htif_cmd) : mword 64 :=
   subrange_vec_dec v.(htif_cmd_htif_cmd_chunk_0) 63 0.

Definition _set_htif_cmd_bits (r_ref : register_ref regstate register_value htif_cmd) (v : mword 64)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       htif_cmd_htif_cmd_chunk_0 :=
         (update_subrange_vec_dec r.(htif_cmd_htif_cmd_chunk_0) 63 0 (subrange_vec_dec v 63 0)) ]}
      : htif_cmd in
   write_reg r_ref r
    : M (unit).

Definition _update_htif_cmd_bits (v : htif_cmd) (x : mword 64) : htif_cmd :=
   {[ v with
     htif_cmd_htif_cmd_chunk_0 :=
       (update_subrange_vec_dec v.(htif_cmd_htif_cmd_chunk_0) 63 0 (subrange_vec_dec x 63 0)) ]}.

Definition _get_htif_cmd_device (v : htif_cmd) : mword 8 :=
   subrange_vec_dec v.(htif_cmd_htif_cmd_chunk_0) 63 56.

Definition _set_htif_cmd_device
(r_ref : register_ref regstate register_value htif_cmd) (v : mword 8)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       htif_cmd_htif_cmd_chunk_0 :=
         (update_subrange_vec_dec r.(htif_cmd_htif_cmd_chunk_0) 63 56 (subrange_vec_dec v 7 0)) ]}
      : htif_cmd in
   write_reg r_ref r
    : M (unit).

Definition _update_htif_cmd_device (v : htif_cmd) (x : mword 8) : htif_cmd :=
   {[ v with
     htif_cmd_htif_cmd_chunk_0 :=
       (update_subrange_vec_dec v.(htif_cmd_htif_cmd_chunk_0) 63 56 (subrange_vec_dec x 7 0)) ]}.

Definition _get_htif_cmd_cmd (v : htif_cmd) : mword 8 :=
   subrange_vec_dec v.(htif_cmd_htif_cmd_chunk_0) 55 48.

Definition _set_htif_cmd_cmd (r_ref : register_ref regstate register_value htif_cmd) (v : mword 8)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       htif_cmd_htif_cmd_chunk_0 :=
         (update_subrange_vec_dec r.(htif_cmd_htif_cmd_chunk_0) 55 48 (subrange_vec_dec v 7 0)) ]}
      : htif_cmd in
   write_reg r_ref r
    : M (unit).

Definition _update_htif_cmd_cmd (v : htif_cmd) (x : mword 8) : htif_cmd :=
   {[ v with
     htif_cmd_htif_cmd_chunk_0 :=
       (update_subrange_vec_dec v.(htif_cmd_htif_cmd_chunk_0) 55 48 (subrange_vec_dec x 7 0)) ]}.

Definition _get_htif_cmd_payload (v : htif_cmd) : mword 48 :=
   subrange_vec_dec v.(htif_cmd_htif_cmd_chunk_0) 47 0.

Definition _set_htif_cmd_payload
(r_ref : register_ref regstate register_value htif_cmd) (v : mword 48)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       htif_cmd_htif_cmd_chunk_0 :=
         (update_subrange_vec_dec r.(htif_cmd_htif_cmd_chunk_0) 47 0 (subrange_vec_dec v 47 0)) ]}
      : htif_cmd in
   write_reg r_ref r
    : M (unit).

Definition _update_htif_cmd_payload (v : htif_cmd) (x : mword 48) : htif_cmd :=
   {[ v with
     htif_cmd_htif_cmd_chunk_0 :=
       (update_subrange_vec_dec v.(htif_cmd_htif_cmd_chunk_0) 47 0 (subrange_vec_dec x 47 0)) ]}.

Definition reset_htif '(tt : unit) : M (unit) :=
   write_reg htif_cmd_write_ref B0 >>
   write_reg htif_payload_writes_ref (Ox"0"  : mword 4) >>
   write_reg htif_tohost_ref (EXTZ 64 ('b"0"  : mword 1))
    : M (unit).

Definition htif_load (t : AccessType unit) (paddr : mword 64) (width : Z) `{ArithFact (width >? 0)}
: M (MemoryOpResult (mword (8 * width))) :=
   (if get_config_print_platform tt then
      ((read_reg htif_tohost_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
      returnm (print_endline
                 (String.append "htif["
                    (String.append (string_of_bits paddr)
                       (String.append "] -> " (string_of_bits w__0)))))
    else returnm tt) >>
   (if sumbool_of_bool (andb (Z.eqb width 8) (eq_vec paddr (plat_htif_tohost tt))) then
      ((read_reg htif_tohost_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
      returnm (MemValue (zero_extend w__1 _))
    else if sumbool_of_bool (andb (Z.eqb width 4) (eq_vec paddr (plat_htif_tohost tt))) then
      ((read_reg htif_tohost_ref)  : M (mword 64)) >>= fun w__2 : mword 64 =>
      returnm (MemValue (zero_extend (subrange_vec_dec w__2 31 0) _))
    else if sumbool_of_bool
      (andb (Z.eqb width 4) (eq_vec paddr (add_vec_int (plat_htif_tohost tt) 4))) then
      ((read_reg htif_tohost_ref)  : M (mword 64)) >>= fun w__3 : mword 64 =>
      returnm (MemValue (zero_extend (subrange_vec_dec w__3 63 32) _))
    else
      returnm (match t with
               | Execute tt => MemException (E_Fetch_Access_Fault tt)
               | Read Data => MemException (E_Load_Access_Fault tt)
               | _ => MemException (E_SAMO_Access_Fault tt)
               end))
    : M (MemoryOpResult (mword (8 * width))).

Definition htif_store (paddr : mword 64) (width : Z) (data : mword (8 * width))
`{ArithFact ((0 <? width) && (width <=? 8))}
: M (MemoryOpResult bool) :=
   let '_ :=
     (if get_config_print_platform tt then
        print_endline
          (String.append "htif["
             (String.append (string_of_bits paddr) (String.append "] <- " (string_of_bits data))))
      else tt)
      : unit in
   (if sumbool_of_bool (Z.eqb width 8) then
      write_reg htif_cmd_write_ref B1 >>
      ((read_reg htif_payload_writes_ref)  : M (mword 4)) >>= fun w__0 : mword 4 =>
      write_reg htif_payload_writes_ref (add_vec_int w__0 1) >>
      write_reg htif_tohost_ref (EXTZ 64 data)
       : M (unit)
    else if sumbool_of_bool (andb (Z.eqb width 4) (eq_vec paddr (plat_htif_tohost tt))) then
      ((read_reg htif_tohost_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
      (if eq_vec data (autocast (autocast (subrange_vec_dec w__1 31 0))) then
         ((read_reg htif_payload_writes_ref)  : M (mword 4)) >>= fun w__2 : mword 4 =>
         write_reg htif_payload_writes_ref (add_vec_int w__2 1)
          : M (unit)
       else write_reg htif_payload_writes_ref (Ox"1"  : mword 4)  : M (unit)) >>
      ((read_reg htif_tohost_ref)  : M (mword 64)) >>= fun w__3 : mword 64 =>
      write_reg htif_tohost_ref (update_subrange_vec_dec w__3 31 0 (autocast (autocast data)))
       : M (unit)
    else if sumbool_of_bool
      (andb (Z.eqb width 4) (eq_vec paddr (add_vec_int (plat_htif_tohost tt) 4))) then
      ((read_reg htif_tohost_ref)  : M (mword 64)) >>= fun w__4 : mword 64 =>
      (if eq_vec (subrange_vec_dec data 15 0) (subrange_vec_dec w__4 47 32) then
         ((read_reg htif_payload_writes_ref)  : M (mword 4)) >>= fun w__5 : mword 4 =>
         write_reg htif_payload_writes_ref (add_vec_int w__5 1)
          : M (unit)
       else write_reg htif_payload_writes_ref (Ox"1"  : mword 4)  : M (unit)) >>
      write_reg htif_cmd_write_ref B1 >>
      ((read_reg htif_tohost_ref)  : M (mword 64)) >>= fun w__6 : mword 64 =>
      write_reg htif_tohost_ref (update_subrange_vec_dec w__6 63 32 (autocast (autocast data)))
       : M (unit)
    else write_reg htif_tohost_ref (EXTZ 64 data)  : M (unit)) >>
   (or_boolM
      ((and_boolM
          (read_reg htif_cmd_write_ref >>= fun w__7 : bitU => returnm ((eq_bit w__7 B1)  : bool))
          (((read_reg htif_payload_writes_ref)  : M (mword 4)) >>= fun w__8 : mword 4 =>
           returnm ((Z.gtb (projT1 (uint w__8)) 0)  : bool)))
       : M (bool))
      (((read_reg htif_payload_writes_ref)  : M (mword 4)) >>= fun w__10 : mword 4 =>
       returnm ((Z.gtb (projT1 (uint w__10)) 2)  : bool))) >>= fun w__11 : bool =>
   (if sumbool_of_bool w__11 then
      ((read_reg htif_tohost_ref)  : M (mword 64)) >>= fun w__12 : mword 64 =>
      let cmd := Mk_htif_cmd w__12 in
      let b__0 := _get_htif_cmd_device cmd in
      (if eq_vec b__0 (Ox"00"  : mword 8) then
         let '_ :=
           (if get_config_print_platform tt then
              print_endline
                (String.append "htif-syscall-proxy cmd: "
                   (string_of_bits (_get_htif_cmd_payload cmd)))
            else tt)
            : unit in
         (if eq_bit (access_vec_dec (_get_htif_cmd_payload cmd) 0) B1 then
            write_reg htif_done_ref true >>
            write_reg htif_exit_code_ref (shiftr (zero_extend (_get_htif_cmd_payload cmd) 64) 1)
             : M (unit)
          else returnm tt)
          : M (unit)
       else if eq_vec b__0 (Ox"01"  : mword 8) then
         let '_ :=
           (if get_config_print_platform tt then
              print_endline
                (String.append "htif-term cmd: " (string_of_bits (_get_htif_cmd_payload cmd)))
            else tt)
            : unit in
         let b__2 := _get_htif_cmd_cmd cmd in
         let '_ :=
           (if eq_vec b__2 (Ox"00"  : mword 8) then tt
            else if eq_vec b__2 (Ox"01"  : mword 8) then
              plat_term_write (subrange_vec_dec (_get_htif_cmd_payload cmd) 7 0)
            else print_endline (String.append "Unknown term cmd: " (string_of_bits b__2)))
            : unit in
         (reset_htif tt)
          : M (unit)
       else returnm (print_endline (String.append "htif-???? cmd: " (string_of_bits data))))
       : M (unit)
    else returnm tt) >>
   returnm (MemValue true).

Definition htif_tick '(tt : unit) : M (unit) :=
   (if get_config_print_platform tt then
      ((read_reg htif_tohost_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
      returnm (print_endline (String.append "htif::tick " (string_of_bits w__0)))
    else returnm tt) >>
   ((read_reg htif_tohost_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   write_reg htif_tohost_ref w__1
    : M (unit).

Definition within_mmio_readable (addr : mword 64) (width : Z)
`{ArithFact ((0 <? width) && (width <=? 16))}
: bool :=
   orb (within_clint addr width)
     (andb (within_htif_readable addr width) (Z.leb 1 (projT1 (__id width)))).

Definition within_mmio_writable (addr : mword 64) (width : Z)
`{ArithFact ((0 <? width) && (width <=? 16))}
: bool :=
   orb (within_clint addr width)
     (andb (within_htif_writable addr width) (Z.leb (projT1 (__id width)) 8)).

Definition mmio_read (t : AccessType unit) (paddr : mword 64) (width : Z)
`{ArithFact ((0 <? width) && (width <=? 16))}
: M (MemoryOpResult (mword (8 * width))) :=
   (if within_clint paddr width then
      (clint_load t paddr width)
       : M (MemoryOpResult (mword (8 * width)))
    else if sumbool_of_bool
      (andb (within_htif_readable paddr width) (Z.leb 1 (projT1 (__id width)))) then
      (htif_load t paddr width)
       : M (MemoryOpResult (mword (8 * width)))
    else
      returnm (match t with
               | Execute tt => MemException (E_Fetch_Access_Fault tt)
               | Read Data => MemException (E_Load_Access_Fault tt)
               | _ => MemException (E_SAMO_Access_Fault tt)
               end))
    : M (MemoryOpResult (mword (8 * width))).

Definition mmio_write (paddr : mword 64) (width : Z) (data : mword (8 * width))
`{ArithFact ((0 <? width) && (width <=? 16))}
: M (MemoryOpResult bool) :=
   (if within_clint paddr width then (clint_store paddr width data)  : M (MemoryOpResult bool)
    else if sumbool_of_bool
      (andb (within_htif_writable paddr width) (Z.leb (projT1 (__id width)) 8)) then
      (htif_store paddr width data)
       : M (MemoryOpResult bool)
    else returnm (MemException (E_SAMO_Access_Fault tt)))
    : M (MemoryOpResult bool).

Definition init_platform '(tt : unit) : M (unit) :=
   write_reg htif_tohost_ref (EXTZ 64 ('b"0"  : mword 1)) >>
   write_reg htif_done_ref false >>
   write_reg htif_exit_code_ref (EXTZ 64 ('b"0"  : mword 1)) >>
   write_reg htif_cmd_write_ref B0 >>
   write_reg htif_payload_writes_ref (EXTZ 4 ('b"0"  : mword 1))
    : M (unit).

Definition tick_platform '(tt : unit) : M (unit) := (htif_tick tt)  : M (unit).

Definition handle_illegal '(tt : unit) : M (unit) :=
   (if plat_mtval_has_illegal_inst_bits tt then
      ((read_reg instbits_ref)  : M (mword 64)) >>= fun w__0 : mword 64 => returnm (Some w__0)
    else returnm None) >>= fun info =>
   let t : sync_exception :=
     {| sync_exception_trap := (E_Illegal_Instr tt); 
        sync_exception_excinfo := info; 
        sync_exception_ext := None |} in
   read_reg cur_privilege_ref >>= fun w__1 : Privilege =>
   ((read_reg PC_ref)  : M (mword 64)) >>= fun w__2 : mword 64 =>
   (exception_handler w__1 (CTL_TRAP t) w__2) >>= fun w__3 : mword 64 =>
   (set_next_pc w__3)
    : M (unit).

Definition platform_wfi '(tt : unit) : M (unit) :=
   let '_ := (cancel_reservation tt)  : unit in
   ((read_reg mtime_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   ((read_reg mtimecmp_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
   (if zopz0zI_u w__0 w__1 then
      ((read_reg mtimecmp_ref)  : M (mword 64)) >>= fun w__2 : mword 64 =>
      write_reg mtime_ref w__2 >>
      ((read_reg mtimecmp_ref)  : M (mword 64)) >>= fun w__3 : mword 64 =>
      write_reg mcycle_ref w__3
       : M (unit)
    else returnm tt)
    : M (unit).

Definition is_aligned_addr (addr : mword 64) (width : Z) : bool :=
   Z.eqb (projT1 (emod_with_eq (projT1 (uint addr)) width)) 0.

Definition read_kind_of_flags (aq : bool) (rl : bool) (res : bool) : option read_kind :=
   match (aq, rl, res) with
   | (false, false, false) => Some Read_plain
   | (true, false, false) => Some Read_RISCV_acquire
   | (true, true, false) => Some Read_RISCV_strong_acquire
   | (false, false, true) => Some Read_RISCV_reserved
   | (true, false, true) => Some Read_RISCV_reserved_acquire
   | (true, true, true) => Some Read_RISCV_reserved_strong_acquire
   | (false, true, false) => None
   | (false, true, true) => None
   end.

Definition phys_mem_read
(t : AccessType unit) (paddr : mword 64) (width : Z) (aq : bool) (rl : bool) (res : bool)
(meta : bool) `{ArithFact ((0 <? width) && (width <=? 16))}
: M (MemoryOpResult ((mword (8 * width) * unit))) :=
   (match (read_kind_of_flags aq rl res) with
    | Some rk =>
       (read_ram rk paddr width meta) >>= fun w__0 : (mword (8 * width) * unit) =>
       returnm (Some w__0)
    | None => returnm None
    end) >>= fun w__1 : option ((mword (8 * width) * unit)) =>
   let result := w__1  : option ((bits (8 * width) * mem_meta)) in
   returnm (match (t, result) with
            | (Execute tt, None) => MemException (E_Fetch_Access_Fault tt)
            | (Read Data, None) => MemException (E_Load_Access_Fault tt)
            | (_, None) => MemException (E_SAMO_Access_Fault tt)
            | (_, Some (v, m)) =>
               let '_ :=
                 (if get_config_print_mem tt then
                    print_endline
                      (String.append "mem["
                         (String.append (accessType_to_str t)
                            (String.append ","
                               (String.append (string_of_bits paddr)
                                  (String.append "] -> " (string_of_bits v))))))
                  else tt)
                  : unit in
               MemValue (v, m)
            end).

Definition checked_mem_read
(t : AccessType unit) (paddr : mword 64) (width : Z) (aq : bool) (rl : bool) (res : bool)
(meta : bool) `{ArithFact ((0 <? width) && (width <=? 16))}
: M (MemoryOpResult ((mword (8 * width) * unit))) :=
   (if within_mmio_readable paddr width then
      (mmio_read t paddr width) >>= fun w__0 : MemoryOpResult (mword (8 * width)) =>
      returnm (MemoryOpResult_add_meta w__0 default_meta)
    else if within_phys_mem paddr width then
      (match (ext_check_phys_mem_read t paddr width aq rl res meta) with
       | Ext_PhysAddr_OK tt =>
          (phys_mem_read t paddr width aq rl res meta)
           : M (MemoryOpResult ((mword (8 * width) * unit)))
       | Ext_PhysAddr_Error e => returnm (MemException e)
       end)
       : M (MemoryOpResult ((mword (8 * width) * unit)))
    else
      returnm (match t with
               | Execute tt => MemException (E_Fetch_Access_Fault tt)
               | Read Data => MemException (E_Load_Access_Fault tt)
               | _ => MemException (E_SAMO_Access_Fault tt)
               end))
    : M (MemoryOpResult ((mword (8 * width) * unit))).

Definition pmp_mem_read
(t : AccessType unit) (p : Privilege) (paddr : mword 64) (width : Z) (aq : bool) (rl : bool)
(res : bool) (meta : bool) `{ArithFact ((0 <? width) && (width <=? 16))}
: M (MemoryOpResult ((mword (8 * width) * unit))) :=
   (if negb (plat_enable_pmp tt) then
      (checked_mem_read t paddr width aq rl res meta)
       : M (MemoryOpResult ((mword (8 * width) * unit)))
    else
      (pmpCheck paddr width t p) >>= fun w__1 : option ExceptionType =>
      (match w__1 with
       | None =>
          (checked_mem_read t paddr width aq rl res meta)
           : M (MemoryOpResult ((mword (8 * width) * unit)))
       | Some e => returnm (MemException e)
       end)
       : M (MemoryOpResult ((mword (8 * width) * unit))))
    : M (MemoryOpResult ((mword (8 * width) * unit))).

Definition rvfi_read
(addr : mword 64) (width : Z) (result : MemoryOpResult ((mword (8 * width) * unit)))
`{ArithFact (width >? 0)}
: unit :=
   tt.

Definition mem_read_priv_meta
(typ : AccessType unit) (priv : Privilege) (paddr : mword 64) (width : Z) (aq : bool) (rl : bool)
(res : bool) (meta : bool) `{ArithFact ((0 <? width) && (width <=? 16))}
: M (MemoryOpResult ((mword (8 * width) * unit))) :=
   (if sumbool_of_bool (andb (orb aq res) (negb (is_aligned_addr paddr width))) then
      returnm (MemException (E_Load_Addr_Align tt))
    else
      (match (aq, rl, res) with
       | (false, true, false) => throw (Error_not_implemented "load.rl")
       | (false, true, true) => throw (Error_not_implemented "lr.rl")
       | (_, _, _) =>
          (pmp_mem_read typ priv paddr width aq rl res meta)
           : M (MemoryOpResult ((mword (8 * width) * unit)))
       end)
       : M (MemoryOpResult ((mword (8 * width) * unit)))) >>= fun result : MemoryOpResult ((bits (8 * width) * mem_meta)) =>
   let '_ := (rvfi_read paddr width result)  : unit in
   returnm result.

Definition mem_read_meta
(typ : AccessType unit) (paddr : mword 64) (width : Z) (aq : bool) (rl : bool) (res : bool)
(meta : bool) `{ArithFact ((0 <? width) && (width <=? 16))}
: M (MemoryOpResult ((mword (8 * width) * unit))) :=
   read_reg mstatus_ref >>= fun w__0 : Mstatus =>
   read_reg cur_privilege_ref >>= fun w__1 : Privilege =>
   (effectivePrivilege typ w__0 w__1) >>= fun w__2 : Privilege =>
   (mem_read_priv_meta typ w__2 paddr width aq rl res meta)
    : M (MemoryOpResult ((mword (8 * width) * unit))).

Definition mem_read_priv
(typ : AccessType unit) (priv : Privilege) (paddr : mword 64) (width : Z) (aq : bool) (rl : bool)
(res : bool) `{ArithFact ((0 <? width) && (width <=? 16))}
: M (MemoryOpResult (mword (8 * width))) :=
   (mem_read_priv_meta typ priv paddr width aq rl res false) >>= fun w__0 : MemoryOpResult ((mword (8 * width) * unit)) =>
   returnm (MemoryOpResult_drop_meta w__0).

Definition mem_read
(typ : AccessType unit) (paddr : mword 64) (width : Z) (aq : bool) (rel : bool) (res : bool)
`{ArithFact ((0 <? width) && (width <=? 16))}
: M (MemoryOpResult (mword (8 * width))) :=
   read_reg mstatus_ref >>= fun w__0 : Mstatus =>
   read_reg cur_privilege_ref >>= fun w__1 : Privilege =>
   (effectivePrivilege typ w__0 w__1) >>= fun w__2 : Privilege =>
   (mem_read_priv typ w__2 paddr width aq rel res)
    : M (MemoryOpResult (mword (8 * width))).

Definition mem_write_ea (addr : mword 64) (width : Z) (aq : bool) (rl : bool) (con : bool)
`{ArithFact ((0 <? width) && (width <=? 16))}
: M (MemoryOpResult unit) :=
   (if sumbool_of_bool (andb (orb rl con) (negb (is_aligned_addr addr width))) then
      returnm (MemException (E_SAMO_Addr_Align tt))
    else
      (match (aq, rl, con) with
       | (false, false, false) => (write_ram_ea Write_plain addr width) >> returnm (MemValue tt)
       | (false, true, false) =>
          (write_ram_ea Write_RISCV_release addr width) >> returnm (MemValue tt)
       | (false, false, true) =>
          (write_ram_ea Write_RISCV_conditional addr width) >> returnm (MemValue tt)
       | (false, true, true) =>
          (write_ram_ea Write_RISCV_conditional_release addr width) >> returnm (MemValue tt)
       | (true, false, false) => throw (Error_not_implemented "store.aq")
       | (true, true, false) =>
          (write_ram_ea Write_RISCV_strong_release addr width) >> returnm (MemValue tt)
       | (true, false, true) => throw (Error_not_implemented "sc.aq")
       | (true, true, true) =>
          (write_ram_ea Write_RISCV_conditional_strong_release addr width) >> returnm (MemValue tt)
       end)
       : M (MemoryOpResult unit))
    : M (MemoryOpResult unit).

Definition rvfi_write (addr : mword 64) (width : Z) (value : mword (8 * width)) (meta : unit)
`{ArithFact (width >? 0)}
: unit :=
   tt.

Definition phys_mem_write
(wk : write_kind) (paddr : mword 64) (width : Z) (data : mword (8 * width)) (meta : unit)
`{ArithFact ((0 <? width) && (width <=? 16))}
: M (MemoryOpResult bool) :=
   let '_ := (rvfi_write paddr width data meta)  : unit in
   (write_ram wk paddr width data meta) >>= fun w__0 : bool =>
   let result := MemValue w__0 in
   let '_ :=
     (if get_config_print_mem tt then
        print_endline
          (String.append "mem["
             (String.append (string_of_bits paddr) (String.append "] <- " (string_of_bits data))))
      else tt)
      : unit in
   returnm result.

Definition checked_mem_write
(wk : write_kind) (paddr : mword 64) (width : Z) (data : mword (8 * width)) (meta : unit)
`{ArithFact ((0 <? width) && (width <=? 16))}
: M (MemoryOpResult bool) :=
   (if within_mmio_writable paddr width then
      (mmio_write paddr width data)
       : M (MemoryOpResult bool)
    else if within_phys_mem paddr width then
      (match (ext_check_phys_mem_write wk paddr width data meta) with
       | Ext_PhysAddr_OK tt => (phys_mem_write wk paddr width data meta)  : M (MemoryOpResult bool)
       | Ext_PhysAddr_Error e => returnm (MemException e)
       end)
       : M (MemoryOpResult bool)
    else returnm (MemException (E_SAMO_Access_Fault tt)))
    : M (MemoryOpResult bool).

Definition pmp_mem_write
(wk : write_kind) (paddr : mword 64) (width : Z) (data : mword (8 * width)) (typ : AccessType unit)
(priv : Privilege) (meta : unit) `{ArithFact ((0 <? width) && (width <=? 16))}
: M (MemoryOpResult bool) :=
   (if negb (plat_enable_pmp tt) then
      (checked_mem_write wk paddr width data meta)
       : M (MemoryOpResult bool)
    else
      (pmpCheck paddr width typ priv) >>= fun w__1 : option ExceptionType =>
      (match w__1 with
       | None => (checked_mem_write wk paddr width data meta)  : M (MemoryOpResult bool)
       | Some e => returnm (MemException e)
       end)
       : M (MemoryOpResult bool))
    : M (MemoryOpResult bool).

Definition mem_write_value_priv_meta
(paddr : mword 64) (width : Z) (value : mword (8 * width)) (typ : AccessType unit)
(priv : Privilege) (meta : unit) (aq : bool) (rl : bool) (con : bool)
`{ArithFact ((0 <? width) && (width <=? 16))}
: M (MemoryOpResult bool) :=
   let '_ := (rvfi_write paddr width value meta)  : unit in
   (if sumbool_of_bool (andb (orb rl con) (negb (is_aligned_addr paddr width))) then
      returnm (MemException (E_SAMO_Addr_Align tt))
    else
      (match (aq, rl, con) with
       | (false, false, false) => returnm Write_plain
       | (false, true, false) => returnm Write_RISCV_release
       | (false, false, true) => returnm Write_RISCV_conditional
       | (false, true, true) => returnm Write_RISCV_conditional_release
       | (true, true, false) => returnm Write_RISCV_strong_release
       | (true, true, true) => returnm Write_RISCV_conditional_strong_release
       | (true, false, false) => throw (Error_not_implemented "store.aq")
       | (true, false, true) => throw (Error_not_implemented "sc.aq")
       end) >>= fun wk : write_kind =>
      (pmp_mem_write wk paddr width value typ priv meta)
       : M (MemoryOpResult bool))
    : M (MemoryOpResult bool).

Definition mem_write_value_priv
(paddr : mword 64) (width : Z) (value : mword (8 * width)) (priv : Privilege) (aq : bool)
(rl : bool) (con : bool) `{ArithFact ((0 <? width) && (width <=? 16))}
: M (MemoryOpResult bool) :=
   (mem_write_value_priv_meta paddr width value (Write default_write_acc) priv default_meta aq rl
      con)
    : M (MemoryOpResult bool).

Definition mem_write_value_meta
(paddr : mword 64) (width : Z) (value : mword (8 * width)) (ext_acc : unit) (meta : unit)
(aq : bool) (rl : bool) (con : bool) `{ArithFact ((0 <? width) && (width <=? 16))}
: M (MemoryOpResult bool) :=
   let typ := Write ext_acc in
   read_reg mstatus_ref >>= fun w__0 : Mstatus =>
   read_reg cur_privilege_ref >>= fun w__1 : Privilege =>
   (effectivePrivilege typ w__0 w__1) >>= fun ep =>
   (mem_write_value_priv_meta paddr width value typ ep meta aq rl con)
    : M (MemoryOpResult bool).

Definition mem_write_value
(paddr : mword 64) (width : Z) (value : mword (8 * width)) (aq : bool) (rl : bool) (con : bool)
`{ArithFact ((0 <? width) && (width <=? 16))}
: M (MemoryOpResult bool) :=
   (mem_write_value_meta paddr width value default_write_acc default_meta aq rl con)
    : M (MemoryOpResult bool).

Definition default_sv32_ext_pte : extPte := zeros_implicit 10.
Hint Unfold default_sv32_ext_pte : sail.
Definition Mk_PTE_Bits (v : mword 8) : PTE_Bits :=
   {| PTE_Bits_PTE_Bits_chunk_0 := (subrange_vec_dec v 7 0) |}.

Definition _get_PTE_Bits_bits (v : PTE_Bits) : mword 8 :=
   subrange_vec_dec v.(PTE_Bits_PTE_Bits_chunk_0) 7 0.

Definition _set_PTE_Bits_bits (r_ref : register_ref regstate register_value PTE_Bits) (v : mword 8)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       PTE_Bits_PTE_Bits_chunk_0 :=
         (update_subrange_vec_dec r.(PTE_Bits_PTE_Bits_chunk_0) 7 0 (subrange_vec_dec v 7 0)) ]}
      : PTE_Bits in
   write_reg r_ref r
    : M (unit).

Definition _update_PTE_Bits_bits (v : PTE_Bits) (x : mword 8) : PTE_Bits :=
   {[ v with
     PTE_Bits_PTE_Bits_chunk_0 :=
       (update_subrange_vec_dec v.(PTE_Bits_PTE_Bits_chunk_0) 7 0 (subrange_vec_dec x 7 0)) ]}.

Definition _get_PTE_Bits_D (v : PTE_Bits) : mword 1 :=
   subrange_vec_dec v.(PTE_Bits_PTE_Bits_chunk_0) 7 7.

Definition _set_PTE_Bits_D (r_ref : register_ref regstate register_value PTE_Bits) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       PTE_Bits_PTE_Bits_chunk_0 :=
         (update_subrange_vec_dec r.(PTE_Bits_PTE_Bits_chunk_0) 7 7 (subrange_vec_dec v 0 0)) ]}
      : PTE_Bits in
   write_reg r_ref r
    : M (unit).

Definition _update_PTE_Bits_D (v : PTE_Bits) (x : mword 1) : PTE_Bits :=
   {[ v with
     PTE_Bits_PTE_Bits_chunk_0 :=
       (update_subrange_vec_dec v.(PTE_Bits_PTE_Bits_chunk_0) 7 7 (subrange_vec_dec x 0 0)) ]}.

Definition _get_PTE_Bits_A (v : PTE_Bits) : mword 1 :=
   subrange_vec_dec v.(PTE_Bits_PTE_Bits_chunk_0) 6 6.

Definition _set_PTE_Bits_A (r_ref : register_ref regstate register_value PTE_Bits) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       PTE_Bits_PTE_Bits_chunk_0 :=
         (update_subrange_vec_dec r.(PTE_Bits_PTE_Bits_chunk_0) 6 6 (subrange_vec_dec v 0 0)) ]}
      : PTE_Bits in
   write_reg r_ref r
    : M (unit).

Definition _update_PTE_Bits_A (v : PTE_Bits) (x : mword 1) : PTE_Bits :=
   {[ v with
     PTE_Bits_PTE_Bits_chunk_0 :=
       (update_subrange_vec_dec v.(PTE_Bits_PTE_Bits_chunk_0) 6 6 (subrange_vec_dec x 0 0)) ]}.

Definition _get_PTE_Bits_G (v : PTE_Bits) : mword 1 :=
   subrange_vec_dec v.(PTE_Bits_PTE_Bits_chunk_0) 5 5.

Definition _set_PTE_Bits_G (r_ref : register_ref regstate register_value PTE_Bits) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       PTE_Bits_PTE_Bits_chunk_0 :=
         (update_subrange_vec_dec r.(PTE_Bits_PTE_Bits_chunk_0) 5 5 (subrange_vec_dec v 0 0)) ]}
      : PTE_Bits in
   write_reg r_ref r
    : M (unit).

Definition _update_PTE_Bits_G (v : PTE_Bits) (x : mword 1) : PTE_Bits :=
   {[ v with
     PTE_Bits_PTE_Bits_chunk_0 :=
       (update_subrange_vec_dec v.(PTE_Bits_PTE_Bits_chunk_0) 5 5 (subrange_vec_dec x 0 0)) ]}.

Definition _get_PTE_Bits_U (v : PTE_Bits) : mword 1 :=
   subrange_vec_dec v.(PTE_Bits_PTE_Bits_chunk_0) 4 4.

Definition _set_PTE_Bits_U (r_ref : register_ref regstate register_value PTE_Bits) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       PTE_Bits_PTE_Bits_chunk_0 :=
         (update_subrange_vec_dec r.(PTE_Bits_PTE_Bits_chunk_0) 4 4 (subrange_vec_dec v 0 0)) ]}
      : PTE_Bits in
   write_reg r_ref r
    : M (unit).

Definition _update_PTE_Bits_U (v : PTE_Bits) (x : mword 1) : PTE_Bits :=
   {[ v with
     PTE_Bits_PTE_Bits_chunk_0 :=
       (update_subrange_vec_dec v.(PTE_Bits_PTE_Bits_chunk_0) 4 4 (subrange_vec_dec x 0 0)) ]}.

Definition _get_PTE_Bits_X (v : PTE_Bits) : mword 1 :=
   subrange_vec_dec v.(PTE_Bits_PTE_Bits_chunk_0) 3 3.

Definition _set_PTE_Bits_X (r_ref : register_ref regstate register_value PTE_Bits) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       PTE_Bits_PTE_Bits_chunk_0 :=
         (update_subrange_vec_dec r.(PTE_Bits_PTE_Bits_chunk_0) 3 3 (subrange_vec_dec v 0 0)) ]}
      : PTE_Bits in
   write_reg r_ref r
    : M (unit).

Definition _update_PTE_Bits_X (v : PTE_Bits) (x : mword 1) : PTE_Bits :=
   {[ v with
     PTE_Bits_PTE_Bits_chunk_0 :=
       (update_subrange_vec_dec v.(PTE_Bits_PTE_Bits_chunk_0) 3 3 (subrange_vec_dec x 0 0)) ]}.

Definition _get_PTE_Bits_W (v : PTE_Bits) : mword 1 :=
   subrange_vec_dec v.(PTE_Bits_PTE_Bits_chunk_0) 2 2.

Definition _set_PTE_Bits_W (r_ref : register_ref regstate register_value PTE_Bits) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       PTE_Bits_PTE_Bits_chunk_0 :=
         (update_subrange_vec_dec r.(PTE_Bits_PTE_Bits_chunk_0) 2 2 (subrange_vec_dec v 0 0)) ]}
      : PTE_Bits in
   write_reg r_ref r
    : M (unit).

Definition _update_PTE_Bits_W (v : PTE_Bits) (x : mword 1) : PTE_Bits :=
   {[ v with
     PTE_Bits_PTE_Bits_chunk_0 :=
       (update_subrange_vec_dec v.(PTE_Bits_PTE_Bits_chunk_0) 2 2 (subrange_vec_dec x 0 0)) ]}.

Definition _get_PTE_Bits_R (v : PTE_Bits) : mword 1 :=
   subrange_vec_dec v.(PTE_Bits_PTE_Bits_chunk_0) 1 1.

Definition _set_PTE_Bits_R (r_ref : register_ref regstate register_value PTE_Bits) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       PTE_Bits_PTE_Bits_chunk_0 :=
         (update_subrange_vec_dec r.(PTE_Bits_PTE_Bits_chunk_0) 1 1 (subrange_vec_dec v 0 0)) ]}
      : PTE_Bits in
   write_reg r_ref r
    : M (unit).

Definition _update_PTE_Bits_R (v : PTE_Bits) (x : mword 1) : PTE_Bits :=
   {[ v with
     PTE_Bits_PTE_Bits_chunk_0 :=
       (update_subrange_vec_dec v.(PTE_Bits_PTE_Bits_chunk_0) 1 1 (subrange_vec_dec x 0 0)) ]}.

Definition _get_PTE_Bits_V (v : PTE_Bits) : mword 1 :=
   subrange_vec_dec v.(PTE_Bits_PTE_Bits_chunk_0) 0 0.

Definition _set_PTE_Bits_V (r_ref : register_ref regstate register_value PTE_Bits) (v : mword 1)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       PTE_Bits_PTE_Bits_chunk_0 :=
         (update_subrange_vec_dec r.(PTE_Bits_PTE_Bits_chunk_0) 0 0 (subrange_vec_dec v 0 0)) ]}
      : PTE_Bits in
   write_reg r_ref r
    : M (unit).

Definition _update_PTE_Bits_V (v : PTE_Bits) (x : mword 1) : PTE_Bits :=
   {[ v with
     PTE_Bits_PTE_Bits_chunk_0 :=
       (update_subrange_vec_dec v.(PTE_Bits_PTE_Bits_chunk_0) 0 0 (subrange_vec_dec x 0 0)) ]}.

Definition isPTEPtr (p : mword 8) (ext : mword 10) : bool :=
   let a := Mk_PTE_Bits p in
   andb (eq_vec (_get_PTE_Bits_R a) ('b"0"  : mword 1))
     (andb (eq_vec (_get_PTE_Bits_W a) ('b"0"  : mword 1))
        (eq_vec (_get_PTE_Bits_X a) ('b"0"  : mword 1))).

Definition isInvalidPTE (p : mword 8) (ext : mword 10) : bool :=
   let a := Mk_PTE_Bits p in
   orb (eq_vec (_get_PTE_Bits_V a) ('b"0"  : mword 1))
     (andb (eq_vec (_get_PTE_Bits_W a) ('b"1"  : mword 1))
        (eq_vec (_get_PTE_Bits_R a) ('b"0"  : mword 1))).

Definition to_pte_check (b : bool) : PTE_Check :=
   if sumbool_of_bool b then PTE_Check_Success tt else PTE_Check_Failure (tt, tt).

Definition checkPTEPermission
(ac : AccessType unit) (priv : Privilege) (mxr : bool) (do_sum : bool) (p : PTE_Bits)
(ext : mword 10) (ext_ptw : unit)
: M (PTE_Check) :=
   (match (ac, priv) with
    | (Read _, User) =>
       returnm (to_pte_check
                  (andb (eq_vec (_get_PTE_Bits_U p) ('b"1"  : mword 1))
                     (orb (eq_vec (_get_PTE_Bits_R p) ('b"1"  : mword 1))
                        (andb (eq_vec (_get_PTE_Bits_X p) ('b"1"  : mword 1)) mxr))))
    | (Write _, User) =>
       returnm (to_pte_check
                  (andb (eq_vec (_get_PTE_Bits_U p) ('b"1"  : mword 1))
                     (eq_vec (_get_PTE_Bits_W p) ('b"1"  : mword 1))))
    | (ReadWrite (_, _), User) =>
       returnm (to_pte_check
                  (andb (eq_vec (_get_PTE_Bits_U p) ('b"1"  : mword 1))
                     (andb (eq_vec (_get_PTE_Bits_W p) ('b"1"  : mword 1))
                        (orb (eq_vec (_get_PTE_Bits_R p) ('b"1"  : mword 1))
                           (andb (eq_vec (_get_PTE_Bits_X p) ('b"1"  : mword 1)) mxr)))))
    | (Execute tt, User) =>
       returnm (to_pte_check
                  (andb (eq_vec (_get_PTE_Bits_U p) ('b"1"  : mword 1))
                     (eq_vec (_get_PTE_Bits_X p) ('b"1"  : mword 1))))
    | (Read _, Supervisor) =>
       returnm (to_pte_check
                  (andb (orb (eq_vec (_get_PTE_Bits_U p) ('b"0"  : mword 1)) do_sum)
                     (orb (eq_vec (_get_PTE_Bits_R p) ('b"1"  : mword 1))
                        (andb (eq_vec (_get_PTE_Bits_X p) ('b"1"  : mword 1)) mxr))))
    | (Write _, Supervisor) =>
       returnm (to_pte_check
                  (andb (orb (eq_vec (_get_PTE_Bits_U p) ('b"0"  : mword 1)) do_sum)
                     (eq_vec (_get_PTE_Bits_W p) ('b"1"  : mword 1))))
    | (ReadWrite (_, _), Supervisor) =>
       returnm (to_pte_check
                  (andb (orb (eq_vec (_get_PTE_Bits_U p) ('b"0"  : mword 1)) do_sum)
                     (andb (eq_vec (_get_PTE_Bits_W p) ('b"1"  : mword 1))
                        (orb (eq_vec (_get_PTE_Bits_R p) ('b"1"  : mword 1))
                           (andb (eq_vec (_get_PTE_Bits_X p) ('b"1"  : mword 1)) mxr)))))
    | (Execute tt, Supervisor) =>
       returnm (to_pte_check
                  (andb (eq_vec (_get_PTE_Bits_U p) ('b"0"  : mword 1))
                     (eq_vec (_get_PTE_Bits_X p) ('b"1"  : mword 1))))
    | (_, Machine) => (internal_error "m-mode mem perm check")  : M (PTE_Check)
    end)
    : M (PTE_Check).

Definition update_PTE_Bits (p : PTE_Bits) (a : AccessType unit) (ext : mword 10)
: option ((PTE_Bits * mword 10)) :=
   let update_d :=
     andb (eq_vec (_get_PTE_Bits_D p) ('b"0"  : mword 1))
       ((match a with
         | Execute tt => false
         | Read tt => false
         | Write _ => true
         | ReadWrite (_, _) => true
         end)
        : bool) in
   let update_a := eq_vec (_get_PTE_Bits_A p) ('b"0"  : mword 1) in
   if sumbool_of_bool (orb update_d update_a) then
     let np := _update_PTE_Bits_A p ('b"1"  : mword 1) in
     let np := if sumbool_of_bool update_d then _update_PTE_Bits_D np ('b"1"  : mword 1) else np in
     Some (np, ext)
   else None.

Definition ptw_error_to_str (e : PTW_Error) : string :=
   match e with
   | PTW_Invalid_Addr tt => "invalid-source-addr"
   | PTW_Access tt => "mem-access-error"
   | PTW_Invalid_PTE tt => "invalid-pte"
   | PTW_No_Permission tt => "no-permission"
   | PTW_Misaligned tt => "misaligned-superpage"
   | PTW_PTE_Update tt => "pte-update-needed"
   | PTW_Ext_Error e => "extension-error"
   end.

Definition ext_get_ptw_error (eptwf : unit) : PTW_Error := PTW_No_Permission tt.

Definition translationException (a : AccessType unit) (f : PTW_Error) : ExceptionType :=
   match (a, f) with
   | (_, PTW_Ext_Error e) => E_Extension (ext_translate_exception e)
   | (ReadWrite _, PTW_Access tt) => E_SAMO_Access_Fault tt
   | (ReadWrite _, _) => E_SAMO_Page_Fault tt
   | (Read _, PTW_Access tt) => E_Load_Access_Fault tt
   | (Read _, _) => E_Load_Page_Fault tt
   | (Write _, PTW_Access tt) => E_SAMO_Access_Fault tt
   | (Write _, _) => E_SAMO_Page_Fault tt
   | (Execute tt, PTW_Access tt) => E_Fetch_Access_Fault tt
   | (Execute tt, _) => E_Fetch_Page_Fault tt
   end.

Definition PAGESIZE_BITS := 12.
Hint Unfold PAGESIZE_BITS : sail.
Definition curAsid32 (satp : mword 32) : mword 9 :=
   let s := Mk_Satp32 satp in
   _get_Satp32_Asid s.

Definition curPTB32 (satp : mword 32) : mword 34 :=
   let s : Satp32 := Mk_Satp32 satp in
   shiftl (EXTZ 34 (_get_Satp32_PPN s)) PAGESIZE_BITS.

Definition SV32_LEVEL_BITS := 10.
Hint Unfold SV32_LEVEL_BITS : sail.
Definition SV32_LEVELS := 2.
Hint Unfold SV32_LEVELS : sail.
Definition PTE32_LOG_SIZE := 2.
Hint Unfold PTE32_LOG_SIZE : sail.
Definition PTE32_SIZE := 4.
Hint Unfold PTE32_SIZE : sail.
Definition Mk_SV32_Vaddr (v : mword 32) : SV32_Vaddr :=
   {| SV32_Vaddr_SV32_Vaddr_chunk_0 := (subrange_vec_dec v 31 0) |}.

Definition _get_SV32_Vaddr_bits (v : SV32_Vaddr) : mword 32 :=
   subrange_vec_dec v.(SV32_Vaddr_SV32_Vaddr_chunk_0) 31 0.

Definition _set_SV32_Vaddr_bits
(r_ref : register_ref regstate register_value SV32_Vaddr) (v : mword 32)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV32_Vaddr_SV32_Vaddr_chunk_0 :=
         (update_subrange_vec_dec r.(SV32_Vaddr_SV32_Vaddr_chunk_0) 31 0 (subrange_vec_dec v 31 0)) ]}
      : SV32_Vaddr in
   write_reg r_ref r
    : M (unit).

Definition _update_SV32_Vaddr_bits (v : SV32_Vaddr) (x : mword 32) : SV32_Vaddr :=
   {[ v with
     SV32_Vaddr_SV32_Vaddr_chunk_0 :=
       (update_subrange_vec_dec v.(SV32_Vaddr_SV32_Vaddr_chunk_0) 31 0 (subrange_vec_dec x 31 0)) ]}.

Definition _get_SV32_Vaddr_VPNi (v : SV32_Vaddr) : mword 20 :=
   subrange_vec_dec v.(SV32_Vaddr_SV32_Vaddr_chunk_0) 31 12.

Definition _set_SV32_Vaddr_VPNi
(r_ref : register_ref regstate register_value SV32_Vaddr) (v : mword 20)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV32_Vaddr_SV32_Vaddr_chunk_0 :=
         (update_subrange_vec_dec r.(SV32_Vaddr_SV32_Vaddr_chunk_0) 31 12 (subrange_vec_dec v 19 0)) ]}
      : SV32_Vaddr in
   write_reg r_ref r
    : M (unit).

Definition _update_SV32_Vaddr_VPNi (v : SV32_Vaddr) (x : mword 20) : SV32_Vaddr :=
   {[ v with
     SV32_Vaddr_SV32_Vaddr_chunk_0 :=
       (update_subrange_vec_dec v.(SV32_Vaddr_SV32_Vaddr_chunk_0) 31 12 (subrange_vec_dec x 19 0)) ]}.

Definition _get_SV32_Vaddr_PgOfs (v : SV32_Vaddr) : mword 12 :=
   subrange_vec_dec v.(SV32_Vaddr_SV32_Vaddr_chunk_0) 11 0.

Definition _set_SV32_Vaddr_PgOfs
(r_ref : register_ref regstate register_value SV32_Vaddr) (v : mword 12)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV32_Vaddr_SV32_Vaddr_chunk_0 :=
         (update_subrange_vec_dec r.(SV32_Vaddr_SV32_Vaddr_chunk_0) 11 0 (subrange_vec_dec v 11 0)) ]}
      : SV32_Vaddr in
   write_reg r_ref r
    : M (unit).

Definition _update_SV32_Vaddr_PgOfs (v : SV32_Vaddr) (x : mword 12) : SV32_Vaddr :=
   {[ v with
     SV32_Vaddr_SV32_Vaddr_chunk_0 :=
       (update_subrange_vec_dec v.(SV32_Vaddr_SV32_Vaddr_chunk_0) 11 0 (subrange_vec_dec x 11 0)) ]}.

Definition Mk_SV32_Paddr (v : mword 34) : SV32_Paddr :=
   {| SV32_Paddr_SV32_Paddr_chunk_0 := (subrange_vec_dec v 33 0) |}.

Definition _get_SV32_Paddr_bits (v : SV32_Paddr) : mword 34 :=
   subrange_vec_dec v.(SV32_Paddr_SV32_Paddr_chunk_0) 33 0.

Definition _set_SV32_Paddr_bits
(r_ref : register_ref regstate register_value SV32_Paddr) (v : mword 34)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV32_Paddr_SV32_Paddr_chunk_0 :=
         (update_subrange_vec_dec r.(SV32_Paddr_SV32_Paddr_chunk_0) 33 0 (subrange_vec_dec v 33 0)) ]}
      : SV32_Paddr in
   write_reg r_ref r
    : M (unit).

Definition _update_SV32_Paddr_bits (v : SV32_Paddr) (x : mword 34) : SV32_Paddr :=
   {[ v with
     SV32_Paddr_SV32_Paddr_chunk_0 :=
       (update_subrange_vec_dec v.(SV32_Paddr_SV32_Paddr_chunk_0) 33 0 (subrange_vec_dec x 33 0)) ]}.

Definition _get_SV32_Paddr_PPNi (v : SV32_Paddr) : mword 22 :=
   subrange_vec_dec v.(SV32_Paddr_SV32_Paddr_chunk_0) 33 12.

Definition _set_SV32_Paddr_PPNi
(r_ref : register_ref regstate register_value SV32_Paddr) (v : mword 22)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV32_Paddr_SV32_Paddr_chunk_0 :=
         (update_subrange_vec_dec r.(SV32_Paddr_SV32_Paddr_chunk_0) 33 12 (subrange_vec_dec v 21 0)) ]}
      : SV32_Paddr in
   write_reg r_ref r
    : M (unit).

Definition _update_SV32_Paddr_PPNi (v : SV32_Paddr) (x : mword 22) : SV32_Paddr :=
   {[ v with
     SV32_Paddr_SV32_Paddr_chunk_0 :=
       (update_subrange_vec_dec v.(SV32_Paddr_SV32_Paddr_chunk_0) 33 12 (subrange_vec_dec x 21 0)) ]}.

Definition _get_SV32_Paddr_PgOfs (v : SV32_Paddr) : mword 12 :=
   subrange_vec_dec v.(SV32_Paddr_SV32_Paddr_chunk_0) 11 0.

Definition _set_SV32_Paddr_PgOfs
(r_ref : register_ref regstate register_value SV32_Paddr) (v : mword 12)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV32_Paddr_SV32_Paddr_chunk_0 :=
         (update_subrange_vec_dec r.(SV32_Paddr_SV32_Paddr_chunk_0) 11 0 (subrange_vec_dec v 11 0)) ]}
      : SV32_Paddr in
   write_reg r_ref r
    : M (unit).

Definition _update_SV32_Paddr_PgOfs (v : SV32_Paddr) (x : mword 12) : SV32_Paddr :=
   {[ v with
     SV32_Paddr_SV32_Paddr_chunk_0 :=
       (update_subrange_vec_dec v.(SV32_Paddr_SV32_Paddr_chunk_0) 11 0 (subrange_vec_dec x 11 0)) ]}.

Definition Mk_SV32_PTE (v : mword 32) : SV32_PTE :=
   {| SV32_PTE_SV32_PTE_chunk_0 := (subrange_vec_dec v 31 0) |}.

Definition _get_SV32_PTE_bits (v : SV32_PTE) : mword 32 :=
   subrange_vec_dec v.(SV32_PTE_SV32_PTE_chunk_0) 31 0.

Definition _set_SV32_PTE_bits (r_ref : register_ref regstate register_value SV32_PTE) (v : mword 32)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV32_PTE_SV32_PTE_chunk_0 :=
         (update_subrange_vec_dec r.(SV32_PTE_SV32_PTE_chunk_0) 31 0 (subrange_vec_dec v 31 0)) ]}
      : SV32_PTE in
   write_reg r_ref r
    : M (unit).

Definition _update_SV32_PTE_bits (v : SV32_PTE) (x : mword 32) : SV32_PTE :=
   {[ v with
     SV32_PTE_SV32_PTE_chunk_0 :=
       (update_subrange_vec_dec v.(SV32_PTE_SV32_PTE_chunk_0) 31 0 (subrange_vec_dec x 31 0)) ]}.

Definition _get_SV32_PTE_PPNi (v : SV32_PTE) : mword 22 :=
   subrange_vec_dec v.(SV32_PTE_SV32_PTE_chunk_0) 31 10.

Definition _set_SV32_PTE_PPNi (r_ref : register_ref regstate register_value SV32_PTE) (v : mword 22)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV32_PTE_SV32_PTE_chunk_0 :=
         (update_subrange_vec_dec r.(SV32_PTE_SV32_PTE_chunk_0) 31 10 (subrange_vec_dec v 21 0)) ]}
      : SV32_PTE in
   write_reg r_ref r
    : M (unit).

Definition _update_SV32_PTE_PPNi (v : SV32_PTE) (x : mword 22) : SV32_PTE :=
   {[ v with
     SV32_PTE_SV32_PTE_chunk_0 :=
       (update_subrange_vec_dec v.(SV32_PTE_SV32_PTE_chunk_0) 31 10 (subrange_vec_dec x 21 0)) ]}.

Definition _get_SV32_PTE_RSW (v : SV32_PTE) : mword 2 :=
   subrange_vec_dec v.(SV32_PTE_SV32_PTE_chunk_0) 9 8.

Definition _set_SV32_PTE_RSW (r_ref : register_ref regstate register_value SV32_PTE) (v : mword 2)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV32_PTE_SV32_PTE_chunk_0 :=
         (update_subrange_vec_dec r.(SV32_PTE_SV32_PTE_chunk_0) 9 8 (subrange_vec_dec v 1 0)) ]}
      : SV32_PTE in
   write_reg r_ref r
    : M (unit).

Definition _update_SV32_PTE_RSW (v : SV32_PTE) (x : mword 2) : SV32_PTE :=
   {[ v with
     SV32_PTE_SV32_PTE_chunk_0 :=
       (update_subrange_vec_dec v.(SV32_PTE_SV32_PTE_chunk_0) 9 8 (subrange_vec_dec x 1 0)) ]}.

Definition _get_SV32_PTE_BITS (v : SV32_PTE) : mword 8 :=
   subrange_vec_dec v.(SV32_PTE_SV32_PTE_chunk_0) 7 0.

Definition _set_SV32_PTE_BITS (r_ref : register_ref regstate register_value SV32_PTE) (v : mword 8)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV32_PTE_SV32_PTE_chunk_0 :=
         (update_subrange_vec_dec r.(SV32_PTE_SV32_PTE_chunk_0) 7 0 (subrange_vec_dec v 7 0)) ]}
      : SV32_PTE in
   write_reg r_ref r
    : M (unit).

Definition _update_SV32_PTE_BITS (v : SV32_PTE) (x : mword 8) : SV32_PTE :=
   {[ v with
     SV32_PTE_SV32_PTE_chunk_0 :=
       (update_subrange_vec_dec v.(SV32_PTE_SV32_PTE_chunk_0) 7 0 (subrange_vec_dec x 7 0)) ]}.

Definition curAsid64 (satp : mword 64) : mword 16 :=
   let s := Mk_Satp64 satp in
   _get_Satp64_Asid s.

Definition curPTB64 (satp : mword 64) : mword 56 :=
   let s := Mk_Satp64 satp in
   shiftl (EXTZ 56 (_get_Satp64_PPN s)) PAGESIZE_BITS.

Definition SV39_LEVEL_BITS := 9.
Hint Unfold SV39_LEVEL_BITS : sail.
Definition SV39_LEVELS := 3.
Hint Unfold SV39_LEVELS : sail.
Definition PTE39_LOG_SIZE := 3.
Hint Unfold PTE39_LOG_SIZE : sail.
Definition PTE39_SIZE := 8.
Hint Unfold PTE39_SIZE : sail.
Definition Mk_SV39_Vaddr (v : mword 39) : SV39_Vaddr :=
   {| SV39_Vaddr_SV39_Vaddr_chunk_0 := (subrange_vec_dec v 38 0) |}.

Definition _get_SV39_Vaddr_bits (v : SV39_Vaddr) : mword 39 :=
   subrange_vec_dec v.(SV39_Vaddr_SV39_Vaddr_chunk_0) 38 0.

Definition _set_SV39_Vaddr_bits
(r_ref : register_ref regstate register_value SV39_Vaddr) (v : mword 39)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV39_Vaddr_SV39_Vaddr_chunk_0 :=
         (update_subrange_vec_dec r.(SV39_Vaddr_SV39_Vaddr_chunk_0) 38 0 (subrange_vec_dec v 38 0)) ]}
      : SV39_Vaddr in
   write_reg r_ref r
    : M (unit).

Definition _update_SV39_Vaddr_bits (v : SV39_Vaddr) (x : mword 39) : SV39_Vaddr :=
   {[ v with
     SV39_Vaddr_SV39_Vaddr_chunk_0 :=
       (update_subrange_vec_dec v.(SV39_Vaddr_SV39_Vaddr_chunk_0) 38 0 (subrange_vec_dec x 38 0)) ]}.

Definition _get_SV39_Vaddr_VPNi (v : SV39_Vaddr) : mword 27 :=
   subrange_vec_dec v.(SV39_Vaddr_SV39_Vaddr_chunk_0) 38 12.

Definition _set_SV39_Vaddr_VPNi
(r_ref : register_ref regstate register_value SV39_Vaddr) (v : mword 27)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV39_Vaddr_SV39_Vaddr_chunk_0 :=
         (update_subrange_vec_dec r.(SV39_Vaddr_SV39_Vaddr_chunk_0) 38 12 (subrange_vec_dec v 26 0)) ]}
      : SV39_Vaddr in
   write_reg r_ref r
    : M (unit).

Definition _update_SV39_Vaddr_VPNi (v : SV39_Vaddr) (x : mword 27) : SV39_Vaddr :=
   {[ v with
     SV39_Vaddr_SV39_Vaddr_chunk_0 :=
       (update_subrange_vec_dec v.(SV39_Vaddr_SV39_Vaddr_chunk_0) 38 12 (subrange_vec_dec x 26 0)) ]}.

Definition _get_SV39_Vaddr_PgOfs (v : SV39_Vaddr) : mword 12 :=
   subrange_vec_dec v.(SV39_Vaddr_SV39_Vaddr_chunk_0) 11 0.

Definition _set_SV39_Vaddr_PgOfs
(r_ref : register_ref regstate register_value SV39_Vaddr) (v : mword 12)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV39_Vaddr_SV39_Vaddr_chunk_0 :=
         (update_subrange_vec_dec r.(SV39_Vaddr_SV39_Vaddr_chunk_0) 11 0 (subrange_vec_dec v 11 0)) ]}
      : SV39_Vaddr in
   write_reg r_ref r
    : M (unit).

Definition _update_SV39_Vaddr_PgOfs (v : SV39_Vaddr) (x : mword 12) : SV39_Vaddr :=
   {[ v with
     SV39_Vaddr_SV39_Vaddr_chunk_0 :=
       (update_subrange_vec_dec v.(SV39_Vaddr_SV39_Vaddr_chunk_0) 11 0 (subrange_vec_dec x 11 0)) ]}.

Definition Mk_SV39_Paddr (v : mword 56) : SV39_Paddr :=
   {| SV39_Paddr_SV39_Paddr_chunk_0 := (subrange_vec_dec v 55 0) |}.

Definition _get_SV39_Paddr_bits (v : SV39_Paddr) : mword 56 :=
   subrange_vec_dec v.(SV39_Paddr_SV39_Paddr_chunk_0) 55 0.

Definition _set_SV39_Paddr_bits
(r_ref : register_ref regstate register_value SV39_Paddr) (v : mword 56)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV39_Paddr_SV39_Paddr_chunk_0 :=
         (update_subrange_vec_dec r.(SV39_Paddr_SV39_Paddr_chunk_0) 55 0 (subrange_vec_dec v 55 0)) ]}
      : SV39_Paddr in
   write_reg r_ref r
    : M (unit).

Definition _update_SV39_Paddr_bits (v : SV39_Paddr) (x : mword 56) : SV39_Paddr :=
   {[ v with
     SV39_Paddr_SV39_Paddr_chunk_0 :=
       (update_subrange_vec_dec v.(SV39_Paddr_SV39_Paddr_chunk_0) 55 0 (subrange_vec_dec x 55 0)) ]}.

Definition _get_SV39_Paddr_PPNi (v : SV39_Paddr) : mword 44 :=
   subrange_vec_dec v.(SV39_Paddr_SV39_Paddr_chunk_0) 55 12.

Definition _set_SV39_Paddr_PPNi
(r_ref : register_ref regstate register_value SV39_Paddr) (v : mword 44)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV39_Paddr_SV39_Paddr_chunk_0 :=
         (update_subrange_vec_dec r.(SV39_Paddr_SV39_Paddr_chunk_0) 55 12 (subrange_vec_dec v 43 0)) ]}
      : SV39_Paddr in
   write_reg r_ref r
    : M (unit).

Definition _update_SV39_Paddr_PPNi (v : SV39_Paddr) (x : mword 44) : SV39_Paddr :=
   {[ v with
     SV39_Paddr_SV39_Paddr_chunk_0 :=
       (update_subrange_vec_dec v.(SV39_Paddr_SV39_Paddr_chunk_0) 55 12 (subrange_vec_dec x 43 0)) ]}.

Definition _get_SV39_Paddr_PgOfs (v : SV39_Paddr) : mword 12 :=
   subrange_vec_dec v.(SV39_Paddr_SV39_Paddr_chunk_0) 11 0.

Definition _set_SV39_Paddr_PgOfs
(r_ref : register_ref regstate register_value SV39_Paddr) (v : mword 12)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV39_Paddr_SV39_Paddr_chunk_0 :=
         (update_subrange_vec_dec r.(SV39_Paddr_SV39_Paddr_chunk_0) 11 0 (subrange_vec_dec v 11 0)) ]}
      : SV39_Paddr in
   write_reg r_ref r
    : M (unit).

Definition _update_SV39_Paddr_PgOfs (v : SV39_Paddr) (x : mword 12) : SV39_Paddr :=
   {[ v with
     SV39_Paddr_SV39_Paddr_chunk_0 :=
       (update_subrange_vec_dec v.(SV39_Paddr_SV39_Paddr_chunk_0) 11 0 (subrange_vec_dec x 11 0)) ]}.

Definition Mk_SV39_PTE (v : mword 64) : SV39_PTE :=
   {| SV39_PTE_SV39_PTE_chunk_0 := (subrange_vec_dec v 63 0) |}.

Definition _get_SV39_PTE_bits (v : SV39_PTE) : mword 64 :=
   subrange_vec_dec v.(SV39_PTE_SV39_PTE_chunk_0) 63 0.

Definition _set_SV39_PTE_bits (r_ref : register_ref regstate register_value SV39_PTE) (v : mword 64)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV39_PTE_SV39_PTE_chunk_0 :=
         (update_subrange_vec_dec r.(SV39_PTE_SV39_PTE_chunk_0) 63 0 (subrange_vec_dec v 63 0)) ]}
      : SV39_PTE in
   write_reg r_ref r
    : M (unit).

Definition _update_SV39_PTE_bits (v : SV39_PTE) (x : mword 64) : SV39_PTE :=
   {[ v with
     SV39_PTE_SV39_PTE_chunk_0 :=
       (update_subrange_vec_dec v.(SV39_PTE_SV39_PTE_chunk_0) 63 0 (subrange_vec_dec x 63 0)) ]}.

Definition _get_SV39_PTE_Ext (v : SV39_PTE) : mword 10 :=
   subrange_vec_dec v.(SV39_PTE_SV39_PTE_chunk_0) 63 54.

Definition _set_SV39_PTE_Ext (r_ref : register_ref regstate register_value SV39_PTE) (v : mword 10)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV39_PTE_SV39_PTE_chunk_0 :=
         (update_subrange_vec_dec r.(SV39_PTE_SV39_PTE_chunk_0) 63 54 (subrange_vec_dec v 9 0)) ]}
      : SV39_PTE in
   write_reg r_ref r
    : M (unit).

Definition _update_SV39_PTE_Ext (v : SV39_PTE) (x : mword 10) : SV39_PTE :=
   {[ v with
     SV39_PTE_SV39_PTE_chunk_0 :=
       (update_subrange_vec_dec v.(SV39_PTE_SV39_PTE_chunk_0) 63 54 (subrange_vec_dec x 9 0)) ]}.

Definition _get_SV39_PTE_PPNi (v : SV39_PTE) : mword 44 :=
   subrange_vec_dec v.(SV39_PTE_SV39_PTE_chunk_0) 53 10.

Definition _set_SV39_PTE_PPNi (r_ref : register_ref regstate register_value SV39_PTE) (v : mword 44)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV39_PTE_SV39_PTE_chunk_0 :=
         (update_subrange_vec_dec r.(SV39_PTE_SV39_PTE_chunk_0) 53 10 (subrange_vec_dec v 43 0)) ]}
      : SV39_PTE in
   write_reg r_ref r
    : M (unit).

Definition _update_SV39_PTE_PPNi (v : SV39_PTE) (x : mword 44) : SV39_PTE :=
   {[ v with
     SV39_PTE_SV39_PTE_chunk_0 :=
       (update_subrange_vec_dec v.(SV39_PTE_SV39_PTE_chunk_0) 53 10 (subrange_vec_dec x 43 0)) ]}.

Definition _get_SV39_PTE_RSW (v : SV39_PTE) : mword 2 :=
   subrange_vec_dec v.(SV39_PTE_SV39_PTE_chunk_0) 9 8.

Definition _set_SV39_PTE_RSW (r_ref : register_ref regstate register_value SV39_PTE) (v : mword 2)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV39_PTE_SV39_PTE_chunk_0 :=
         (update_subrange_vec_dec r.(SV39_PTE_SV39_PTE_chunk_0) 9 8 (subrange_vec_dec v 1 0)) ]}
      : SV39_PTE in
   write_reg r_ref r
    : M (unit).

Definition _update_SV39_PTE_RSW (v : SV39_PTE) (x : mword 2) : SV39_PTE :=
   {[ v with
     SV39_PTE_SV39_PTE_chunk_0 :=
       (update_subrange_vec_dec v.(SV39_PTE_SV39_PTE_chunk_0) 9 8 (subrange_vec_dec x 1 0)) ]}.

Definition _get_SV39_PTE_BITS (v : SV39_PTE) : mword 8 :=
   subrange_vec_dec v.(SV39_PTE_SV39_PTE_chunk_0) 7 0.

Definition _set_SV39_PTE_BITS (r_ref : register_ref regstate register_value SV39_PTE) (v : mword 8)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV39_PTE_SV39_PTE_chunk_0 :=
         (update_subrange_vec_dec r.(SV39_PTE_SV39_PTE_chunk_0) 7 0 (subrange_vec_dec v 7 0)) ]}
      : SV39_PTE in
   write_reg r_ref r
    : M (unit).

Definition _update_SV39_PTE_BITS (v : SV39_PTE) (x : mword 8) : SV39_PTE :=
   {[ v with
     SV39_PTE_SV39_PTE_chunk_0 :=
       (update_subrange_vec_dec v.(SV39_PTE_SV39_PTE_chunk_0) 7 0 (subrange_vec_dec x 7 0)) ]}.

Definition SV48_LEVEL_BITS := 9.
Hint Unfold SV48_LEVEL_BITS : sail.
Definition SV48_LEVELS := 4.
Hint Unfold SV48_LEVELS : sail.
Definition PTE48_LOG_SIZE := 3.
Hint Unfold PTE48_LOG_SIZE : sail.
Definition PTE48_SIZE := 8.
Hint Unfold PTE48_SIZE : sail.
Definition Mk_SV48_Vaddr (v : mword 48) : SV48_Vaddr :=
   {| SV48_Vaddr_SV48_Vaddr_chunk_0 := (subrange_vec_dec v 47 0) |}.

Definition _get_SV48_Vaddr_bits (v : SV48_Vaddr) : mword 48 :=
   subrange_vec_dec v.(SV48_Vaddr_SV48_Vaddr_chunk_0) 47 0.

Definition _set_SV48_Vaddr_bits
(r_ref : register_ref regstate register_value SV48_Vaddr) (v : mword 48)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV48_Vaddr_SV48_Vaddr_chunk_0 :=
         (update_subrange_vec_dec r.(SV48_Vaddr_SV48_Vaddr_chunk_0) 47 0 (subrange_vec_dec v 47 0)) ]}
      : SV48_Vaddr in
   write_reg r_ref r
    : M (unit).

Definition _update_SV48_Vaddr_bits (v : SV48_Vaddr) (x : mword 48) : SV48_Vaddr :=
   {[ v with
     SV48_Vaddr_SV48_Vaddr_chunk_0 :=
       (update_subrange_vec_dec v.(SV48_Vaddr_SV48_Vaddr_chunk_0) 47 0 (subrange_vec_dec x 47 0)) ]}.

Definition _get_SV48_Vaddr_VPNi (v : SV48_Vaddr) : mword 27 :=
   subrange_vec_dec v.(SV48_Vaddr_SV48_Vaddr_chunk_0) 38 12.

Definition _set_SV48_Vaddr_VPNi
(r_ref : register_ref regstate register_value SV48_Vaddr) (v : mword 27)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV48_Vaddr_SV48_Vaddr_chunk_0 :=
         (update_subrange_vec_dec r.(SV48_Vaddr_SV48_Vaddr_chunk_0) 38 12 (subrange_vec_dec v 26 0)) ]}
      : SV48_Vaddr in
   write_reg r_ref r
    : M (unit).

Definition _update_SV48_Vaddr_VPNi (v : SV48_Vaddr) (x : mword 27) : SV48_Vaddr :=
   {[ v with
     SV48_Vaddr_SV48_Vaddr_chunk_0 :=
       (update_subrange_vec_dec v.(SV48_Vaddr_SV48_Vaddr_chunk_0) 38 12 (subrange_vec_dec x 26 0)) ]}.

Definition _get_SV48_Vaddr_PgOfs (v : SV48_Vaddr) : mword 12 :=
   subrange_vec_dec v.(SV48_Vaddr_SV48_Vaddr_chunk_0) 11 0.

Definition _set_SV48_Vaddr_PgOfs
(r_ref : register_ref regstate register_value SV48_Vaddr) (v : mword 12)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV48_Vaddr_SV48_Vaddr_chunk_0 :=
         (update_subrange_vec_dec r.(SV48_Vaddr_SV48_Vaddr_chunk_0) 11 0 (subrange_vec_dec v 11 0)) ]}
      : SV48_Vaddr in
   write_reg r_ref r
    : M (unit).

Definition _update_SV48_Vaddr_PgOfs (v : SV48_Vaddr) (x : mword 12) : SV48_Vaddr :=
   {[ v with
     SV48_Vaddr_SV48_Vaddr_chunk_0 :=
       (update_subrange_vec_dec v.(SV48_Vaddr_SV48_Vaddr_chunk_0) 11 0 (subrange_vec_dec x 11 0)) ]}.

Definition Mk_SV48_Paddr (v : mword 56) : SV48_Paddr :=
   {| SV48_Paddr_SV48_Paddr_chunk_0 := (subrange_vec_dec v 55 0) |}.

Definition _get_SV48_Paddr_bits (v : SV48_Paddr) : mword 56 :=
   subrange_vec_dec v.(SV48_Paddr_SV48_Paddr_chunk_0) 55 0.

Definition _set_SV48_Paddr_bits
(r_ref : register_ref regstate register_value SV48_Paddr) (v : mword 56)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV48_Paddr_SV48_Paddr_chunk_0 :=
         (update_subrange_vec_dec r.(SV48_Paddr_SV48_Paddr_chunk_0) 55 0 (subrange_vec_dec v 55 0)) ]}
      : SV48_Paddr in
   write_reg r_ref r
    : M (unit).

Definition _update_SV48_Paddr_bits (v : SV48_Paddr) (x : mword 56) : SV48_Paddr :=
   {[ v with
     SV48_Paddr_SV48_Paddr_chunk_0 :=
       (update_subrange_vec_dec v.(SV48_Paddr_SV48_Paddr_chunk_0) 55 0 (subrange_vec_dec x 55 0)) ]}.

Definition _get_SV48_Paddr_PPNi (v : SV48_Paddr) : mword 44 :=
   subrange_vec_dec v.(SV48_Paddr_SV48_Paddr_chunk_0) 55 12.

Definition _set_SV48_Paddr_PPNi
(r_ref : register_ref regstate register_value SV48_Paddr) (v : mword 44)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV48_Paddr_SV48_Paddr_chunk_0 :=
         (update_subrange_vec_dec r.(SV48_Paddr_SV48_Paddr_chunk_0) 55 12 (subrange_vec_dec v 43 0)) ]}
      : SV48_Paddr in
   write_reg r_ref r
    : M (unit).

Definition _update_SV48_Paddr_PPNi (v : SV48_Paddr) (x : mword 44) : SV48_Paddr :=
   {[ v with
     SV48_Paddr_SV48_Paddr_chunk_0 :=
       (update_subrange_vec_dec v.(SV48_Paddr_SV48_Paddr_chunk_0) 55 12 (subrange_vec_dec x 43 0)) ]}.

Definition _get_SV48_Paddr_PgOfs (v : SV48_Paddr) : mword 12 :=
   subrange_vec_dec v.(SV48_Paddr_SV48_Paddr_chunk_0) 11 0.

Definition _set_SV48_Paddr_PgOfs
(r_ref : register_ref regstate register_value SV48_Paddr) (v : mword 12)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV48_Paddr_SV48_Paddr_chunk_0 :=
         (update_subrange_vec_dec r.(SV48_Paddr_SV48_Paddr_chunk_0) 11 0 (subrange_vec_dec v 11 0)) ]}
      : SV48_Paddr in
   write_reg r_ref r
    : M (unit).

Definition _update_SV48_Paddr_PgOfs (v : SV48_Paddr) (x : mword 12) : SV48_Paddr :=
   {[ v with
     SV48_Paddr_SV48_Paddr_chunk_0 :=
       (update_subrange_vec_dec v.(SV48_Paddr_SV48_Paddr_chunk_0) 11 0 (subrange_vec_dec x 11 0)) ]}.

Definition Mk_SV48_PTE (v : mword 64) : SV48_PTE :=
   {| SV48_PTE_SV48_PTE_chunk_0 := (subrange_vec_dec v 63 0) |}.

Definition _get_SV48_PTE_bits (v : SV48_PTE) : mword 64 :=
   subrange_vec_dec v.(SV48_PTE_SV48_PTE_chunk_0) 63 0.

Definition _set_SV48_PTE_bits (r_ref : register_ref regstate register_value SV48_PTE) (v : mword 64)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV48_PTE_SV48_PTE_chunk_0 :=
         (update_subrange_vec_dec r.(SV48_PTE_SV48_PTE_chunk_0) 63 0 (subrange_vec_dec v 63 0)) ]}
      : SV48_PTE in
   write_reg r_ref r
    : M (unit).

Definition _update_SV48_PTE_bits (v : SV48_PTE) (x : mword 64) : SV48_PTE :=
   {[ v with
     SV48_PTE_SV48_PTE_chunk_0 :=
       (update_subrange_vec_dec v.(SV48_PTE_SV48_PTE_chunk_0) 63 0 (subrange_vec_dec x 63 0)) ]}.

Definition _get_SV48_PTE_Ext (v : SV48_PTE) : mword 10 :=
   subrange_vec_dec v.(SV48_PTE_SV48_PTE_chunk_0) 63 54.

Definition _set_SV48_PTE_Ext (r_ref : register_ref regstate register_value SV48_PTE) (v : mword 10)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV48_PTE_SV48_PTE_chunk_0 :=
         (update_subrange_vec_dec r.(SV48_PTE_SV48_PTE_chunk_0) 63 54 (subrange_vec_dec v 9 0)) ]}
      : SV48_PTE in
   write_reg r_ref r
    : M (unit).

Definition _update_SV48_PTE_Ext (v : SV48_PTE) (x : mword 10) : SV48_PTE :=
   {[ v with
     SV48_PTE_SV48_PTE_chunk_0 :=
       (update_subrange_vec_dec v.(SV48_PTE_SV48_PTE_chunk_0) 63 54 (subrange_vec_dec x 9 0)) ]}.

Definition _get_SV48_PTE_PPNi (v : SV48_PTE) : mword 44 :=
   subrange_vec_dec v.(SV48_PTE_SV48_PTE_chunk_0) 53 10.

Definition _set_SV48_PTE_PPNi (r_ref : register_ref regstate register_value SV48_PTE) (v : mword 44)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV48_PTE_SV48_PTE_chunk_0 :=
         (update_subrange_vec_dec r.(SV48_PTE_SV48_PTE_chunk_0) 53 10 (subrange_vec_dec v 43 0)) ]}
      : SV48_PTE in
   write_reg r_ref r
    : M (unit).

Definition _update_SV48_PTE_PPNi (v : SV48_PTE) (x : mword 44) : SV48_PTE :=
   {[ v with
     SV48_PTE_SV48_PTE_chunk_0 :=
       (update_subrange_vec_dec v.(SV48_PTE_SV48_PTE_chunk_0) 53 10 (subrange_vec_dec x 43 0)) ]}.

Definition _get_SV48_PTE_RSW (v : SV48_PTE) : mword 2 :=
   subrange_vec_dec v.(SV48_PTE_SV48_PTE_chunk_0) 9 8.

Definition _set_SV48_PTE_RSW (r_ref : register_ref regstate register_value SV48_PTE) (v : mword 2)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV48_PTE_SV48_PTE_chunk_0 :=
         (update_subrange_vec_dec r.(SV48_PTE_SV48_PTE_chunk_0) 9 8 (subrange_vec_dec v 1 0)) ]}
      : SV48_PTE in
   write_reg r_ref r
    : M (unit).

Definition _update_SV48_PTE_RSW (v : SV48_PTE) (x : mword 2) : SV48_PTE :=
   {[ v with
     SV48_PTE_SV48_PTE_chunk_0 :=
       (update_subrange_vec_dec v.(SV48_PTE_SV48_PTE_chunk_0) 9 8 (subrange_vec_dec x 1 0)) ]}.

Definition _get_SV48_PTE_BITS (v : SV48_PTE) : mword 8 :=
   subrange_vec_dec v.(SV48_PTE_SV48_PTE_chunk_0) 7 0.

Definition _set_SV48_PTE_BITS (r_ref : register_ref regstate register_value SV48_PTE) (v : mword 8)
: M (unit) :=
   (reg_deref r_ref) >>= fun r =>
   let r :=
     {[ r with
       SV48_PTE_SV48_PTE_chunk_0 :=
         (update_subrange_vec_dec r.(SV48_PTE_SV48_PTE_chunk_0) 7 0 (subrange_vec_dec v 7 0)) ]}
      : SV48_PTE in
   write_reg r_ref r
    : M (unit).

Definition _update_SV48_PTE_BITS (v : SV48_PTE) (x : mword 8) : SV48_PTE :=
   {[ v with
     SV48_PTE_SV48_PTE_chunk_0 :=
       (update_subrange_vec_dec v.(SV48_PTE_SV48_PTE_chunk_0) 7 0 (subrange_vec_dec x 7 0)) ]}.

Definition make_TLB_Entry {asidlen : Z} {valen : Z} {palen : Z} {ptelen : Z}
(asid : mword asidlen) (global : bool) (vAddr : mword valen) (pAddr : mword palen)
(pte : mword ptelen) (level : Z) (pteAddr : mword palen) (levelBitSize : Z)
`{ArithFact (valen >? 0)} `{ArithFact (0 <=? level)} `{ArithFact (0 <=? levelBitSize)}
: M (TLB_Entry asidlen valen palen ptelen) :=
   let shift := Z.add PAGESIZE_BITS (Z.mul level levelBitSize) in
   let vAddrMask : bits valen :=
     sub_vec_int
       (shiftl (xor_vec vAddr (xor_vec vAddr (EXTZ (length_mword vAddr) ('b"1"  : mword 1)))) shift)
       1 in
   let vMatchMask : bits valen := not_vec vAddrMask in
   ((read_reg mcycle_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   returnm ({| TLB_Entry_asid := asid; 
               TLB_Entry_global := global; 
               TLB_Entry_pte := pte; 
               TLB_Entry_pteAddr := pteAddr; 
               TLB_Entry_vAddrMask := vAddrMask; 
               TLB_Entry_vMatchMask := vMatchMask; 
               TLB_Entry_vAddr := (and_vec vAddr vMatchMask); 
               TLB_Entry_pAddr := (shiftl (shiftr pAddr shift) shift); 
               TLB_Entry_age := w__0 |}).

Definition match_TLB_Entry {asidlen : Z} {valen : Z} {palen : Z} {ptelen : Z}
(ent : TLB_Entry asidlen valen palen ptelen) (asid : mword asidlen) (vaddr : mword valen)
: bool :=
   andb (orb ent.(TLB_Entry_global) (eq_vec ent.(TLB_Entry_asid) asid))
     (eq_vec ent.(TLB_Entry_vAddr) (and_vec ent.(TLB_Entry_vMatchMask) vaddr)).

Definition flush_TLB_Entry {asidlen : Z} {valen : Z} {palen : Z} {ptelen : Z}
(e : TLB_Entry asidlen valen palen ptelen) (asid : option (mword asidlen))
(addr : option (mword valen))
: bool :=
   match (asid, addr) with
   | (None, None) => true
   | (None, Some a) => eq_vec e.(TLB_Entry_vAddr) (and_vec e.(TLB_Entry_vMatchMask) a)
   | (Some i, None) => andb (eq_vec e.(TLB_Entry_asid) i) (negb e.(TLB_Entry_global))
   | (Some i, Some a) =>
      andb (eq_vec e.(TLB_Entry_asid) i)
        (andb (eq_vec e.(TLB_Entry_vAddr) (and_vec a e.(TLB_Entry_vMatchMask)))
           (negb e.(TLB_Entry_global)))
   end.

Fixpoint _rec_walk39
(vaddr : mword 39) (ac : AccessType unit) (priv : Privilege) (mxr : bool) (do_sum : bool)
(ptb : mword 56) (level : Z) (global : bool) (ext_ptw : unit) (_reclimit : Z)
`{ArithFact (0 <=? level)} (_acc : Acc (Zwf 0) _reclimit)
{struct _acc} : M (PTW_Result (mword 56) SV39_PTE).
exact (
   assert_exp' (Z.geb _reclimit 0) "recursion limit reached" >>= fun _ =>
   let va := Mk_SV39_Vaddr vaddr in
   let pt_ofs : paddr64 :=
     shiftl
       (EXTZ 56
          (subrange_vec_dec (shiftr (_get_SV39_Vaddr_VPNi va) (Z.mul level SV39_LEVEL_BITS))
             (Z.sub SV39_LEVEL_BITS 1) 0)) PTE39_LOG_SIZE in
   let pte_addr := add_vec ptb pt_ofs in
   (mem_read_priv (Read Data) Supervisor (EXTZ 64 pte_addr) 8 false false false) >>= fun w__0 : MemoryOpResult (mword (8 * 8)) =>
   (match w__0 with
    | MemException _ => returnm (PTW_Failure (PTW_Access tt, ext_ptw))
    | MemValue v =>
       let pte := Mk_SV39_PTE v in
       let pbits := _get_SV39_PTE_BITS pte in
       let ext_pte := _get_SV39_PTE_Ext pte in
       let pattr := Mk_PTE_Bits pbits in
       let is_global := orb global (eq_vec (_get_PTE_Bits_G pattr) ('b"1"  : mword 1)) in
       (if isInvalidPTE pbits ext_pte then returnm (PTW_Failure (PTW_Invalid_PTE tt, ext_ptw))
        else if isPTEPtr pbits ext_pte then
          (if sumbool_of_bool (Z.gtb level 0) then
             (_rec_walk39 vaddr ac priv mxr do_sum
                (shiftl (EXTZ 56 (_get_SV39_PTE_PPNi pte)) PAGESIZE_BITS) (Z.sub level 1) is_global
                ext_ptw (Z.sub _reclimit 1) _ (_limit_reduces _acc))
              : M (PTW_Result (mword 56) SV39_PTE)
           else returnm (PTW_Failure (PTW_Invalid_PTE tt, ext_ptw)))
           : M (PTW_Result (mword 56) SV39_PTE)
        else
          (checkPTEPermission ac priv mxr do_sum pattr ext_pte ext_ptw) >>= fun w__3 : PTE_Check =>
          returnm (match w__3 with
                   | PTE_Check_Failure (ext_ptw, ext_ptw_fail) =>
                      PTW_Failure (ext_get_ptw_error ext_ptw_fail, ext_ptw)
                   | PTE_Check_Success ext_ptw =>
                      if sumbool_of_bool (Z.gtb level 0) then
                        let mask :=
                          sub_vec_int
                            (shiftl
                               (xor_vec (_get_SV39_PTE_PPNi pte)
                                  (xor_vec (_get_SV39_PTE_PPNi pte) (EXTZ 44 ('b"1"  : mword 1))))
                               (Z.mul level SV39_LEVEL_BITS)) 1 in
                        if neq_vec (and_vec (_get_SV39_PTE_PPNi pte) mask)
                             (EXTZ 44 ('b"0"  : mword 1)) then
                          PTW_Failure (PTW_Misaligned tt, ext_ptw)
                        else
                          let ppn :=
                            or_vec (_get_SV39_PTE_PPNi pte)
                              (and_vec (EXTZ 44 (_get_SV39_Vaddr_VPNi va)) mask) in
                          PTW_Success
                            (concat_vec ppn (_get_SV39_Vaddr_PgOfs va), pte, pte_addr, build_ex
                            level, is_global, ext_ptw)
                      else
                        PTW_Success
                          (concat_vec (_get_SV39_PTE_PPNi pte) (_get_SV39_Vaddr_PgOfs va), pte, pte_addr, build_ex
                          level, is_global, ext_ptw)
                   end))
        : M (PTW_Result (mword 56) SV39_PTE)
    end)
    : M (PTW_Result (mword 56) SV39_PTE)
).
Defined.


Definition walk39
(_arg0 : mword 39) (_arg1 : AccessType unit) (_arg2 : Privilege) (_arg3 : bool) (_arg4 : bool)
(_arg5 : mword 56) (level : Z) (_arg7 : bool) (_arg8 : unit) `{ArithFact (0 <=? level)}
: M (PTW_Result (mword 56) SV39_PTE) :=
   (_rec_walk39 _arg0 _arg1 _arg2 _arg3 _arg4 _arg5 level _arg7 _arg8 (level  : Z) (Zwf_guarded _))
    : M (PTW_Result (mword 56) SV39_PTE).

Definition lookup_TLB39 (asid : mword 16) (vaddr : mword 39)
: M (option (({n : Z & ArithFact (n >=? 0)} * TLB_Entry 16 39 56 64))) :=
   read_reg tlb39_ref >>= fun w__0 : option (TLB_Entry 16 39 56 64) =>
   returnm (match w__0 with
            | None => None
            | Some e => if match_TLB_Entry e asid vaddr then Some (build_ex 0, e) else None
            end).

Definition add_to_TLB39
(asid : mword 16) (vAddr : mword 39) (pAddr : mword 56) (pte : SV39_PTE) (pteAddr : mword 56)
(level : Z) (global : bool) `{ArithFact (0 <=? level)}
: M (unit) :=
   (make_TLB_Entry asid global vAddr pAddr (_get_SV39_PTE_bits pte) level pteAddr SV39_LEVEL_BITS) >>= fun ent : TLB39_Entry =>
   write_reg tlb39_ref (Some ent)
    : M (unit).

Definition write_TLB39 (idx : Z) (ent : TLB_Entry 16 39 56 64) `{ArithFact (0 <=? idx)} : M (unit) :=
   write_reg tlb39_ref (Some ent)  : M (unit).

Definition flush_TLB39 (asid : option (mword 16)) (addr : option (mword 39)) : M (unit) :=
   read_reg tlb39_ref >>= fun w__0 : option (TLB_Entry 16 39 56 64) =>
   (match w__0 with
    | None => returnm tt
    | Some e =>
       (if flush_TLB_Entry e asid addr then write_reg tlb39_ref None  : M (unit)
        else returnm tt)
        : M (unit)
    end)
    : M (unit).

Definition translate39
(asid : mword 16) (ptb : mword 56) (vAddr : mword 39) (ac : AccessType unit) (priv : Privilege)
(mxr : bool) (do_sum : bool) (level : Z) (ext_ptw : unit) `{ArithFact (0 <=? level)}
: M (TR_Result (mword 56) PTW_Error) :=
   (lookup_TLB39 asid vAddr) >>= fun w__0 : option (({n : Z & ArithFact (n >=? 0)} * TLB_Entry 16 39 56 64)) =>
   (match w__0 with
    | Some (existT _ idx _, ent) =>
       let pte := Mk_SV39_PTE ent.(TLB_Entry_pte) in
       let ext_pte := _get_SV39_PTE_Ext pte in
       let pteBits := Mk_PTE_Bits (_get_SV39_PTE_BITS pte) in
       (checkPTEPermission ac priv mxr do_sum pteBits ext_pte ext_ptw) >>= fun w__1 : PTE_Check =>
       (match w__1 with
        | PTE_Check_Failure (ext_ptw, ext_ptw_fail) =>
           returnm (TR_Failure (ext_get_ptw_error ext_ptw_fail, ext_ptw))
        | PTE_Check_Success ext_ptw =>
           (match (update_PTE_Bits pteBits ac ext_pte) with
            | None =>
               returnm (TR_Address
                          (or_vec ent.(TLB_Entry_pAddr)
                             (EXTZ 56 (and_vec vAddr ent.(TLB_Entry_vAddrMask))), ext_ptw))
            | Some (pbits, ext) =>
               (if negb (plat_enable_dirty_update tt) then
                  returnm (TR_Failure (PTW_PTE_Update tt, ext_ptw))
                else
                  let n_pte := _update_SV39_PTE_BITS pte (_get_PTE_Bits_bits pbits) in
                  let n_pte := (_update_SV39_PTE_Ext n_pte ext)  : SV39_PTE in
                  let n_ent : TLB39_Entry := ent in
                  let n_ent :=
                    {[ n_ent with TLB_Entry_pte := (_get_SV39_PTE_bits n_pte) ]}
                     : TLB_Entry 16 39 56 64 in
                  (write_TLB39 idx n_ent) >>
                  (mem_write_value_priv (EXTZ 64 ent.(TLB_Entry_pteAddr)) 8
                     (_get_SV39_PTE_bits n_pte) Supervisor false false false) >>= fun w__2 : MemoryOpResult bool =>
                  (match w__2 with
                   | MemValue _ => returnm tt
                   | MemException e =>
                      (internal_error "invalid physical address in TLB")  : M (unit)
                   end) >>
                  returnm (TR_Address
                             (or_vec ent.(TLB_Entry_pAddr)
                                (EXTZ 56 (and_vec vAddr ent.(TLB_Entry_vAddrMask))), ext_ptw)))
                : M (TR_Result (mword 56) PTW_Error)
            end)
            : M (TR_Result (mword 56) PTW_Error)
        end)
        : M (TR_Result (mword 56) PTW_Error)
    | None =>
       (walk39 vAddr ac priv mxr do_sum ptb level false ext_ptw) >>= fun w__6 : PTW_Result (mword 56) SV39_PTE =>
       (match w__6 with
        | PTW_Failure (f, ext_ptw) => returnm (TR_Failure (f, ext_ptw))
        | PTW_Success (pAddr, pte, pteAddr, existT _ level _, global, ext_ptw) =>
           (match (update_PTE_Bits (Mk_PTE_Bits (_get_SV39_PTE_BITS pte)) ac (_get_SV39_PTE_Ext pte)) with
            | None =>
               (add_to_TLB39 asid vAddr pAddr pte pteAddr level global) >>
               returnm (TR_Address (pAddr, ext_ptw))
            | Some (pbits, ext) =>
               (if negb (plat_enable_dirty_update tt) then
                  returnm (TR_Failure (PTW_PTE_Update tt, ext_ptw))
                else
                  let w_pte : SV39_PTE := _update_SV39_PTE_BITS pte (_get_PTE_Bits_bits pbits) in
                  let w_pte : SV39_PTE := (_update_SV39_PTE_Ext w_pte ext)  : SV39_PTE in
                  (mem_write_value_priv (EXTZ 64 pteAddr) 8 (_get_SV39_PTE_bits w_pte) Supervisor
                     false false false) >>= fun w__7 : MemoryOpResult bool =>
                  (match w__7 with
                   | MemValue _ =>
                      (add_to_TLB39 asid vAddr pAddr w_pte pteAddr level global) >>
                      returnm (TR_Address (pAddr, ext_ptw))
                   | MemException e => returnm (TR_Failure (PTW_Access tt, ext_ptw))
                   end)
                   : M (TR_Result (mword 56) PTW_Error))
                : M (TR_Result (mword 56) PTW_Error)
            end)
            : M (TR_Result (mword 56) PTW_Error)
        end)
        : M (TR_Result (mword 56) PTW_Error)
    end)
    : M (TR_Result (mword 56) PTW_Error).

Definition init_vmem_sv39 '(tt : unit) : M (unit) := write_reg tlb39_ref None  : M (unit).

Fixpoint _rec_walk48
(vaddr : mword 48) (ac : AccessType unit) (priv : Privilege) (mxr : bool) (do_sum : bool)
(ptb : mword 56) (level : Z) (global : bool) (ext_ptw : unit) (_reclimit : Z)
`{ArithFact (0 <=? level)} (_acc : Acc (Zwf 0) _reclimit)
{struct _acc} : M (PTW_Result (mword 56) SV48_PTE).
exact (
   assert_exp' (Z.geb _reclimit 0) "recursion limit reached" >>= fun _ =>
   let va := Mk_SV48_Vaddr vaddr in
   let pt_ofs : paddr64 :=
     shiftl
       (EXTZ 56
          (subrange_vec_dec (shiftr (_get_SV48_Vaddr_VPNi va) (Z.mul level SV48_LEVEL_BITS))
             (Z.sub SV48_LEVEL_BITS 1) 0)) PTE48_LOG_SIZE in
   let pte_addr := add_vec ptb pt_ofs in
   (mem_read_priv (Read Data) Supervisor (EXTZ 64 pte_addr) 8 false false false) >>= fun w__0 : MemoryOpResult (mword (8 * 8)) =>
   (match w__0 with
    | MemException _ => returnm (PTW_Failure (PTW_Access tt, ext_ptw))
    | MemValue v =>
       let pte := Mk_SV48_PTE v in
       let pbits := _get_SV48_PTE_BITS pte in
       let ext_pte := _get_SV48_PTE_Ext pte in
       let pattr := Mk_PTE_Bits pbits in
       let is_global := orb global (eq_vec (_get_PTE_Bits_G pattr) ('b"1"  : mword 1)) in
       (if isInvalidPTE pbits ext_pte then returnm (PTW_Failure (PTW_Invalid_PTE tt, ext_ptw))
        else if isPTEPtr pbits ext_pte then
          (if sumbool_of_bool (Z.gtb level 0) then
             (_rec_walk48 vaddr ac priv mxr do_sum
                (shiftl (EXTZ 56 (_get_SV48_PTE_PPNi pte)) PAGESIZE_BITS) (Z.sub level 1) is_global
                ext_ptw (Z.sub _reclimit 1) _ (_limit_reduces _acc))
              : M (PTW_Result (mword 56) SV48_PTE)
           else returnm (PTW_Failure (PTW_Invalid_PTE tt, ext_ptw)))
           : M (PTW_Result (mword 56) SV48_PTE)
        else
          (checkPTEPermission ac priv mxr do_sum pattr ext_pte ext_ptw) >>= fun w__3 : PTE_Check =>
          returnm (match w__3 with
                   | PTE_Check_Failure (ext_ptw, ext_ptw_fail) =>
                      PTW_Failure (ext_get_ptw_error ext_ptw_fail, ext_ptw)
                   | PTE_Check_Success ext_ptw =>
                      if sumbool_of_bool (Z.gtb level 0) then
                        let mask :=
                          sub_vec_int
                            (shiftl
                               (xor_vec (_get_SV48_PTE_PPNi pte)
                                  (xor_vec (_get_SV48_PTE_PPNi pte) (EXTZ 44 ('b"1"  : mword 1))))
                               (Z.mul level SV48_LEVEL_BITS)) 1 in
                        if neq_vec (and_vec (_get_SV48_PTE_PPNi pte) mask)
                             (EXTZ 44 ('b"0"  : mword 1)) then
                          PTW_Failure (PTW_Misaligned tt, ext_ptw)
                        else
                          let ppn :=
                            or_vec (_get_SV48_PTE_PPNi pte)
                              (and_vec (EXTZ 44 (_get_SV48_Vaddr_VPNi va)) mask) in
                          PTW_Success
                            (concat_vec ppn (_get_SV48_Vaddr_PgOfs va), pte, pte_addr, build_ex
                            level, is_global, ext_ptw)
                      else
                        PTW_Success
                          (concat_vec (_get_SV48_PTE_PPNi pte) (_get_SV48_Vaddr_PgOfs va), pte, pte_addr, build_ex
                          level, is_global, ext_ptw)
                   end))
        : M (PTW_Result (mword 56) SV48_PTE)
    end)
    : M (PTW_Result (mword 56) SV48_PTE)
).
Defined.


Definition walk48
(_arg0 : mword 48) (_arg1 : AccessType unit) (_arg2 : Privilege) (_arg3 : bool) (_arg4 : bool)
(_arg5 : mword 56) (level : Z) (_arg7 : bool) (_arg8 : unit) `{ArithFact (0 <=? level)}
: M (PTW_Result (mword 56) SV48_PTE) :=
   (_rec_walk48 _arg0 _arg1 _arg2 _arg3 _arg4 _arg5 level _arg7 _arg8 (level  : Z) (Zwf_guarded _))
    : M (PTW_Result (mword 56) SV48_PTE).

Definition lookup_TLB48 (asid : mword 16) (vaddr : mword 48)
: M (option (({n : Z & ArithFact (n >=? 0)} * TLB_Entry 16 48 56 64))) :=
   read_reg tlb48_ref >>= fun w__0 : option (TLB_Entry 16 48 56 64) =>
   returnm (match w__0 with
            | None => None
            | Some e => if match_TLB_Entry e asid vaddr then Some (build_ex 0, e) else None
            end).

Definition add_to_TLB48
(asid : mword 16) (vAddr : mword 48) (pAddr : mword 56) (pte : SV48_PTE) (pteAddr : mword 56)
(level : Z) (global : bool) `{ArithFact (0 <=? level)}
: M (unit) :=
   (make_TLB_Entry asid global vAddr pAddr (_get_SV48_PTE_bits pte) level pteAddr SV48_LEVEL_BITS) >>= fun ent : TLB48_Entry =>
   write_reg tlb48_ref (Some ent)
    : M (unit).

Definition write_TLB48 (idx : Z) (ent : TLB_Entry 16 48 56 64) `{ArithFact (0 <=? idx)} : M (unit) :=
   write_reg tlb48_ref (Some ent)  : M (unit).

Definition flush_TLB48 (asid : option (mword 16)) (addr : option (mword 48)) : M (unit) :=
   read_reg tlb48_ref >>= fun w__0 : option (TLB_Entry 16 48 56 64) =>
   (match w__0 with
    | None => returnm tt
    | Some e =>
       (if flush_TLB_Entry e asid addr then write_reg tlb48_ref None  : M (unit)
        else returnm tt)
        : M (unit)
    end)
    : M (unit).

Definition translate48
(asid : mword 16) (ptb : mword 56) (vAddr : mword 48) (ac : AccessType unit) (priv : Privilege)
(mxr : bool) (do_sum : bool) (level : Z) (ext_ptw : unit) `{ArithFact (0 <=? level)}
: M (TR_Result (mword 56) PTW_Error) :=
   (walk48 vAddr ac priv mxr do_sum ptb level false ext_ptw) >>= fun w__0 : PTW_Result (mword 56) SV48_PTE =>
   (match w__0 with
    | PTW_Failure (f, ext_ptw) => returnm (TR_Failure (f, ext_ptw))
    | PTW_Success (pAddr, pte, pteAddr, existT _ level _, global, ext_ptw) =>
       (match (update_PTE_Bits (Mk_PTE_Bits (_get_SV48_PTE_BITS pte)) ac (_get_SV48_PTE_Ext pte)) with
        | None =>
           (add_to_TLB48 asid vAddr pAddr pte pteAddr level global) >>
           returnm (TR_Address (pAddr, ext_ptw))
        | Some (pbits, ext) =>
           (if negb (plat_enable_dirty_update tt) then
              returnm (TR_Failure (PTW_PTE_Update tt, ext_ptw))
            else
              let w_pte : SV48_PTE := _update_SV48_PTE_BITS pte (_get_PTE_Bits_bits pbits) in
              let w_pte : SV48_PTE := (_update_SV48_PTE_Ext w_pte ext)  : SV48_PTE in
              (mem_write_value_priv (EXTZ 64 pteAddr) 8 (_get_SV48_PTE_bits w_pte) Supervisor false
                 false false) >>= fun w__1 : MemoryOpResult bool =>
              (match w__1 with
               | MemValue _ =>
                  (add_to_TLB48 asid vAddr pAddr w_pte pteAddr level global) >>
                  returnm (TR_Address (pAddr, ext_ptw))
               | MemException e => returnm (TR_Failure (PTW_Access tt, ext_ptw))
               end)
               : M (TR_Result (mword 56) PTW_Error))
            : M (TR_Result (mword 56) PTW_Error)
        end)
        : M (TR_Result (mword 56) PTW_Error)
    end)
    : M (TR_Result (mword 56) PTW_Error).

Definition init_vmem_sv48 '(tt : unit) : M (unit) := write_reg tlb48_ref None  : M (unit).

Definition legalize_satp (a : Architecture) (o : mword 64) (v : mword 64) : mword 64 :=
   legalize_satp64 a o v.

Definition isValidSv39Addr (vAddr : mword 64) : bool :=
   eq_vec (subrange_vec_dec vAddr 63 39)
     (if eq_bit (access_vec_dec vAddr 38) B1 then ones (Z.add (Z.sub 63 39) 1)
      else zeros_implicit (Z.add (Z.sub 63 39) 1)).

Definition isValidSv48Addr (vAddr : mword 64) : bool :=
   eq_vec (subrange_vec_dec vAddr 63 48)
     (if eq_bit (access_vec_dec vAddr 47) B1 then ones (Z.add (Z.sub 63 48) 1)
      else zeros_implicit (Z.add (Z.sub 63 48) 1)).

Definition translationMode (priv : Privilege) : M (SATPMode) :=
   (if generic_eq priv Machine then returnm Sbare
    else
      read_reg mstatus_ref >>= fun w__0 : Mstatus =>
      let arch := architecture (get_mstatus_SXL w__0) in
      (match arch with
       | Some RV64 =>
          ((read_reg satp_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
          let mbits : satp_mode := _get_Satp64_Mode (Mk_Satp64 w__1) in
          (match (satp64Mode_of_bits RV64 mbits) with
           | Some m => returnm m
           | None => (internal_error "invalid RV64 translation mode in satp")  : M (SATPMode)
           end)
           : M (SATPMode)
       | Some RV32 =>
          ((read_reg satp_ref)  : M (mword 64)) >>= fun w__4 : mword 64 =>
          let s := Mk_Satp32 (subrange_vec_dec w__4 31 0) in
          returnm (if eq_vec (_get_Satp32_Mode s) ('b"0"  : mword 1) then Sbare else Sv32)
       | _ => (internal_error "unsupported address translation arch")  : M (SATPMode)
       end)
       : M (SATPMode))
    : M (SATPMode).

Definition translateAddr_priv (vAddr : mword 64) (ac : AccessType unit) (effPriv : Privilege)
: M (TR_Result (mword 64) ExceptionType) :=
   read_reg mstatus_ref >>= fun w__0 : Mstatus =>
   let mxr : bool := eq_vec (_get_Mstatus_MXR w__0) ('b"1"  : mword 1) in
   read_reg mstatus_ref >>= fun w__1 : Mstatus =>
   let do_sum : bool := eq_vec (_get_Mstatus_SUM w__1) ('b"1"  : mword 1) in
   (translationMode effPriv) >>= fun mode : SATPMode =>
   ((read_reg satp_ref)  : M (mword 64)) >>= fun w__2 : mword 64 =>
   let asid := curAsid64 w__2 in
   ((read_reg satp_ref)  : M (mword 64)) >>= fun w__3 : mword 64 =>
   let ptb := curPTB64 w__3 in
   let ext_ptw : ext_ptw := init_ext_ptw in
   (match mode with
    | Sbare => returnm (TR_Address (vAddr, ext_ptw))
    | Sv39 =>
       (if isValidSv39Addr vAddr then
          (translate39 asid ptb (subrange_vec_dec vAddr 38 0) ac effPriv mxr do_sum
             (Z.sub SV39_LEVELS 1) ext_ptw) >>= fun w__4 : TR_Result (mword 56) PTW_Error =>
          returnm (match w__4 with
                   | TR_Address (pa, ext_ptw) => TR_Address (EXTZ 64 pa, ext_ptw)
                   | TR_Failure (f, ext_ptw) => TR_Failure (translationException ac f, ext_ptw)
                   end)
        else returnm (TR_Failure (translationException ac (PTW_Invalid_Addr tt), ext_ptw)))
        : M (TR_Result (mword 64) ExceptionType)
    | Sv48 =>
       (if isValidSv48Addr vAddr then
          (translate48 asid ptb (subrange_vec_dec vAddr 47 0) ac effPriv mxr do_sum
             (Z.sub SV48_LEVELS 1) ext_ptw) >>= fun w__6 : TR_Result (mword 56) PTW_Error =>
          returnm (match w__6 with
                   | TR_Address (pa, ext_ptw) => TR_Address (EXTZ 64 pa, ext_ptw)
                   | TR_Failure (f, ext_ptw) => TR_Failure (translationException ac f, ext_ptw)
                   end)
        else returnm (TR_Failure (translationException ac (PTW_Invalid_Addr tt), ext_ptw)))
        : M (TR_Result (mword 64) ExceptionType)
    | _ =>
       (internal_error "unsupported address translation scheme")
        : M (TR_Result (mword 64) ExceptionType)
    end)
    : M (TR_Result (mword 64) ExceptionType).

Definition translateAddr (vAddr : mword 64) (ac : AccessType unit)
: M (TR_Result (mword 64) ExceptionType) :=
   read_reg mstatus_ref >>= fun w__0 : Mstatus =>
   read_reg cur_privilege_ref >>= fun w__1 : Privilege =>
   (effectivePrivilege ac w__0 w__1) >>= fun w__2 : Privilege =>
   (translateAddr_priv vAddr ac w__2)
    : M (TR_Result (mword 64) ExceptionType).

Definition flush_TLB (asid_xlen : option (mword 64)) (addr_xlen : option (mword 64)) : M (unit) :=
   let '(addr39, addr48) :=
     (match addr_xlen with
      | None => (None, None)
      | Some a => (Some (subrange_vec_dec a 38 0), Some (subrange_vec_dec a 47 0))
      end)
      : (option vaddr39 * option vaddr48) in
   let asid : option asid64 :=
     match asid_xlen with | None => None | Some a => Some (subrange_vec_dec a 15 0) end in
   (flush_TLB39 asid addr39) >> (flush_TLB48 asid addr48)  : M (unit).

Definition init_vmem '(tt : unit) : M (unit) :=
   (init_vmem_sv39 tt) >> (init_vmem_sv48 tt)  : M (unit).

Definition encdec_uop_forwards (arg_ : uop) : mword 7 :=
   match arg_ with | RISCV_LUI => 'b"0110111"  : mword 7 | RISCV_AUIPC => 'b"0010111"  : mword 7 end.

Definition encdec_uop_backwards (arg_ : mword 7) : M (uop) :=
   let b__0 := arg_ in
   (if eq_vec b__0 ('b"0110111"  : mword 7) then returnm RISCV_LUI
    else if eq_vec b__0 ('b"0010111"  : mword 7) then returnm RISCV_AUIPC
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (uop).

Definition encdec_uop_forwards_matches (arg_ : uop) : bool :=
   match arg_ with | RISCV_LUI => true | RISCV_AUIPC => true end.

Definition encdec_uop_backwards_matches (arg_ : mword 7) : bool :=
   let b__0 := arg_ in
   if eq_vec b__0 ('b"0110111"  : mword 7) then true
   else if eq_vec b__0 ('b"0010111"  : mword 7) then true
   else false.

Definition utype_mnemonic_forwards (arg_ : uop) : string :=
   match arg_ with | RISCV_LUI => "lui" | RISCV_AUIPC => "auipc" end.

Definition utype_mnemonic_backwards (arg_ : string) : M (uop) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "lui" then returnm RISCV_LUI
    else if generic_eq p0_ "auipc" then returnm RISCV_AUIPC
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (uop).

Definition utype_mnemonic_forwards_matches (arg_ : uop) : bool :=
   match arg_ with | RISCV_LUI => true | RISCV_AUIPC => true end.

Definition utype_mnemonic_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "lui" then true
   else if generic_eq p0_ "auipc" then true
   else false.

Definition _s761_ (_s762_ : string) : option string :=
   let _s763_ := _s762_ in
   if string_startswith _s763_ "auipc" then
     match (string_drop _s763_ (projT1 (string_length "auipc"))) with | s_ => Some s_ end
   else None.

Definition _s757_ (_s758_ : string) : option string :=
   let _s759_ := _s758_ in
   if string_startswith _s759_ "lui" then
     match (string_drop _s759_ (projT1 (string_length "lui"))) with | s_ => Some s_ end
   else None.

Definition utype_mnemonic_matches_prefix (arg_ : string)
: M (option ((uop * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s760_ := arg_ in
   (if match (_s757_ _s760_) with | Some s_ => true | _ => false end then
      (match (_s757_ _s760_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_LUI, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((uop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((uop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s761_ _s760_) with | Some s_ => true | _ => false end then
      (match (_s761_ _s760_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_AUIPC, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((uop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((uop * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((uop * {n : Z & ArithFact (n >=? 0)}))).

Definition encdec_bop_forwards (arg_ : bop) : mword 3 :=
   match arg_ with
   | RISCV_BEQ => 'b"000"  : mword 3
   | RISCV_BNE => 'b"001"  : mword 3
   | RISCV_BLT => 'b"100"  : mword 3
   | RISCV_BGE => 'b"101"  : mword 3
   | RISCV_BLTU => 'b"110"  : mword 3
   | RISCV_BGEU => 'b"111"  : mword 3
   end.

Definition encdec_bop_backwards (arg_ : mword 3) : M (bop) :=
   let b__0 := arg_ in
   (if eq_vec b__0 ('b"000"  : mword 3) then returnm RISCV_BEQ
    else if eq_vec b__0 ('b"001"  : mword 3) then returnm RISCV_BNE
    else if eq_vec b__0 ('b"100"  : mword 3) then returnm RISCV_BLT
    else if eq_vec b__0 ('b"101"  : mword 3) then returnm RISCV_BGE
    else if eq_vec b__0 ('b"110"  : mword 3) then returnm RISCV_BLTU
    else if eq_vec b__0 ('b"111"  : mword 3) then returnm RISCV_BGEU
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (bop).

Definition encdec_bop_forwards_matches (arg_ : bop) : bool :=
   match arg_ with
   | RISCV_BEQ => true
   | RISCV_BNE => true
   | RISCV_BLT => true
   | RISCV_BGE => true
   | RISCV_BLTU => true
   | RISCV_BGEU => true
   end.

Definition encdec_bop_backwards_matches (arg_ : mword 3) : bool :=
   let b__0 := arg_ in
   if eq_vec b__0 ('b"000"  : mword 3) then true
   else if eq_vec b__0 ('b"001"  : mword 3) then true
   else if eq_vec b__0 ('b"100"  : mword 3) then true
   else if eq_vec b__0 ('b"101"  : mword 3) then true
   else if eq_vec b__0 ('b"110"  : mword 3) then true
   else if eq_vec b__0 ('b"111"  : mword 3) then true
   else false.

Definition btype_mnemonic_forwards (arg_ : bop) : string :=
   match arg_ with
   | RISCV_BEQ => "beq"
   | RISCV_BNE => "bne"
   | RISCV_BLT => "blt"
   | RISCV_BGE => "bge"
   | RISCV_BLTU => "bltu"
   | RISCV_BGEU => "bgeu"
   end.

Definition btype_mnemonic_backwards (arg_ : string) : M (bop) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "beq" then returnm RISCV_BEQ
    else if generic_eq p0_ "bne" then returnm RISCV_BNE
    else if generic_eq p0_ "blt" then returnm RISCV_BLT
    else if generic_eq p0_ "bge" then returnm RISCV_BGE
    else if generic_eq p0_ "bltu" then returnm RISCV_BLTU
    else if generic_eq p0_ "bgeu" then returnm RISCV_BGEU
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (bop).

Definition btype_mnemonic_forwards_matches (arg_ : bop) : bool :=
   match arg_ with
   | RISCV_BEQ => true
   | RISCV_BNE => true
   | RISCV_BLT => true
   | RISCV_BGE => true
   | RISCV_BLTU => true
   | RISCV_BGEU => true
   end.

Definition btype_mnemonic_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "beq" then true
   else if generic_eq p0_ "bne" then true
   else if generic_eq p0_ "blt" then true
   else if generic_eq p0_ "bge" then true
   else if generic_eq p0_ "bltu" then true
   else if generic_eq p0_ "bgeu" then true
   else false.

Definition _s785_ (_s786_ : string) : option string :=
   let _s787_ := _s786_ in
   if string_startswith _s787_ "bgeu" then
     match (string_drop _s787_ (projT1 (string_length "bgeu"))) with | s_ => Some s_ end
   else None.

Definition _s781_ (_s782_ : string) : option string :=
   let _s783_ := _s782_ in
   if string_startswith _s783_ "bltu" then
     match (string_drop _s783_ (projT1 (string_length "bltu"))) with | s_ => Some s_ end
   else None.

Definition _s777_ (_s778_ : string) : option string :=
   let _s779_ := _s778_ in
   if string_startswith _s779_ "bge" then
     match (string_drop _s779_ (projT1 (string_length "bge"))) with | s_ => Some s_ end
   else None.

Definition _s773_ (_s774_ : string) : option string :=
   let _s775_ := _s774_ in
   if string_startswith _s775_ "blt" then
     match (string_drop _s775_ (projT1 (string_length "blt"))) with | s_ => Some s_ end
   else None.

Definition _s769_ (_s770_ : string) : option string :=
   let _s771_ := _s770_ in
   if string_startswith _s771_ "bne" then
     match (string_drop _s771_ (projT1 (string_length "bne"))) with | s_ => Some s_ end
   else None.

Definition _s765_ (_s766_ : string) : option string :=
   let _s767_ := _s766_ in
   if string_startswith _s767_ "beq" then
     match (string_drop _s767_ (projT1 (string_length "beq"))) with | s_ => Some s_ end
   else None.

Definition btype_mnemonic_matches_prefix (arg_ : string)
: M (option ((bop * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s768_ := arg_ in
   (if match (_s765_ _s768_) with | Some s_ => true | _ => false end then
      (match (_s765_ _s768_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_BEQ, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((bop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((bop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s769_ _s768_) with | Some s_ => true | _ => false end then
      (match (_s769_ _s768_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_BNE, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((bop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((bop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s773_ _s768_) with | Some s_ => true | _ => false end then
      (match (_s773_ _s768_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_BLT, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((bop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((bop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s777_ _s768_) with | Some s_ => true | _ => false end then
      (match (_s777_ _s768_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_BGE, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((bop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((bop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s781_ _s768_) with | Some s_ => true | _ => false end then
      (match (_s781_ _s768_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_BLTU, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((bop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((bop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s785_ _s768_) with | Some s_ => true | _ => false end then
      (match (_s785_ _s768_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_BGEU, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((bop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((bop * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((bop * {n : Z & ArithFact (n >=? 0)}))).

Definition encdec_iop_forwards (arg_ : iop) : mword 3 :=
   match arg_ with
   | RISCV_ADDI => 'b"000"  : mword 3
   | RISCV_SLTI => 'b"010"  : mword 3
   | RISCV_SLTIU => 'b"011"  : mword 3
   | RISCV_ANDI => 'b"111"  : mword 3
   | RISCV_ORI => 'b"110"  : mword 3
   | RISCV_XORI => 'b"100"  : mword 3
   end.

Definition encdec_iop_backwards (arg_ : mword 3) : M (iop) :=
   let b__0 := arg_ in
   (if eq_vec b__0 ('b"000"  : mword 3) then returnm RISCV_ADDI
    else if eq_vec b__0 ('b"010"  : mword 3) then returnm RISCV_SLTI
    else if eq_vec b__0 ('b"011"  : mword 3) then returnm RISCV_SLTIU
    else if eq_vec b__0 ('b"111"  : mword 3) then returnm RISCV_ANDI
    else if eq_vec b__0 ('b"110"  : mword 3) then returnm RISCV_ORI
    else if eq_vec b__0 ('b"100"  : mword 3) then returnm RISCV_XORI
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (iop).

Definition encdec_iop_forwards_matches (arg_ : iop) : bool :=
   match arg_ with
   | RISCV_ADDI => true
   | RISCV_SLTI => true
   | RISCV_SLTIU => true
   | RISCV_ANDI => true
   | RISCV_ORI => true
   | RISCV_XORI => true
   end.

Definition encdec_iop_backwards_matches (arg_ : mword 3) : bool :=
   let b__0 := arg_ in
   if eq_vec b__0 ('b"000"  : mword 3) then true
   else if eq_vec b__0 ('b"010"  : mword 3) then true
   else if eq_vec b__0 ('b"011"  : mword 3) then true
   else if eq_vec b__0 ('b"111"  : mword 3) then true
   else if eq_vec b__0 ('b"110"  : mword 3) then true
   else if eq_vec b__0 ('b"100"  : mword 3) then true
   else false.

Definition itype_mnemonic_forwards (arg_ : iop) : string :=
   match arg_ with
   | RISCV_ADDI => "addi"
   | RISCV_SLTI => "slti"
   | RISCV_SLTIU => "sltiu"
   | RISCV_XORI => "xori"
   | RISCV_ORI => "ori"
   | RISCV_ANDI => "andi"
   end.

Definition itype_mnemonic_backwards (arg_ : string) : M (iop) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "addi" then returnm RISCV_ADDI
    else if generic_eq p0_ "slti" then returnm RISCV_SLTI
    else if generic_eq p0_ "sltiu" then returnm RISCV_SLTIU
    else if generic_eq p0_ "xori" then returnm RISCV_XORI
    else if generic_eq p0_ "ori" then returnm RISCV_ORI
    else if generic_eq p0_ "andi" then returnm RISCV_ANDI
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (iop).

Definition itype_mnemonic_forwards_matches (arg_ : iop) : bool :=
   match arg_ with
   | RISCV_ADDI => true
   | RISCV_SLTI => true
   | RISCV_SLTIU => true
   | RISCV_XORI => true
   | RISCV_ORI => true
   | RISCV_ANDI => true
   end.

Definition itype_mnemonic_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "addi" then true
   else if generic_eq p0_ "slti" then true
   else if generic_eq p0_ "sltiu" then true
   else if generic_eq p0_ "xori" then true
   else if generic_eq p0_ "ori" then true
   else if generic_eq p0_ "andi" then true
   else false.

Definition _s809_ (_s810_ : string) : option string :=
   let _s811_ := _s810_ in
   if string_startswith _s811_ "andi" then
     match (string_drop _s811_ (projT1 (string_length "andi"))) with | s_ => Some s_ end
   else None.

Definition _s805_ (_s806_ : string) : option string :=
   let _s807_ := _s806_ in
   if string_startswith _s807_ "ori" then
     match (string_drop _s807_ (projT1 (string_length "ori"))) with | s_ => Some s_ end
   else None.

Definition _s801_ (_s802_ : string) : option string :=
   let _s803_ := _s802_ in
   if string_startswith _s803_ "xori" then
     match (string_drop _s803_ (projT1 (string_length "xori"))) with | s_ => Some s_ end
   else None.

Definition _s797_ (_s798_ : string) : option string :=
   let _s799_ := _s798_ in
   if string_startswith _s799_ "sltiu" then
     match (string_drop _s799_ (projT1 (string_length "sltiu"))) with | s_ => Some s_ end
   else None.

Definition _s793_ (_s794_ : string) : option string :=
   let _s795_ := _s794_ in
   if string_startswith _s795_ "slti" then
     match (string_drop _s795_ (projT1 (string_length "slti"))) with | s_ => Some s_ end
   else None.

Definition _s789_ (_s790_ : string) : option string :=
   let _s791_ := _s790_ in
   if string_startswith _s791_ "addi" then
     match (string_drop _s791_ (projT1 (string_length "addi"))) with | s_ => Some s_ end
   else None.

Definition itype_mnemonic_matches_prefix (arg_ : string)
: M (option ((iop * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s792_ := arg_ in
   (if match (_s789_ _s792_) with | Some s_ => true | _ => false end then
      (match (_s789_ _s792_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_ADDI, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((iop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((iop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s793_ _s792_) with | Some s_ => true | _ => false end then
      (match (_s793_ _s792_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SLTI, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((iop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((iop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s797_ _s792_) with | Some s_ => true | _ => false end then
      (match (_s797_ _s792_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SLTIU, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((iop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((iop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s801_ _s792_) with | Some s_ => true | _ => false end then
      (match (_s801_ _s792_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_XORI, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((iop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((iop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s805_ _s792_) with | Some s_ => true | _ => false end then
      (match (_s805_ _s792_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_ORI, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((iop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((iop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s809_ _s792_) with | Some s_ => true | _ => false end then
      (match (_s809_ _s792_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_ANDI, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((iop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((iop * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((iop * {n : Z & ArithFact (n >=? 0)}))).

Definition encdec_sop_forwards (arg_ : sop) : mword 3 :=
   match arg_ with
   | RISCV_SLLI => 'b"001"  : mword 3
   | RISCV_SRLI => 'b"101"  : mword 3
   | RISCV_SRAI => 'b"101"  : mword 3
   end.

Definition encdec_sop_backwards (arg_ : mword 3) : M (sop) :=
   let b__0 := arg_ in
   (if eq_vec b__0 ('b"001"  : mword 3) then returnm RISCV_SLLI
    else if eq_vec b__0 ('b"101"  : mword 3) then returnm RISCV_SRLI
    else if eq_vec b__0 ('b"101"  : mword 3) then returnm RISCV_SRAI
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (sop).

Definition encdec_sop_forwards_matches (arg_ : sop) : bool :=
   match arg_ with | RISCV_SLLI => true | RISCV_SRLI => true | RISCV_SRAI => true end.

Definition encdec_sop_backwards_matches (arg_ : mword 3) : bool :=
   let b__0 := arg_ in
   if eq_vec b__0 ('b"001"  : mword 3) then true
   else if eq_vec b__0 ('b"101"  : mword 3) then true
   else if eq_vec b__0 ('b"101"  : mword 3) then true
   else false.

Definition shiftiop_mnemonic_forwards (arg_ : sop) : string :=
   match arg_ with | RISCV_SLLI => "slli" | RISCV_SRLI => "srli" | RISCV_SRAI => "srai" end.

Definition shiftiop_mnemonic_backwards (arg_ : string) : M (sop) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "slli" then returnm RISCV_SLLI
    else if generic_eq p0_ "srli" then returnm RISCV_SRLI
    else if generic_eq p0_ "srai" then returnm RISCV_SRAI
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (sop).

Definition shiftiop_mnemonic_forwards_matches (arg_ : sop) : bool :=
   match arg_ with | RISCV_SLLI => true | RISCV_SRLI => true | RISCV_SRAI => true end.

Definition shiftiop_mnemonic_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "slli" then true
   else if generic_eq p0_ "srli" then true
   else if generic_eq p0_ "srai" then true
   else false.

Definition _s821_ (_s822_ : string) : option string :=
   let _s823_ := _s822_ in
   if string_startswith _s823_ "srai" then
     match (string_drop _s823_ (projT1 (string_length "srai"))) with | s_ => Some s_ end
   else None.

Definition _s817_ (_s818_ : string) : option string :=
   let _s819_ := _s818_ in
   if string_startswith _s819_ "srli" then
     match (string_drop _s819_ (projT1 (string_length "srli"))) with | s_ => Some s_ end
   else None.

Definition _s813_ (_s814_ : string) : option string :=
   let _s815_ := _s814_ in
   if string_startswith _s815_ "slli" then
     match (string_drop _s815_ (projT1 (string_length "slli"))) with | s_ => Some s_ end
   else None.

Definition shiftiop_mnemonic_matches_prefix (arg_ : string)
: M (option ((sop * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s816_ := arg_ in
   (if match (_s813_ _s816_) with | Some s_ => true | _ => false end then
      (match (_s813_ _s816_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SLLI, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((sop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((sop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s817_ _s816_) with | Some s_ => true | _ => false end then
      (match (_s817_ _s816_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SRLI, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((sop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((sop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s821_ _s816_) with | Some s_ => true | _ => false end then
      (match (_s821_ _s816_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SRAI, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((sop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((sop * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((sop * {n : Z & ArithFact (n >=? 0)}))).

Definition rtype_mnemonic_forwards (arg_ : rop) : string :=
   match arg_ with
   | RISCV_ADD => "add"
   | RISCV_SLT => "slt"
   | RISCV_SLTU => "sltu"
   | RISCV_AND => "and"
   | RISCV_OR => "or"
   | RISCV_XOR => "xor"
   | RISCV_SLL => "sll"
   | RISCV_SRL => "srl"
   | RISCV_SUB => "sub"
   | RISCV_SRA => "sra"
   end.

Definition rtype_mnemonic_backwards (arg_ : string) : M (rop) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "add" then returnm RISCV_ADD
    else if generic_eq p0_ "slt" then returnm RISCV_SLT
    else if generic_eq p0_ "sltu" then returnm RISCV_SLTU
    else if generic_eq p0_ "and" then returnm RISCV_AND
    else if generic_eq p0_ "or" then returnm RISCV_OR
    else if generic_eq p0_ "xor" then returnm RISCV_XOR
    else if generic_eq p0_ "sll" then returnm RISCV_SLL
    else if generic_eq p0_ "srl" then returnm RISCV_SRL
    else if generic_eq p0_ "sub" then returnm RISCV_SUB
    else if generic_eq p0_ "sra" then returnm RISCV_SRA
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (rop).

Definition rtype_mnemonic_forwards_matches (arg_ : rop) : bool :=
   match arg_ with
   | RISCV_ADD => true
   | RISCV_SLT => true
   | RISCV_SLTU => true
   | RISCV_AND => true
   | RISCV_OR => true
   | RISCV_XOR => true
   | RISCV_SLL => true
   | RISCV_SRL => true
   | RISCV_SUB => true
   | RISCV_SRA => true
   end.

Definition rtype_mnemonic_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "add" then true
   else if generic_eq p0_ "slt" then true
   else if generic_eq p0_ "sltu" then true
   else if generic_eq p0_ "and" then true
   else if generic_eq p0_ "or" then true
   else if generic_eq p0_ "xor" then true
   else if generic_eq p0_ "sll" then true
   else if generic_eq p0_ "srl" then true
   else if generic_eq p0_ "sub" then true
   else if generic_eq p0_ "sra" then true
   else false.

Definition _s861_ (_s862_ : string) : option string :=
   let _s863_ := _s862_ in
   if string_startswith _s863_ "sra" then
     match (string_drop _s863_ (projT1 (string_length "sra"))) with | s_ => Some s_ end
   else None.

Definition _s857_ (_s858_ : string) : option string :=
   let _s859_ := _s858_ in
   if string_startswith _s859_ "sub" then
     match (string_drop _s859_ (projT1 (string_length "sub"))) with | s_ => Some s_ end
   else None.

Definition _s853_ (_s854_ : string) : option string :=
   let _s855_ := _s854_ in
   if string_startswith _s855_ "srl" then
     match (string_drop _s855_ (projT1 (string_length "srl"))) with | s_ => Some s_ end
   else None.

Definition _s849_ (_s850_ : string) : option string :=
   let _s851_ := _s850_ in
   if string_startswith _s851_ "sll" then
     match (string_drop _s851_ (projT1 (string_length "sll"))) with | s_ => Some s_ end
   else None.

Definition _s845_ (_s846_ : string) : option string :=
   let _s847_ := _s846_ in
   if string_startswith _s847_ "xor" then
     match (string_drop _s847_ (projT1 (string_length "xor"))) with | s_ => Some s_ end
   else None.

Definition _s841_ (_s842_ : string) : option string :=
   let _s843_ := _s842_ in
   if string_startswith _s843_ "or" then
     match (string_drop _s843_ (projT1 (string_length "or"))) with | s_ => Some s_ end
   else None.

Definition _s837_ (_s838_ : string) : option string :=
   let _s839_ := _s838_ in
   if string_startswith _s839_ "and" then
     match (string_drop _s839_ (projT1 (string_length "and"))) with | s_ => Some s_ end
   else None.

Definition _s833_ (_s834_ : string) : option string :=
   let _s835_ := _s834_ in
   if string_startswith _s835_ "sltu" then
     match (string_drop _s835_ (projT1 (string_length "sltu"))) with | s_ => Some s_ end
   else None.

Definition _s829_ (_s830_ : string) : option string :=
   let _s831_ := _s830_ in
   if string_startswith _s831_ "slt" then
     match (string_drop _s831_ (projT1 (string_length "slt"))) with | s_ => Some s_ end
   else None.

Definition _s825_ (_s826_ : string) : option string :=
   let _s827_ := _s826_ in
   if string_startswith _s827_ "add" then
     match (string_drop _s827_ (projT1 (string_length "add"))) with | s_ => Some s_ end
   else None.

Definition rtype_mnemonic_matches_prefix (arg_ : string)
: M (option ((rop * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s828_ := arg_ in
   (if match (_s825_ _s828_) with | Some s_ => true | _ => false end then
      (match (_s825_ _s828_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_ADD, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((rop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((rop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s829_ _s828_) with | Some s_ => true | _ => false end then
      (match (_s829_ _s828_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SLT, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((rop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((rop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s833_ _s828_) with | Some s_ => true | _ => false end then
      (match (_s833_ _s828_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SLTU, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((rop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((rop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s837_ _s828_) with | Some s_ => true | _ => false end then
      (match (_s837_ _s828_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_AND, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((rop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((rop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s841_ _s828_) with | Some s_ => true | _ => false end then
      (match (_s841_ _s828_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_OR, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((rop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((rop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s845_ _s828_) with | Some s_ => true | _ => false end then
      (match (_s845_ _s828_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_XOR, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((rop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((rop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s849_ _s828_) with | Some s_ => true | _ => false end then
      (match (_s849_ _s828_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SLL, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((rop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((rop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s853_ _s828_) with | Some s_ => true | _ => false end then
      (match (_s853_ _s828_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SRL, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((rop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((rop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s857_ _s828_) with | Some s_ => true | _ => false end then
      (match (_s857_ _s828_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SUB, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((rop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((rop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s861_ _s828_) with | Some s_ => true | _ => false end then
      (match (_s861_ _s828_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SRA, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((rop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((rop * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((rop * {n : Z & ArithFact (n >=? 0)}))).

Definition extend_value {n : Z} (is_unsigned : bool) (value : MemoryOpResult (mword (8 * n)))
`{ArithFact ((0 <? n) && (n <=? 8))}
: MemoryOpResult (mword 64) :=
   match value with
   | MemValue v =>
      MemValue (if sumbool_of_bool is_unsigned then EXTZ 64 v else (EXTS 64 v)  : xlenbits)
   | MemException e => MemException e
   end.

Definition process_load {n : Z}
(rd : mword 5) (vaddr : mword 64) (value : MemoryOpResult (mword (8 * n))) (is_unsigned : bool)
`{ArithFact ((0 <? n) && (n <=? 8))}
: M (Retired) :=
   (match (extend_value is_unsigned value) with
    | MemValue result => (wX_bits rd result) >> returnm RETIRE_SUCCESS
    | MemException e => (handle_mem_exception vaddr e) >> returnm RETIRE_FAIL
    end)
    : M (Retired).

Definition check_misaligned (vaddr : mword 64) (width : word_width) : bool :=
   if plat_enable_misaligned_access tt then false
   else
     match width with
     | BYTE => false
     | HALF => eq_bit (access_vec_dec vaddr 0) B1
     | WORD => orb (eq_bit (access_vec_dec vaddr 0) B1) (eq_bit (access_vec_dec vaddr 1) B1)
     | DOUBLE =>
        orb (eq_bit (access_vec_dec vaddr 0) B1)
          (orb (eq_bit (access_vec_dec vaddr 1) B1) (eq_bit (access_vec_dec vaddr 2) B1))
     end.

Definition maybe_aq_forwards (arg_ : bool) : string :=
   match arg_ with | true => ".aq" | false => "" end.

Definition maybe_aq_backwards (arg_ : string) : M (bool) :=
   let p0_ := arg_ in
   (if generic_eq p0_ ".aq" then returnm true
    else if generic_eq p0_ "" then returnm false
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (bool).

Definition maybe_aq_forwards_matches (arg_ : bool) : bool :=
   match arg_ with | true => true | false => true end.

Definition maybe_aq_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ ".aq" then true
   else if generic_eq p0_ "" then true
   else false.

Definition _s869_ (_s870_ : string) : option string :=
   let _s871_ := _s870_ in
   if string_startswith _s871_ "" then
     match (string_drop _s871_ (projT1 (string_length ""))) with | s_ => Some s_ end
   else None.

Definition _s865_ (_s866_ : string) : option string :=
   let _s867_ := _s866_ in
   if string_startswith _s867_ ".aq" then
     match (string_drop _s867_ (projT1 (string_length ".aq"))) with | s_ => Some s_ end
   else None.

Definition maybe_aq_matches_prefix (arg_ : string)
: M (option ((bool * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s868_ := arg_ in
   (if match (_s865_ _s868_) with | Some s_ => true | _ => false end then
      (match (_s865_ _s868_) with
       | Some s_ =>
          returnm (Some
                     (true, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((bool * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((bool * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s869_ _s868_) with | Some s_ => true | _ => false end then
      (match (_s869_ _s868_) with
       | Some s_ =>
          returnm (Some
                     (false, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((bool * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((bool * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((bool * {n : Z & ArithFact (n >=? 0)}))).

Definition maybe_rl_forwards (arg_ : bool) : string :=
   match arg_ with | true => ".rl" | false => "" end.

Definition maybe_rl_backwards (arg_ : string) : M (bool) :=
   let p0_ := arg_ in
   (if generic_eq p0_ ".rl" then returnm true
    else if generic_eq p0_ "" then returnm false
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (bool).

Definition maybe_rl_forwards_matches (arg_ : bool) : bool :=
   match arg_ with | true => true | false => true end.

Definition maybe_rl_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ ".rl" then true
   else if generic_eq p0_ "" then true
   else false.

Definition _s877_ (_s878_ : string) : option string :=
   let _s879_ := _s878_ in
   if string_startswith _s879_ "" then
     match (string_drop _s879_ (projT1 (string_length ""))) with | s_ => Some s_ end
   else None.

Definition _s873_ (_s874_ : string) : option string :=
   let _s875_ := _s874_ in
   if string_startswith _s875_ ".rl" then
     match (string_drop _s875_ (projT1 (string_length ".rl"))) with | s_ => Some s_ end
   else None.

Definition maybe_rl_matches_prefix (arg_ : string)
: M (option ((bool * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s876_ := arg_ in
   (if match (_s873_ _s876_) with | Some s_ => true | _ => false end then
      (match (_s873_ _s876_) with
       | Some s_ =>
          returnm (Some
                     (true, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((bool * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((bool * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s877_ _s876_) with | Some s_ => true | _ => false end then
      (match (_s877_ _s876_) with
       | Some s_ =>
          returnm (Some
                     (false, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((bool * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((bool * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((bool * {n : Z & ArithFact (n >=? 0)}))).

Definition maybe_u_forwards (arg_ : bool) : string :=
   match arg_ with | true => "u" | false => "" end.

Definition maybe_u_backwards (arg_ : string) : M (bool) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "u" then returnm true
    else if generic_eq p0_ "" then returnm false
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (bool).

Definition maybe_u_forwards_matches (arg_ : bool) : bool :=
   match arg_ with | true => true | false => true end.

Definition maybe_u_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "u" then true
   else if generic_eq p0_ "" then true
   else false.

Definition _s885_ (_s886_ : string) : option string :=
   let _s887_ := _s886_ in
   if string_startswith _s887_ "" then
     match (string_drop _s887_ (projT1 (string_length ""))) with | s_ => Some s_ end
   else None.

Definition _s881_ (_s882_ : string) : option string :=
   let _s883_ := _s882_ in
   if string_startswith _s883_ "u" then
     match (string_drop _s883_ (projT1 (string_length "u"))) with | s_ => Some s_ end
   else None.

Definition maybe_u_matches_prefix (arg_ : string)
: M (option ((bool * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s884_ := arg_ in
   (if match (_s881_ _s884_) with | Some s_ => true | _ => false end then
      (match (_s881_ _s884_) with
       | Some s_ =>
          returnm (Some
                     (true, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((bool * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((bool * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s885_ _s884_) with | Some s_ => true | _ => false end then
      (match (_s885_ _s884_) with
       | Some s_ =>
          returnm (Some
                     (false, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((bool * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((bool * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((bool * {n : Z & ArithFact (n >=? 0)}))).

Definition shiftw_mnemonic_forwards (arg_ : sop) : string :=
   match arg_ with | RISCV_SLLI => "slli" | RISCV_SRLI => "srli" | RISCV_SRAI => "srai" end.

Definition shiftw_mnemonic_backwards (arg_ : string) : M (sop) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "slli" then returnm RISCV_SLLI
    else if generic_eq p0_ "srli" then returnm RISCV_SRLI
    else if generic_eq p0_ "srai" then returnm RISCV_SRAI
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (sop).

Definition shiftw_mnemonic_forwards_matches (arg_ : sop) : bool :=
   match arg_ with | RISCV_SLLI => true | RISCV_SRLI => true | RISCV_SRAI => true end.

Definition shiftw_mnemonic_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "slli" then true
   else if generic_eq p0_ "srli" then true
   else if generic_eq p0_ "srai" then true
   else false.

Definition _s897_ (_s898_ : string) : option string :=
   let _s899_ := _s898_ in
   if string_startswith _s899_ "srai" then
     match (string_drop _s899_ (projT1 (string_length "srai"))) with | s_ => Some s_ end
   else None.

Definition _s893_ (_s894_ : string) : option string :=
   let _s895_ := _s894_ in
   if string_startswith _s895_ "srli" then
     match (string_drop _s895_ (projT1 (string_length "srli"))) with | s_ => Some s_ end
   else None.

Definition _s889_ (_s890_ : string) : option string :=
   let _s891_ := _s890_ in
   if string_startswith _s891_ "slli" then
     match (string_drop _s891_ (projT1 (string_length "slli"))) with | s_ => Some s_ end
   else None.

Definition shiftw_mnemonic_matches_prefix (arg_ : string)
: M (option ((sop * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s892_ := arg_ in
   (if match (_s889_ _s892_) with | Some s_ => true | _ => false end then
      (match (_s889_ _s892_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SLLI, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((sop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((sop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s893_ _s892_) with | Some s_ => true | _ => false end then
      (match (_s893_ _s892_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SRLI, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((sop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((sop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s897_ _s892_) with | Some s_ => true | _ => false end then
      (match (_s897_ _s892_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SRAI, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((sop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((sop * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((sop * {n : Z & ArithFact (n >=? 0)}))).

Definition rtypew_mnemonic_forwards (arg_ : ropw) : string :=
   match arg_ with
   | RISCV_ADDW => "addw"
   | RISCV_SUBW => "subw"
   | RISCV_SLLW => "sllw"
   | RISCV_SRLW => "srlw"
   | RISCV_SRAW => "sraw"
   end.

Definition rtypew_mnemonic_backwards (arg_ : string) : M (ropw) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "addw" then returnm RISCV_ADDW
    else if generic_eq p0_ "subw" then returnm RISCV_SUBW
    else if generic_eq p0_ "sllw" then returnm RISCV_SLLW
    else if generic_eq p0_ "srlw" then returnm RISCV_SRLW
    else if generic_eq p0_ "sraw" then returnm RISCV_SRAW
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (ropw).

Definition rtypew_mnemonic_forwards_matches (arg_ : ropw) : bool :=
   match arg_ with
   | RISCV_ADDW => true
   | RISCV_SUBW => true
   | RISCV_SLLW => true
   | RISCV_SRLW => true
   | RISCV_SRAW => true
   end.

Definition rtypew_mnemonic_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "addw" then true
   else if generic_eq p0_ "subw" then true
   else if generic_eq p0_ "sllw" then true
   else if generic_eq p0_ "srlw" then true
   else if generic_eq p0_ "sraw" then true
   else false.

Definition _s917_ (_s918_ : string) : option string :=
   let _s919_ := _s918_ in
   if string_startswith _s919_ "sraw" then
     match (string_drop _s919_ (projT1 (string_length "sraw"))) with | s_ => Some s_ end
   else None.

Definition _s913_ (_s914_ : string) : option string :=
   let _s915_ := _s914_ in
   if string_startswith _s915_ "srlw" then
     match (string_drop _s915_ (projT1 (string_length "srlw"))) with | s_ => Some s_ end
   else None.

Definition _s909_ (_s910_ : string) : option string :=
   let _s911_ := _s910_ in
   if string_startswith _s911_ "sllw" then
     match (string_drop _s911_ (projT1 (string_length "sllw"))) with | s_ => Some s_ end
   else None.

Definition _s905_ (_s906_ : string) : option string :=
   let _s907_ := _s906_ in
   if string_startswith _s907_ "subw" then
     match (string_drop _s907_ (projT1 (string_length "subw"))) with | s_ => Some s_ end
   else None.

Definition _s901_ (_s902_ : string) : option string :=
   let _s903_ := _s902_ in
   if string_startswith _s903_ "addw" then
     match (string_drop _s903_ (projT1 (string_length "addw"))) with | s_ => Some s_ end
   else None.

Definition rtypew_mnemonic_matches_prefix (arg_ : string)
: M (option ((ropw * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s904_ := arg_ in
   (if match (_s901_ _s904_) with | Some s_ => true | _ => false end then
      (match (_s901_ _s904_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_ADDW, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((ropw * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((ropw * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s905_ _s904_) with | Some s_ => true | _ => false end then
      (match (_s905_ _s904_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SUBW, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((ropw * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((ropw * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s909_ _s904_) with | Some s_ => true | _ => false end then
      (match (_s909_ _s904_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SLLW, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((ropw * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((ropw * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s913_ _s904_) with | Some s_ => true | _ => false end then
      (match (_s913_ _s904_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SRLW, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((ropw * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((ropw * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s917_ _s904_) with | Some s_ => true | _ => false end then
      (match (_s917_ _s904_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SRAW, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((ropw * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((ropw * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((ropw * {n : Z & ArithFact (n >=? 0)}))).

Definition shiftiwop_mnemonic_forwards (arg_ : sopw) : string :=
   match arg_ with | RISCV_SLLIW => "slliw" | RISCV_SRLIW => "srliw" | RISCV_SRAIW => "sraiw" end.

Definition shiftiwop_mnemonic_backwards (arg_ : string) : M (sopw) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "slliw" then returnm RISCV_SLLIW
    else if generic_eq p0_ "srliw" then returnm RISCV_SRLIW
    else if generic_eq p0_ "sraiw" then returnm RISCV_SRAIW
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (sopw).

Definition shiftiwop_mnemonic_forwards_matches (arg_ : sopw) : bool :=
   match arg_ with | RISCV_SLLIW => true | RISCV_SRLIW => true | RISCV_SRAIW => true end.

Definition shiftiwop_mnemonic_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "slliw" then true
   else if generic_eq p0_ "srliw" then true
   else if generic_eq p0_ "sraiw" then true
   else false.

Definition _s929_ (_s930_ : string) : option string :=
   let _s931_ := _s930_ in
   if string_startswith _s931_ "sraiw" then
     match (string_drop _s931_ (projT1 (string_length "sraiw"))) with | s_ => Some s_ end
   else None.

Definition _s925_ (_s926_ : string) : option string :=
   let _s927_ := _s926_ in
   if string_startswith _s927_ "srliw" then
     match (string_drop _s927_ (projT1 (string_length "srliw"))) with | s_ => Some s_ end
   else None.

Definition _s921_ (_s922_ : string) : option string :=
   let _s923_ := _s922_ in
   if string_startswith _s923_ "slliw" then
     match (string_drop _s923_ (projT1 (string_length "slliw"))) with | s_ => Some s_ end
   else None.

Definition shiftiwop_mnemonic_matches_prefix (arg_ : string)
: M (option ((sopw * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s924_ := arg_ in
   (if match (_s921_ _s924_) with | Some s_ => true | _ => false end then
      (match (_s921_ _s924_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SLLIW, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((sopw * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((sopw * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s925_ _s924_) with | Some s_ => true | _ => false end then
      (match (_s925_ _s924_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SRLIW, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((sopw * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((sopw * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s929_ _s924_) with | Some s_ => true | _ => false end then
      (match (_s929_ _s924_) with
       | Some s_ =>
          returnm (Some
                     (RISCV_SRAIW, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((sopw * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((sopw * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((sopw * {n : Z & ArithFact (n >=? 0)}))).

Definition bit_maybe_r_forwards (arg_ : mword 1) : M (string) :=
   let b__0 := arg_ in
   (if eq_vec b__0 ('b"1"  : mword 1) then returnm "r"
    else if eq_vec b__0 ('b"0"  : mword 1) then returnm ""
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (string).

Definition bit_maybe_r_backwards (arg_ : string) : M (mword 1) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "r" then returnm ('b"1"  : mword 1)
    else if generic_eq p0_ "" then returnm ('b"0"  : mword 1)
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (mword 1).

Definition bit_maybe_r_forwards_matches (arg_ : mword 1) : bool :=
   let b__0 := arg_ in
   if eq_vec b__0 ('b"1"  : mword 1) then true
   else if eq_vec b__0 ('b"0"  : mword 1) then true
   else false.

Definition bit_maybe_r_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "r" then true
   else if generic_eq p0_ "" then true
   else false.

Definition _s937_ (_s938_ : string) : option string :=
   let _s939_ := _s938_ in
   if string_startswith _s939_ "" then
     match (string_drop _s939_ (projT1 (string_length ""))) with | s_ => Some s_ end
   else None.

Definition _s933_ (_s934_ : string) : option string :=
   let _s935_ := _s934_ in
   if string_startswith _s935_ "r" then
     match (string_drop _s935_ (projT1 (string_length "r"))) with | s_ => Some s_ end
   else None.

Definition bit_maybe_r_matches_prefix (arg_ : string)
: M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s936_ := arg_ in
   (if match (_s933_ _s936_) with | Some s_ => true | _ => false end then
      (match (_s933_ _s936_) with
       | Some s_ =>
          returnm (Some
                     ('b"1"
                      : mword 1, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s937_ _s936_) with | Some s_ => true | _ => false end then
      (match (_s937_ _s936_) with
       | Some s_ =>
          returnm (Some
                     ('b"0"
                      : mword 1, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)}))).

Definition bit_maybe_w_forwards (arg_ : mword 1) : M (string) :=
   let b__0 := arg_ in
   (if eq_vec b__0 ('b"1"  : mword 1) then returnm "w"
    else if eq_vec b__0 ('b"0"  : mword 1) then returnm ""
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (string).

Definition bit_maybe_w_backwards (arg_ : string) : M (mword 1) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "w" then returnm ('b"1"  : mword 1)
    else if generic_eq p0_ "" then returnm ('b"0"  : mword 1)
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (mword 1).

Definition bit_maybe_w_forwards_matches (arg_ : mword 1) : bool :=
   let b__0 := arg_ in
   if eq_vec b__0 ('b"1"  : mword 1) then true
   else if eq_vec b__0 ('b"0"  : mword 1) then true
   else false.

Definition bit_maybe_w_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "w" then true
   else if generic_eq p0_ "" then true
   else false.

Definition _s945_ (_s946_ : string) : option string :=
   let _s947_ := _s946_ in
   if string_startswith _s947_ "" then
     match (string_drop _s947_ (projT1 (string_length ""))) with | s_ => Some s_ end
   else None.

Definition _s941_ (_s942_ : string) : option string :=
   let _s943_ := _s942_ in
   if string_startswith _s943_ "w" then
     match (string_drop _s943_ (projT1 (string_length "w"))) with | s_ => Some s_ end
   else None.

Definition bit_maybe_w_matches_prefix (arg_ : string)
: M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s944_ := arg_ in
   (if match (_s941_ _s944_) with | Some s_ => true | _ => false end then
      (match (_s941_ _s944_) with
       | Some s_ =>
          returnm (Some
                     ('b"1"
                      : mword 1, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s945_ _s944_) with | Some s_ => true | _ => false end then
      (match (_s945_ _s944_) with
       | Some s_ =>
          returnm (Some
                     ('b"0"
                      : mword 1, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)}))).

Definition bit_maybe_i_forwards (arg_ : mword 1) : M (string) :=
   let b__0 := arg_ in
   (if eq_vec b__0 ('b"1"  : mword 1) then returnm "i"
    else if eq_vec b__0 ('b"0"  : mword 1) then returnm ""
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (string).

Definition bit_maybe_i_backwards (arg_ : string) : M (mword 1) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "i" then returnm ('b"1"  : mword 1)
    else if generic_eq p0_ "" then returnm ('b"0"  : mword 1)
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (mword 1).

Definition bit_maybe_i_forwards_matches (arg_ : mword 1) : bool :=
   let b__0 := arg_ in
   if eq_vec b__0 ('b"1"  : mword 1) then true
   else if eq_vec b__0 ('b"0"  : mword 1) then true
   else false.

Definition bit_maybe_i_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "i" then true
   else if generic_eq p0_ "" then true
   else false.

Definition _s953_ (_s954_ : string) : option string :=
   let _s955_ := _s954_ in
   if string_startswith _s955_ "" then
     match (string_drop _s955_ (projT1 (string_length ""))) with | s_ => Some s_ end
   else None.

Definition _s949_ (_s950_ : string) : option string :=
   let _s951_ := _s950_ in
   if string_startswith _s951_ "i" then
     match (string_drop _s951_ (projT1 (string_length "i"))) with | s_ => Some s_ end
   else None.

Definition bit_maybe_i_matches_prefix (arg_ : string)
: M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s952_ := arg_ in
   (if match (_s949_ _s952_) with | Some s_ => true | _ => false end then
      (match (_s949_ _s952_) with
       | Some s_ =>
          returnm (Some
                     ('b"1"
                      : mword 1, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s953_ _s952_) with | Some s_ => true | _ => false end then
      (match (_s953_ _s952_) with
       | Some s_ =>
          returnm (Some
                     ('b"0"
                      : mword 1, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)}))).

Definition bit_maybe_o_forwards (arg_ : mword 1) : M (string) :=
   let b__0 := arg_ in
   (if eq_vec b__0 ('b"1"  : mword 1) then returnm "o"
    else if eq_vec b__0 ('b"0"  : mword 1) then returnm ""
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (string).

Definition bit_maybe_o_backwards (arg_ : string) : M (mword 1) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "o" then returnm ('b"1"  : mword 1)
    else if generic_eq p0_ "" then returnm ('b"0"  : mword 1)
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (mword 1).

Definition bit_maybe_o_forwards_matches (arg_ : mword 1) : bool :=
   let b__0 := arg_ in
   if eq_vec b__0 ('b"1"  : mword 1) then true
   else if eq_vec b__0 ('b"0"  : mword 1) then true
   else false.

Definition bit_maybe_o_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "o" then true
   else if generic_eq p0_ "" then true
   else false.

Definition _s961_ (_s962_ : string) : option string :=
   let _s963_ := _s962_ in
   if string_startswith _s963_ "" then
     match (string_drop _s963_ (projT1 (string_length ""))) with | s_ => Some s_ end
   else None.

Definition _s957_ (_s958_ : string) : option string :=
   let _s959_ := _s958_ in
   if string_startswith _s959_ "o" then
     match (string_drop _s959_ (projT1 (string_length "o"))) with | s_ => Some s_ end
   else None.

Definition bit_maybe_o_matches_prefix (arg_ : string)
: M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s960_ := arg_ in
   (if match (_s957_ _s960_) with | Some s_ => true | _ => false end then
      (match (_s957_ _s960_) with
       | Some s_ =>
          returnm (Some
                     ('b"1"
                      : mword 1, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s961_ _s960_) with | Some s_ => true | _ => false end then
      (match (_s961_ _s960_) with
       | Some s_ =>
          returnm (Some
                     ('b"0"
                      : mword 1, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((mword 1 * {n : Z & ArithFact (n >=? 0)}))).

Definition fence_bits_forwards (arg_ : mword 4) : M (string) :=
   (match arg_ with
    | v__0 =>
       let i : bits 1 := subrange_vec_dec v__0 3 3 in
       let w : bits 1 := subrange_vec_dec v__0 0 0 in
       let r : bits 1 := subrange_vec_dec v__0 1 1 in
       let o : bits 1 := subrange_vec_dec v__0 2 2 in
       let i : bits 1 := subrange_vec_dec v__0 3 3 in
       (bit_maybe_i_forwards i) >>= fun w__0 : string =>
       (bit_maybe_o_forwards o) >>= fun w__1 : string =>
       (bit_maybe_r_forwards r) >>= fun w__2 : string =>
       (bit_maybe_w_forwards w) >>= fun w__3 : string =>
       returnm (string_append w__0 (string_append w__1 (string_append w__2 (string_append w__3 ""))))
    end)
    : M (string).

Definition _s965_ (_s966_ : string) : M (option ((mword 1 * mword 1 * mword 1 * mword 1))) :=
   (match _s966_ with
    | _s967_ =>
       (bit_maybe_i_matches_prefix _s967_) >>= fun w__0 : option ((mword 1 * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (i, existT _ _s968_ _) =>
           (match (string_drop _s967_ _s968_) with
            | _s969_ =>
               (bit_maybe_o_matches_prefix _s969_) >>= fun w__1 : option ((mword 1 * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (o, existT _ _s970_ _) =>
                   (match (string_drop _s969_ _s970_) with
                    | _s971_ =>
                       (bit_maybe_r_matches_prefix _s971_) >>= fun w__2 : option ((mword 1 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (r, existT _ _s972_ _) =>
                           (match (string_drop _s971_ _s972_) with
                            | _s973_ =>
                               (bit_maybe_w_matches_prefix _s973_) >>= fun w__3 : option ((mword 1 * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               returnm (match w__3 with
                                        | Some (w, existT _ _s974_ _) =>
                                           let p0_ := string_drop _s973_ _s974_ in
                                           if generic_eq p0_ "" then Some (i, o, r, w)
                                           else None
                                        | _ => None
                                        end)
                            end)
                            : M (option ((mword 1 * mword 1 * mword 1 * mword 1)))
                        | _ => returnm None
                        end)
                        : M (option ((mword 1 * mword 1 * mword 1 * mword 1)))
                    end)
                    : M (option ((mword 1 * mword 1 * mword 1 * mword 1)))
                | _ => returnm None
                end)
                : M (option ((mword 1 * mword 1 * mword 1 * mword 1)))
            end)
            : M (option ((mword 1 * mword 1 * mword 1 * mword 1)))
        | _ => returnm None
        end)
        : M (option ((mword 1 * mword 1 * mword 1 * mword 1)))
    end)
    : M (option ((mword 1 * mword 1 * mword 1 * mword 1))).

Definition fence_bits_backwards (arg_ : string) : M (mword 4) :=
   let _s975_ := arg_ in
   (_s965_ _s975_) >>= fun w__0 : option ((mword 1 * mword 1 * mword 1 * mword 1)) =>
   (if match w__0 with | Some (i, o, r, w) => true | _ => false end then
      (_s965_ _s975_) >>= fun w__1 : option ((mword 1 * mword 1 * mword 1 * mword 1)) =>
      (match w__1 with
       | Some (i, o, r, w) =>
          returnm (concat_vec (i  : bits 1)
                     (concat_vec (o  : bits 1) (concat_vec (r  : bits 1) (w  : bits 1))))
       | _ => exit tt  : M (mword 4)
       end)
       : M (mword 4)
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (mword 4).

Definition fence_bits_forwards_matches (arg_ : mword 4) : bool :=
   match arg_ with | v__1 => true end.

Definition _s976_ (_s977_ : string) : M (option ((mword 1 * mword 1 * mword 1 * mword 1))) :=
   (match _s977_ with
    | _s978_ =>
       (bit_maybe_i_matches_prefix _s978_) >>= fun w__0 : option ((mword 1 * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (i, existT _ _s979_ _) =>
           (match (string_drop _s978_ _s979_) with
            | _s980_ =>
               (bit_maybe_o_matches_prefix _s980_) >>= fun w__1 : option ((mword 1 * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (o, existT _ _s981_ _) =>
                   (match (string_drop _s980_ _s981_) with
                    | _s982_ =>
                       (bit_maybe_r_matches_prefix _s982_) >>= fun w__2 : option ((mword 1 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (r, existT _ _s983_ _) =>
                           (match (string_drop _s982_ _s983_) with
                            | _s984_ =>
                               (bit_maybe_w_matches_prefix _s984_) >>= fun w__3 : option ((mword 1 * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               returnm (match w__3 with
                                        | Some (w, existT _ _s985_ _) =>
                                           let p0_ := string_drop _s984_ _s985_ in
                                           if generic_eq p0_ "" then Some (i, o, r, w)
                                           else None
                                        | _ => None
                                        end)
                            end)
                            : M (option ((mword 1 * mword 1 * mword 1 * mword 1)))
                        | _ => returnm None
                        end)
                        : M (option ((mword 1 * mword 1 * mword 1 * mword 1)))
                    end)
                    : M (option ((mword 1 * mword 1 * mword 1 * mword 1)))
                | _ => returnm None
                end)
                : M (option ((mword 1 * mword 1 * mword 1 * mword 1)))
            end)
            : M (option ((mword 1 * mword 1 * mword 1 * mword 1)))
        | _ => returnm None
        end)
        : M (option ((mword 1 * mword 1 * mword 1 * mword 1)))
    end)
    : M (option ((mword 1 * mword 1 * mword 1 * mword 1))).

Definition fence_bits_backwards_matches (arg_ : string) : M (bool) :=
   let _s986_ := arg_ in
   (_s976_ _s986_) >>= fun w__0 : option ((mword 1 * mword 1 * mword 1 * mword 1)) =>
   (if match w__0 with | Some (i, o, r, w) => true | _ => false end then
      (_s976_ _s986_) >>= fun w__1 : option ((mword 1 * mword 1 * mword 1 * mword 1)) =>
      (match w__1 with | Some (i, o, r, w) => returnm true | _ => exit tt  : M (bool) end)
       : M (bool)
    else returnm false)
    : M (bool).

Definition _s987_ (_s988_ : string) : M (option ((mword 1 * mword 1 * mword 1 * mword 1 * string))) :=
   (match _s988_ with
    | _s989_ =>
       (bit_maybe_i_matches_prefix _s989_) >>= fun w__0 : option ((mword 1 * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (i, existT _ _s990_ _) =>
           (match (string_drop _s989_ _s990_) with
            | _s991_ =>
               (bit_maybe_o_matches_prefix _s991_) >>= fun w__1 : option ((mword 1 * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (o, existT _ _s992_ _) =>
                   (match (string_drop _s991_ _s992_) with
                    | _s993_ =>
                       (bit_maybe_r_matches_prefix _s993_) >>= fun w__2 : option ((mword 1 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (r, existT _ _s994_ _) =>
                           (match (string_drop _s993_ _s994_) with
                            | _s995_ =>
                               (bit_maybe_w_matches_prefix _s995_) >>= fun w__3 : option ((mword 1 * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               returnm (match w__3 with
                                        | Some (w, existT _ _s996_ _) =>
                                           match (string_drop _s995_ _s996_) with
                                           | s_ => Some (i, o, r, w, s_)
                                           end
                                        | _ => None
                                        end)
                            end)
                            : M (option ((mword 1 * mword 1 * mword 1 * mword 1 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((mword 1 * mword 1 * mword 1 * mword 1 * string)))
                    end)
                    : M (option ((mword 1 * mword 1 * mword 1 * mword 1 * string)))
                | _ => returnm None
                end)
                : M (option ((mword 1 * mword 1 * mword 1 * mword 1 * string)))
            end)
            : M (option ((mword 1 * mword 1 * mword 1 * mword 1 * string)))
        | _ => returnm None
        end)
        : M (option ((mword 1 * mword 1 * mword 1 * mword 1 * string)))
    end)
    : M (option ((mword 1 * mword 1 * mword 1 * mword 1 * string))).

Definition fence_bits_matches_prefix (arg_ : string)
: M (option ((mword 4 * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s997_ := arg_ in
   (_s987_ _s997_) >>= fun w__0 : option ((mword 1 * mword 1 * mword 1 * mword 1 * string)) =>
   (if match w__0 with | Some (i, o, r, w, s_) => true | _ => false end then
      (_s987_ _s997_) >>= fun w__1 : option ((mword 1 * mword 1 * mword 1 * mword 1 * string)) =>
      (match w__1 with
       | Some (i, o, r, w, s_) =>
          returnm (Some
                     (concat_vec (i  : bits 1)
                        (concat_vec (o  : bits 1) (concat_vec (r  : bits 1) (w  : bits 1))), build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((mword 4 * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((mword 4 * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((mword 4 * {n : Z & ArithFact (n >=? 0)}))).

Definition aqrl_str (aq : bool) (rl : bool) : string :=
   match (aq, rl) with
   | (false, false) => ""
   | (false, true) => ".rl"
   | (true, false) => ".aq"
   | (true, true) => ".aqrl"
   end.

Definition lrsc_width_str (width : word_width) : string :=
   match width with | BYTE => ".b" | HALF => ".h" | WORD => ".w" | DOUBLE => ".d" end.

Definition amo_width_valid (size : word_width) : bool :=
   match size with | WORD => true | DOUBLE => Z.geb 64 64 | _ => false end.

Definition process_loadres {n : Z}
(rd : mword 5) (addr : mword 64) (value : MemoryOpResult (mword (8 * n))) (is_unsigned : bool)
`{ArithFact ((0 <? n) && (n <=? 8))}
: M (Retired) :=
   (match (extend_value is_unsigned value) with
    | MemValue result =>
       let '_ := (load_reservation addr)  : unit in
       (wX_bits rd result) >> returnm RETIRE_SUCCESS
    | MemException e => (handle_mem_exception addr e) >> returnm RETIRE_FAIL
    end)
    : M (Retired).

Definition encdec_amoop_forwards (arg_ : amoop) : mword 5 :=
   match arg_ with
   | AMOSWAP => 'b"00001"  : mword 5
   | AMOADD => 'b"00000"  : mword 5
   | AMOXOR => 'b"00100"  : mword 5
   | AMOAND => 'b"01100"  : mword 5
   | AMOOR => 'b"01000"  : mword 5
   | AMOMIN => 'b"10000"  : mword 5
   | AMOMAX => 'b"10100"  : mword 5
   | AMOMINU => 'b"11000"  : mword 5
   | AMOMAXU => 'b"11100"  : mword 5
   end.

Definition encdec_amoop_backwards (arg_ : mword 5) : M (amoop) :=
   let b__0 := arg_ in
   (if eq_vec b__0 ('b"00001"  : mword 5) then returnm AMOSWAP
    else if eq_vec b__0 ('b"00000"  : mword 5) then returnm AMOADD
    else if eq_vec b__0 ('b"00100"  : mword 5) then returnm AMOXOR
    else if eq_vec b__0 ('b"01100"  : mword 5) then returnm AMOAND
    else if eq_vec b__0 ('b"01000"  : mword 5) then returnm AMOOR
    else if eq_vec b__0 ('b"10000"  : mword 5) then returnm AMOMIN
    else if eq_vec b__0 ('b"10100"  : mword 5) then returnm AMOMAX
    else if eq_vec b__0 ('b"11000"  : mword 5) then returnm AMOMINU
    else if eq_vec b__0 ('b"11100"  : mword 5) then returnm AMOMAXU
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (amoop).

Definition encdec_amoop_forwards_matches (arg_ : amoop) : bool :=
   match arg_ with
   | AMOSWAP => true
   | AMOADD => true
   | AMOXOR => true
   | AMOAND => true
   | AMOOR => true
   | AMOMIN => true
   | AMOMAX => true
   | AMOMINU => true
   | AMOMAXU => true
   end.

Definition encdec_amoop_backwards_matches (arg_ : mword 5) : bool :=
   let b__0 := arg_ in
   if eq_vec b__0 ('b"00001"  : mword 5) then true
   else if eq_vec b__0 ('b"00000"  : mword 5) then true
   else if eq_vec b__0 ('b"00100"  : mword 5) then true
   else if eq_vec b__0 ('b"01100"  : mword 5) then true
   else if eq_vec b__0 ('b"01000"  : mword 5) then true
   else if eq_vec b__0 ('b"10000"  : mword 5) then true
   else if eq_vec b__0 ('b"10100"  : mword 5) then true
   else if eq_vec b__0 ('b"11000"  : mword 5) then true
   else if eq_vec b__0 ('b"11100"  : mword 5) then true
   else false.

Definition amo_mnemonic_forwards (arg_ : amoop) : string :=
   match arg_ with
   | AMOSWAP => "amoswap"
   | AMOADD => "amoadd"
   | AMOXOR => "amoxor"
   | AMOAND => "amoand"
   | AMOOR => "amoor"
   | AMOMIN => "amomin"
   | AMOMAX => "amomax"
   | AMOMINU => "amominu"
   | AMOMAXU => "amomaxu"
   end.

Definition amo_mnemonic_backwards (arg_ : string) : M (amoop) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "amoswap" then returnm AMOSWAP
    else if generic_eq p0_ "amoadd" then returnm AMOADD
    else if generic_eq p0_ "amoxor" then returnm AMOXOR
    else if generic_eq p0_ "amoand" then returnm AMOAND
    else if generic_eq p0_ "amoor" then returnm AMOOR
    else if generic_eq p0_ "amomin" then returnm AMOMIN
    else if generic_eq p0_ "amomax" then returnm AMOMAX
    else if generic_eq p0_ "amominu" then returnm AMOMINU
    else if generic_eq p0_ "amomaxu" then returnm AMOMAXU
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (amoop).

Definition amo_mnemonic_forwards_matches (arg_ : amoop) : bool :=
   match arg_ with
   | AMOSWAP => true
   | AMOADD => true
   | AMOXOR => true
   | AMOAND => true
   | AMOOR => true
   | AMOMIN => true
   | AMOMAX => true
   | AMOMINU => true
   | AMOMAXU => true
   end.

Definition amo_mnemonic_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "amoswap" then true
   else if generic_eq p0_ "amoadd" then true
   else if generic_eq p0_ "amoxor" then true
   else if generic_eq p0_ "amoand" then true
   else if generic_eq p0_ "amoor" then true
   else if generic_eq p0_ "amomin" then true
   else if generic_eq p0_ "amomax" then true
   else if generic_eq p0_ "amominu" then true
   else if generic_eq p0_ "amomaxu" then true
   else false.

Definition _s1030_ (_s1031_ : string) : option string :=
   let _s1032_ := _s1031_ in
   if string_startswith _s1032_ "amomaxu" then
     match (string_drop _s1032_ (projT1 (string_length "amomaxu"))) with | s_ => Some s_ end
   else None.

Definition _s1026_ (_s1027_ : string) : option string :=
   let _s1028_ := _s1027_ in
   if string_startswith _s1028_ "amominu" then
     match (string_drop _s1028_ (projT1 (string_length "amominu"))) with | s_ => Some s_ end
   else None.

Definition _s1022_ (_s1023_ : string) : option string :=
   let _s1024_ := _s1023_ in
   if string_startswith _s1024_ "amomax" then
     match (string_drop _s1024_ (projT1 (string_length "amomax"))) with | s_ => Some s_ end
   else None.

Definition _s1018_ (_s1019_ : string) : option string :=
   let _s1020_ := _s1019_ in
   if string_startswith _s1020_ "amomin" then
     match (string_drop _s1020_ (projT1 (string_length "amomin"))) with | s_ => Some s_ end
   else None.

Definition _s1014_ (_s1015_ : string) : option string :=
   let _s1016_ := _s1015_ in
   if string_startswith _s1016_ "amoor" then
     match (string_drop _s1016_ (projT1 (string_length "amoor"))) with | s_ => Some s_ end
   else None.

Definition _s1010_ (_s1011_ : string) : option string :=
   let _s1012_ := _s1011_ in
   if string_startswith _s1012_ "amoand" then
     match (string_drop _s1012_ (projT1 (string_length "amoand"))) with | s_ => Some s_ end
   else None.

Definition _s1006_ (_s1007_ : string) : option string :=
   let _s1008_ := _s1007_ in
   if string_startswith _s1008_ "amoxor" then
     match (string_drop _s1008_ (projT1 (string_length "amoxor"))) with | s_ => Some s_ end
   else None.

Definition _s1002_ (_s1003_ : string) : option string :=
   let _s1004_ := _s1003_ in
   if string_startswith _s1004_ "amoadd" then
     match (string_drop _s1004_ (projT1 (string_length "amoadd"))) with | s_ => Some s_ end
   else None.

Definition _s998_ (_s999_ : string) : option string :=
   let _s1000_ := _s999_ in
   if string_startswith _s1000_ "amoswap" then
     match (string_drop _s1000_ (projT1 (string_length "amoswap"))) with | s_ => Some s_ end
   else None.

Definition amo_mnemonic_matches_prefix (arg_ : string)
: M (option ((amoop * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s1001_ := arg_ in
   (if match (_s998_ _s1001_) with | Some s_ => true | _ => false end then
      (match (_s998_ _s1001_) with
       | Some s_ =>
          returnm (Some
                     (AMOSWAP, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((amoop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((amoop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1002_ _s1001_) with | Some s_ => true | _ => false end then
      (match (_s1002_ _s1001_) with
       | Some s_ =>
          returnm (Some
                     (AMOADD, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((amoop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((amoop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1006_ _s1001_) with | Some s_ => true | _ => false end then
      (match (_s1006_ _s1001_) with
       | Some s_ =>
          returnm (Some
                     (AMOXOR, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((amoop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((amoop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1010_ _s1001_) with | Some s_ => true | _ => false end then
      (match (_s1010_ _s1001_) with
       | Some s_ =>
          returnm (Some
                     (AMOAND, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((amoop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((amoop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1014_ _s1001_) with | Some s_ => true | _ => false end then
      (match (_s1014_ _s1001_) with
       | Some s_ =>
          returnm (Some
                     (AMOOR, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((amoop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((amoop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1018_ _s1001_) with | Some s_ => true | _ => false end then
      (match (_s1018_ _s1001_) with
       | Some s_ =>
          returnm (Some
                     (AMOMIN, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((amoop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((amoop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1022_ _s1001_) with | Some s_ => true | _ => false end then
      (match (_s1022_ _s1001_) with
       | Some s_ =>
          returnm (Some
                     (AMOMAX, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((amoop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((amoop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1026_ _s1001_) with | Some s_ => true | _ => false end then
      (match (_s1026_ _s1001_) with
       | Some s_ =>
          returnm (Some
                     (AMOMINU, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((amoop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((amoop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1030_ _s1001_) with | Some s_ => true | _ => false end then
      (match (_s1030_ _s1001_) with
       | Some s_ =>
          returnm (Some
                     (AMOMAXU, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((amoop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((amoop * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((amoop * {n : Z & ArithFact (n >=? 0)}))).

Definition encdec_mul_op_forwards (arg_ : (bool * bool * bool)) : M (mword 3) :=
   (match arg_ with
    | (false, true, true) => returnm ('b"000"  : mword 3)
    | (true, true, true) => returnm ('b"001"  : mword 3)
    | (true, true, false) => returnm ('b"010"  : mword 3)
    | (true, false, false) => returnm ('b"011"  : mword 3)
    | _ => exit tt  : M (mword 3)
    end)
    : M (mword 3).

Definition encdec_mul_op_backwards (arg_ : mword 3) : M ((bool * bool * bool)) :=
   let b__0 := arg_ in
   (if eq_vec b__0 ('b"000"  : mword 3) then returnm (false, true, true)
    else if eq_vec b__0 ('b"001"  : mword 3) then returnm (true, true, true)
    else if eq_vec b__0 ('b"010"  : mword 3) then returnm (true, true, false)
    else if eq_vec b__0 ('b"011"  : mword 3) then returnm (true, false, false)
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M ((bool * bool * bool)).

Definition encdec_mul_op_forwards_matches (arg_ : (bool * bool * bool)) : bool :=
   match arg_ with
   | (false, true, true) => true
   | (true, true, true) => true
   | (true, true, false) => true
   | (true, false, false) => true
   | _ => false
   end.

Definition encdec_mul_op_backwards_matches (arg_ : mword 3) : bool :=
   let b__0 := arg_ in
   if eq_vec b__0 ('b"000"  : mword 3) then true
   else if eq_vec b__0 ('b"001"  : mword 3) then true
   else if eq_vec b__0 ('b"010"  : mword 3) then true
   else if eq_vec b__0 ('b"011"  : mword 3) then true
   else false.

Definition mul_mnemonic_forwards (arg_ : (bool * bool * bool)) : M (string) :=
   (match arg_ with
    | (false, true, true) => returnm "mul"
    | (true, true, true) => returnm "mulh"
    | (true, true, false) => returnm "mulhsu"
    | (true, false, false) => returnm "mulhu"
    | _ => exit tt  : M (string)
    end)
    : M (string).

Definition mul_mnemonic_backwards (arg_ : string) : M ((bool * bool * bool)) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "mul" then returnm (false, true, true)
    else if generic_eq p0_ "mulh" then returnm (true, true, true)
    else if generic_eq p0_ "mulhsu" then returnm (true, true, false)
    else if generic_eq p0_ "mulhu" then returnm (true, false, false)
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M ((bool * bool * bool)).

Definition mul_mnemonic_forwards_matches (arg_ : (bool * bool * bool)) : bool :=
   match arg_ with
   | (false, true, true) => true
   | (true, true, true) => true
   | (true, true, false) => true
   | (true, false, false) => true
   | _ => false
   end.

Definition mul_mnemonic_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "mul" then true
   else if generic_eq p0_ "mulh" then true
   else if generic_eq p0_ "mulhsu" then true
   else if generic_eq p0_ "mulhu" then true
   else false.

Definition _s1046_ (_s1047_ : string) : option string :=
   let _s1048_ := _s1047_ in
   if string_startswith _s1048_ "mulhu" then
     match (string_drop _s1048_ (projT1 (string_length "mulhu"))) with | s_ => Some s_ end
   else None.

Definition _s1042_ (_s1043_ : string) : option string :=
   let _s1044_ := _s1043_ in
   if string_startswith _s1044_ "mulhsu" then
     match (string_drop _s1044_ (projT1 (string_length "mulhsu"))) with | s_ => Some s_ end
   else None.

Definition _s1038_ (_s1039_ : string) : option string :=
   let _s1040_ := _s1039_ in
   if string_startswith _s1040_ "mulh" then
     match (string_drop _s1040_ (projT1 (string_length "mulh"))) with | s_ => Some s_ end
   else None.

Definition _s1034_ (_s1035_ : string) : option string :=
   let _s1036_ := _s1035_ in
   if string_startswith _s1036_ "mul" then
     match (string_drop _s1036_ (projT1 (string_length "mul"))) with | s_ => Some s_ end
   else None.

Definition mul_mnemonic_matches_prefix (arg_ : string)
: M (option (((bool * bool * bool) * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s1037_ := arg_ in
   (if match (_s1034_ _s1037_) with | Some s_ => true | _ => false end then
      (match (_s1034_ _s1037_) with
       | Some s_ =>
          returnm (Some
                     ((false, true, true), build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option (((bool * bool * bool) * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option (((bool * bool * bool) * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1038_ _s1037_) with | Some s_ => true | _ => false end then
      (match (_s1038_ _s1037_) with
       | Some s_ =>
          returnm (Some
                     ((true, true, true), build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option (((bool * bool * bool) * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option (((bool * bool * bool) * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1042_ _s1037_) with | Some s_ => true | _ => false end then
      (match (_s1042_ _s1037_) with
       | Some s_ =>
          returnm (Some
                     ((true, true, false), build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option (((bool * bool * bool) * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option (((bool * bool * bool) * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1046_ _s1037_) with | Some s_ => true | _ => false end then
      (match (_s1046_ _s1037_) with
       | Some s_ =>
          returnm (Some
                     ((true, false, false), build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option (((bool * bool * bool) * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option (((bool * bool * bool) * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option (((bool * bool * bool) * {n : Z & ArithFact (n >=? 0)}))).

Definition maybe_not_u_forwards (arg_ : bool) : string :=
   match arg_ with | false => "u" | true => "" end.

Definition maybe_not_u_backwards (arg_ : string) : M (bool) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "u" then returnm false
    else if generic_eq p0_ "" then returnm true
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (bool).

Definition maybe_not_u_forwards_matches (arg_ : bool) : bool :=
   match arg_ with | false => true | true => true end.

Definition maybe_not_u_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "u" then true
   else if generic_eq p0_ "" then true
   else false.

Definition _s1054_ (_s1055_ : string) : option string :=
   let _s1056_ := _s1055_ in
   if string_startswith _s1056_ "" then
     match (string_drop _s1056_ (projT1 (string_length ""))) with | s_ => Some s_ end
   else None.

Definition _s1050_ (_s1051_ : string) : option string :=
   let _s1052_ := _s1051_ in
   if string_startswith _s1052_ "u" then
     match (string_drop _s1052_ (projT1 (string_length "u"))) with | s_ => Some s_ end
   else None.

Definition maybe_not_u_matches_prefix (arg_ : string)
: M (option ((bool * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s1053_ := arg_ in
   (if match (_s1050_ _s1053_) with | Some s_ => true | _ => false end then
      (match (_s1050_ _s1053_) with
       | Some s_ =>
          returnm (Some
                     (false, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((bool * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((bool * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1054_ _s1053_) with | Some s_ => true | _ => false end then
      (match (_s1054_ _s1053_) with
       | Some s_ =>
          returnm (Some
                     (true, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((bool * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((bool * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((bool * {n : Z & ArithFact (n >=? 0)}))).

Definition encdec_csrop_forwards (arg_ : csrop) : mword 2 :=
   match arg_ with
   | CSRRW => 'b"01"  : mword 2
   | CSRRS => 'b"10"  : mword 2
   | CSRRC => 'b"11"  : mword 2
   end.

Definition encdec_csrop_backwards (arg_ : mword 2) : M (csrop) :=
   let b__0 := arg_ in
   (if eq_vec b__0 ('b"01"  : mword 2) then returnm CSRRW
    else if eq_vec b__0 ('b"10"  : mword 2) then returnm CSRRS
    else if eq_vec b__0 ('b"11"  : mword 2) then returnm CSRRC
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (csrop).

Definition encdec_csrop_forwards_matches (arg_ : csrop) : bool :=
   match arg_ with | CSRRW => true | CSRRS => true | CSRRC => true end.

Definition encdec_csrop_backwards_matches (arg_ : mword 2) : bool :=
   let b__0 := arg_ in
   if eq_vec b__0 ('b"01"  : mword 2) then true
   else if eq_vec b__0 ('b"10"  : mword 2) then true
   else if eq_vec b__0 ('b"11"  : mword 2) then true
   else false.

Definition readCSR (csr : mword 12) : M (mword 64) :=
   (match (csr, 64) with
    | (b__0, g__336) =>
       (if eq_vec b__0 (Ox"F11"  : mword 12) then
          ((read_reg mvendorid_ref)  : M (mword 32)) >>= fun w__0 : mword 32 =>
          returnm (EXTZ 64 w__0)
        else if eq_vec b__0 (Ox"F12"  : mword 12) then
          ((read_reg marchid_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"F13"  : mword 12) then
          ((read_reg mimpid_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"F14"  : mword 12) then
          ((read_reg mhartid_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"300"  : mword 12) then
          read_reg mstatus_ref >>= fun w__4 : Mstatus => returnm (_get_Mstatus_bits w__4)
        else if eq_vec b__0 (Ox"301"  : mword 12) then
          read_reg misa_ref >>= fun w__5 : Misa => returnm (_get_Misa_bits w__5)
        else if eq_vec b__0 (Ox"302"  : mword 12) then
          read_reg medeleg_ref >>= fun w__6 : Medeleg => returnm (_get_Medeleg_bits w__6)
        else if eq_vec b__0 (Ox"303"  : mword 12) then
          read_reg mideleg_ref >>= fun w__7 : Minterrupts => returnm (_get_Minterrupts_bits w__7)
        else if eq_vec b__0 (Ox"304"  : mword 12) then
          read_reg mie_ref >>= fun w__8 : Minterrupts => returnm (_get_Minterrupts_bits w__8)
        else if eq_vec b__0 (Ox"305"  : mword 12) then (get_mtvec tt)  : M (mword 64)
        else if eq_vec b__0 (Ox"306"  : mword 12) then
          read_reg mcounteren_ref >>= fun w__10 : Counteren =>
          returnm (EXTZ 64 (_get_Counteren_bits w__10))
        else if eq_vec b__0 (Ox"320"  : mword 12) then
          read_reg mcountinhibit_ref >>= fun w__11 : Counterin =>
          returnm (EXTZ 64 (_get_Counterin_bits w__11))
        else if eq_vec b__0 (Ox"340"  : mword 12) then
          ((read_reg mscratch_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"341"  : mword 12) then
          (get_xret_target Machine) >>= fun w__13 : mword 64 =>
          (pc_alignment_mask tt) >>= fun w__14 : mword 64 => returnm (and_vec w__13 w__14)
        else if eq_vec b__0 (Ox"342"  : mword 12) then
          read_reg mcause_ref >>= fun w__15 : Mcause => returnm (_get_Mcause_bits w__15)
        else if eq_vec b__0 (Ox"343"  : mword 12) then
          ((read_reg mtval_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"344"  : mword 12) then
          read_reg mip_ref >>= fun w__17 : Minterrupts => returnm (_get_Minterrupts_bits w__17)
        else if eq_vec b__0 (Ox"3A0"  : mword 12) then (pmpReadCfgReg 0)  : M (mword 64)
        else if eq_vec b__0 (Ox"3A2"  : mword 12) then (pmpReadCfgReg 2)  : M (mword 64)
        else if eq_vec b__0 (Ox"3B0"  : mword 12) then
          ((read_reg pmpaddr0_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"3B1"  : mword 12) then
          ((read_reg pmpaddr1_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"3B2"  : mword 12) then
          ((read_reg pmpaddr2_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"3B3"  : mword 12) then
          ((read_reg pmpaddr3_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"3B4"  : mword 12) then
          ((read_reg pmpaddr4_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"3B5"  : mword 12) then
          ((read_reg pmpaddr5_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"3B6"  : mword 12) then
          ((read_reg pmpaddr6_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"3B7"  : mword 12) then
          ((read_reg pmpaddr7_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"3B8"  : mword 12) then
          ((read_reg pmpaddr8_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"3B9"  : mword 12) then
          ((read_reg pmpaddr9_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"3BA"  : mword 12) then
          ((read_reg pmpaddr10_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"3BB"  : mword 12) then
          ((read_reg pmpaddr11_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"3BC"  : mword 12) then
          ((read_reg pmpaddr12_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"3BD"  : mword 12) then
          ((read_reg pmpaddr13_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"3BE"  : mword 12) then
          ((read_reg pmpaddr14_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"3BF"  : mword 12) then
          ((read_reg pmpaddr15_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"B00"  : mword 12) then
          ((read_reg mcycle_ref)  : M (mword 64)) >>= fun w__36 : mword 64 =>
          returnm (subrange_vec_dec w__36 (Z.sub 64 1) 0)
        else if eq_vec b__0 (Ox"B02"  : mword 12) then
          ((read_reg minstret_ref)  : M (mword 64)) >>= fun w__37 : mword 64 =>
          returnm (subrange_vec_dec w__37 (Z.sub 64 1) 0)
        else if eq_vec b__0 (Ox"7A0"  : mword 12) then
          ((read_reg tselect_ref)  : M (mword 64)) >>= fun w__38 : mword 64 =>
          returnm (not_vec w__38)
        else if eq_vec b__0 (Ox"100"  : mword 12) then
          read_reg mstatus_ref >>= fun w__39 : Mstatus =>
          returnm (_get_Sstatus_bits (lower_mstatus w__39))
        else if eq_vec b__0 (Ox"102"  : mword 12) then
          read_reg sedeleg_ref >>= fun w__40 : Sedeleg => returnm (_get_Sedeleg_bits w__40)
        else if eq_vec b__0 (Ox"103"  : mword 12) then
          read_reg sideleg_ref >>= fun w__41 : Sinterrupts => returnm (_get_Sinterrupts_bits w__41)
        else if eq_vec b__0 (Ox"104"  : mword 12) then
          read_reg mie_ref >>= fun w__42 : Minterrupts =>
          read_reg mideleg_ref >>= fun w__43 : Minterrupts =>
          returnm (_get_Sinterrupts_bits (lower_mie w__42 w__43))
        else if eq_vec b__0 (Ox"105"  : mword 12) then (get_stvec tt)  : M (mword 64)
        else if eq_vec b__0 (Ox"106"  : mword 12) then
          read_reg scounteren_ref >>= fun w__45 : Counteren =>
          returnm (EXTZ 64 (_get_Counteren_bits w__45))
        else if eq_vec b__0 (Ox"140"  : mword 12) then
          ((read_reg sscratch_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"141"  : mword 12) then
          (get_xret_target Supervisor) >>= fun w__47 : mword 64 =>
          (pc_alignment_mask tt) >>= fun w__48 : mword 64 => returnm (and_vec w__47 w__48)
        else if eq_vec b__0 (Ox"142"  : mword 12) then
          read_reg scause_ref >>= fun w__49 : Mcause => returnm (_get_Mcause_bits w__49)
        else if eq_vec b__0 (Ox"143"  : mword 12) then
          ((read_reg stval_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"144"  : mword 12) then
          read_reg mip_ref >>= fun w__51 : Minterrupts =>
          read_reg mideleg_ref >>= fun w__52 : Minterrupts =>
          returnm (_get_Sinterrupts_bits (lower_mip w__51 w__52))
        else if eq_vec b__0 (Ox"180"  : mword 12) then
          ((read_reg satp_ref)  : M (mword 64))
           : M (mword 64)
        else if eq_vec b__0 (Ox"C00"  : mword 12) then
          ((read_reg mcycle_ref)  : M (mword 64)) >>= fun w__54 : mword 64 =>
          returnm (subrange_vec_dec w__54 (Z.sub 64 1) 0)
        else if eq_vec b__0 (Ox"C01"  : mword 12) then
          ((read_reg mtime_ref)  : M (mword 64)) >>= fun w__55 : mword 64 =>
          returnm (subrange_vec_dec w__55 (Z.sub 64 1) 0)
        else if eq_vec b__0 (Ox"C02"  : mword 12) then
          ((read_reg minstret_ref)  : M (mword 64)) >>= fun w__56 : mword 64 =>
          returnm (subrange_vec_dec w__56 (Z.sub 64 1) 0)
        else
          (ext_read_CSR csr) >>= fun w__57 : option (mword 64) =>
          returnm (match w__57 with
                   | Some res => res
                   | None =>
                      let '_ := (print_bits "unhandled read to CSR " csr)  : unit in
                      EXTZ 64 (Ox"0"  : mword 4)
                   end))
        : M (mword 64)
    end) >>= fun res : xlenbits =>
   let '_ :=
     (if get_config_print_reg tt then
        print_endline
          (String.append "CSR "
             (String.append (csr_name csr) (String.append " -> " (string_of_bits res))))
      else tt)
      : unit in
   returnm res.

Definition writeCSR (csr : mword 12) (value : mword 64) : M (unit) :=
   (match (csr, 64) with
    | (b__0, g__335) =>
       (if eq_vec b__0 (Ox"300"  : mword 12) then
          read_reg mstatus_ref >>= fun w__0 : Mstatus =>
          (legalize_mstatus w__0 value) >>= fun w__1 : Mstatus =>
          write_reg mstatus_ref w__1 >>
          read_reg mstatus_ref >>= fun w__2 : Mstatus => returnm (Some (_get_Mstatus_bits w__2))
        else if eq_vec b__0 (Ox"301"  : mword 12) then
          read_reg misa_ref >>= fun w__3 : Misa =>
          (legalize_misa w__3 value) >>= fun w__4 : Misa =>
          write_reg misa_ref w__4 >>
          read_reg misa_ref >>= fun w__5 : Misa => returnm (Some (_get_Misa_bits w__5))
        else if eq_vec b__0 (Ox"302"  : mword 12) then
          read_reg medeleg_ref >>= fun w__6 : Medeleg =>
          write_reg medeleg_ref (legalize_medeleg w__6 value) >>
          read_reg medeleg_ref >>= fun w__7 : Medeleg => returnm (Some (_get_Medeleg_bits w__7))
        else if eq_vec b__0 (Ox"303"  : mword 12) then
          read_reg mideleg_ref >>= fun w__8 : Minterrupts =>
          write_reg mideleg_ref (legalize_mideleg w__8 value) >>
          read_reg mideleg_ref >>= fun w__9 : Minterrupts =>
          returnm (Some (_get_Minterrupts_bits w__9))
        else if eq_vec b__0 (Ox"304"  : mword 12) then
          read_reg mie_ref >>= fun w__10 : Minterrupts =>
          (legalize_mie w__10 value) >>= fun w__11 : Minterrupts =>
          write_reg mie_ref w__11 >>
          read_reg mie_ref >>= fun w__12 : Minterrupts =>
          returnm (Some (_get_Minterrupts_bits w__12))
        else if eq_vec b__0 (Ox"305"  : mword 12) then
          (set_mtvec value) >>= fun w__13 : mword 64 => returnm (Some w__13)
        else if eq_vec b__0 (Ox"306"  : mword 12) then
          read_reg mcounteren_ref >>= fun w__14 : Counteren =>
          write_reg mcounteren_ref (legalize_mcounteren w__14 value) >>
          read_reg mcounteren_ref >>= fun w__15 : Counteren =>
          returnm (Some (EXTZ 64 (_get_Counteren_bits w__15)))
        else if eq_vec b__0 (Ox"320"  : mword 12) then
          read_reg mcountinhibit_ref >>= fun w__16 : Counterin =>
          write_reg mcountinhibit_ref (legalize_mcountinhibit w__16 value) >>
          read_reg mcountinhibit_ref >>= fun w__17 : Counterin =>
          returnm (Some (EXTZ 64 (_get_Counterin_bits w__17)))
        else if eq_vec b__0 (Ox"340"  : mword 12) then
          write_reg mscratch_ref value >>
          ((read_reg mscratch_ref)  : M (mword 64)) >>= fun w__18 : mword 64 => returnm (Some w__18)
        else if eq_vec b__0 (Ox"341"  : mword 12) then
          (set_xret_target Machine value) >>= fun w__19 : mword 64 => returnm (Some w__19)
        else if eq_vec b__0 (Ox"342"  : mword 12) then
          (_set_Mcause_bits mcause_ref value) >>
          read_reg mcause_ref >>= fun w__20 : Mcause => returnm (Some (_get_Mcause_bits w__20))
        else if eq_vec b__0 (Ox"343"  : mword 12) then
          write_reg mtval_ref value >>
          ((read_reg mtval_ref)  : M (mword 64)) >>= fun w__21 : mword 64 => returnm (Some w__21)
        else if eq_vec b__0 (Ox"344"  : mword 12) then
          read_reg mip_ref >>= fun w__22 : Minterrupts =>
          (legalize_mip w__22 value) >>= fun w__23 : Minterrupts =>
          write_reg mip_ref w__23 >>
          read_reg mip_ref >>= fun w__24 : Minterrupts =>
          returnm (Some (_get_Minterrupts_bits w__24))
        else if eq_vec b__0 (Ox"3A0"  : mword 12) then
          (pmpWriteCfgReg 0 value) >>
          (pmpReadCfgReg 0) >>= fun w__25 : mword 64 => returnm (Some w__25)
        else if eq_vec b__0 (Ox"3A2"  : mword 12) then
          (pmpWriteCfgReg 2 value) >>
          (pmpReadCfgReg 2) >>= fun w__26 : mword 64 => returnm (Some w__26)
        else if eq_vec b__0 (Ox"3B0"  : mword 12) then
          read_reg pmp0cfg_ref >>= fun w__27 : Pmpcfg_ent =>
          read_reg pmp1cfg_ref >>= fun w__28 : Pmpcfg_ent =>
          (pmpTORLocked w__28) >>= fun w__29 : bool =>
          ((read_reg pmpaddr0_ref)  : M (mword 64)) >>= fun w__30 : mword 64 =>
          write_reg pmpaddr0_ref (pmpWriteAddr (pmpLocked w__27) w__29 w__30 value) >>
          ((read_reg pmpaddr0_ref)  : M (mword 64)) >>= fun w__31 : mword 64 => returnm (Some w__31)
        else if eq_vec b__0 (Ox"3B1"  : mword 12) then
          read_reg pmp1cfg_ref >>= fun w__32 : Pmpcfg_ent =>
          read_reg pmp2cfg_ref >>= fun w__33 : Pmpcfg_ent =>
          (pmpTORLocked w__33) >>= fun w__34 : bool =>
          ((read_reg pmpaddr1_ref)  : M (mword 64)) >>= fun w__35 : mword 64 =>
          write_reg pmpaddr1_ref (pmpWriteAddr (pmpLocked w__32) w__34 w__35 value) >>
          ((read_reg pmpaddr1_ref)  : M (mword 64)) >>= fun w__36 : mword 64 => returnm (Some w__36)
        else if eq_vec b__0 (Ox"3B2"  : mword 12) then
          read_reg pmp2cfg_ref >>= fun w__37 : Pmpcfg_ent =>
          read_reg pmp3cfg_ref >>= fun w__38 : Pmpcfg_ent =>
          (pmpTORLocked w__38) >>= fun w__39 : bool =>
          ((read_reg pmpaddr2_ref)  : M (mword 64)) >>= fun w__40 : mword 64 =>
          write_reg pmpaddr2_ref (pmpWriteAddr (pmpLocked w__37) w__39 w__40 value) >>
          ((read_reg pmpaddr2_ref)  : M (mword 64)) >>= fun w__41 : mword 64 => returnm (Some w__41)
        else if eq_vec b__0 (Ox"3B3"  : mword 12) then
          read_reg pmp3cfg_ref >>= fun w__42 : Pmpcfg_ent =>
          read_reg pmp4cfg_ref >>= fun w__43 : Pmpcfg_ent =>
          (pmpTORLocked w__43) >>= fun w__44 : bool =>
          ((read_reg pmpaddr3_ref)  : M (mword 64)) >>= fun w__45 : mword 64 =>
          write_reg pmpaddr3_ref (pmpWriteAddr (pmpLocked w__42) w__44 w__45 value) >>
          ((read_reg pmpaddr3_ref)  : M (mword 64)) >>= fun w__46 : mword 64 => returnm (Some w__46)
        else if eq_vec b__0 (Ox"3B4"  : mword 12) then
          read_reg pmp4cfg_ref >>= fun w__47 : Pmpcfg_ent =>
          read_reg pmp5cfg_ref >>= fun w__48 : Pmpcfg_ent =>
          (pmpTORLocked w__48) >>= fun w__49 : bool =>
          ((read_reg pmpaddr4_ref)  : M (mword 64)) >>= fun w__50 : mword 64 =>
          write_reg pmpaddr4_ref (pmpWriteAddr (pmpLocked w__47) w__49 w__50 value) >>
          ((read_reg pmpaddr4_ref)  : M (mword 64)) >>= fun w__51 : mword 64 => returnm (Some w__51)
        else if eq_vec b__0 (Ox"3B5"  : mword 12) then
          read_reg pmp5cfg_ref >>= fun w__52 : Pmpcfg_ent =>
          read_reg pmp6cfg_ref >>= fun w__53 : Pmpcfg_ent =>
          (pmpTORLocked w__53) >>= fun w__54 : bool =>
          ((read_reg pmpaddr5_ref)  : M (mword 64)) >>= fun w__55 : mword 64 =>
          write_reg pmpaddr5_ref (pmpWriteAddr (pmpLocked w__52) w__54 w__55 value) >>
          ((read_reg pmpaddr5_ref)  : M (mword 64)) >>= fun w__56 : mword 64 => returnm (Some w__56)
        else if eq_vec b__0 (Ox"3B6"  : mword 12) then
          read_reg pmp6cfg_ref >>= fun w__57 : Pmpcfg_ent =>
          read_reg pmp7cfg_ref >>= fun w__58 : Pmpcfg_ent =>
          (pmpTORLocked w__58) >>= fun w__59 : bool =>
          ((read_reg pmpaddr6_ref)  : M (mword 64)) >>= fun w__60 : mword 64 =>
          write_reg pmpaddr6_ref (pmpWriteAddr (pmpLocked w__57) w__59 w__60 value) >>
          ((read_reg pmpaddr6_ref)  : M (mword 64)) >>= fun w__61 : mword 64 => returnm (Some w__61)
        else if eq_vec b__0 (Ox"3B7"  : mword 12) then
          read_reg pmp7cfg_ref >>= fun w__62 : Pmpcfg_ent =>
          read_reg pmp8cfg_ref >>= fun w__63 : Pmpcfg_ent =>
          (pmpTORLocked w__63) >>= fun w__64 : bool =>
          ((read_reg pmpaddr7_ref)  : M (mword 64)) >>= fun w__65 : mword 64 =>
          write_reg pmpaddr7_ref (pmpWriteAddr (pmpLocked w__62) w__64 w__65 value) >>
          ((read_reg pmpaddr7_ref)  : M (mword 64)) >>= fun w__66 : mword 64 => returnm (Some w__66)
        else if eq_vec b__0 (Ox"3B8"  : mword 12) then
          read_reg pmp8cfg_ref >>= fun w__67 : Pmpcfg_ent =>
          read_reg pmp9cfg_ref >>= fun w__68 : Pmpcfg_ent =>
          (pmpTORLocked w__68) >>= fun w__69 : bool =>
          ((read_reg pmpaddr8_ref)  : M (mword 64)) >>= fun w__70 : mword 64 =>
          write_reg pmpaddr8_ref (pmpWriteAddr (pmpLocked w__67) w__69 w__70 value) >>
          ((read_reg pmpaddr8_ref)  : M (mword 64)) >>= fun w__71 : mword 64 => returnm (Some w__71)
        else if eq_vec b__0 (Ox"3B9"  : mword 12) then
          read_reg pmp9cfg_ref >>= fun w__72 : Pmpcfg_ent =>
          read_reg pmp10cfg_ref >>= fun w__73 : Pmpcfg_ent =>
          (pmpTORLocked w__73) >>= fun w__74 : bool =>
          ((read_reg pmpaddr9_ref)  : M (mword 64)) >>= fun w__75 : mword 64 =>
          write_reg pmpaddr9_ref (pmpWriteAddr (pmpLocked w__72) w__74 w__75 value) >>
          ((read_reg pmpaddr9_ref)  : M (mword 64)) >>= fun w__76 : mword 64 => returnm (Some w__76)
        else if eq_vec b__0 (Ox"3BA"  : mword 12) then
          read_reg pmp10cfg_ref >>= fun w__77 : Pmpcfg_ent =>
          read_reg pmp11cfg_ref >>= fun w__78 : Pmpcfg_ent =>
          (pmpTORLocked w__78) >>= fun w__79 : bool =>
          ((read_reg pmpaddr10_ref)  : M (mword 64)) >>= fun w__80 : mword 64 =>
          write_reg pmpaddr10_ref (pmpWriteAddr (pmpLocked w__77) w__79 w__80 value) >>
          ((read_reg pmpaddr10_ref)  : M (mword 64)) >>= fun w__81 : mword 64 =>
          returnm (Some w__81)
        else if eq_vec b__0 (Ox"3BB"  : mword 12) then
          read_reg pmp11cfg_ref >>= fun w__82 : Pmpcfg_ent =>
          read_reg pmp12cfg_ref >>= fun w__83 : Pmpcfg_ent =>
          (pmpTORLocked w__83) >>= fun w__84 : bool =>
          ((read_reg pmpaddr11_ref)  : M (mword 64)) >>= fun w__85 : mword 64 =>
          write_reg pmpaddr11_ref (pmpWriteAddr (pmpLocked w__82) w__84 w__85 value) >>
          ((read_reg pmpaddr11_ref)  : M (mword 64)) >>= fun w__86 : mword 64 =>
          returnm (Some w__86)
        else if eq_vec b__0 (Ox"3BC"  : mword 12) then
          read_reg pmp12cfg_ref >>= fun w__87 : Pmpcfg_ent =>
          read_reg pmp13cfg_ref >>= fun w__88 : Pmpcfg_ent =>
          (pmpTORLocked w__88) >>= fun w__89 : bool =>
          ((read_reg pmpaddr12_ref)  : M (mword 64)) >>= fun w__90 : mword 64 =>
          write_reg pmpaddr12_ref (pmpWriteAddr (pmpLocked w__87) w__89 w__90 value) >>
          ((read_reg pmpaddr12_ref)  : M (mword 64)) >>= fun w__91 : mword 64 =>
          returnm (Some w__91)
        else if eq_vec b__0 (Ox"3BD"  : mword 12) then
          read_reg pmp13cfg_ref >>= fun w__92 : Pmpcfg_ent =>
          read_reg pmp14cfg_ref >>= fun w__93 : Pmpcfg_ent =>
          (pmpTORLocked w__93) >>= fun w__94 : bool =>
          ((read_reg pmpaddr13_ref)  : M (mword 64)) >>= fun w__95 : mword 64 =>
          write_reg pmpaddr13_ref (pmpWriteAddr (pmpLocked w__92) w__94 w__95 value) >>
          ((read_reg pmpaddr13_ref)  : M (mword 64)) >>= fun w__96 : mword 64 =>
          returnm (Some w__96)
        else if eq_vec b__0 (Ox"3BE"  : mword 12) then
          read_reg pmp14cfg_ref >>= fun w__97 : Pmpcfg_ent =>
          read_reg pmp15cfg_ref >>= fun w__98 : Pmpcfg_ent =>
          (pmpTORLocked w__98) >>= fun w__99 : bool =>
          ((read_reg pmpaddr14_ref)  : M (mword 64)) >>= fun w__100 : mword 64 =>
          write_reg pmpaddr14_ref (pmpWriteAddr (pmpLocked w__97) w__99 w__100 value) >>
          ((read_reg pmpaddr14_ref)  : M (mword 64)) >>= fun w__101 : mword 64 =>
          returnm (Some w__101)
        else if eq_vec b__0 (Ox"3BF"  : mword 12) then
          read_reg pmp15cfg_ref >>= fun w__102 : Pmpcfg_ent =>
          ((read_reg pmpaddr15_ref)  : M (mword 64)) >>= fun w__103 : mword 64 =>
          write_reg pmpaddr15_ref (pmpWriteAddr (pmpLocked w__102) false w__103 value) >>
          ((read_reg pmpaddr15_ref)  : M (mword 64)) >>= fun w__104 : mword 64 =>
          returnm (Some w__104)
        else if eq_vec b__0 (Ox"B00"  : mword 12) then
          ((read_reg mcycle_ref)  : M (mword 64)) >>= fun w__105 : mword 64 =>
          write_reg mcycle_ref (update_subrange_vec_dec w__105 (Z.sub 64 1) 0 value) >>
          returnm (Some value)
        else if eq_vec b__0 (Ox"B02"  : mword 12) then
          ((read_reg minstret_ref)  : M (mword 64)) >>= fun w__106 : mword 64 =>
          write_reg minstret_ref (update_subrange_vec_dec w__106 (Z.sub 64 1) 0 value) >>
          write_reg minstret_written_ref true >> returnm (Some value)
        else if eq_vec b__0 (Ox"7A0"  : mword 12) then
          write_reg tselect_ref value >>
          ((read_reg tselect_ref)  : M (mword 64)) >>= fun w__107 : mword 64 =>
          returnm (Some w__107)
        else if eq_vec b__0 (Ox"100"  : mword 12) then
          read_reg mstatus_ref >>= fun w__108 : Mstatus =>
          (legalize_sstatus w__108 value) >>= fun w__109 : Mstatus =>
          write_reg mstatus_ref w__109 >>
          read_reg mstatus_ref >>= fun w__110 : Mstatus => returnm (Some (_get_Mstatus_bits w__110))
        else if eq_vec b__0 (Ox"102"  : mword 12) then
          read_reg sedeleg_ref >>= fun w__111 : Sedeleg =>
          write_reg sedeleg_ref (legalize_sedeleg w__111 value) >>
          read_reg sedeleg_ref >>= fun w__112 : Sedeleg => returnm (Some (_get_Sedeleg_bits w__112))
        else if eq_vec b__0 (Ox"103"  : mword 12) then
          (_set_Sinterrupts_bits sideleg_ref value) >>
          read_reg sideleg_ref >>= fun w__113 : Sinterrupts =>
          returnm (Some (_get_Sinterrupts_bits w__113))
        else if eq_vec b__0 (Ox"104"  : mword 12) then
          read_reg mie_ref >>= fun w__114 : Minterrupts =>
          read_reg mideleg_ref >>= fun w__115 : Minterrupts =>
          (legalize_sie w__114 w__115 value) >>= fun w__116 : Minterrupts =>
          write_reg mie_ref w__116 >>
          read_reg mie_ref >>= fun w__117 : Minterrupts =>
          returnm (Some (_get_Minterrupts_bits w__117))
        else if eq_vec b__0 (Ox"105"  : mword 12) then
          (set_stvec value) >>= fun w__118 : mword 64 => returnm (Some w__118)
        else if eq_vec b__0 (Ox"106"  : mword 12) then
          read_reg scounteren_ref >>= fun w__119 : Counteren =>
          write_reg scounteren_ref (legalize_scounteren w__119 value) >>
          read_reg scounteren_ref >>= fun w__120 : Counteren =>
          returnm (Some (EXTZ 64 (_get_Counteren_bits w__120)))
        else if eq_vec b__0 (Ox"140"  : mword 12) then
          write_reg sscratch_ref value >>
          ((read_reg sscratch_ref)  : M (mword 64)) >>= fun w__121 : mword 64 =>
          returnm (Some w__121)
        else if eq_vec b__0 (Ox"141"  : mword 12) then
          (set_xret_target Supervisor value) >>= fun w__122 : mword 64 => returnm (Some w__122)
        else if eq_vec b__0 (Ox"142"  : mword 12) then
          (_set_Mcause_bits scause_ref value) >>
          read_reg scause_ref >>= fun w__123 : Mcause => returnm (Some (_get_Mcause_bits w__123))
        else if eq_vec b__0 (Ox"143"  : mword 12) then
          write_reg stval_ref value >>
          ((read_reg stval_ref)  : M (mword 64)) >>= fun w__124 : mword 64 => returnm (Some w__124)
        else if eq_vec b__0 (Ox"144"  : mword 12) then
          read_reg mip_ref >>= fun w__125 : Minterrupts =>
          read_reg mideleg_ref >>= fun w__126 : Minterrupts =>
          (legalize_sip w__125 w__126 value) >>= fun w__127 : Minterrupts =>
          write_reg mip_ref w__127 >>
          read_reg mip_ref >>= fun w__128 : Minterrupts =>
          returnm (Some (_get_Minterrupts_bits w__128))
        else if eq_vec b__0 (Ox"180"  : mword 12) then
          (cur_Architecture tt) >>= fun w__129 : Architecture =>
          ((read_reg satp_ref)  : M (mword 64)) >>= fun w__130 : mword 64 =>
          write_reg satp_ref (legalize_satp w__129 w__130 value) >>
          ((read_reg satp_ref)  : M (mword 64)) >>= fun w__131 : mword 64 => returnm (Some w__131)
        else (ext_write_CSR csr value)  : M (option (mword 64)))
        : M (option (mword 64))
    end) >>= fun res : option xlenbits =>
   returnm (match res with
            | Some v =>
               if get_config_print_reg tt then
                 print_endline
                   (String.append "CSR "
                      (String.append (csr_name csr)
                         (String.append " <- "
                            (String.append (string_of_bits v)
                               (String.append " (input: " (String.append (string_of_bits value) ")"))))))
               else tt
            | None => print_bits "unhandled write to CSR " csr
            end).

Definition maybe_i_forwards (arg_ : bool) : string :=
   match arg_ with | true => "i" | false => "" end.

Definition maybe_i_backwards (arg_ : string) : M (bool) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "i" then returnm true
    else if generic_eq p0_ "" then returnm false
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (bool).

Definition maybe_i_forwards_matches (arg_ : bool) : bool :=
   match arg_ with | true => true | false => true end.

Definition maybe_i_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "i" then true
   else if generic_eq p0_ "" then true
   else false.

Definition _s1062_ (_s1063_ : string) : option string :=
   let _s1064_ := _s1063_ in
   if string_startswith _s1064_ "" then
     match (string_drop _s1064_ (projT1 (string_length ""))) with | s_ => Some s_ end
   else None.

Definition _s1058_ (_s1059_ : string) : option string :=
   let _s1060_ := _s1059_ in
   if string_startswith _s1060_ "i" then
     match (string_drop _s1060_ (projT1 (string_length "i"))) with | s_ => Some s_ end
   else None.

Definition maybe_i_matches_prefix (arg_ : string)
: M (option ((bool * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s1061_ := arg_ in
   (if match (_s1058_ _s1061_) with | Some s_ => true | _ => false end then
      (match (_s1058_ _s1061_) with
       | Some s_ =>
          returnm (Some
                     (true, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((bool * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((bool * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1062_ _s1061_) with | Some s_ => true | _ => false end then
      (match (_s1062_ _s1061_) with
       | Some s_ =>
          returnm (Some
                     (false, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((bool * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((bool * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((bool * {n : Z & ArithFact (n >=? 0)}))).

Definition csr_mnemonic_forwards (arg_ : csrop) : string :=
   match arg_ with | CSRRW => "csrrw" | CSRRS => "csrrs" | CSRRC => "csrrc" end.

Definition csr_mnemonic_backwards (arg_ : string) : M (csrop) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "csrrw" then returnm CSRRW
    else if generic_eq p0_ "csrrs" then returnm CSRRS
    else if generic_eq p0_ "csrrc" then returnm CSRRC
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (csrop).

Definition csr_mnemonic_forwards_matches (arg_ : csrop) : bool :=
   match arg_ with | CSRRW => true | CSRRS => true | CSRRC => true end.

Definition csr_mnemonic_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "csrrw" then true
   else if generic_eq p0_ "csrrs" then true
   else if generic_eq p0_ "csrrc" then true
   else false.

Definition _s1074_ (_s1075_ : string) : option string :=
   let _s1076_ := _s1075_ in
   if string_startswith _s1076_ "csrrc" then
     match (string_drop _s1076_ (projT1 (string_length "csrrc"))) with | s_ => Some s_ end
   else None.

Definition _s1070_ (_s1071_ : string) : option string :=
   let _s1072_ := _s1071_ in
   if string_startswith _s1072_ "csrrs" then
     match (string_drop _s1072_ (projT1 (string_length "csrrs"))) with | s_ => Some s_ end
   else None.

Definition _s1066_ (_s1067_ : string) : option string :=
   let _s1068_ := _s1067_ in
   if string_startswith _s1068_ "csrrw" then
     match (string_drop _s1068_ (projT1 (string_length "csrrw"))) with | s_ => Some s_ end
   else None.

Definition csr_mnemonic_matches_prefix (arg_ : string)
: M (option ((csrop * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s1069_ := arg_ in
   (if match (_s1066_ _s1069_) with | Some s_ => true | _ => false end then
      (match (_s1066_ _s1069_) with
       | Some s_ =>
          returnm (Some
                     (CSRRW, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((csrop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((csrop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1070_ _s1069_) with | Some s_ => true | _ => false end then
      (match (_s1070_ _s1069_) with
       | Some s_ =>
          returnm (Some
                     (CSRRS, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((csrop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((csrop * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1074_ _s1069_) with | Some s_ => true | _ => false end then
      (match (_s1074_ _s1069_) with
       | Some s_ =>
          returnm (Some
                     (CSRRC, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((csrop * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((csrop * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((csrop * {n : Z & ArithFact (n >=? 0)}))).

Definition encdec_rounding_mode_forwards (arg_ : rounding_mode) : mword 3 :=
   match arg_ with
   | RM_RNE => 'b"000"  : mword 3
   | RM_RTZ => 'b"001"  : mword 3
   | RM_RDN => 'b"010"  : mword 3
   | RM_RUP => 'b"011"  : mword 3
   | RM_RMM => 'b"100"  : mword 3
   | RM_DYN => 'b"111"  : mword 3
   end.

Definition encdec_rounding_mode_backwards (arg_ : mword 3) : M (rounding_mode) :=
   let b__0 := arg_ in
   (if eq_vec b__0 ('b"000"  : mword 3) then returnm RM_RNE
    else if eq_vec b__0 ('b"001"  : mword 3) then returnm RM_RTZ
    else if eq_vec b__0 ('b"010"  : mword 3) then returnm RM_RDN
    else if eq_vec b__0 ('b"011"  : mword 3) then returnm RM_RUP
    else if eq_vec b__0 ('b"100"  : mword 3) then returnm RM_RMM
    else if eq_vec b__0 ('b"111"  : mword 3) then returnm RM_DYN
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (rounding_mode).

Definition encdec_rounding_mode_forwards_matches (arg_ : rounding_mode) : bool :=
   match arg_ with
   | RM_RNE => true
   | RM_RTZ => true
   | RM_RDN => true
   | RM_RUP => true
   | RM_RMM => true
   | RM_DYN => true
   end.

Definition encdec_rounding_mode_backwards_matches (arg_ : mword 3) : bool :=
   let b__0 := arg_ in
   if eq_vec b__0 ('b"000"  : mword 3) then true
   else if eq_vec b__0 ('b"001"  : mword 3) then true
   else if eq_vec b__0 ('b"010"  : mword 3) then true
   else if eq_vec b__0 ('b"011"  : mword 3) then true
   else if eq_vec b__0 ('b"100"  : mword 3) then true
   else if eq_vec b__0 ('b"111"  : mword 3) then true
   else false.

Definition frm_mnemonic_forwards (arg_ : rounding_mode) : string :=
   match arg_ with
   | RM_RNE => "rne"
   | RM_RTZ => "rtz"
   | RM_RDN => "rdn"
   | RM_RUP => "rup"
   | RM_RMM => "rmm"
   | RM_DYN => "dyn"
   end.

Definition frm_mnemonic_backwards (arg_ : string) : M (rounding_mode) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "rne" then returnm RM_RNE
    else if generic_eq p0_ "rtz" then returnm RM_RTZ
    else if generic_eq p0_ "rdn" then returnm RM_RDN
    else if generic_eq p0_ "rup" then returnm RM_RUP
    else if generic_eq p0_ "rmm" then returnm RM_RMM
    else if generic_eq p0_ "dyn" then returnm RM_DYN
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (rounding_mode).

Definition frm_mnemonic_forwards_matches (arg_ : rounding_mode) : bool :=
   match arg_ with
   | RM_RNE => true
   | RM_RTZ => true
   | RM_RDN => true
   | RM_RUP => true
   | RM_RMM => true
   | RM_DYN => true
   end.

Definition frm_mnemonic_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "rne" then true
   else if generic_eq p0_ "rtz" then true
   else if generic_eq p0_ "rdn" then true
   else if generic_eq p0_ "rup" then true
   else if generic_eq p0_ "rmm" then true
   else if generic_eq p0_ "dyn" then true
   else false.

Definition _s1098_ (_s1099_ : string) : option string :=
   let _s1100_ := _s1099_ in
   if string_startswith _s1100_ "dyn" then
     match (string_drop _s1100_ (projT1 (string_length "dyn"))) with | s_ => Some s_ end
   else None.

Definition _s1094_ (_s1095_ : string) : option string :=
   let _s1096_ := _s1095_ in
   if string_startswith _s1096_ "rmm" then
     match (string_drop _s1096_ (projT1 (string_length "rmm"))) with | s_ => Some s_ end
   else None.

Definition _s1090_ (_s1091_ : string) : option string :=
   let _s1092_ := _s1091_ in
   if string_startswith _s1092_ "rup" then
     match (string_drop _s1092_ (projT1 (string_length "rup"))) with | s_ => Some s_ end
   else None.

Definition _s1086_ (_s1087_ : string) : option string :=
   let _s1088_ := _s1087_ in
   if string_startswith _s1088_ "rdn" then
     match (string_drop _s1088_ (projT1 (string_length "rdn"))) with | s_ => Some s_ end
   else None.

Definition _s1082_ (_s1083_ : string) : option string :=
   let _s1084_ := _s1083_ in
   if string_startswith _s1084_ "rtz" then
     match (string_drop _s1084_ (projT1 (string_length "rtz"))) with | s_ => Some s_ end
   else None.

Definition _s1078_ (_s1079_ : string) : option string :=
   let _s1080_ := _s1079_ in
   if string_startswith _s1080_ "rne" then
     match (string_drop _s1080_ (projT1 (string_length "rne"))) with | s_ => Some s_ end
   else None.

Definition frm_mnemonic_matches_prefix (arg_ : string)
: M (option ((rounding_mode * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s1081_ := arg_ in
   (if match (_s1078_ _s1081_) with | Some s_ => true | _ => false end then
      (match (_s1078_ _s1081_) with
       | Some s_ =>
          returnm (Some
                     (RM_RNE, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((rounding_mode * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((rounding_mode * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1082_ _s1081_) with | Some s_ => true | _ => false end then
      (match (_s1082_ _s1081_) with
       | Some s_ =>
          returnm (Some
                     (RM_RTZ, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((rounding_mode * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((rounding_mode * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1086_ _s1081_) with | Some s_ => true | _ => false end then
      (match (_s1086_ _s1081_) with
       | Some s_ =>
          returnm (Some
                     (RM_RDN, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((rounding_mode * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((rounding_mode * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1090_ _s1081_) with | Some s_ => true | _ => false end then
      (match (_s1090_ _s1081_) with
       | Some s_ =>
          returnm (Some
                     (RM_RUP, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((rounding_mode * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((rounding_mode * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1094_ _s1081_) with | Some s_ => true | _ => false end then
      (match (_s1094_ _s1081_) with
       | Some s_ =>
          returnm (Some
                     (RM_RMM, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((rounding_mode * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((rounding_mode * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1098_ _s1081_) with | Some s_ => true | _ => false end then
      (match (_s1098_ _s1081_) with
       | Some s_ =>
          returnm (Some
                     (RM_DYN, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((rounding_mode * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((rounding_mode * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((rounding_mode * {n : Z & ArithFact (n >=? 0)}))).

Definition select_instr_or_fcsr_rm (instr_rm : rounding_mode) : M (rounding_mode) :=
   (if generic_eq instr_rm RM_DYN then
      read_reg fcsr_ref >>= fun w__0 : Fcsr =>
      (encdec_rounding_mode_backwards (_get_Fcsr_FRM w__0))
       : M (rounding_mode)
    else returnm instr_rm)
    : M (rounding_mode).

Definition nxFlag '(tt : unit) : mword 5 := 'b"00001"  : mword 5.

Definition ufFlag '(tt : unit) : mword 5 := 'b"00010"  : mword 5.

Definition ofFlag '(tt : unit) : mword 5 := 'b"00100"  : mword 5.

Definition dzFlag '(tt : unit) : mword 5 := 'b"01000"  : mword 5.

Definition nvFlag '(tt : unit) : mword 5 := 'b"10000"  : mword 5.

Definition fsplit_S (x32 : mword 32) : (mword 1 * mword 8 * mword 23) :=
   (subrange_vec_dec x32 31 31, subrange_vec_dec x32 30 23, subrange_vec_dec x32 22 0).

Definition fmake_S (sign : mword 1) (exp : mword 8) (mant : mword 23) : mword 32 :=
   concat_vec sign (concat_vec exp mant).

Definition canonical_NaN_S '(tt : unit) : mword 32 := Ox"7FC00000"  : mword 32.

Definition f_is_neg_inf_S (x32 : mword 32) : bool :=
   let '(sign, exp, mant) := fsplit_S x32 in
   andb (eq_vec sign ('b"1"  : mword 1))
     (andb (eq_vec exp (ones 8)) (eq_vec mant (zeros_implicit 23))).

Definition f_is_neg_norm_S (x32 : mword 32) : bool :=
   let '(sign, exp, mant) := fsplit_S x32 in
   andb (eq_vec sign ('b"1"  : mword 1))
     (andb (neq_vec exp (zeros_implicit 8)) (neq_vec exp (ones 8))).

Definition f_is_neg_subnorm_S (x32 : mword 32) : bool :=
   let '(sign, exp, mant) := fsplit_S x32 in
   andb (eq_vec sign ('b"1"  : mword 1))
     (andb (eq_vec exp (zeros_implicit 8)) (neq_vec mant (zeros_implicit 23))).

Definition f_is_neg_zero_S (x32 : mword 32) : bool :=
   let '(sign, exp, mant) := fsplit_S x32 in
   andb (eq_vec sign (ones 1))
     (andb (eq_vec exp (zeros_implicit 8)) (eq_vec mant (zeros_implicit 23))).

Definition f_is_pos_zero_S (x32 : mword 32) : bool :=
   let '(sign, exp, mant) := fsplit_S x32 in
   andb (eq_vec sign (zeros_implicit 1))
     (andb (eq_vec exp (zeros_implicit 8)) (eq_vec mant (zeros_implicit 23))).

Definition f_is_pos_subnorm_S (x32 : mword 32) : bool :=
   let '(sign, exp, mant) := fsplit_S x32 in
   andb (eq_vec sign (zeros_implicit 1))
     (andb (eq_vec exp (zeros_implicit 8)) (neq_vec mant (zeros_implicit 23))).

Definition f_is_pos_norm_S (x32 : mword 32) : bool :=
   let '(sign, exp, mant) := fsplit_S x32 in
   andb (eq_vec sign (zeros_implicit 1))
     (andb (neq_vec exp (zeros_implicit 8)) (neq_vec exp (ones 8))).

Definition f_is_pos_inf_S (x32 : mword 32) : bool :=
   let '(sign, exp, mant) := fsplit_S x32 in
   andb (eq_vec sign (zeros_implicit 1))
     (andb (eq_vec exp (ones 8)) (eq_vec mant (zeros_implicit 23))).

Definition f_is_SNaN_S (x32 : mword 32) : bool :=
   let '(sign, exp, mant) := fsplit_S x32 in
   andb (eq_vec exp (ones 8))
     (andb (eq_bit (access_vec_dec mant 22) B0) (neq_vec mant (zeros_implicit 23))).

Definition f_is_QNaN_S (x32 : mword 32) : bool :=
   let '(sign, exp, mant) := fsplit_S x32 in
   andb (eq_vec exp (ones 8)) (eq_bit (access_vec_dec mant 22) B1).

Definition f_is_NaN_S (x32 : mword 32) : bool :=
   let '(sign, exp, mant) := fsplit_S x32 in
   andb (eq_vec exp (ones 8)) (neq_vec mant (zeros_implicit 23)).

Definition negate_S (x32 : mword 32) : mword 32 :=
   let '(sign, exp, mant) := fsplit_S x32 in
   let new_sign := if eq_vec sign ('b"0"  : mword 1) then 'b"1"  : mword 1 else 'b"0"  : mword 1 in
   fmake_S new_sign exp mant.

Definition feq_quiet_S (v1 : mword 32) (v2 : mword 32) : (bool * mword 5) :=
   let '(s1, e1, m1) := fsplit_S v1 in
   let '(s2, e2, m2) := fsplit_S v2 in
   let v1Is0 := orb (f_is_neg_zero_S v1) (f_is_pos_zero_S v1) in
   let v2Is0 := orb (f_is_neg_zero_S v2) (f_is_pos_zero_S v2) in
   let result := orb (eq_vec v1 v2) (andb v1Is0 v2Is0) in
   let fflags := if orb (f_is_SNaN_S v1) (f_is_SNaN_S v2) then nvFlag tt else zeros_implicit 5 in
   (result, fflags).

Definition flt_S (v1 : mword 32) (v2 : mword 32) (is_quiet : bool) : (bool * mword 5) :=
   let '(s1, e1, m1) := fsplit_S v1 in
   let '(s2, e2, m2) := fsplit_S v2 in
   let result : bool :=
     if andb (eq_vec s1 ('b"0"  : mword 1)) (eq_vec s2 ('b"0"  : mword 1)) then
       if eq_vec e1 e2 then Z.ltb (projT1 (uint m1)) (projT1 (uint m2))
       else Z.ltb (projT1 (uint e1)) (projT1 (uint e2))
     else if andb (eq_vec s1 ('b"0"  : mword 1)) (eq_vec s2 ('b"1"  : mword 1)) then false
     else if andb (eq_vec s1 ('b"1"  : mword 1)) (eq_vec s2 ('b"0"  : mword 1)) then true
     else if eq_vec e1 e2 then Z.gtb (projT1 (uint m1)) (projT1 (uint m2))
     else Z.gtb (projT1 (uint e1)) (projT1 (uint e2)) in
   let fflags :=
     if sumbool_of_bool is_quiet then
       if orb (f_is_SNaN_S v1) (f_is_SNaN_S v2) then nvFlag tt
       else zeros_implicit 5
     else if orb (f_is_NaN_S v1) (f_is_NaN_S v2) then nvFlag tt
     else zeros_implicit 5 in
   (result, fflags).

Definition fle_S (v1 : mword 32) (v2 : mword 32) (is_quiet : bool) : (bool * mword 5) :=
   let '(s1, e1, m1) := fsplit_S v1 in
   let '(s2, e2, m2) := fsplit_S v2 in
   let v1Is0 := orb (f_is_neg_zero_S v1) (f_is_pos_zero_S v1) in
   let v2Is0 := orb (f_is_neg_zero_S v2) (f_is_pos_zero_S v2) in
   let result : bool :=
     if andb (eq_vec s1 ('b"0"  : mword 1)) (eq_vec s2 ('b"0"  : mword 1)) then
       if eq_vec e1 e2 then Z.leb (projT1 (uint m1)) (projT1 (uint m2))
       else Z.ltb (projT1 (uint e1)) (projT1 (uint e2))
     else if andb (eq_vec s1 ('b"0"  : mword 1)) (eq_vec s2 ('b"1"  : mword 1)) then
       andb v1Is0 v2Is0
     else if andb (eq_vec s1 ('b"1"  : mword 1)) (eq_vec s2 ('b"0"  : mword 1)) then true
     else if eq_vec e1 e2 then Z.geb (projT1 (uint m1)) (projT1 (uint m2))
     else Z.gtb (projT1 (uint e1)) (projT1 (uint e2)) in
   let fflags :=
     if sumbool_of_bool is_quiet then
       if orb (f_is_SNaN_S v1) (f_is_SNaN_S v2) then nvFlag tt
       else zeros_implicit 5
     else if orb (f_is_NaN_S v1) (f_is_NaN_S v2) then nvFlag tt
     else zeros_implicit 5 in
   (result, fflags).

Definition nan_box (val_32b : mword 32) : mword 64 := concat_vec (Ox"FFFFFFFF"  : mword 32) val_32b.

Definition nan_unbox (regval : mword 64) : mword 32 :=
   if eq_vec (subrange_vec_dec regval 63 32) (Ox"FFFFFFFF"  : mword (63 - 32 + 1)) then
     subrange_vec_dec regval 31 0
   else canonical_NaN_S tt.

Definition is_RV32F_or_RV64F '(tt : unit) : M (bool) :=
   projT1_m
   ((and_boolMP (build_trivial_ex ((haveFExt tt)  : M (bool)))
       ((returnm (build_ex
         (projT1
         (build_ex
         (orb (Z.eqb 64 32) (Z.eqb 64 64))
          : {_bool : bool & ArithFact (Bool.eqb ((64 =? 32) || (64 =? 64)) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb ((64 =?
         32) ||
         (64 =? 64)) _bool)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
     ((64 =? 32) || (64 =? 64))) _bool = true)}))
    : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 && ((64 =? 32) || (64 =? 64))) _bool = true)})).

Definition is_RV64F '(tt : unit) : M (bool) :=
   projT1_m
   ((and_boolMP (build_trivial_ex ((haveFExt tt)  : M (bool)))
       ((returnm (build_ex
         (projT1
         (build_ex
         (Z.eqb 64 64)
          : {_bool : bool & ArithFact (Bool.eqb (64 =? 64) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
         64) _bool)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
     (64 =? 64)) _bool = true)}))
    : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 && (64 =? 64)) _bool = true)})).

Definition is_RV32D_or_RV64D '(tt : unit) : M (bool) :=
   projT1_m
   ((and_boolMP (build_trivial_ex ((haveDExt tt)  : M (bool)))
       ((returnm (build_ex
         (projT1
         (build_ex
         (orb (Z.eqb 64 32) (Z.eqb 64 64))
          : {_bool : bool & ArithFact (Bool.eqb ((64 =? 32) || (64 =? 64)) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb ((64 =?
         32) ||
         (64 =? 64)) _bool)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
     ((64 =? 32) || (64 =? 64))) _bool = true)}))
    : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 && ((64 =? 32) || (64 =? 64))) _bool = true)})).

Definition is_RV64D '(tt : unit) : M (bool) :=
   projT1_m
   ((and_boolMP (build_trivial_ex ((haveDExt tt)  : M (bool)))
       ((returnm (build_ex
         (projT1
         (build_ex
         (Z.eqb 64 64)
          : {_bool : bool & ArithFact (Bool.eqb (64 =? 64) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
         64) _bool)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
     (64 =? 64)) _bool = true)}))
    : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 && (64 =? 64)) _bool = true)})).

Definition process_fload64 (rd : mword 5) (addr : mword 64) (value : MemoryOpResult (mword 64))
: M (Retired) :=
   (match value with
    | MemValue result => (wF_bits rd result) >> returnm RETIRE_SUCCESS
    | MemException e => (handle_mem_exception addr e) >> returnm RETIRE_FAIL
    end)
    : M (Retired).

Definition process_fload32 (rd : mword 5) (addr : mword 64) (value : MemoryOpResult (mword 32))
: M (Retired) :=
   (match value with
    | MemValue result => (wF_bits rd (nan_box result)) >> returnm RETIRE_SUCCESS
    | MemException e => (handle_mem_exception addr e) >> returnm RETIRE_FAIL
    end)
    : M (Retired).

Definition process_fstore (vaddr : mword 64) (value : MemoryOpResult bool) : M (Retired) :=
   (match value with
    | MemValue true => returnm RETIRE_SUCCESS
    | MemValue false => (internal_error "store got false from mem_write_value")  : M (Retired)
    | MemException e => (handle_mem_exception vaddr e) >> returnm RETIRE_FAIL
    end)
    : M (Retired).

Definition f_madd_type_mnemonic_S_forwards (arg_ : f_madd_op_S) : string :=
   match arg_ with
   | FMADD_S => "fmadd.s"
   | FMSUB_S => "fmsub.s"
   | FNMSUB_S => "fnmsub.s"
   | FNMADD_S => "fnmadd.s"
   end.

Definition f_madd_type_mnemonic_S_backwards (arg_ : string) : M (f_madd_op_S) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "fmadd.s" then returnm FMADD_S
    else if generic_eq p0_ "fmsub.s" then returnm FMSUB_S
    else if generic_eq p0_ "fnmsub.s" then returnm FNMSUB_S
    else if generic_eq p0_ "fnmadd.s" then returnm FNMADD_S
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (f_madd_op_S).

Definition f_madd_type_mnemonic_S_forwards_matches (arg_ : f_madd_op_S) : bool :=
   match arg_ with | FMADD_S => true | FMSUB_S => true | FNMSUB_S => true | FNMADD_S => true end.

Definition f_madd_type_mnemonic_S_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "fmadd.s" then true
   else if generic_eq p0_ "fmsub.s" then true
   else if generic_eq p0_ "fnmsub.s" then true
   else if generic_eq p0_ "fnmadd.s" then true
   else false.

Definition _s1114_ (_s1115_ : string) : option string :=
   let _s1116_ := _s1115_ in
   if string_startswith _s1116_ "fnmadd.s" then
     match (string_drop _s1116_ (projT1 (string_length "fnmadd.s"))) with | s_ => Some s_ end
   else None.

Definition _s1110_ (_s1111_ : string) : option string :=
   let _s1112_ := _s1111_ in
   if string_startswith _s1112_ "fnmsub.s" then
     match (string_drop _s1112_ (projT1 (string_length "fnmsub.s"))) with | s_ => Some s_ end
   else None.

Definition _s1106_ (_s1107_ : string) : option string :=
   let _s1108_ := _s1107_ in
   if string_startswith _s1108_ "fmsub.s" then
     match (string_drop _s1108_ (projT1 (string_length "fmsub.s"))) with | s_ => Some s_ end
   else None.

Definition _s1102_ (_s1103_ : string) : option string :=
   let _s1104_ := _s1103_ in
   if string_startswith _s1104_ "fmadd.s" then
     match (string_drop _s1104_ (projT1 (string_length "fmadd.s"))) with | s_ => Some s_ end
   else None.

Definition f_madd_type_mnemonic_S_matches_prefix (arg_ : string)
: M (option ((f_madd_op_S * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s1105_ := arg_ in
   (if match (_s1102_ _s1105_) with | Some s_ => true | _ => false end then
      (match (_s1102_ _s1105_) with
       | Some s_ =>
          returnm (Some
                     (FMADD_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_madd_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_madd_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1106_ _s1105_) with | Some s_ => true | _ => false end then
      (match (_s1106_ _s1105_) with
       | Some s_ =>
          returnm (Some
                     (FMSUB_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_madd_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_madd_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1110_ _s1105_) with | Some s_ => true | _ => false end then
      (match (_s1110_ _s1105_) with
       | Some s_ =>
          returnm (Some
                     (FNMSUB_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_madd_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_madd_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1114_ _s1105_) with | Some s_ => true | _ => false end then
      (match (_s1114_ _s1105_) with
       | Some s_ =>
          returnm (Some
                     (FNMADD_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_madd_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_madd_op_S * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((f_madd_op_S * {n : Z & ArithFact (n >=? 0)}))).

Definition f_bin_rm_type_mnemonic_S_forwards (arg_ : f_bin_rm_op_S) : string :=
   match arg_ with
   | FADD_S => "fadd.s"
   | FSUB_S => "fsub.s"
   | FMUL_S => "fmul.s"
   | FDIV_S => "fdiv.s"
   end.

Definition f_bin_rm_type_mnemonic_S_backwards (arg_ : string) : M (f_bin_rm_op_S) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "fadd.s" then returnm FADD_S
    else if generic_eq p0_ "fsub.s" then returnm FSUB_S
    else if generic_eq p0_ "fmul.s" then returnm FMUL_S
    else if generic_eq p0_ "fdiv.s" then returnm FDIV_S
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (f_bin_rm_op_S).

Definition f_bin_rm_type_mnemonic_S_forwards_matches (arg_ : f_bin_rm_op_S) : bool :=
   match arg_ with | FADD_S => true | FSUB_S => true | FMUL_S => true | FDIV_S => true end.

Definition f_bin_rm_type_mnemonic_S_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "fadd.s" then true
   else if generic_eq p0_ "fsub.s" then true
   else if generic_eq p0_ "fmul.s" then true
   else if generic_eq p0_ "fdiv.s" then true
   else false.

Definition _s1130_ (_s1131_ : string) : option string :=
   let _s1132_ := _s1131_ in
   if string_startswith _s1132_ "fdiv.s" then
     match (string_drop _s1132_ (projT1 (string_length "fdiv.s"))) with | s_ => Some s_ end
   else None.

Definition _s1126_ (_s1127_ : string) : option string :=
   let _s1128_ := _s1127_ in
   if string_startswith _s1128_ "fmul.s" then
     match (string_drop _s1128_ (projT1 (string_length "fmul.s"))) with | s_ => Some s_ end
   else None.

Definition _s1122_ (_s1123_ : string) : option string :=
   let _s1124_ := _s1123_ in
   if string_startswith _s1124_ "fsub.s" then
     match (string_drop _s1124_ (projT1 (string_length "fsub.s"))) with | s_ => Some s_ end
   else None.

Definition _s1118_ (_s1119_ : string) : option string :=
   let _s1120_ := _s1119_ in
   if string_startswith _s1120_ "fadd.s" then
     match (string_drop _s1120_ (projT1 (string_length "fadd.s"))) with | s_ => Some s_ end
   else None.

Definition f_bin_rm_type_mnemonic_S_matches_prefix (arg_ : string)
: M (option ((f_bin_rm_op_S * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s1121_ := arg_ in
   (if match (_s1118_ _s1121_) with | Some s_ => true | _ => false end then
      (match (_s1118_ _s1121_) with
       | Some s_ =>
          returnm (Some
                     (FADD_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1122_ _s1121_) with | Some s_ => true | _ => false end then
      (match (_s1122_ _s1121_) with
       | Some s_ =>
          returnm (Some
                     (FSUB_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1126_ _s1121_) with | Some s_ => true | _ => false end then
      (match (_s1126_ _s1121_) with
       | Some s_ =>
          returnm (Some
                     (FMUL_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1130_ _s1121_) with | Some s_ => true | _ => false end then
      (match (_s1130_ _s1121_) with
       | Some s_ =>
          returnm (Some
                     (FDIV_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((f_bin_rm_op_S * {n : Z & ArithFact (n >=? 0)}))).

Definition f_un_rm_type_mnemonic_S_forwards (arg_ : f_un_rm_op_S) : string :=
   match arg_ with
   | FSQRT_S => "fsqrt.s"
   | FCVT_W_S => "fcvt.w.s"
   | FCVT_WU_S => "fcvt.wu.s"
   | FCVT_S_W => "fcvt.s.w"
   | FCVT_S_WU => "fcvt.s.wu"
   | FCVT_L_S => "fcvt.l.s"
   | FCVT_LU_S => "fcvt.lu.s"
   | FCVT_S_L => "fcvt.s.l"
   | FCVT_S_LU => "fcvt.s.lu"
   end.

Definition f_un_rm_type_mnemonic_S_backwards (arg_ : string) : M (f_un_rm_op_S) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "fsqrt.s" then returnm FSQRT_S
    else if generic_eq p0_ "fcvt.w.s" then returnm FCVT_W_S
    else if generic_eq p0_ "fcvt.wu.s" then returnm FCVT_WU_S
    else if generic_eq p0_ "fcvt.s.w" then returnm FCVT_S_W
    else if generic_eq p0_ "fcvt.s.wu" then returnm FCVT_S_WU
    else if generic_eq p0_ "fcvt.l.s" then returnm FCVT_L_S
    else if generic_eq p0_ "fcvt.lu.s" then returnm FCVT_LU_S
    else if generic_eq p0_ "fcvt.s.l" then returnm FCVT_S_L
    else if generic_eq p0_ "fcvt.s.lu" then returnm FCVT_S_LU
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (f_un_rm_op_S).

Definition f_un_rm_type_mnemonic_S_forwards_matches (arg_ : f_un_rm_op_S) : bool :=
   match arg_ with
   | FSQRT_S => true
   | FCVT_W_S => true
   | FCVT_WU_S => true
   | FCVT_S_W => true
   | FCVT_S_WU => true
   | FCVT_L_S => true
   | FCVT_LU_S => true
   | FCVT_S_L => true
   | FCVT_S_LU => true
   end.

Definition f_un_rm_type_mnemonic_S_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "fsqrt.s" then true
   else if generic_eq p0_ "fcvt.w.s" then true
   else if generic_eq p0_ "fcvt.wu.s" then true
   else if generic_eq p0_ "fcvt.s.w" then true
   else if generic_eq p0_ "fcvt.s.wu" then true
   else if generic_eq p0_ "fcvt.l.s" then true
   else if generic_eq p0_ "fcvt.lu.s" then true
   else if generic_eq p0_ "fcvt.s.l" then true
   else if generic_eq p0_ "fcvt.s.lu" then true
   else false.

Definition _s1166_ (_s1167_ : string) : option string :=
   let _s1168_ := _s1167_ in
   if string_startswith _s1168_ "fcvt.s.lu" then
     match (string_drop _s1168_ (projT1 (string_length "fcvt.s.lu"))) with | s_ => Some s_ end
   else None.

Definition _s1162_ (_s1163_ : string) : option string :=
   let _s1164_ := _s1163_ in
   if string_startswith _s1164_ "fcvt.s.l" then
     match (string_drop _s1164_ (projT1 (string_length "fcvt.s.l"))) with | s_ => Some s_ end
   else None.

Definition _s1158_ (_s1159_ : string) : option string :=
   let _s1160_ := _s1159_ in
   if string_startswith _s1160_ "fcvt.lu.s" then
     match (string_drop _s1160_ (projT1 (string_length "fcvt.lu.s"))) with | s_ => Some s_ end
   else None.

Definition _s1154_ (_s1155_ : string) : option string :=
   let _s1156_ := _s1155_ in
   if string_startswith _s1156_ "fcvt.l.s" then
     match (string_drop _s1156_ (projT1 (string_length "fcvt.l.s"))) with | s_ => Some s_ end
   else None.

Definition _s1150_ (_s1151_ : string) : option string :=
   let _s1152_ := _s1151_ in
   if string_startswith _s1152_ "fcvt.s.wu" then
     match (string_drop _s1152_ (projT1 (string_length "fcvt.s.wu"))) with | s_ => Some s_ end
   else None.

Definition _s1146_ (_s1147_ : string) : option string :=
   let _s1148_ := _s1147_ in
   if string_startswith _s1148_ "fcvt.s.w" then
     match (string_drop _s1148_ (projT1 (string_length "fcvt.s.w"))) with | s_ => Some s_ end
   else None.

Definition _s1142_ (_s1143_ : string) : option string :=
   let _s1144_ := _s1143_ in
   if string_startswith _s1144_ "fcvt.wu.s" then
     match (string_drop _s1144_ (projT1 (string_length "fcvt.wu.s"))) with | s_ => Some s_ end
   else None.

Definition _s1138_ (_s1139_ : string) : option string :=
   let _s1140_ := _s1139_ in
   if string_startswith _s1140_ "fcvt.w.s" then
     match (string_drop _s1140_ (projT1 (string_length "fcvt.w.s"))) with | s_ => Some s_ end
   else None.

Definition _s1134_ (_s1135_ : string) : option string :=
   let _s1136_ := _s1135_ in
   if string_startswith _s1136_ "fsqrt.s" then
     match (string_drop _s1136_ (projT1 (string_length "fsqrt.s"))) with | s_ => Some s_ end
   else None.

Definition f_un_rm_type_mnemonic_S_matches_prefix (arg_ : string)
: M (option ((f_un_rm_op_S * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s1137_ := arg_ in
   (if match (_s1134_ _s1137_) with | Some s_ => true | _ => false end then
      (match (_s1134_ _s1137_) with
       | Some s_ =>
          returnm (Some
                     (FSQRT_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1138_ _s1137_) with | Some s_ => true | _ => false end then
      (match (_s1138_ _s1137_) with
       | Some s_ =>
          returnm (Some
                     (FCVT_W_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1142_ _s1137_) with | Some s_ => true | _ => false end then
      (match (_s1142_ _s1137_) with
       | Some s_ =>
          returnm (Some
                     (FCVT_WU_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1146_ _s1137_) with | Some s_ => true | _ => false end then
      (match (_s1146_ _s1137_) with
       | Some s_ =>
          returnm (Some
                     (FCVT_S_W, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1150_ _s1137_) with | Some s_ => true | _ => false end then
      (match (_s1150_ _s1137_) with
       | Some s_ =>
          returnm (Some
                     (FCVT_S_WU, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1154_ _s1137_) with | Some s_ => true | _ => false end then
      (match (_s1154_ _s1137_) with
       | Some s_ =>
          returnm (Some
                     (FCVT_L_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1158_ _s1137_) with | Some s_ => true | _ => false end then
      (match (_s1158_ _s1137_) with
       | Some s_ =>
          returnm (Some
                     (FCVT_LU_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1162_ _s1137_) with | Some s_ => true | _ => false end then
      (match (_s1162_ _s1137_) with
       | Some s_ =>
          returnm (Some
                     (FCVT_S_L, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1166_ _s1137_) with | Some s_ => true | _ => false end then
      (match (_s1166_ _s1137_) with
       | Some s_ =>
          returnm (Some
                     (FCVT_S_LU, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_rm_op_S * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((f_un_rm_op_S * {n : Z & ArithFact (n >=? 0)}))).

Definition f_bin_type_mnemonic_S_forwards (arg_ : f_bin_op_S) : string :=
   match arg_ with
   | FSGNJ_S => "fsgnj.s"
   | FSGNJN_S => "fsgnjn.s"
   | FSGNJX_S => "fsgnjx.s"
   | FMIN_S => "fmin.s"
   | FMAX_S => "fmax.s"
   | FEQ_S => "feq.s"
   | FLT_S => "flt.s"
   | FLE_S => "fle.s"
   end.

Definition f_bin_type_mnemonic_S_backwards (arg_ : string) : M (f_bin_op_S) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "fsgnj.s" then returnm FSGNJ_S
    else if generic_eq p0_ "fsgnjn.s" then returnm FSGNJN_S
    else if generic_eq p0_ "fsgnjx.s" then returnm FSGNJX_S
    else if generic_eq p0_ "fmin.s" then returnm FMIN_S
    else if generic_eq p0_ "fmax.s" then returnm FMAX_S
    else if generic_eq p0_ "feq.s" then returnm FEQ_S
    else if generic_eq p0_ "flt.s" then returnm FLT_S
    else if generic_eq p0_ "fle.s" then returnm FLE_S
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (f_bin_op_S).

Definition f_bin_type_mnemonic_S_forwards_matches (arg_ : f_bin_op_S) : bool :=
   match arg_ with
   | FSGNJ_S => true
   | FSGNJN_S => true
   | FSGNJX_S => true
   | FMIN_S => true
   | FMAX_S => true
   | FEQ_S => true
   | FLT_S => true
   | FLE_S => true
   end.

Definition f_bin_type_mnemonic_S_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "fsgnj.s" then true
   else if generic_eq p0_ "fsgnjn.s" then true
   else if generic_eq p0_ "fsgnjx.s" then true
   else if generic_eq p0_ "fmin.s" then true
   else if generic_eq p0_ "fmax.s" then true
   else if generic_eq p0_ "feq.s" then true
   else if generic_eq p0_ "flt.s" then true
   else if generic_eq p0_ "fle.s" then true
   else false.

Definition _s1198_ (_s1199_ : string) : option string :=
   let _s1200_ := _s1199_ in
   if string_startswith _s1200_ "fle.s" then
     match (string_drop _s1200_ (projT1 (string_length "fle.s"))) with | s_ => Some s_ end
   else None.

Definition _s1194_ (_s1195_ : string) : option string :=
   let _s1196_ := _s1195_ in
   if string_startswith _s1196_ "flt.s" then
     match (string_drop _s1196_ (projT1 (string_length "flt.s"))) with | s_ => Some s_ end
   else None.

Definition _s1190_ (_s1191_ : string) : option string :=
   let _s1192_ := _s1191_ in
   if string_startswith _s1192_ "feq.s" then
     match (string_drop _s1192_ (projT1 (string_length "feq.s"))) with | s_ => Some s_ end
   else None.

Definition _s1186_ (_s1187_ : string) : option string :=
   let _s1188_ := _s1187_ in
   if string_startswith _s1188_ "fmax.s" then
     match (string_drop _s1188_ (projT1 (string_length "fmax.s"))) with | s_ => Some s_ end
   else None.

Definition _s1182_ (_s1183_ : string) : option string :=
   let _s1184_ := _s1183_ in
   if string_startswith _s1184_ "fmin.s" then
     match (string_drop _s1184_ (projT1 (string_length "fmin.s"))) with | s_ => Some s_ end
   else None.

Definition _s1178_ (_s1179_ : string) : option string :=
   let _s1180_ := _s1179_ in
   if string_startswith _s1180_ "fsgnjx.s" then
     match (string_drop _s1180_ (projT1 (string_length "fsgnjx.s"))) with | s_ => Some s_ end
   else None.

Definition _s1174_ (_s1175_ : string) : option string :=
   let _s1176_ := _s1175_ in
   if string_startswith _s1176_ "fsgnjn.s" then
     match (string_drop _s1176_ (projT1 (string_length "fsgnjn.s"))) with | s_ => Some s_ end
   else None.

Definition _s1170_ (_s1171_ : string) : option string :=
   let _s1172_ := _s1171_ in
   if string_startswith _s1172_ "fsgnj.s" then
     match (string_drop _s1172_ (projT1 (string_length "fsgnj.s"))) with | s_ => Some s_ end
   else None.

Definition f_bin_type_mnemonic_S_matches_prefix (arg_ : string)
: M (option ((f_bin_op_S * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s1173_ := arg_ in
   (if match (_s1170_ _s1173_) with | Some s_ => true | _ => false end then
      (match (_s1170_ _s1173_) with
       | Some s_ =>
          returnm (Some
                     (FSGNJ_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1174_ _s1173_) with | Some s_ => true | _ => false end then
      (match (_s1174_ _s1173_) with
       | Some s_ =>
          returnm (Some
                     (FSGNJN_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1178_ _s1173_) with | Some s_ => true | _ => false end then
      (match (_s1178_ _s1173_) with
       | Some s_ =>
          returnm (Some
                     (FSGNJX_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1182_ _s1173_) with | Some s_ => true | _ => false end then
      (match (_s1182_ _s1173_) with
       | Some s_ =>
          returnm (Some
                     (FMIN_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1186_ _s1173_) with | Some s_ => true | _ => false end then
      (match (_s1186_ _s1173_) with
       | Some s_ =>
          returnm (Some
                     (FMAX_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1190_ _s1173_) with | Some s_ => true | _ => false end then
      (match (_s1190_ _s1173_) with
       | Some s_ =>
          returnm (Some
                     (FEQ_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1194_ _s1173_) with | Some s_ => true | _ => false end then
      (match (_s1194_ _s1173_) with
       | Some s_ =>
          returnm (Some
                     (FLT_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1198_ _s1173_) with | Some s_ => true | _ => false end then
      (match (_s1198_ _s1173_) with
       | Some s_ =>
          returnm (Some
                     (FLE_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_op_S * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((f_bin_op_S * {n : Z & ArithFact (n >=? 0)}))).

Definition f_un_type_mnemonic_S_forwards (arg_ : f_un_op_S) : string :=
   match arg_ with | FMV_X_W => "fmv.x.w" | FCLASS_S => "fclass.s" | FMV_W_X => "fmv.w.x" end.

Definition f_un_type_mnemonic_S_backwards (arg_ : string) : M (f_un_op_S) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "fmv.x.w" then returnm FMV_X_W
    else if generic_eq p0_ "fclass.s" then returnm FCLASS_S
    else if generic_eq p0_ "fmv.w.x" then returnm FMV_W_X
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (f_un_op_S).

Definition f_un_type_mnemonic_S_forwards_matches (arg_ : f_un_op_S) : bool :=
   match arg_ with | FMV_X_W => true | FCLASS_S => true | FMV_W_X => true end.

Definition f_un_type_mnemonic_S_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "fmv.x.w" then true
   else if generic_eq p0_ "fclass.s" then true
   else if generic_eq p0_ "fmv.w.x" then true
   else false.

Definition _s1210_ (_s1211_ : string) : option string :=
   let _s1212_ := _s1211_ in
   if string_startswith _s1212_ "fmv.w.x" then
     match (string_drop _s1212_ (projT1 (string_length "fmv.w.x"))) with | s_ => Some s_ end
   else None.

Definition _s1206_ (_s1207_ : string) : option string :=
   let _s1208_ := _s1207_ in
   if string_startswith _s1208_ "fclass.s" then
     match (string_drop _s1208_ (projT1 (string_length "fclass.s"))) with | s_ => Some s_ end
   else None.

Definition _s1202_ (_s1203_ : string) : option string :=
   let _s1204_ := _s1203_ in
   if string_startswith _s1204_ "fmv.x.w" then
     match (string_drop _s1204_ (projT1 (string_length "fmv.x.w"))) with | s_ => Some s_ end
   else None.

Definition f_un_type_mnemonic_S_matches_prefix (arg_ : string)
: M (option ((f_un_op_S * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s1205_ := arg_ in
   (if match (_s1202_ _s1205_) with | Some s_ => true | _ => false end then
      (match (_s1202_ _s1205_) with
       | Some s_ =>
          returnm (Some
                     (FMV_X_W, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1206_ _s1205_) with | Some s_ => true | _ => false end then
      (match (_s1206_ _s1205_) with
       | Some s_ =>
          returnm (Some
                     (FCLASS_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_op_S * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1210_ _s1205_) with | Some s_ => true | _ => false end then
      (match (_s1210_ _s1205_) with
       | Some s_ =>
          returnm (Some
                     (FMV_W_X, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_op_S * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_op_S * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((f_un_op_S * {n : Z & ArithFact (n >=? 0)}))).

Definition fsplit_D (x64 : mword 64) : (mword 1 * mword 11 * mword 52) :=
   (subrange_vec_dec x64 63 63, subrange_vec_dec x64 62 52, subrange_vec_dec x64 51 0).

Definition fmake_D (sign : mword 1) (exp : mword 11) (mant : mword 52) : mword 64 :=
   concat_vec sign (concat_vec exp mant).

Definition canonical_NaN_D '(tt : unit) : mword 64 := Ox"7FF8000000000000"  : mword 64.

Definition f_is_neg_inf_D (x64 : mword 64) : bool :=
   let '(sign, exp, mant) := fsplit_D x64 in
   andb (eq_vec sign ('b"1"  : mword 1))
     (andb (eq_vec exp (ones 11)) (eq_vec mant (zeros_implicit 52))).

Definition f_is_neg_norm_D (x64 : mword 64) : bool :=
   let '(sign, exp, mant) := fsplit_D x64 in
   andb (eq_vec sign ('b"1"  : mword 1))
     (andb (neq_vec exp (zeros_implicit 11)) (neq_vec exp (ones 11))).

Definition f_is_neg_subnorm_D (x64 : mword 64) : bool :=
   let '(sign, exp, mant) := fsplit_D x64 in
   andb (eq_vec sign ('b"1"  : mword 1))
     (andb (eq_vec exp (zeros_implicit 11)) (neq_vec mant (zeros_implicit 52))).

Definition f_is_neg_zero_D (x64 : mword 64) : bool :=
   let '(sign, exp, mant) := fsplit_D x64 in
   andb (eq_vec sign (ones 1))
     (andb (eq_vec exp (zeros_implicit 11)) (eq_vec mant (zeros_implicit 52))).

Definition f_is_pos_zero_D (x64 : mword 64) : bool :=
   let '(sign, exp, mant) := fsplit_D x64 in
   andb (eq_vec sign (zeros_implicit 1))
     (andb (eq_vec exp (zeros_implicit 11)) (eq_vec mant (zeros_implicit 52))).

Definition f_is_pos_subnorm_D (x64 : mword 64) : bool :=
   let '(sign, exp, mant) := fsplit_D x64 in
   andb (eq_vec sign (zeros_implicit 1))
     (andb (eq_vec exp (zeros_implicit 11)) (neq_vec mant (zeros_implicit 52))).

Definition f_is_pos_norm_D (x64 : mword 64) : bool :=
   let '(sign, exp, mant) := fsplit_D x64 in
   andb (eq_vec sign (zeros_implicit 1))
     (andb (neq_vec exp (zeros_implicit 11)) (neq_vec exp (ones 11))).

Definition f_is_pos_inf_D (x64 : mword 64) : bool :=
   let '(sign, exp, mant) := fsplit_D x64 in
   andb (eq_vec sign (zeros_implicit 1))
     (andb (eq_vec exp (ones 11)) (eq_vec mant (zeros_implicit 52))).

Definition f_is_SNaN_D (x64 : mword 64) : bool :=
   let '(sign, exp, mant) := fsplit_D x64 in
   andb (eq_vec exp (ones 11))
     (andb (eq_bit (access_vec_dec mant 51) B0) (neq_vec mant (zeros_implicit 52))).

Definition f_is_QNaN_D (x64 : mword 64) : bool :=
   let '(sign, exp, mant) := fsplit_D x64 in
   andb (eq_vec exp (ones 11)) (eq_bit (access_vec_dec mant 51) B1).

Definition f_is_NaN_D (x64 : mword 64) : bool :=
   let '(sign, exp, mant) := fsplit_D x64 in
   andb (eq_vec exp (ones 11)) (neq_vec mant (zeros_implicit 52)).

Definition negate_D (x64 : mword 64) : mword 64 :=
   let '(sign, exp, mant) := fsplit_D x64 in
   let new_sign := if eq_vec sign ('b"0"  : mword 1) then 'b"1"  : mword 1 else 'b"0"  : mword 1 in
   fmake_D new_sign exp mant.

Definition feq_quiet_D (v1 : mword 64) (v2 : mword 64) : (bool * mword 5) :=
   let '(s1, e1, m1) := fsplit_D v1 in
   let '(s2, e2, m2) := fsplit_D v2 in
   let v1Is0 := orb (f_is_neg_zero_D v1) (f_is_pos_zero_D v1) in
   let v2Is0 := orb (f_is_neg_zero_D v2) (f_is_pos_zero_D v2) in
   let result := orb (eq_vec v1 v2) (andb v1Is0 v2Is0) in
   let fflags := if orb (f_is_SNaN_D v1) (f_is_SNaN_D v2) then nvFlag tt else zeros_implicit 5 in
   (result, fflags).

Definition flt_D (v1 : mword 64) (v2 : mword 64) (is_quiet : bool) : (bool * mword 5) :=
   let '(s1, e1, m1) := fsplit_D v1 in
   let '(s2, e2, m2) := fsplit_D v2 in
   let result : bool :=
     if andb (eq_vec s1 ('b"0"  : mword 1)) (eq_vec s2 ('b"0"  : mword 1)) then
       if eq_vec e1 e2 then Z.ltb (projT1 (uint m1)) (projT1 (uint m2))
       else Z.ltb (projT1 (uint e1)) (projT1 (uint e2))
     else if andb (eq_vec s1 ('b"0"  : mword 1)) (eq_vec s2 ('b"1"  : mword 1)) then false
     else if andb (eq_vec s1 ('b"1"  : mword 1)) (eq_vec s2 ('b"0"  : mword 1)) then true
     else if eq_vec e1 e2 then Z.gtb (projT1 (uint m1)) (projT1 (uint m2))
     else Z.gtb (projT1 (uint e1)) (projT1 (uint e2)) in
   let fflags :=
     if sumbool_of_bool is_quiet then
       if orb (f_is_SNaN_D v1) (f_is_SNaN_D v2) then nvFlag tt
       else zeros_implicit 5
     else if orb (f_is_NaN_D v1) (f_is_NaN_D v2) then nvFlag tt
     else zeros_implicit 5 in
   (result, fflags).

Definition fle_D (v1 : mword 64) (v2 : mword 64) (is_quiet : bool) : (bool * mword 5) :=
   let '(s1, e1, m1) := fsplit_D v1 in
   let '(s2, e2, m2) := fsplit_D v2 in
   let v1Is0 := orb (f_is_neg_zero_D v1) (f_is_pos_zero_D v1) in
   let v2Is0 := orb (f_is_neg_zero_D v2) (f_is_pos_zero_D v2) in
   let result : bool :=
     if andb (eq_vec s1 ('b"0"  : mword 1)) (eq_vec s2 ('b"0"  : mword 1)) then
       if eq_vec e1 e2 then Z.leb (projT1 (uint m1)) (projT1 (uint m2))
       else Z.ltb (projT1 (uint e1)) (projT1 (uint e2))
     else if andb (eq_vec s1 ('b"0"  : mword 1)) (eq_vec s2 ('b"1"  : mword 1)) then
       andb v1Is0 v2Is0
     else if andb (eq_vec s1 ('b"1"  : mword 1)) (eq_vec s2 ('b"0"  : mword 1)) then true
     else if eq_vec e1 e2 then Z.geb (projT1 (uint m1)) (projT1 (uint m2))
     else Z.gtb (projT1 (uint e1)) (projT1 (uint e2)) in
   let fflags :=
     if sumbool_of_bool is_quiet then
       if orb (f_is_SNaN_D v1) (f_is_SNaN_D v2) then nvFlag tt
       else zeros_implicit 5
     else if orb (f_is_NaN_D v1) (f_is_NaN_D v2) then nvFlag tt
     else zeros_implicit 5 in
   (result, fflags).

Definition f_madd_type_mnemonic_D_forwards (arg_ : f_madd_op_D) : string :=
   match arg_ with
   | FMADD_D => "fmadd.d"
   | FMSUB_D => "fmsub.d"
   | FNMSUB_D => "fnmsub.d"
   | FNMADD_D => "fnmadd.d"
   end.

Definition f_madd_type_mnemonic_D_backwards (arg_ : string) : M (f_madd_op_D) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "fmadd.d" then returnm FMADD_D
    else if generic_eq p0_ "fmsub.d" then returnm FMSUB_D
    else if generic_eq p0_ "fnmsub.d" then returnm FNMSUB_D
    else if generic_eq p0_ "fnmadd.d" then returnm FNMADD_D
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (f_madd_op_D).

Definition f_madd_type_mnemonic_D_forwards_matches (arg_ : f_madd_op_D) : bool :=
   match arg_ with | FMADD_D => true | FMSUB_D => true | FNMSUB_D => true | FNMADD_D => true end.

Definition f_madd_type_mnemonic_D_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "fmadd.d" then true
   else if generic_eq p0_ "fmsub.d" then true
   else if generic_eq p0_ "fnmsub.d" then true
   else if generic_eq p0_ "fnmadd.d" then true
   else false.

Definition _s1226_ (_s1227_ : string) : option string :=
   let _s1228_ := _s1227_ in
   if string_startswith _s1228_ "fnmadd.d" then
     match (string_drop _s1228_ (projT1 (string_length "fnmadd.d"))) with | s_ => Some s_ end
   else None.

Definition _s1222_ (_s1223_ : string) : option string :=
   let _s1224_ := _s1223_ in
   if string_startswith _s1224_ "fnmsub.d" then
     match (string_drop _s1224_ (projT1 (string_length "fnmsub.d"))) with | s_ => Some s_ end
   else None.

Definition _s1218_ (_s1219_ : string) : option string :=
   let _s1220_ := _s1219_ in
   if string_startswith _s1220_ "fmsub.d" then
     match (string_drop _s1220_ (projT1 (string_length "fmsub.d"))) with | s_ => Some s_ end
   else None.

Definition _s1214_ (_s1215_ : string) : option string :=
   let _s1216_ := _s1215_ in
   if string_startswith _s1216_ "fmadd.d" then
     match (string_drop _s1216_ (projT1 (string_length "fmadd.d"))) with | s_ => Some s_ end
   else None.

Definition f_madd_type_mnemonic_D_matches_prefix (arg_ : string)
: M (option ((f_madd_op_D * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s1217_ := arg_ in
   (if match (_s1214_ _s1217_) with | Some s_ => true | _ => false end then
      (match (_s1214_ _s1217_) with
       | Some s_ =>
          returnm (Some
                     (FMADD_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_madd_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_madd_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1218_ _s1217_) with | Some s_ => true | _ => false end then
      (match (_s1218_ _s1217_) with
       | Some s_ =>
          returnm (Some
                     (FMSUB_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_madd_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_madd_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1222_ _s1217_) with | Some s_ => true | _ => false end then
      (match (_s1222_ _s1217_) with
       | Some s_ =>
          returnm (Some
                     (FNMSUB_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_madd_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_madd_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1226_ _s1217_) with | Some s_ => true | _ => false end then
      (match (_s1226_ _s1217_) with
       | Some s_ =>
          returnm (Some
                     (FNMADD_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_madd_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_madd_op_D * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((f_madd_op_D * {n : Z & ArithFact (n >=? 0)}))).

Definition f_bin_rm_type_mnemonic_D_forwards (arg_ : f_bin_rm_op_D) : string :=
   match arg_ with
   | FADD_D => "fadd.d"
   | FSUB_D => "fsub.d"
   | FMUL_D => "fmul.d"
   | FDIV_D => "fdiv.d"
   end.

Definition f_bin_rm_type_mnemonic_D_backwards (arg_ : string) : M (f_bin_rm_op_D) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "fadd.d" then returnm FADD_D
    else if generic_eq p0_ "fsub.d" then returnm FSUB_D
    else if generic_eq p0_ "fmul.d" then returnm FMUL_D
    else if generic_eq p0_ "fdiv.d" then returnm FDIV_D
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (f_bin_rm_op_D).

Definition f_bin_rm_type_mnemonic_D_forwards_matches (arg_ : f_bin_rm_op_D) : bool :=
   match arg_ with | FADD_D => true | FSUB_D => true | FMUL_D => true | FDIV_D => true end.

Definition f_bin_rm_type_mnemonic_D_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "fadd.d" then true
   else if generic_eq p0_ "fsub.d" then true
   else if generic_eq p0_ "fmul.d" then true
   else if generic_eq p0_ "fdiv.d" then true
   else false.

Definition _s1242_ (_s1243_ : string) : option string :=
   let _s1244_ := _s1243_ in
   if string_startswith _s1244_ "fdiv.d" then
     match (string_drop _s1244_ (projT1 (string_length "fdiv.d"))) with | s_ => Some s_ end
   else None.

Definition _s1238_ (_s1239_ : string) : option string :=
   let _s1240_ := _s1239_ in
   if string_startswith _s1240_ "fmul.d" then
     match (string_drop _s1240_ (projT1 (string_length "fmul.d"))) with | s_ => Some s_ end
   else None.

Definition _s1234_ (_s1235_ : string) : option string :=
   let _s1236_ := _s1235_ in
   if string_startswith _s1236_ "fsub.d" then
     match (string_drop _s1236_ (projT1 (string_length "fsub.d"))) with | s_ => Some s_ end
   else None.

Definition _s1230_ (_s1231_ : string) : option string :=
   let _s1232_ := _s1231_ in
   if string_startswith _s1232_ "fadd.d" then
     match (string_drop _s1232_ (projT1 (string_length "fadd.d"))) with | s_ => Some s_ end
   else None.

Definition f_bin_rm_type_mnemonic_D_matches_prefix (arg_ : string)
: M (option ((f_bin_rm_op_D * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s1233_ := arg_ in
   (if match (_s1230_ _s1233_) with | Some s_ => true | _ => false end then
      (match (_s1230_ _s1233_) with
       | Some s_ =>
          returnm (Some
                     (FADD_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1234_ _s1233_) with | Some s_ => true | _ => false end then
      (match (_s1234_ _s1233_) with
       | Some s_ =>
          returnm (Some
                     (FSUB_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1238_ _s1233_) with | Some s_ => true | _ => false end then
      (match (_s1238_ _s1233_) with
       | Some s_ =>
          returnm (Some
                     (FMUL_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1242_ _s1233_) with | Some s_ => true | _ => false end then
      (match (_s1242_ _s1233_) with
       | Some s_ =>
          returnm (Some
                     (FDIV_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((f_bin_rm_op_D * {n : Z & ArithFact (n >=? 0)}))).

Definition f_un_rm_type_mnemonic_D_forwards (arg_ : f_un_rm_op_D) : string :=
   match arg_ with
   | FSQRT_D => "fsqrt.d"
   | FCVT_W_D => "fcvt.w.d"
   | FCVT_WU_D => "fcvt.wu.d"
   | FCVT_D_W => "fcvt.d.w"
   | FCVT_D_WU => "fcvt.d.wu"
   | FCVT_L_D => "fcvt.l.d"
   | FCVT_LU_D => "fcvt.lu.d"
   | FCVT_D_L => "fcvt.d.l"
   | FCVT_D_LU => "fcvt.d.lu"
   | FCVT_S_D => "fcvt.s.d"
   | FCVT_D_S => "fcvt.d.s"
   end.

Definition f_un_rm_type_mnemonic_D_backwards (arg_ : string) : M (f_un_rm_op_D) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "fsqrt.d" then returnm FSQRT_D
    else if generic_eq p0_ "fcvt.w.d" then returnm FCVT_W_D
    else if generic_eq p0_ "fcvt.wu.d" then returnm FCVT_WU_D
    else if generic_eq p0_ "fcvt.d.w" then returnm FCVT_D_W
    else if generic_eq p0_ "fcvt.d.wu" then returnm FCVT_D_WU
    else if generic_eq p0_ "fcvt.l.d" then returnm FCVT_L_D
    else if generic_eq p0_ "fcvt.lu.d" then returnm FCVT_LU_D
    else if generic_eq p0_ "fcvt.d.l" then returnm FCVT_D_L
    else if generic_eq p0_ "fcvt.d.lu" then returnm FCVT_D_LU
    else if generic_eq p0_ "fcvt.s.d" then returnm FCVT_S_D
    else if generic_eq p0_ "fcvt.d.s" then returnm FCVT_D_S
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (f_un_rm_op_D).

Definition f_un_rm_type_mnemonic_D_forwards_matches (arg_ : f_un_rm_op_D) : bool :=
   match arg_ with
   | FSQRT_D => true
   | FCVT_W_D => true
   | FCVT_WU_D => true
   | FCVT_D_W => true
   | FCVT_D_WU => true
   | FCVT_L_D => true
   | FCVT_LU_D => true
   | FCVT_D_L => true
   | FCVT_D_LU => true
   | FCVT_S_D => true
   | FCVT_D_S => true
   end.

Definition f_un_rm_type_mnemonic_D_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "fsqrt.d" then true
   else if generic_eq p0_ "fcvt.w.d" then true
   else if generic_eq p0_ "fcvt.wu.d" then true
   else if generic_eq p0_ "fcvt.d.w" then true
   else if generic_eq p0_ "fcvt.d.wu" then true
   else if generic_eq p0_ "fcvt.l.d" then true
   else if generic_eq p0_ "fcvt.lu.d" then true
   else if generic_eq p0_ "fcvt.d.l" then true
   else if generic_eq p0_ "fcvt.d.lu" then true
   else if generic_eq p0_ "fcvt.s.d" then true
   else if generic_eq p0_ "fcvt.d.s" then true
   else false.

Definition _s1286_ (_s1287_ : string) : option string :=
   let _s1288_ := _s1287_ in
   if string_startswith _s1288_ "fcvt.d.s" then
     match (string_drop _s1288_ (projT1 (string_length "fcvt.d.s"))) with | s_ => Some s_ end
   else None.

Definition _s1282_ (_s1283_ : string) : option string :=
   let _s1284_ := _s1283_ in
   if string_startswith _s1284_ "fcvt.s.d" then
     match (string_drop _s1284_ (projT1 (string_length "fcvt.s.d"))) with | s_ => Some s_ end
   else None.

Definition _s1278_ (_s1279_ : string) : option string :=
   let _s1280_ := _s1279_ in
   if string_startswith _s1280_ "fcvt.d.lu" then
     match (string_drop _s1280_ (projT1 (string_length "fcvt.d.lu"))) with | s_ => Some s_ end
   else None.

Definition _s1274_ (_s1275_ : string) : option string :=
   let _s1276_ := _s1275_ in
   if string_startswith _s1276_ "fcvt.d.l" then
     match (string_drop _s1276_ (projT1 (string_length "fcvt.d.l"))) with | s_ => Some s_ end
   else None.

Definition _s1270_ (_s1271_ : string) : option string :=
   let _s1272_ := _s1271_ in
   if string_startswith _s1272_ "fcvt.lu.d" then
     match (string_drop _s1272_ (projT1 (string_length "fcvt.lu.d"))) with | s_ => Some s_ end
   else None.

Definition _s1266_ (_s1267_ : string) : option string :=
   let _s1268_ := _s1267_ in
   if string_startswith _s1268_ "fcvt.l.d" then
     match (string_drop _s1268_ (projT1 (string_length "fcvt.l.d"))) with | s_ => Some s_ end
   else None.

Definition _s1262_ (_s1263_ : string) : option string :=
   let _s1264_ := _s1263_ in
   if string_startswith _s1264_ "fcvt.d.wu" then
     match (string_drop _s1264_ (projT1 (string_length "fcvt.d.wu"))) with | s_ => Some s_ end
   else None.

Definition _s1258_ (_s1259_ : string) : option string :=
   let _s1260_ := _s1259_ in
   if string_startswith _s1260_ "fcvt.d.w" then
     match (string_drop _s1260_ (projT1 (string_length "fcvt.d.w"))) with | s_ => Some s_ end
   else None.

Definition _s1254_ (_s1255_ : string) : option string :=
   let _s1256_ := _s1255_ in
   if string_startswith _s1256_ "fcvt.wu.d" then
     match (string_drop _s1256_ (projT1 (string_length "fcvt.wu.d"))) with | s_ => Some s_ end
   else None.

Definition _s1250_ (_s1251_ : string) : option string :=
   let _s1252_ := _s1251_ in
   if string_startswith _s1252_ "fcvt.w.d" then
     match (string_drop _s1252_ (projT1 (string_length "fcvt.w.d"))) with | s_ => Some s_ end
   else None.

Definition _s1246_ (_s1247_ : string) : option string :=
   let _s1248_ := _s1247_ in
   if string_startswith _s1248_ "fsqrt.d" then
     match (string_drop _s1248_ (projT1 (string_length "fsqrt.d"))) with | s_ => Some s_ end
   else None.

Definition f_un_rm_type_mnemonic_D_matches_prefix (arg_ : string)
: M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s1249_ := arg_ in
   (if match (_s1246_ _s1249_) with | Some s_ => true | _ => false end then
      (match (_s1246_ _s1249_) with
       | Some s_ =>
          returnm (Some
                     (FSQRT_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1250_ _s1249_) with | Some s_ => true | _ => false end then
      (match (_s1250_ _s1249_) with
       | Some s_ =>
          returnm (Some
                     (FCVT_W_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1254_ _s1249_) with | Some s_ => true | _ => false end then
      (match (_s1254_ _s1249_) with
       | Some s_ =>
          returnm (Some
                     (FCVT_WU_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1258_ _s1249_) with | Some s_ => true | _ => false end then
      (match (_s1258_ _s1249_) with
       | Some s_ =>
          returnm (Some
                     (FCVT_D_W, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1262_ _s1249_) with | Some s_ => true | _ => false end then
      (match (_s1262_ _s1249_) with
       | Some s_ =>
          returnm (Some
                     (FCVT_D_WU, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1266_ _s1249_) with | Some s_ => true | _ => false end then
      (match (_s1266_ _s1249_) with
       | Some s_ =>
          returnm (Some
                     (FCVT_L_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1270_ _s1249_) with | Some s_ => true | _ => false end then
      (match (_s1270_ _s1249_) with
       | Some s_ =>
          returnm (Some
                     (FCVT_LU_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1274_ _s1249_) with | Some s_ => true | _ => false end then
      (match (_s1274_ _s1249_) with
       | Some s_ =>
          returnm (Some
                     (FCVT_D_L, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1278_ _s1249_) with | Some s_ => true | _ => false end then
      (match (_s1278_ _s1249_) with
       | Some s_ =>
          returnm (Some
                     (FCVT_D_LU, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1282_ _s1249_) with | Some s_ => true | _ => false end then
      (match (_s1282_ _s1249_) with
       | Some s_ =>
          returnm (Some
                     (FCVT_S_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1286_ _s1249_) with | Some s_ => true | _ => false end then
      (match (_s1286_ _s1249_) with
       | Some s_ =>
          returnm (Some
                     (FCVT_D_S, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((f_un_rm_op_D * {n : Z & ArithFact (n >=? 0)}))).

Definition f_bin_type_mnemonic_D_forwards (arg_ : f_bin_op_D) : string :=
   match arg_ with
   | FSGNJ_D => "fsgnj.d"
   | FSGNJN_D => "fsgnjn.d"
   | FSGNJX_D => "fsgnjx.d"
   | FMIN_D => "fmin.d"
   | FMAX_D => "fmax.d"
   | FEQ_D => "feq.d"
   | FLT_D => "flt.d"
   | FLE_D => "fle.d"
   end.

Definition f_bin_type_mnemonic_D_backwards (arg_ : string) : M (f_bin_op_D) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "fsgnj.d" then returnm FSGNJ_D
    else if generic_eq p0_ "fsgnjn.d" then returnm FSGNJN_D
    else if generic_eq p0_ "fsgnjx.d" then returnm FSGNJX_D
    else if generic_eq p0_ "fmin.d" then returnm FMIN_D
    else if generic_eq p0_ "fmax.d" then returnm FMAX_D
    else if generic_eq p0_ "feq.d" then returnm FEQ_D
    else if generic_eq p0_ "flt.d" then returnm FLT_D
    else if generic_eq p0_ "fle.d" then returnm FLE_D
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (f_bin_op_D).

Definition f_bin_type_mnemonic_D_forwards_matches (arg_ : f_bin_op_D) : bool :=
   match arg_ with
   | FSGNJ_D => true
   | FSGNJN_D => true
   | FSGNJX_D => true
   | FMIN_D => true
   | FMAX_D => true
   | FEQ_D => true
   | FLT_D => true
   | FLE_D => true
   end.

Definition f_bin_type_mnemonic_D_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "fsgnj.d" then true
   else if generic_eq p0_ "fsgnjn.d" then true
   else if generic_eq p0_ "fsgnjx.d" then true
   else if generic_eq p0_ "fmin.d" then true
   else if generic_eq p0_ "fmax.d" then true
   else if generic_eq p0_ "feq.d" then true
   else if generic_eq p0_ "flt.d" then true
   else if generic_eq p0_ "fle.d" then true
   else false.

Definition _s1318_ (_s1319_ : string) : option string :=
   let _s1320_ := _s1319_ in
   if string_startswith _s1320_ "fle.d" then
     match (string_drop _s1320_ (projT1 (string_length "fle.d"))) with | s_ => Some s_ end
   else None.

Definition _s1314_ (_s1315_ : string) : option string :=
   let _s1316_ := _s1315_ in
   if string_startswith _s1316_ "flt.d" then
     match (string_drop _s1316_ (projT1 (string_length "flt.d"))) with | s_ => Some s_ end
   else None.

Definition _s1310_ (_s1311_ : string) : option string :=
   let _s1312_ := _s1311_ in
   if string_startswith _s1312_ "feq.d" then
     match (string_drop _s1312_ (projT1 (string_length "feq.d"))) with | s_ => Some s_ end
   else None.

Definition _s1306_ (_s1307_ : string) : option string :=
   let _s1308_ := _s1307_ in
   if string_startswith _s1308_ "fmax.d" then
     match (string_drop _s1308_ (projT1 (string_length "fmax.d"))) with | s_ => Some s_ end
   else None.

Definition _s1302_ (_s1303_ : string) : option string :=
   let _s1304_ := _s1303_ in
   if string_startswith _s1304_ "fmin.d" then
     match (string_drop _s1304_ (projT1 (string_length "fmin.d"))) with | s_ => Some s_ end
   else None.

Definition _s1298_ (_s1299_ : string) : option string :=
   let _s1300_ := _s1299_ in
   if string_startswith _s1300_ "fsgnjx.d" then
     match (string_drop _s1300_ (projT1 (string_length "fsgnjx.d"))) with | s_ => Some s_ end
   else None.

Definition _s1294_ (_s1295_ : string) : option string :=
   let _s1296_ := _s1295_ in
   if string_startswith _s1296_ "fsgnjn.d" then
     match (string_drop _s1296_ (projT1 (string_length "fsgnjn.d"))) with | s_ => Some s_ end
   else None.

Definition _s1290_ (_s1291_ : string) : option string :=
   let _s1292_ := _s1291_ in
   if string_startswith _s1292_ "fsgnj.d" then
     match (string_drop _s1292_ (projT1 (string_length "fsgnj.d"))) with | s_ => Some s_ end
   else None.

Definition f_bin_type_mnemonic_D_matches_prefix (arg_ : string)
: M (option ((f_bin_op_D * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s1293_ := arg_ in
   (if match (_s1290_ _s1293_) with | Some s_ => true | _ => false end then
      (match (_s1290_ _s1293_) with
       | Some s_ =>
          returnm (Some
                     (FSGNJ_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1294_ _s1293_) with | Some s_ => true | _ => false end then
      (match (_s1294_ _s1293_) with
       | Some s_ =>
          returnm (Some
                     (FSGNJN_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1298_ _s1293_) with | Some s_ => true | _ => false end then
      (match (_s1298_ _s1293_) with
       | Some s_ =>
          returnm (Some
                     (FSGNJX_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1302_ _s1293_) with | Some s_ => true | _ => false end then
      (match (_s1302_ _s1293_) with
       | Some s_ =>
          returnm (Some
                     (FMIN_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1306_ _s1293_) with | Some s_ => true | _ => false end then
      (match (_s1306_ _s1293_) with
       | Some s_ =>
          returnm (Some
                     (FMAX_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1310_ _s1293_) with | Some s_ => true | _ => false end then
      (match (_s1310_ _s1293_) with
       | Some s_ =>
          returnm (Some
                     (FEQ_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1314_ _s1293_) with | Some s_ => true | _ => false end then
      (match (_s1314_ _s1293_) with
       | Some s_ =>
          returnm (Some
                     (FLT_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1318_ _s1293_) with | Some s_ => true | _ => false end then
      (match (_s1318_ _s1293_) with
       | Some s_ =>
          returnm (Some
                     (FLE_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_bin_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_bin_op_D * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((f_bin_op_D * {n : Z & ArithFact (n >=? 0)}))).

Definition f_un_type_mnemonic_D_forwards (arg_ : f_un_op_D) : string :=
   match arg_ with | FMV_X_D => "fmv.x.d" | FCLASS_D => "fclass.d" | FMV_D_X => "fmv.d.x" end.

Definition f_un_type_mnemonic_D_backwards (arg_ : string) : M (f_un_op_D) :=
   let p0_ := arg_ in
   (if generic_eq p0_ "fmv.x.d" then returnm FMV_X_D
    else if generic_eq p0_ "fclass.d" then returnm FCLASS_D
    else if generic_eq p0_ "fmv.d.x" then returnm FMV_D_X
    else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
    : M (f_un_op_D).

Definition f_un_type_mnemonic_D_forwards_matches (arg_ : f_un_op_D) : bool :=
   match arg_ with | FMV_X_D => true | FCLASS_D => true | FMV_D_X => true end.

Definition f_un_type_mnemonic_D_backwards_matches (arg_ : string) : bool :=
   let p0_ := arg_ in
   if generic_eq p0_ "fmv.x.d" then true
   else if generic_eq p0_ "fclass.d" then true
   else if generic_eq p0_ "fmv.d.x" then true
   else false.

Definition _s1330_ (_s1331_ : string) : option string :=
   let _s1332_ := _s1331_ in
   if string_startswith _s1332_ "fmv.d.x" then
     match (string_drop _s1332_ (projT1 (string_length "fmv.d.x"))) with | s_ => Some s_ end
   else None.

Definition _s1326_ (_s1327_ : string) : option string :=
   let _s1328_ := _s1327_ in
   if string_startswith _s1328_ "fclass.d" then
     match (string_drop _s1328_ (projT1 (string_length "fclass.d"))) with | s_ => Some s_ end
   else None.

Definition _s1322_ (_s1323_ : string) : option string :=
   let _s1324_ := _s1323_ in
   if string_startswith _s1324_ "fmv.x.d" then
     match (string_drop _s1324_ (projT1 (string_length "fmv.x.d"))) with | s_ => Some s_ end
   else None.

Definition f_un_type_mnemonic_D_matches_prefix (arg_ : string)
: M (option ((f_un_op_D * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s1325_ := arg_ in
   (if match (_s1322_ _s1325_) with | Some s_ => true | _ => false end then
      (match (_s1322_ _s1325_) with
       | Some s_ =>
          returnm (Some
                     (FMV_X_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1326_ _s1325_) with | Some s_ => true | _ => false end then
      (match (_s1326_ _s1325_) with
       | Some s_ =>
          returnm (Some
                     (FCLASS_D, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_op_D * {n : Z & ArithFact (n >=? 0)})))
    else if match (_s1330_ _s1325_) with | Some s_ => true | _ => false end then
      (match (_s1330_ _s1325_) with
       | Some s_ =>
          returnm (Some
                     (FMV_D_X, build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((f_un_op_D * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((f_un_op_D * {n : Z & ArithFact (n >=? 0)})))
    else returnm None)
    : M (option ((f_un_op_D * {n : Z & ArithFact (n >=? 0)}))).

Definition encdec_forwards (arg_ : ast) : M (mword 32) :=
   (match arg_ with
    | UTYPE (imm, rd, op) =>
       returnm (concat_vec (imm  : mword 20) (concat_vec (rd  : mword 5) (encdec_uop_forwards op)))
    | RISCV_JAL (v__2, rd) =>
       (if eq_vec (subrange_vec_dec v__2 0 0) ('b"0"  : mword (0 - 0 + 1)) then
          let imm_19 : bits 1 := subrange_vec_dec v__2 20 20 in
          let imm_8 : bits 1 := subrange_vec_dec v__2 11 11 in
          let imm_7_0 : bits 8 := subrange_vec_dec v__2 19 12 in
          let imm_19 : bits 1 := subrange_vec_dec v__2 20 20 in
          let imm_18_13 : bits 6 := subrange_vec_dec v__2 10 5 in
          let imm_12_9 : bits 4 := subrange_vec_dec v__2 4 1 in
          returnm (concat_vec (imm_19  : bits 1)
                     (concat_vec (imm_18_13  : bits 6)
                        (concat_vec (imm_12_9  : bits 4)
                           (concat_vec (imm_8  : bits 1)
                              (concat_vec (imm_7_0  : bits 8)
                                 (concat_vec (rd  : mword 5) ('b"1101111"  : mword 7)))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | RISCV_JALR (imm, rs1, rd) =>
       returnm (concat_vec (imm  : mword 12)
                  (concat_vec (rs1  : mword 5)
                     (concat_vec ('b"000"  : mword 3)
                        (concat_vec (rd  : mword 5) ('b"1100111"  : mword 7)))))
    | BTYPE (v__4, rs2, rs1, op) =>
       (if eq_vec (subrange_vec_dec v__4 0 0) ('b"0"  : mword (0 - 0 + 1)) then
          let imm7_6 : bits 1 := subrange_vec_dec v__4 12 12 in
          let imm7_6 : bits 1 := subrange_vec_dec v__4 12 12 in
          let imm7_5_0 : bits 6 := subrange_vec_dec v__4 10 5 in
          let imm5_4_1 : bits 4 := subrange_vec_dec v__4 4 1 in
          let imm5_0 : bits 1 := subrange_vec_dec v__4 11 11 in
          returnm (concat_vec (imm7_6  : bits 1)
                     (concat_vec (imm7_5_0  : bits 6)
                        (concat_vec (rs2  : mword 5)
                           (concat_vec (rs1  : mword 5)
                              (concat_vec (encdec_bop_forwards op)
                                 (concat_vec (imm5_4_1  : bits 4)
                                    (concat_vec (imm5_0  : bits 1) ('b"1100011"  : mword 7))))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | ITYPE (imm, rs1, rd, op) =>
       returnm (concat_vec (imm  : mword 12)
                  (concat_vec (rs1  : mword 5)
                     (concat_vec (encdec_iop_forwards op)
                        (concat_vec (rd  : mword 5) ('b"0010011"  : mword 7)))))
    | SHIFTIOP (shamt, rs1, rd, RISCV_SLLI) =>
       returnm (concat_vec ('b"000000"  : mword 6)
                  (concat_vec (shamt  : mword 6)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec ('b"001"  : mword 3)
                           (concat_vec (rd  : mword 5) ('b"0010011"  : mword 7))))))
    | SHIFTIOP (shamt, rs1, rd, RISCV_SRLI) =>
       returnm (concat_vec ('b"000000"  : mword 6)
                  (concat_vec (shamt  : mword 6)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec ('b"101"  : mword 3)
                           (concat_vec (rd  : mword 5) ('b"0010011"  : mword 7))))))
    | SHIFTIOP (shamt, rs1, rd, RISCV_SRAI) =>
       returnm (concat_vec ('b"010000"  : mword 6)
                  (concat_vec (shamt  : mword 6)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec ('b"101"  : mword 3)
                           (concat_vec (rd  : mword 5) ('b"0010011"  : mword 7))))))
    | RTYPE (rs2, rs1, rd, RISCV_ADD) =>
       returnm (concat_vec ('b"0000000"  : mword 7)
                  (concat_vec (rs2  : mword 5)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec ('b"000"  : mword 3)
                           (concat_vec (rd  : mword 5) ('b"0110011"  : mword 7))))))
    | RTYPE (rs2, rs1, rd, RISCV_SLT) =>
       returnm (concat_vec ('b"0000000"  : mword 7)
                  (concat_vec (rs2  : mword 5)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec ('b"010"  : mword 3)
                           (concat_vec (rd  : mword 5) ('b"0110011"  : mword 7))))))
    | RTYPE (rs2, rs1, rd, RISCV_SLTU) =>
       returnm (concat_vec ('b"0000000"  : mword 7)
                  (concat_vec (rs2  : mword 5)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec ('b"011"  : mword 3)
                           (concat_vec (rd  : mword 5) ('b"0110011"  : mword 7))))))
    | RTYPE (rs2, rs1, rd, RISCV_AND) =>
       returnm (concat_vec ('b"0000000"  : mword 7)
                  (concat_vec (rs2  : mword 5)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec ('b"111"  : mword 3)
                           (concat_vec (rd  : mword 5) ('b"0110011"  : mword 7))))))
    | RTYPE (rs2, rs1, rd, RISCV_OR) =>
       returnm (concat_vec ('b"0000000"  : mword 7)
                  (concat_vec (rs2  : mword 5)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec ('b"110"  : mword 3)
                           (concat_vec (rd  : mword 5) ('b"0110011"  : mword 7))))))
    | RTYPE (rs2, rs1, rd, RISCV_XOR) =>
       returnm (concat_vec ('b"0000000"  : mword 7)
                  (concat_vec (rs2  : mword 5)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec ('b"100"  : mword 3)
                           (concat_vec (rd  : mword 5) ('b"0110011"  : mword 7))))))
    | RTYPE (rs2, rs1, rd, RISCV_SLL) =>
       returnm (concat_vec ('b"0000000"  : mword 7)
                  (concat_vec (rs2  : mword 5)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec ('b"001"  : mword 3)
                           (concat_vec (rd  : mword 5) ('b"0110011"  : mword 7))))))
    | RTYPE (rs2, rs1, rd, RISCV_SRL) =>
       returnm (concat_vec ('b"0000000"  : mword 7)
                  (concat_vec (rs2  : mword 5)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec ('b"101"  : mword 3)
                           (concat_vec (rd  : mword 5) ('b"0110011"  : mword 7))))))
    | RTYPE (rs2, rs1, rd, RISCV_SUB) =>
       returnm (concat_vec ('b"0100000"  : mword 7)
                  (concat_vec (rs2  : mword 5)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec ('b"000"  : mword 3)
                           (concat_vec (rd  : mword 5) ('b"0110011"  : mword 7))))))
    | RTYPE (rs2, rs1, rd, RISCV_SRA) =>
       returnm (concat_vec ('b"0100000"  : mword 7)
                  (concat_vec (rs2  : mword 5)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec ('b"101"  : mword 3)
                           (concat_vec (rd  : mword 5) ('b"0110011"  : mword 7))))))
    | LOAD (imm, rs1, rd, is_unsigned, size, false, false) =>
       (if sumbool_of_bool
          (orb (Z.ltb (projT1 (word_width_bytes size)) 8)
             (andb (negb is_unsigned) ((Z.leb (projT1 (word_width_bytes size)) 8)  : bool))) then
          returnm (concat_vec (imm  : mword 12)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec (bool_bits_forwards is_unsigned)
                           (concat_vec (size_bits_forwards size)
                              (concat_vec (rd  : mword 5) ('b"0000011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | STORE (v__6, rs2, rs1, size, false, false) =>
       (if sumbool_of_bool (Z.leb (projT1 (word_width_bytes size)) 8) then
          let imm7 : bits 7 := subrange_vec_dec v__6 11 5 in
          let imm7 : bits 7 := subrange_vec_dec v__6 11 5 in
          let imm5 : bits 5 := subrange_vec_dec v__6 4 0 in
          returnm (concat_vec (imm7  : bits 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"0"  : mword 1)
                              (concat_vec (size_bits_forwards size)
                                 (concat_vec (imm5  : bits 5) ('b"0100011"  : mword 7)))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | ADDIW (imm, rs1, rd) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          returnm (concat_vec (imm  : mword 12)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec ('b"000"  : mword 3)
                           (concat_vec (rd  : mword 5) ('b"0011011"  : mword 7)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | SHIFTW (shamt, rs1, rd, RISCV_SLLI) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          returnm (concat_vec ('b"0000000"  : mword 7)
                     (concat_vec (shamt  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"001"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"0011011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | SHIFTW (shamt, rs1, rd, RISCV_SRLI) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          returnm (concat_vec ('b"0000000"  : mword 7)
                     (concat_vec (shamt  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"101"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"0011011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | SHIFTW (shamt, rs1, rd, RISCV_SRAI) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          returnm (concat_vec ('b"0100000"  : mword 7)
                     (concat_vec (shamt  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"101"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"0011011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | RTYPEW (rs2, rs1, rd, RISCV_ADDW) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          returnm (concat_vec ('b"0000000"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"000"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"0111011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | RTYPEW (rs2, rs1, rd, RISCV_SUBW) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          returnm (concat_vec ('b"0100000"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"000"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"0111011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | RTYPEW (rs2, rs1, rd, RISCV_SLLW) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          returnm (concat_vec ('b"0000000"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"001"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"0111011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | RTYPEW (rs2, rs1, rd, RISCV_SRLW) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          returnm (concat_vec ('b"0000000"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"101"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"0111011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | RTYPEW (rs2, rs1, rd, RISCV_SRAW) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          returnm (concat_vec ('b"0100000"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"101"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"0111011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | SHIFTIWOP (shamt, rs1, rd, RISCV_SLLIW) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          returnm (concat_vec ('b"0000000"  : mword 7)
                     (concat_vec (shamt  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"001"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"0011011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | SHIFTIWOP (shamt, rs1, rd, RISCV_SRLIW) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          returnm (concat_vec ('b"0000000"  : mword 7)
                     (concat_vec (shamt  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"101"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"0011011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | SHIFTIWOP (shamt, rs1, rd, RISCV_SRAIW) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          returnm (concat_vec ('b"0100000"  : mword 7)
                     (concat_vec (shamt  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"101"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"0011011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | FENCE (pred, succ) =>
       returnm (concat_vec (Ox"0"  : mword 4)
                  (concat_vec (pred  : mword 4)
                     (concat_vec (succ  : mword 4)
                        (concat_vec ('b"00000"  : mword 5)
                           (concat_vec ('b"000"  : mword 3)
                              (concat_vec ('b"00000"  : mword 5) ('b"0001111"  : mword 7)))))))
    | FENCE_TSO (pred, succ) =>
       returnm (concat_vec (Ox"8"  : mword 4)
                  (concat_vec (pred  : mword 4)
                     (concat_vec (succ  : mword 4)
                        (concat_vec ('b"00000"  : mword 5)
                           (concat_vec ('b"000"  : mword 3)
                              (concat_vec ('b"00000"  : mword 5) ('b"0001111"  : mword 7)))))))
    | FENCEI tt =>
       returnm (concat_vec (Ox"000"  : mword 12)
                  (concat_vec ('b"00000"  : mword 5)
                     (concat_vec ('b"001"  : mword 3)
                        (concat_vec ('b"00000"  : mword 5) ('b"0001111"  : mword 7)))))
    | ECALL tt =>
       returnm (concat_vec (Ox"000"  : mword 12)
                  (concat_vec ('b"00000"  : mword 5)
                     (concat_vec ('b"000"  : mword 3)
                        (concat_vec ('b"00000"  : mword 5) ('b"1110011"  : mword 7)))))
    | MRET tt =>
       returnm (concat_vec ('b"0011000"  : mword 7)
                  (concat_vec ('b"00010"  : mword 5)
                     (concat_vec ('b"00000"  : mword 5)
                        (concat_vec ('b"000"  : mword 3)
                           (concat_vec ('b"00000"  : mword 5) ('b"1110011"  : mword 7))))))
    | SRET tt =>
       returnm (concat_vec ('b"0001000"  : mword 7)
                  (concat_vec ('b"00010"  : mword 5)
                     (concat_vec ('b"00000"  : mword 5)
                        (concat_vec ('b"000"  : mword 3)
                           (concat_vec ('b"00000"  : mword 5) ('b"1110011"  : mword 7))))))
    | EBREAK tt =>
       returnm (concat_vec (Ox"001"  : mword 12)
                  (concat_vec ('b"00000"  : mword 5)
                     (concat_vec ('b"000"  : mword 3)
                        (concat_vec ('b"00000"  : mword 5) ('b"1110011"  : mword 7)))))
    | WFI tt =>
       returnm (concat_vec (Ox"105"  : mword 12)
                  (concat_vec ('b"00000"  : mword 5)
                     (concat_vec ('b"000"  : mword 3)
                        (concat_vec ('b"00000"  : mword 5) ('b"1110011"  : mword 7)))))
    | SFENCE_VMA (rs1, rs2) =>
       returnm (concat_vec ('b"0001001"  : mword 7)
                  (concat_vec (rs2  : mword 5)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec ('b"000"  : mword 3)
                           (concat_vec ('b"00000"  : mword 5) ('b"1110011"  : mword 7))))))
    | LOADRES (aq, rl, rs1, size, rd) =>
       (if amo_width_valid size then
          returnm (concat_vec ('b"00010"  : mword 5)
                     (concat_vec (bool_bits_forwards aq)
                        (concat_vec (bool_bits_forwards rl)
                           (concat_vec ('b"00000"  : mword 5)
                              (concat_vec (rs1  : mword 5)
                                 (concat_vec ('b"0"  : mword 1)
                                    (concat_vec (size_bits_forwards size)
                                       (concat_vec (rd  : mword 5) ('b"0101111"  : mword 7)))))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | STORECON (aq, rl, rs2, rs1, size, rd) =>
       (if amo_width_valid size then
          returnm (concat_vec ('b"00011"  : mword 5)
                     (concat_vec (bool_bits_forwards aq)
                        (concat_vec (bool_bits_forwards rl)
                           (concat_vec (rs2  : mword 5)
                              (concat_vec (rs1  : mword 5)
                                 (concat_vec ('b"0"  : mword 1)
                                    (concat_vec (size_bits_forwards size)
                                       (concat_vec (rd  : mword 5) ('b"0101111"  : mword 7)))))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | AMO (op, aq, rl, rs2, rs1, size, rd) =>
       (if amo_width_valid size then
          returnm (concat_vec (encdec_amoop_forwards op)
                     (concat_vec (bool_bits_forwards aq)
                        (concat_vec (bool_bits_forwards rl)
                           (concat_vec (rs2  : mword 5)
                              (concat_vec (rs1  : mword 5)
                                 (concat_vec ('b"0"  : mword 1)
                                    (concat_vec (size_bits_forwards size)
                                       (concat_vec (rd  : mword 5) ('b"0101111"  : mword 7)))))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | MUL (rs2, rs1, rd, high, signed1, signed2) =>
       (encdec_mul_op_forwards (high, signed1, signed2)) >>= fun w__38 : mword 3 =>
       returnm (concat_vec ('b"0000001"  : mword 7)
                  (concat_vec (rs2  : mword 5)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec (w__38  : bits 3)
                           (concat_vec (rd  : mword 5) ('b"0110011"  : mword 7))))))
    | DIV (rs2, rs1, rd, s) =>
       returnm (concat_vec ('b"0000001"  : mword 7)
                  (concat_vec (rs2  : mword 5)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec ('b"10"  : mword 2)
                           (concat_vec (bool_not_bits_forwards s)
                              (concat_vec (rd  : mword 5) ('b"0110011"  : mword 7)))))))
    | REM (rs2, rs1, rd, s) =>
       returnm (concat_vec ('b"0000001"  : mword 7)
                  (concat_vec (rs2  : mword 5)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec ('b"11"  : mword 2)
                           (concat_vec (bool_not_bits_forwards s)
                              (concat_vec (rd  : mword 5) ('b"0110011"  : mword 7)))))))
    | MULW (rs2, rs1, rd) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          returnm (concat_vec ('b"0000001"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"000"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"0111011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | DIVW (rs2, rs1, rd, s) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          returnm (concat_vec ('b"0000001"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"10"  : mword 2)
                              (concat_vec (bool_not_bits_forwards s)
                                 (concat_vec (rd  : mword 5) ('b"0111011"  : mword 7)))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | REMW (rs2, rs1, rd, s) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          returnm (concat_vec ('b"0000001"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"11"  : mword 2)
                              (concat_vec (bool_not_bits_forwards s)
                                 (concat_vec (rd  : mword 5) ('b"0111011"  : mword 7)))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | CSR (csr, rs1, rd, is_imm, op) =>
       returnm (concat_vec (csr  : mword 12)
                  (concat_vec (rs1  : mword 5)
                     (concat_vec (bool_bits_forwards is_imm)
                        (concat_vec (encdec_csrop_forwards op)
                           (concat_vec (rd  : mword 5) ('b"1110011"  : mword 7))))))
    | URET tt =>
       returnm (concat_vec ('b"0000000"  : mword 7)
                  (concat_vec ('b"00010"  : mword 5)
                     (concat_vec ('b"00000"  : mword 5)
                        (concat_vec ('b"000"  : mword 3)
                           (concat_vec ('b"00000"  : mword 5) ('b"1110011"  : mword 7))))))
    | FENCE_RESERVED (fm, pred, succ, rs, rd) =>
       (if orb (andb (neq_vec fm (Ox"0"  : mword 4)) (neq_vec fm (Ox"8"  : mword 4)))
             (orb (neq_vec rs ('b"00000"  : mword 5)) (neq_vec rd ('b"00000"  : mword 5))) then
          returnm (concat_vec (fm  : bits 4)
                     (concat_vec (pred  : bits 4)
                        (concat_vec (succ  : bits 4)
                           (concat_vec (rs  : regidx)
                              (concat_vec ('b"000"  : mword 3)
                                 (concat_vec (rd  : regidx) ('b"0001111"  : mword 7)))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | FENCEI_RESERVED (imm, rs, rd) =>
       (if orb (neq_vec imm (Ox"000"  : mword 12)) (orb (neq_vec rs zreg) (neq_vec rd zreg)) then
          returnm (concat_vec (imm  : bits 12)
                     (concat_vec (rs  : regidx)
                        (concat_vec ('b"001"  : mword 3)
                           (concat_vec (rd  : regidx) ('b"0001111"  : mword 7)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | LOAD_FP (imm, rs1, rd, WORD) =>
       (is_RV32F_or_RV64F tt) >>= fun w__49 : bool =>
       (if sumbool_of_bool w__49 then
          returnm (concat_vec (imm  : mword 12)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec ('b"010"  : mword 3)
                           (concat_vec (rd  : mword 5) ('b"0000111"  : mword 7)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | LOAD_FP (imm, rs1, rd, DOUBLE) =>
       (is_RV32D_or_RV64D tt) >>= fun w__52 : bool =>
       (if sumbool_of_bool w__52 then
          returnm (concat_vec (imm  : mword 12)
                     (concat_vec (rs1  : mword 5)
                        (concat_vec ('b"011"  : mword 3)
                           (concat_vec (rd  : mword 5) ('b"0000111"  : mword 7)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | STORE_FP (v__7, rs2, rs1, WORD) =>
       (is_RV32F_or_RV64F tt) >>= fun w__55 : bool =>
       (if sumbool_of_bool w__55 then
          let imm7 : bits 7 := subrange_vec_dec v__7 11 5 in
          let imm7 : bits 7 := subrange_vec_dec v__7 11 5 in
          let imm5 : bits 5 := subrange_vec_dec v__7 4 0 in
          returnm (concat_vec (imm7  : bits 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"010"  : mword 3)
                              (concat_vec (imm5  : bits 5) ('b"0100111"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | STORE_FP (v__8, rs2, rs1, DOUBLE) =>
       (is_RV32D_or_RV64D tt) >>= fun w__58 : bool =>
       (if sumbool_of_bool w__58 then
          let imm7 : bits 7 := subrange_vec_dec v__8 11 5 in
          let imm7 : bits 7 := subrange_vec_dec v__8 11 5 in
          let imm5 : bits 5 := subrange_vec_dec v__8 4 0 in
          returnm (concat_vec (imm7  : bits 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"011"  : mword 3)
                              (concat_vec (imm5  : bits 5) ('b"0100111"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_MADD_TYPE_S (rs3, rs2, rs1, rm, rd, FMADD_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__61 : bool =>
       (if sumbool_of_bool w__61 then
          returnm (concat_vec (rs3  : mword 5)
                     (concat_vec ('b"00"  : mword 2)
                        (concat_vec (rs2  : mword 5)
                           (concat_vec (rs1  : mword 5)
                              (concat_vec (encdec_rounding_mode_forwards rm)
                                 (concat_vec (rd  : mword 5) ('b"1000011"  : mword 7)))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_MADD_TYPE_S (rs3, rs2, rs1, rm, rd, FMSUB_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__64 : bool =>
       (if sumbool_of_bool w__64 then
          returnm (concat_vec (rs3  : mword 5)
                     (concat_vec ('b"00"  : mword 2)
                        (concat_vec (rs2  : mword 5)
                           (concat_vec (rs1  : mword 5)
                              (concat_vec (encdec_rounding_mode_forwards rm)
                                 (concat_vec (rd  : mword 5) ('b"1000111"  : mword 7)))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_MADD_TYPE_S (rs3, rs2, rs1, rm, rd, FNMSUB_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__67 : bool =>
       (if sumbool_of_bool w__67 then
          returnm (concat_vec (rs3  : mword 5)
                     (concat_vec ('b"00"  : mword 2)
                        (concat_vec (rs2  : mword 5)
                           (concat_vec (rs1  : mword 5)
                              (concat_vec (encdec_rounding_mode_forwards rm)
                                 (concat_vec (rd  : mword 5) ('b"1001011"  : mword 7)))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_MADD_TYPE_S (rs3, rs2, rs1, rm, rd, FNMADD_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__70 : bool =>
       (if sumbool_of_bool w__70 then
          returnm (concat_vec (rs3  : mword 5)
                     (concat_vec ('b"00"  : mword 2)
                        (concat_vec (rs2  : mword 5)
                           (concat_vec (rs1  : mword 5)
                              (concat_vec (encdec_rounding_mode_forwards rm)
                                 (concat_vec (rd  : mword 5) ('b"1001111"  : mword 7)))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_RM_TYPE_S (rs2, rs1, rm, rd, FADD_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__73 : bool =>
       (if sumbool_of_bool w__73 then
          returnm (concat_vec ('b"0000000"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_RM_TYPE_S (rs2, rs1, rm, rd, FSUB_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__76 : bool =>
       (if sumbool_of_bool w__76 then
          returnm (concat_vec ('b"0000100"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_RM_TYPE_S (rs2, rs1, rm, rd, FMUL_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__79 : bool =>
       (if sumbool_of_bool w__79 then
          returnm (concat_vec ('b"0001000"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_RM_TYPE_S (rs2, rs1, rm, rd, FDIV_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__82 : bool =>
       (if sumbool_of_bool w__82 then
          returnm (concat_vec ('b"0001100"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_RM_TYPE_S (rs1, rm, rd, FSQRT_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__85 : bool =>
       (if sumbool_of_bool w__85 then
          returnm (concat_vec ('b"0101100"  : mword 7)
                     (concat_vec ('b"00000"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_W_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__88 : bool =>
       (if sumbool_of_bool w__88 then
          returnm (concat_vec ('b"1100000"  : mword 7)
                     (concat_vec ('b"00000"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_WU_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__91 : bool =>
       (if sumbool_of_bool w__91 then
          returnm (concat_vec ('b"1100000"  : mword 7)
                     (concat_vec ('b"00001"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_W) =>
       (is_RV32F_or_RV64F tt) >>= fun w__94 : bool =>
       (if sumbool_of_bool w__94 then
          returnm (concat_vec ('b"1101000"  : mword 7)
                     (concat_vec ('b"00000"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_WU) =>
       (is_RV32F_or_RV64F tt) >>= fun w__97 : bool =>
       (if sumbool_of_bool w__97 then
          returnm (concat_vec ('b"1101000"  : mword 7)
                     (concat_vec ('b"00001"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_L_S) =>
       (is_RV64F tt) >>= fun w__100 : bool =>
       (if sumbool_of_bool w__100 then
          returnm (concat_vec ('b"1100000"  : mword 7)
                     (concat_vec ('b"00010"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_LU_S) =>
       (is_RV64F tt) >>= fun w__103 : bool =>
       (if sumbool_of_bool w__103 then
          returnm (concat_vec ('b"1100000"  : mword 7)
                     (concat_vec ('b"00011"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_L) =>
       (is_RV64F tt) >>= fun w__106 : bool =>
       (if sumbool_of_bool w__106 then
          returnm (concat_vec ('b"1101000"  : mword 7)
                     (concat_vec ('b"00010"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_LU) =>
       (is_RV64F tt) >>= fun w__109 : bool =>
       (if sumbool_of_bool w__109 then
          returnm (concat_vec ('b"1101000"  : mword 7)
                     (concat_vec ('b"00011"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_TYPE_S (rs2, rs1, rd, FSGNJ_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__112 : bool =>
       (if sumbool_of_bool w__112 then
          returnm (concat_vec ('b"0010000"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"000"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_TYPE_S (rs2, rs1, rd, FSGNJN_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__115 : bool =>
       (if sumbool_of_bool w__115 then
          returnm (concat_vec ('b"0010000"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"001"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_TYPE_S (rs2, rs1, rd, FSGNJX_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__118 : bool =>
       (if sumbool_of_bool w__118 then
          returnm (concat_vec ('b"0010000"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"010"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_TYPE_S (rs2, rs1, rd, FMIN_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__121 : bool =>
       (if sumbool_of_bool w__121 then
          returnm (concat_vec ('b"0010100"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"000"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_TYPE_S (rs2, rs1, rd, FMAX_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__124 : bool =>
       (if sumbool_of_bool w__124 then
          returnm (concat_vec ('b"0010100"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"001"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_TYPE_S (rs2, rs1, rd, FEQ_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__127 : bool =>
       (if sumbool_of_bool w__127 then
          returnm (concat_vec ('b"1010000"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"010"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_TYPE_S (rs2, rs1, rd, FLT_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__130 : bool =>
       (if sumbool_of_bool w__130 then
          returnm (concat_vec ('b"1010000"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"001"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_TYPE_S (rs2, rs1, rd, FLE_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__133 : bool =>
       (if sumbool_of_bool w__133 then
          returnm (concat_vec ('b"1010000"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"000"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_TYPE_S (rs1, rd, FCLASS_S) =>
       (haveFExt tt) >>= fun w__136 : bool =>
       (if sumbool_of_bool w__136 then
          returnm (concat_vec ('b"1110000"  : mword 7)
                     (concat_vec ('b"00000"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"001"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_TYPE_S (rs1, rd, FMV_X_W) =>
       (haveFExt tt) >>= fun w__139 : bool =>
       (if sumbool_of_bool w__139 then
          returnm (concat_vec ('b"1110000"  : mword 7)
                     (concat_vec ('b"00000"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"000"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_TYPE_S (rs1, rd, FMV_W_X) =>
       (haveFExt tt) >>= fun w__142 : bool =>
       (if sumbool_of_bool w__142 then
          returnm (concat_vec ('b"1111000"  : mword 7)
                     (concat_vec ('b"00000"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"000"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_MADD_TYPE_D (rs3, rs2, rs1, rm, rd, FMADD_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__145 : bool =>
       (if sumbool_of_bool w__145 then
          returnm (concat_vec (rs3  : mword 5)
                     (concat_vec ('b"01"  : mword 2)
                        (concat_vec (rs2  : mword 5)
                           (concat_vec (rs1  : mword 5)
                              (concat_vec (encdec_rounding_mode_forwards rm)
                                 (concat_vec (rd  : mword 5) ('b"1000011"  : mword 7)))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_MADD_TYPE_D (rs3, rs2, rs1, rm, rd, FMSUB_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__148 : bool =>
       (if sumbool_of_bool w__148 then
          returnm (concat_vec (rs3  : mword 5)
                     (concat_vec ('b"01"  : mword 2)
                        (concat_vec (rs2  : mword 5)
                           (concat_vec (rs1  : mword 5)
                              (concat_vec (encdec_rounding_mode_forwards rm)
                                 (concat_vec (rd  : mword 5) ('b"1000111"  : mword 7)))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_MADD_TYPE_D (rs3, rs2, rs1, rm, rd, FNMSUB_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__151 : bool =>
       (if sumbool_of_bool w__151 then
          returnm (concat_vec (rs3  : mword 5)
                     (concat_vec ('b"01"  : mword 2)
                        (concat_vec (rs2  : mword 5)
                           (concat_vec (rs1  : mword 5)
                              (concat_vec (encdec_rounding_mode_forwards rm)
                                 (concat_vec (rd  : mword 5) ('b"1001011"  : mword 7)))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_MADD_TYPE_D (rs3, rs2, rs1, rm, rd, FNMADD_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__154 : bool =>
       (if sumbool_of_bool w__154 then
          returnm (concat_vec (rs3  : mword 5)
                     (concat_vec ('b"01"  : mword 2)
                        (concat_vec (rs2  : mword 5)
                           (concat_vec (rs1  : mword 5)
                              (concat_vec (encdec_rounding_mode_forwards rm)
                                 (concat_vec (rd  : mword 5) ('b"1001111"  : mword 7)))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_RM_TYPE_D (rs2, rs1, rm, rd, FADD_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__157 : bool =>
       (if sumbool_of_bool w__157 then
          returnm (concat_vec ('b"0000001"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_RM_TYPE_D (rs2, rs1, rm, rd, FSUB_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__160 : bool =>
       (if sumbool_of_bool w__160 then
          returnm (concat_vec ('b"0000101"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_RM_TYPE_D (rs2, rs1, rm, rd, FMUL_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__163 : bool =>
       (if sumbool_of_bool w__163 then
          returnm (concat_vec ('b"0001001"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_RM_TYPE_D (rs2, rs1, rm, rd, FDIV_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__166 : bool =>
       (if sumbool_of_bool w__166 then
          returnm (concat_vec ('b"0001101"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FSQRT_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__169 : bool =>
       (if sumbool_of_bool w__169 then
          returnm (concat_vec ('b"0101101"  : mword 7)
                     (concat_vec ('b"00000"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_W_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__172 : bool =>
       (if sumbool_of_bool w__172 then
          returnm (concat_vec ('b"1100001"  : mword 7)
                     (concat_vec ('b"00000"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_WU_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__175 : bool =>
       (if sumbool_of_bool w__175 then
          returnm (concat_vec ('b"1100001"  : mword 7)
                     (concat_vec ('b"00001"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_W) =>
       (is_RV32D_or_RV64D tt) >>= fun w__178 : bool =>
       (if sumbool_of_bool w__178 then
          returnm (concat_vec ('b"1101001"  : mword 7)
                     (concat_vec ('b"00000"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_WU) =>
       (is_RV32D_or_RV64D tt) >>= fun w__181 : bool =>
       (if sumbool_of_bool w__181 then
          returnm (concat_vec ('b"1101001"  : mword 7)
                     (concat_vec ('b"00001"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_S_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__184 : bool =>
       (if sumbool_of_bool w__184 then
          returnm (concat_vec ('b"0100000"  : mword 7)
                     (concat_vec ('b"00001"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_S) =>
       (is_RV32D_or_RV64D tt) >>= fun w__187 : bool =>
       (if sumbool_of_bool w__187 then
          returnm (concat_vec ('b"0100001"  : mword 7)
                     (concat_vec ('b"00000"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_L_D) =>
       (is_RV64D tt) >>= fun w__190 : bool =>
       (if sumbool_of_bool w__190 then
          returnm (concat_vec ('b"1100001"  : mword 7)
                     (concat_vec ('b"00010"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_LU_D) =>
       (is_RV64D tt) >>= fun w__193 : bool =>
       (if sumbool_of_bool w__193 then
          returnm (concat_vec ('b"1100001"  : mword 7)
                     (concat_vec ('b"00011"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_L) =>
       (is_RV64D tt) >>= fun w__196 : bool =>
       (if sumbool_of_bool w__196 then
          returnm (concat_vec ('b"1101001"  : mword 7)
                     (concat_vec ('b"00010"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_LU) =>
       (is_RV64D tt) >>= fun w__199 : bool =>
       (if sumbool_of_bool w__199 then
          returnm (concat_vec ('b"1101001"  : mword 7)
                     (concat_vec ('b"00011"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec (encdec_rounding_mode_forwards rm)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_TYPE_D (rs2, rs1, rd, FSGNJ_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__202 : bool =>
       (if sumbool_of_bool w__202 then
          returnm (concat_vec ('b"0010001"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"000"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_TYPE_D (rs2, rs1, rd, FSGNJN_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__205 : bool =>
       (if sumbool_of_bool w__205 then
          returnm (concat_vec ('b"0010001"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"001"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_TYPE_D (rs2, rs1, rd, FSGNJX_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__208 : bool =>
       (if sumbool_of_bool w__208 then
          returnm (concat_vec ('b"0010001"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"010"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_TYPE_D (rs2, rs1, rd, FMIN_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__211 : bool =>
       (if sumbool_of_bool w__211 then
          returnm (concat_vec ('b"0010101"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"000"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_TYPE_D (rs2, rs1, rd, FMAX_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__214 : bool =>
       (if sumbool_of_bool w__214 then
          returnm (concat_vec ('b"0010101"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"001"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_TYPE_D (rs2, rs1, rd, FEQ_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__217 : bool =>
       (if sumbool_of_bool w__217 then
          returnm (concat_vec ('b"1010001"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"010"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_TYPE_D (rs2, rs1, rd, FLT_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__220 : bool =>
       (if sumbool_of_bool w__220 then
          returnm (concat_vec ('b"1010001"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"001"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_BIN_TYPE_D (rs2, rs1, rd, FLE_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__223 : bool =>
       (if sumbool_of_bool w__223 then
          returnm (concat_vec ('b"1010001"  : mword 7)
                     (concat_vec (rs2  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"000"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_TYPE_D (rs1, rd, FCLASS_D) =>
       (haveDExt tt) >>= fun w__226 : bool =>
       (if sumbool_of_bool w__226 then
          returnm (concat_vec ('b"1110001"  : mword 7)
                     (concat_vec ('b"00000"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"001"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_TYPE_D (rs1, rd, FMV_X_D) =>
       (is_RV64D tt) >>= fun w__229 : bool =>
       (if sumbool_of_bool w__229 then
          returnm (concat_vec ('b"1110001"  : mword 7)
                     (concat_vec ('b"00000"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"000"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | F_UN_TYPE_D (rs1, rd, FMV_D_X) =>
       (is_RV64D tt) >>= fun w__232 : bool =>
       (if sumbool_of_bool w__232 then
          returnm (concat_vec ('b"1111001"  : mword 7)
                     (concat_vec ('b"00000"  : mword 5)
                        (concat_vec (rs1  : mword 5)
                           (concat_vec ('b"000"  : mword 3)
                              (concat_vec (rd  : mword 5) ('b"1010011"  : mword 7))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 32)
    | ILLEGAL s => returnm s
    | _ => assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt
    end)
    : M (mword 32).

Definition encdec_backwards (arg_ : mword 32) : M (ast) :=
   let v__9 := arg_ in
   (if let _mappingpatterns_59_ : mword 7 := subrange_vec_dec v__9 6 0 in
      encdec_uop_backwards_matches _mappingpatterns_59_ then
      let imm : mword 20 := subrange_vec_dec v__9 31 12 in
      let rd : mword 5 := subrange_vec_dec v__9 11 7 in
      let imm : mword 20 := subrange_vec_dec v__9 31 12 in
      let _mappingpatterns_59_ : mword 7 := subrange_vec_dec v__9 6 0 in
      (encdec_uop_backwards _mappingpatterns_59_) >>= fun op => returnm (UTYPE (imm, rd, op))
    else if eq_vec (subrange_vec_dec v__9 6 0) ('b"1101111"  : mword (6 - 0 + 1)) then
      let imm_19 : bits 1 := subrange_vec_dec v__9 31 31 in
      let rd : mword 5 := subrange_vec_dec v__9 11 7 in
      let imm_8 : bits 1 := subrange_vec_dec v__9 20 20 in
      let imm_7_0 : bits 8 := subrange_vec_dec v__9 19 12 in
      let imm_19 : bits 1 := subrange_vec_dec v__9 31 31 in
      let imm_18_13 : bits 6 := subrange_vec_dec v__9 30 25 in
      let imm_12_9 : bits 4 := subrange_vec_dec v__9 24 21 in
      returnm (RISCV_JAL
                 (concat_vec (imm_19  : bits 1)
                    (concat_vec (imm_7_0  : bits 8)
                       (concat_vec (imm_8  : bits 1)
                          (concat_vec (imm_18_13  : bits 6)
                             (concat_vec (imm_12_9  : bits 4) ('b"0"  : mword 1))))), rd))
    else if andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"000"  : mword (14 - 12 + 1)))
              (eq_vec (subrange_vec_dec v__9 6 0) ('b"1100111"  : mword (6 - 0 + 1))) then
      let imm : mword 12 := subrange_vec_dec v__9 31 20 in
      let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
      let rd : mword 5 := subrange_vec_dec v__9 11 7 in
      let imm : mword 12 := subrange_vec_dec v__9 31 20 in
      returnm (RISCV_JALR (imm, rs1, rd))
    else if andb
              (let _mappingpatterns_60_ : mword 3 := subrange_vec_dec v__9 14 12 in
              encdec_bop_backwards_matches _mappingpatterns_60_)
              (eq_vec (subrange_vec_dec v__9 6 0) ('b"1100011"  : mword (6 - 0 + 1))) then
      let imm7_6 : bits 1 := subrange_vec_dec v__9 31 31 in
      let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
      let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
      let imm7_6 : bits 1 := subrange_vec_dec v__9 31 31 in
      let imm7_5_0 : bits 6 := subrange_vec_dec v__9 30 25 in
      let imm5_4_1 : bits 4 := subrange_vec_dec v__9 11 8 in
      let imm5_0 : bits 1 := subrange_vec_dec v__9 7 7 in
      let _mappingpatterns_60_ : mword 3 := subrange_vec_dec v__9 14 12 in
      (encdec_bop_backwards _mappingpatterns_60_) >>= fun op =>
      returnm (BTYPE
                 (concat_vec (imm7_6  : bits 1)
                    (concat_vec (imm5_0  : bits 1)
                       (concat_vec (imm7_5_0  : bits 6)
                          (concat_vec (imm5_4_1  : bits 4) ('b"0"  : mword 1)))), rs2, rs1, op))
    else if andb
              (let _mappingpatterns_61_ : mword 3 := subrange_vec_dec v__9 14 12 in
              encdec_iop_backwards_matches _mappingpatterns_61_)
              (eq_vec (subrange_vec_dec v__9 6 0) ('b"0010011"  : mword (6 - 0 + 1))) then
      let imm : mword 12 := subrange_vec_dec v__9 31 20 in
      let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
      let rd : mword 5 := subrange_vec_dec v__9 11 7 in
      let imm : mword 12 := subrange_vec_dec v__9 31 20 in
      let _mappingpatterns_61_ : mword 3 := subrange_vec_dec v__9 14 12 in
      (encdec_iop_backwards _mappingpatterns_61_) >>= fun op => returnm (ITYPE (imm, rs1, rd, op))
    else if sumbool_of_bool
      (andb
         (let shamt : mword 6 := subrange_vec_dec v__9 25 20 in
         orb (Z.eqb 64 64) (eq_bit (access_vec_dec shamt 5) B0))
         (andb (eq_vec (subrange_vec_dec v__9 31 26) ('b"000000"  : mword (31 - 26 + 1)))
            (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"001"  : mword (14 - 12 + 1)))
               (eq_vec (subrange_vec_dec v__9 6 0) ('b"0010011"  : mword (6 - 0 + 1)))))) then
      let shamt : mword 6 := subrange_vec_dec v__9 25 20 in
      let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
      let rd : mword 5 := subrange_vec_dec v__9 11 7 in
      returnm (SHIFTIOP (shamt, rs1, rd, RISCV_SLLI))
    else if sumbool_of_bool
      (andb
         (let shamt : mword 6 := subrange_vec_dec v__9 25 20 in
         orb (Z.eqb 64 64) (eq_bit (access_vec_dec shamt 5) B0))
         (andb (eq_vec (subrange_vec_dec v__9 31 26) ('b"000000"  : mword (31 - 26 + 1)))
            (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"101"  : mword (14 - 12 + 1)))
               (eq_vec (subrange_vec_dec v__9 6 0) ('b"0010011"  : mword (6 - 0 + 1)))))) then
      let shamt : mword 6 := subrange_vec_dec v__9 25 20 in
      let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
      let rd : mword 5 := subrange_vec_dec v__9 11 7 in
      returnm (SHIFTIOP (shamt, rs1, rd, RISCV_SRLI))
    else if sumbool_of_bool
      (andb
         (let shamt : mword 6 := subrange_vec_dec v__9 25 20 in
         orb (Z.eqb 64 64) (eq_bit (access_vec_dec shamt 5) B0))
         (andb (eq_vec (subrange_vec_dec v__9 31 26) ('b"010000"  : mword (31 - 26 + 1)))
            (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"101"  : mword (14 - 12 + 1)))
               (eq_vec (subrange_vec_dec v__9 6 0) ('b"0010011"  : mword (6 - 0 + 1)))))) then
      let shamt : mword 6 := subrange_vec_dec v__9 25 20 in
      let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
      let rd : mword 5 := subrange_vec_dec v__9 11 7 in
      returnm (SHIFTIOP (shamt, rs1, rd, RISCV_SRAI))
    else if andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
              (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"000"  : mword (14 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__9 6 0) ('b"0110011"  : mword (6 - 0 + 1)))) then
      let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
      let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
      let rd : mword 5 := subrange_vec_dec v__9 11 7 in
      returnm (RTYPE (rs2, rs1, rd, RISCV_ADD))
    else if andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
              (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"010"  : mword (14 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__9 6 0) ('b"0110011"  : mword (6 - 0 + 1)))) then
      let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
      let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
      let rd : mword 5 := subrange_vec_dec v__9 11 7 in
      returnm (RTYPE (rs2, rs1, rd, RISCV_SLT))
    else if andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
              (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"011"  : mword (14 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__9 6 0) ('b"0110011"  : mword (6 - 0 + 1)))) then
      let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
      let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
      let rd : mword 5 := subrange_vec_dec v__9 11 7 in
      returnm (RTYPE (rs2, rs1, rd, RISCV_SLTU))
    else if andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
              (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"111"  : mword (14 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__9 6 0) ('b"0110011"  : mword (6 - 0 + 1)))) then
      let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
      let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
      let rd : mword 5 := subrange_vec_dec v__9 11 7 in
      returnm (RTYPE (rs2, rs1, rd, RISCV_AND))
    else if andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
              (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"110"  : mword (14 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__9 6 0) ('b"0110011"  : mword (6 - 0 + 1)))) then
      let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
      let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
      let rd : mword 5 := subrange_vec_dec v__9 11 7 in
      returnm (RTYPE (rs2, rs1, rd, RISCV_OR))
    else if andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
              (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"100"  : mword (14 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__9 6 0) ('b"0110011"  : mword (6 - 0 + 1)))) then
      let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
      let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
      let rd : mword 5 := subrange_vec_dec v__9 11 7 in
      returnm (RTYPE (rs2, rs1, rd, RISCV_XOR))
    else if andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
              (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"001"  : mword (14 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__9 6 0) ('b"0110011"  : mword (6 - 0 + 1)))) then
      let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
      let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
      let rd : mword 5 := subrange_vec_dec v__9 11 7 in
      returnm (RTYPE (rs2, rs1, rd, RISCV_SLL))
    else if andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
              (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"101"  : mword (14 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__9 6 0) ('b"0110011"  : mword (6 - 0 + 1)))) then
      let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
      let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
      let rd : mword 5 := subrange_vec_dec v__9 11 7 in
      returnm (RTYPE (rs2, rs1, rd, RISCV_SRL))
    else if andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0100000"  : mword (31 - 25 + 1)))
              (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"000"  : mword (14 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__9 6 0) ('b"0110011"  : mword (6 - 0 + 1)))) then
      let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
      let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
      let rd : mword 5 := subrange_vec_dec v__9 11 7 in
      returnm (RTYPE (rs2, rs1, rd, RISCV_SUB))
    else if andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0100000"  : mword (31 - 25 + 1)))
              (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"101"  : mword (14 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__9 6 0) ('b"0110011"  : mword (6 - 0 + 1)))) then
      let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
      let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
      let rd : mword 5 := subrange_vec_dec v__9 11 7 in
      returnm (RTYPE (rs2, rs1, rd, RISCV_SRA))
    else
      (and_boolM
         (let _mappingpatterns_63_ : mword 2 := subrange_vec_dec v__9 13 12 in
         let _mappingpatterns_62_ : mword 1 := subrange_vec_dec v__9 14 14 in
         (if size_bits_backwards_matches _mappingpatterns_63_ then
            (size_bits_backwards _mappingpatterns_63_) >>= fun size =>
            (if bool_bits_backwards_matches _mappingpatterns_62_ then
               (bool_bits_backwards _mappingpatterns_62_) >>= fun is_unsigned =>
               returnm ((orb (Z.ltb (projT1 (word_width_bytes size)) 8)
                           (andb (negb is_unsigned)
                              ((Z.leb (projT1 (word_width_bytes size)) 8)
                               : bool)))
                : bool)
             else returnm false)
             : M (bool)
          else returnm false)
          : M (bool))
         (returnm ((eq_vec (subrange_vec_dec v__9 6 0) ('b"0000011"  : mword (6 - 0 + 1)))  : bool))) >>= fun w__2 : bool =>
      (if sumbool_of_bool w__2 then
         let imm : mword 12 := subrange_vec_dec v__9 31 20 in
         let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
         let rd : mword 5 := subrange_vec_dec v__9 11 7 in
         let imm : mword 12 := subrange_vec_dec v__9 31 20 in
         let _mappingpatterns_63_ : mword 2 := subrange_vec_dec v__9 13 12 in
         let _mappingpatterns_62_ : mword 1 := subrange_vec_dec v__9 14 14 in
         (size_bits_backwards _mappingpatterns_63_) >>= fun size =>
         (bool_bits_backwards _mappingpatterns_62_) >>= fun is_unsigned =>
         returnm (LOAD (imm, rs1, rd, is_unsigned, size, false, false))
       else
         (and_boolM
            (let _mappingpatterns_64_ : mword 2 := subrange_vec_dec v__9 13 12 in
            (if size_bits_backwards_matches _mappingpatterns_64_ then
               (size_bits_backwards _mappingpatterns_64_) >>= fun size =>
               returnm ((Z.leb (projT1 (word_width_bytes size)) 8)  : bool)
             else returnm false)
             : M (bool))
            (returnm ((andb (eq_vec (subrange_vec_dec v__9 14 14) ('b"0"  : mword (14 - 14 + 1)))
                         (eq_vec (subrange_vec_dec v__9 6 0) ('b"0100011"  : mword (6 - 0 + 1))))
              : bool))) >>= fun w__4 : bool =>
         (if sumbool_of_bool w__4 then
            let imm7 : bits 7 := subrange_vec_dec v__9 31 25 in
            let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
            let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
            let imm7 : bits 7 := subrange_vec_dec v__9 31 25 in
            let imm5 : bits 5 := subrange_vec_dec v__9 11 7 in
            let _mappingpatterns_64_ : mword 2 := subrange_vec_dec v__9 13 12 in
            (size_bits_backwards _mappingpatterns_64_) >>= fun size =>
            returnm (STORE
                       (concat_vec (imm7  : bits 7) (imm5  : bits 5), rs2, rs1, size, false, false))
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"000"  : mword (14 - 12 + 1)))
                  (eq_vec (subrange_vec_dec v__9 6 0) ('b"0011011"  : mword (6 - 0 + 1))))) then
            let imm : mword 12 := subrange_vec_dec v__9 31 20 in
            let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
            let rd : mword 5 := subrange_vec_dec v__9 11 7 in
            let imm : mword 12 := subrange_vec_dec v__9 31 20 in
            returnm (ADDIW (imm, rs1, rd))
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"001"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__9 6 0) ('b"0011011"  : mword (6 - 0 + 1)))))) then
            let shamt : mword 5 := subrange_vec_dec v__9 24 20 in
            let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
            let rd : mword 5 := subrange_vec_dec v__9 11 7 in
            returnm (SHIFTW (shamt, rs1, rd, RISCV_SLLI))
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"101"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__9 6 0) ('b"0011011"  : mword (6 - 0 + 1)))))) then
            let shamt : mword 5 := subrange_vec_dec v__9 24 20 in
            let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
            let rd : mword 5 := subrange_vec_dec v__9 11 7 in
            returnm (SHIFTW (shamt, rs1, rd, RISCV_SRLI))
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0100000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"101"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__9 6 0) ('b"0011011"  : mword (6 - 0 + 1)))))) then
            let shamt : mword 5 := subrange_vec_dec v__9 24 20 in
            let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
            let rd : mword 5 := subrange_vec_dec v__9 11 7 in
            returnm (SHIFTW (shamt, rs1, rd, RISCV_SRAI))
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"000"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__9 6 0) ('b"0111011"  : mword (6 - 0 + 1)))))) then
            let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
            let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
            let rd : mword 5 := subrange_vec_dec v__9 11 7 in
            returnm (RTYPEW (rs2, rs1, rd, RISCV_ADDW))
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0100000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"000"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__9 6 0) ('b"0111011"  : mword (6 - 0 + 1)))))) then
            let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
            let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
            let rd : mword 5 := subrange_vec_dec v__9 11 7 in
            returnm (RTYPEW (rs2, rs1, rd, RISCV_SUBW))
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"001"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__9 6 0) ('b"0111011"  : mword (6 - 0 + 1)))))) then
            let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
            let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
            let rd : mword 5 := subrange_vec_dec v__9 11 7 in
            returnm (RTYPEW (rs2, rs1, rd, RISCV_SLLW))
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"101"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__9 6 0) ('b"0111011"  : mword (6 - 0 + 1)))))) then
            let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
            let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
            let rd : mword 5 := subrange_vec_dec v__9 11 7 in
            returnm (RTYPEW (rs2, rs1, rd, RISCV_SRLW))
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0100000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"101"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__9 6 0) ('b"0111011"  : mword (6 - 0 + 1)))))) then
            let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
            let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
            let rd : mword 5 := subrange_vec_dec v__9 11 7 in
            returnm (RTYPEW (rs2, rs1, rd, RISCV_SRAW))
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"001"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__9 6 0) ('b"0011011"  : mword (6 - 0 + 1)))))) then
            let shamt : mword 5 := subrange_vec_dec v__9 24 20 in
            let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
            let rd : mword 5 := subrange_vec_dec v__9 11 7 in
            returnm (SHIFTIWOP (shamt, rs1, rd, RISCV_SLLIW))
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"101"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__9 6 0) ('b"0011011"  : mword (6 - 0 + 1)))))) then
            let shamt : mword 5 := subrange_vec_dec v__9 24 20 in
            let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
            let rd : mword 5 := subrange_vec_dec v__9 11 7 in
            returnm (SHIFTIWOP (shamt, rs1, rd, RISCV_SRLIW))
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0100000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__9 14 12) ('b"101"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__9 6 0) ('b"0011011"  : mword (6 - 0 + 1)))))) then
            let shamt : mword 5 := subrange_vec_dec v__9 24 20 in
            let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
            let rd : mword 5 := subrange_vec_dec v__9 11 7 in
            returnm (SHIFTIWOP (shamt, rs1, rd, RISCV_SRAIW))
          else if andb (eq_vec (subrange_vec_dec v__9 31 28) (Ox"0"  : mword (31 - 28 + 1)))
                    (eq_vec (subrange_vec_dec v__9 19 0) (Ox"0000F"  : mword (19 - 0 + 1))) then
            let succ : mword 4 := subrange_vec_dec v__9 23 20 in
            let pred : mword 4 := subrange_vec_dec v__9 27 24 in
            returnm (FENCE (pred, succ))
          else if andb (eq_vec (subrange_vec_dec v__9 31 28) (Ox"8"  : mword (31 - 28 + 1)))
                    (eq_vec (subrange_vec_dec v__9 19 0) (Ox"0000F"  : mword (19 - 0 + 1))) then
            let succ : mword 4 := subrange_vec_dec v__9 23 20 in
            let pred : mword 4 := subrange_vec_dec v__9 27 24 in
            returnm (FENCE_TSO (pred, succ))
          else if eq_vec v__9 (Ox"0000100F"  : mword 32) then returnm (FENCEI tt)
          else if eq_vec v__9 (Ox"00000073"  : mword 32) then returnm (ECALL tt)
          else if eq_vec v__9 (Ox"30200073"  : mword 32) then returnm (MRET tt)
          else if eq_vec v__9 (Ox"10200073"  : mword 32) then returnm (SRET tt)
          else if eq_vec v__9 (Ox"00100073"  : mword 32) then returnm (EBREAK tt)
          else if eq_vec v__9 (Ox"10500073"  : mword 32) then returnm (WFI tt)
          else if andb (eq_vec (subrange_vec_dec v__9 31 25) ('b"0001001"  : mword (31 - 25 + 1)))
                    (eq_vec (subrange_vec_dec v__9 14 0) ('b"000000001110011"  : mword (14 - 0 + 1)))
          then
            let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
            let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
            returnm (SFENCE_VMA (rs1, rs2))
          else
            (and_boolM
               (let _mappingpatterns_67_ : mword 2 := subrange_vec_dec v__9 13 12 in
               let _mappingpatterns_66_ : mword 1 := subrange_vec_dec v__9 25 25 in
               let _mappingpatterns_65_ : mword 1 := subrange_vec_dec v__9 26 26 in
               (if size_bits_backwards_matches _mappingpatterns_67_ then
                  (size_bits_backwards _mappingpatterns_67_) >>= fun size =>
                  (if bool_bits_backwards_matches _mappingpatterns_66_ then
                     (bool_bits_backwards _mappingpatterns_66_) >>= fun rl =>
                     (if bool_bits_backwards_matches _mappingpatterns_65_ then
                        (bool_bits_backwards _mappingpatterns_65_) >>= fun aq =>
                        returnm ((amo_width_valid size)  : bool)
                      else returnm false)
                      : M (bool)
                   else returnm false)
                   : M (bool)
                else returnm false)
                : M (bool))
               (returnm ((andb
                            (eq_vec (subrange_vec_dec v__9 31 27) ('b"00010"  : mword (31 - 27 + 1)))
                            (andb
                               (eq_vec (subrange_vec_dec v__9 24 20)
                                  ('b"00000"
                                   : mword (24 - 20 + 1)))
                               (andb
                                  (eq_vec (subrange_vec_dec v__9 14 14)
                                     ('b"0"
                                      : mword (14 - 14 + 1)))
                                  (eq_vec (subrange_vec_dec v__9 6 0)
                                     ('b"0101111"
                                      : mword (6 - 0 + 1))))))
                 : bool))) >>= fun w__8 : bool =>
            (if sumbool_of_bool w__8 then
               let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
               let rd : mword 5 := subrange_vec_dec v__9 11 7 in
               let _mappingpatterns_67_ : mword 2 := subrange_vec_dec v__9 13 12 in
               let _mappingpatterns_66_ : mword 1 := subrange_vec_dec v__9 25 25 in
               let _mappingpatterns_65_ : mword 1 := subrange_vec_dec v__9 26 26 in
               (size_bits_backwards _mappingpatterns_67_) >>= fun size =>
               (bool_bits_backwards _mappingpatterns_66_) >>= fun rl =>
               (bool_bits_backwards _mappingpatterns_65_) >>= fun aq =>
               returnm (LOADRES (aq, rl, rs1, size, rd))
             else
               (and_boolM
                  (let _mappingpatterns_70_ : mword 2 := subrange_vec_dec v__9 13 12 in
                  let _mappingpatterns_69_ : mword 1 := subrange_vec_dec v__9 25 25 in
                  let _mappingpatterns_68_ : mword 1 := subrange_vec_dec v__9 26 26 in
                  (if size_bits_backwards_matches _mappingpatterns_70_ then
                     (size_bits_backwards _mappingpatterns_70_) >>= fun size =>
                     (if bool_bits_backwards_matches _mappingpatterns_69_ then
                        (bool_bits_backwards _mappingpatterns_69_) >>= fun rl =>
                        (if bool_bits_backwards_matches _mappingpatterns_68_ then
                           (bool_bits_backwards _mappingpatterns_68_) >>= fun aq =>
                           returnm ((amo_width_valid size)  : bool)
                         else returnm false)
                         : M (bool)
                      else returnm false)
                      : M (bool)
                   else returnm false)
                   : M (bool))
                  (returnm ((andb
                               (eq_vec (subrange_vec_dec v__9 31 27)
                                  ('b"00011"
                                   : mword (31 - 27 + 1)))
                               (andb
                                  (eq_vec (subrange_vec_dec v__9 14 14)
                                     ('b"0"
                                      : mword (14 - 14 + 1)))
                                  (eq_vec (subrange_vec_dec v__9 6 0)
                                     ('b"0101111"
                                      : mword (6 - 0 + 1)))))
                    : bool))) >>= fun w__12 : bool =>
               (if sumbool_of_bool w__12 then
                  let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
                  let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
                  let rd : mword 5 := subrange_vec_dec v__9 11 7 in
                  let _mappingpatterns_70_ : mword 2 := subrange_vec_dec v__9 13 12 in
                  let _mappingpatterns_69_ : mword 1 := subrange_vec_dec v__9 25 25 in
                  let _mappingpatterns_68_ : mword 1 := subrange_vec_dec v__9 26 26 in
                  (size_bits_backwards _mappingpatterns_70_) >>= fun size =>
                  (bool_bits_backwards _mappingpatterns_69_) >>= fun rl =>
                  (bool_bits_backwards _mappingpatterns_68_) >>= fun aq =>
                  returnm (STORECON (aq, rl, rs2, rs1, size, rd))
                else
                  (and_boolM
                     (let _mappingpatterns_71_ : mword 5 := subrange_vec_dec v__9 31 27 in
                     let _mappingpatterns_74_ : mword 2 := subrange_vec_dec v__9 13 12 in
                     let _mappingpatterns_73_ : mword 1 := subrange_vec_dec v__9 25 25 in
                     let _mappingpatterns_72_ : mword 1 := subrange_vec_dec v__9 26 26 in
                     let _mappingpatterns_71_ : mword 5 := subrange_vec_dec v__9 31 27 in
                     (if size_bits_backwards_matches _mappingpatterns_74_ then
                        (size_bits_backwards _mappingpatterns_74_) >>= fun size =>
                        (if bool_bits_backwards_matches _mappingpatterns_73_ then
                           (bool_bits_backwards _mappingpatterns_73_) >>= fun rl =>
                           (if bool_bits_backwards_matches _mappingpatterns_72_ then
                              (bool_bits_backwards _mappingpatterns_72_) >>= fun aq =>
                              (if encdec_amoop_backwards_matches _mappingpatterns_71_ then
                                 (encdec_amoop_backwards _mappingpatterns_71_) >>= fun op =>
                                 returnm ((amo_width_valid size)  : bool)
                               else returnm false)
                               : M (bool)
                            else returnm false)
                            : M (bool)
                         else returnm false)
                         : M (bool)
                      else returnm false)
                      : M (bool))
                     (returnm ((andb
                                  (eq_vec (subrange_vec_dec v__9 14 14)
                                     ('b"0"
                                      : mword (14 - 14 + 1)))
                                  (eq_vec (subrange_vec_dec v__9 6 0)
                                     ('b"0101111"
                                      : mword (6 - 0 + 1))))
                       : bool))) >>= fun w__17 : bool =>
                  (if sumbool_of_bool w__17 then
                     let _mappingpatterns_71_ : mword 5 := subrange_vec_dec v__9 31 27 in
                     let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
                     let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
                     let rd : mword 5 := subrange_vec_dec v__9 11 7 in
                     let _mappingpatterns_74_ : mword 2 := subrange_vec_dec v__9 13 12 in
                     let _mappingpatterns_73_ : mword 1 := subrange_vec_dec v__9 25 25 in
                     let _mappingpatterns_72_ : mword 1 := subrange_vec_dec v__9 26 26 in
                     let _mappingpatterns_71_ : mword 5 := subrange_vec_dec v__9 31 27 in
                     (size_bits_backwards _mappingpatterns_74_) >>= fun size =>
                     (bool_bits_backwards _mappingpatterns_73_) >>= fun rl =>
                     (bool_bits_backwards _mappingpatterns_72_) >>= fun aq =>
                     (encdec_amoop_backwards _mappingpatterns_71_) >>= fun op =>
                     returnm (AMO (op, aq, rl, rs2, rs1, size, rd))
                   else if andb
                             (let _mappingpatterns_75_ : mword 3 := subrange_vec_dec v__9 14 12 in
                             encdec_mul_op_backwards_matches _mappingpatterns_75_)
                             (andb
                                (eq_vec (subrange_vec_dec v__9 31 25)
                                   ('b"0000001"
                                    : mword (31 - 25 + 1)))
                                (eq_vec (subrange_vec_dec v__9 6 0)
                                   ('b"0110011"
                                    : mword (6 - 0 + 1)))) then
                     let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
                     let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
                     let rd : mword 5 := subrange_vec_dec v__9 11 7 in
                     let _mappingpatterns_75_ : mword 3 := subrange_vec_dec v__9 14 12 in
                     (encdec_mul_op_backwards _mappingpatterns_75_) >>= fun '(high, signed1, signed2) =>
                     returnm (MUL (rs2, rs1, rd, high, signed1, signed2))
                   else if andb
                             (let _mappingpatterns_76_ : mword 1 := subrange_vec_dec v__9 12 12 in
                             bool_not_bits_backwards_matches _mappingpatterns_76_)
                             (andb
                                (eq_vec (subrange_vec_dec v__9 31 25)
                                   ('b"0000001"
                                    : mword (31 - 25 + 1)))
                                (andb
                                   (eq_vec (subrange_vec_dec v__9 14 13)
                                      ('b"10"
                                       : mword (14 - 13 + 1)))
                                   (eq_vec (subrange_vec_dec v__9 6 0)
                                      ('b"0110011"
                                       : mword (6 - 0 + 1))))) then
                     let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
                     let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
                     let rd : mword 5 := subrange_vec_dec v__9 11 7 in
                     let _mappingpatterns_76_ : mword 1 := subrange_vec_dec v__9 12 12 in
                     (bool_not_bits_backwards _mappingpatterns_76_) >>= fun s =>
                     returnm (DIV (rs2, rs1, rd, s))
                   else if andb
                             (let _mappingpatterns_77_ : mword 1 := subrange_vec_dec v__9 12 12 in
                             bool_not_bits_backwards_matches _mappingpatterns_77_)
                             (andb
                                (eq_vec (subrange_vec_dec v__9 31 25)
                                   ('b"0000001"
                                    : mword (31 - 25 + 1)))
                                (andb
                                   (eq_vec (subrange_vec_dec v__9 14 13)
                                      ('b"11"
                                       : mword (14 - 13 + 1)))
                                   (eq_vec (subrange_vec_dec v__9 6 0)
                                      ('b"0110011"
                                       : mword (6 - 0 + 1))))) then
                     let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
                     let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
                     let rd : mword 5 := subrange_vec_dec v__9 11 7 in
                     let _mappingpatterns_77_ : mword 1 := subrange_vec_dec v__9 12 12 in
                     (bool_not_bits_backwards _mappingpatterns_77_) >>= fun s =>
                     returnm (REM (rs2, rs1, rd, s))
                   else if sumbool_of_bool
                     (andb (Z.eqb 64 64)
                        (andb
                           (eq_vec (subrange_vec_dec v__9 31 25)
                              ('b"0000001"
                               : mword (31 - 25 + 1)))
                           (andb
                              (eq_vec (subrange_vec_dec v__9 14 12) ('b"000"  : mword (14 - 12 + 1)))
                              (eq_vec (subrange_vec_dec v__9 6 0) ('b"0111011"  : mword (6 - 0 + 1))))))
                   then
                     let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
                     let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
                     let rd : mword 5 := subrange_vec_dec v__9 11 7 in
                     returnm (MULW (rs2, rs1, rd))
                   else
                     (and_boolM
                        (let _mappingpatterns_78_ : mword 1 := subrange_vec_dec v__9 12 12 in
                        (if bool_not_bits_backwards_matches _mappingpatterns_78_ then
                           (bool_not_bits_backwards _mappingpatterns_78_) >>= fun s =>
                           returnm ((Z.eqb 64 64)  : bool)
                         else returnm false)
                         : M (bool))
                        (returnm ((andb
                                     (eq_vec (subrange_vec_dec v__9 31 25)
                                        ('b"0000001"
                                         : mword (31 - 25 + 1)))
                                     (andb
                                        (eq_vec (subrange_vec_dec v__9 14 13)
                                           ('b"10"
                                            : mword (14 - 13 + 1)))
                                        (eq_vec (subrange_vec_dec v__9 6 0)
                                           ('b"0111011"
                                            : mword (6 - 0 + 1)))))
                          : bool))) >>= fun w__19 : bool =>
                     (if sumbool_of_bool w__19 then
                        let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
                        let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
                        let rd : mword 5 := subrange_vec_dec v__9 11 7 in
                        let _mappingpatterns_78_ : mword 1 := subrange_vec_dec v__9 12 12 in
                        (bool_not_bits_backwards _mappingpatterns_78_) >>= fun s =>
                        returnm (DIVW (rs2, rs1, rd, s))
                      else
                        (and_boolM
                           (let _mappingpatterns_79_ : mword 1 := subrange_vec_dec v__9 12 12 in
                           (if bool_not_bits_backwards_matches _mappingpatterns_79_ then
                              (bool_not_bits_backwards _mappingpatterns_79_) >>= fun s =>
                              returnm ((Z.eqb 64 64)  : bool)
                            else returnm false)
                            : M (bool))
                           (returnm ((andb
                                        (eq_vec (subrange_vec_dec v__9 31 25)
                                           ('b"0000001"
                                            : mword (31 - 25 + 1)))
                                        (andb
                                           (eq_vec (subrange_vec_dec v__9 14 13)
                                              ('b"11"
                                               : mword (14 - 13 + 1)))
                                           (eq_vec (subrange_vec_dec v__9 6 0)
                                              ('b"0111011"
                                               : mword (6 - 0 + 1)))))
                             : bool))) >>= fun w__21 : bool =>
                        (if sumbool_of_bool w__21 then
                           let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
                           let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
                           let rd : mword 5 := subrange_vec_dec v__9 11 7 in
                           let _mappingpatterns_79_ : mword 1 := subrange_vec_dec v__9 12 12 in
                           (bool_not_bits_backwards _mappingpatterns_79_) >>= fun s =>
                           returnm (REMW (rs2, rs1, rd, s))
                         else
                           (and_boolM
                              (let _mappingpatterns_81_ : mword 2 := subrange_vec_dec v__9 13 12 in
                              let _mappingpatterns_80_ : mword 1 := subrange_vec_dec v__9 14 14 in
                              (if encdec_csrop_backwards_matches _mappingpatterns_81_ then
                                 (encdec_csrop_backwards _mappingpatterns_81_) >>= fun op =>
                                 returnm ((bool_bits_backwards_matches _mappingpatterns_80_)
                                  : bool)
                               else returnm false)
                               : M (bool))
                              (returnm ((eq_vec (subrange_vec_dec v__9 6 0)
                                           ('b"1110011"
                                            : mword (6 - 0 + 1)))
                                : bool))) >>= fun w__23 : bool =>
                           (if sumbool_of_bool w__23 then
                              let csr : mword 12 := subrange_vec_dec v__9 31 20 in
                              let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
                              let rd : mword 5 := subrange_vec_dec v__9 11 7 in
                              let csr : mword 12 := subrange_vec_dec v__9 31 20 in
                              let _mappingpatterns_81_ : mword 2 := subrange_vec_dec v__9 13 12 in
                              let _mappingpatterns_80_ : mword 1 := subrange_vec_dec v__9 14 14 in
                              (encdec_csrop_backwards _mappingpatterns_81_) >>= fun op =>
                              (bool_bits_backwards _mappingpatterns_80_) >>= fun is_imm =>
                              returnm (CSR (csr, rs1, rd, is_imm, op))
                            else if eq_vec v__9 (Ox"00200073"  : mword 32) then returnm (URET tt)
                            else if andb
                                      (let fm : bits 4 := subrange_vec_dec v__9 31 28 in
                                      let rs : regidx := subrange_vec_dec v__9 19 15 in
                                      let rd : regidx := subrange_vec_dec v__9 11 7 in
                                      let fm : bits 4 := subrange_vec_dec v__9 31 28 in
                                      orb
                                        (andb (neq_vec fm (Ox"0"  : mword 4))
                                           (neq_vec fm (Ox"8"  : mword 4)))
                                        (orb (neq_vec rs ('b"00000"  : mword 5))
                                           (neq_vec rd ('b"00000"  : mword 5))))
                                      (andb
                                         (eq_vec (subrange_vec_dec v__9 14 12)
                                            ('b"000"
                                             : mword (14 - 12 + 1)))
                                         (eq_vec (subrange_vec_dec v__9 6 0)
                                            ('b"0001111"
                                             : mword (6 - 0 + 1)))) then
                              let fm : bits 4 := subrange_vec_dec v__9 31 28 in
                              let succ : bits 4 := subrange_vec_dec v__9 23 20 in
                              let rs : regidx := subrange_vec_dec v__9 19 15 in
                              let rd : regidx := subrange_vec_dec v__9 11 7 in
                              let pred : bits 4 := subrange_vec_dec v__9 27 24 in
                              let fm : bits 4 := subrange_vec_dec v__9 31 28 in
                              returnm (FENCE_RESERVED (fm, pred, succ, rs, rd))
                            else if andb
                                      (let imm : bits 12 := subrange_vec_dec v__9 31 20 in
                                      let rs : regidx := subrange_vec_dec v__9 19 15 in
                                      let rd : regidx := subrange_vec_dec v__9 11 7 in
                                      let imm : bits 12 := subrange_vec_dec v__9 31 20 in
                                      orb (neq_vec imm (Ox"000"  : mword 12))
                                        (orb (neq_vec rs zreg) (neq_vec rd zreg)))
                                      (andb
                                         (eq_vec (subrange_vec_dec v__9 14 12)
                                            ('b"001"
                                             : mword (14 - 12 + 1)))
                                         (eq_vec (subrange_vec_dec v__9 6 0)
                                            ('b"0001111"
                                             : mword (6 - 0 + 1)))) then
                              let imm : bits 12 := subrange_vec_dec v__9 31 20 in
                              let rs : regidx := subrange_vec_dec v__9 19 15 in
                              let rd : regidx := subrange_vec_dec v__9 11 7 in
                              let imm : bits 12 := subrange_vec_dec v__9 31 20 in
                              returnm (FENCEI_RESERVED (imm, rs, rd))
                            else
                              (and_boolM ((is_RV32F_or_RV64F tt)  : M (bool))
                                 (returnm ((andb
                                              (eq_vec (subrange_vec_dec v__9 14 12)
                                                 ('b"010"
                                                  : mword (14 - 12 + 1)))
                                              (eq_vec (subrange_vec_dec v__9 6 0)
                                                 ('b"0000111"
                                                  : mword (6 - 0 + 1))))
                                   : bool))) >>= fun w__25 : bool =>
                              (if sumbool_of_bool w__25 then
                                 let imm : mword 12 := subrange_vec_dec v__9 31 20 in
                                 let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
                                 let rd : mword 5 := subrange_vec_dec v__9 11 7 in
                                 let imm : mword 12 := subrange_vec_dec v__9 31 20 in
                                 returnm (LOAD_FP (imm, rs1, rd, WORD))
                               else
                                 (and_boolM ((is_RV32D_or_RV64D tt)  : M (bool))
                                    (returnm ((andb
                                                 (eq_vec (subrange_vec_dec v__9 14 12)
                                                    ('b"011"
                                                     : mword (14 - 12 + 1)))
                                                 (eq_vec (subrange_vec_dec v__9 6 0)
                                                    ('b"0000111"
                                                     : mword (6 - 0 + 1))))
                                      : bool))) >>= fun w__27 : bool =>
                                 (if sumbool_of_bool w__27 then
                                    let imm : mword 12 := subrange_vec_dec v__9 31 20 in
                                    let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
                                    let rd : mword 5 := subrange_vec_dec v__9 11 7 in
                                    let imm : mword 12 := subrange_vec_dec v__9 31 20 in
                                    returnm (LOAD_FP (imm, rs1, rd, DOUBLE))
                                  else
                                    (and_boolM ((is_RV32F_or_RV64F tt)  : M (bool))
                                       (returnm ((andb
                                                    (eq_vec (subrange_vec_dec v__9 14 12)
                                                       ('b"010"
                                                        : mword (14 - 12 + 1)))
                                                    (eq_vec (subrange_vec_dec v__9 6 0)
                                                       ('b"0100111"
                                                        : mword (6 - 0 + 1))))
                                         : bool))) >>= fun w__29 : bool =>
                                    (if sumbool_of_bool w__29 then
                                       let imm7 : bits 7 := subrange_vec_dec v__9 31 25 in
                                       let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
                                       let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
                                       let imm7 : bits 7 := subrange_vec_dec v__9 31 25 in
                                       let imm5 : bits 5 := subrange_vec_dec v__9 11 7 in
                                       returnm (STORE_FP
                                                  (concat_vec (imm7  : bits 7) (imm5  : bits 5), rs2, rs1, WORD))
                                     else
                                       (and_boolM ((is_RV32D_or_RV64D tt)  : M (bool))
                                          (returnm ((andb
                                                       (eq_vec (subrange_vec_dec v__9 14 12)
                                                          ('b"011"
                                                           : mword (14 - 12 + 1)))
                                                       (eq_vec (subrange_vec_dec v__9 6 0)
                                                          ('b"0100111"
                                                           : mword (6 - 0 + 1))))
                                            : bool))) >>= fun w__31 : bool =>
                                       (if sumbool_of_bool w__31 then
                                          let imm7 : bits 7 := subrange_vec_dec v__9 31 25 in
                                          let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
                                          let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
                                          let imm7 : bits 7 := subrange_vec_dec v__9 31 25 in
                                          let imm5 : bits 5 := subrange_vec_dec v__9 11 7 in
                                          returnm (STORE_FP
                                                     (concat_vec (imm7  : bits 7) (imm5  : bits 5), rs2, rs1, DOUBLE))
                                        else
                                          (and_boolM
                                             (let _mappingpatterns_82_ : mword 3 :=
                                               subrange_vec_dec v__9 14 12 in
                                             (if encdec_rounding_mode_backwards_matches
                                                   _mappingpatterns_82_ then
                                                (encdec_rounding_mode_backwards _mappingpatterns_82_) >>= fun rm =>
                                                (is_RV32F_or_RV64F tt)
                                                 : M (bool)
                                              else returnm false)
                                              : M (bool))
                                             (returnm ((andb
                                                          (eq_vec (subrange_vec_dec v__9 26 25)
                                                             ('b"00"
                                                              : mword (26 - 25 + 1)))
                                                          (eq_vec (subrange_vec_dec v__9 6 0)
                                                             ('b"1000011"
                                                              : mword (6 - 0 + 1))))
                                               : bool))) >>= fun w__34 : bool =>
                                          (if sumbool_of_bool w__34 then
                                             let rs3 : mword 5 := subrange_vec_dec v__9 31 27 in
                                             let rs3 : mword 5 := subrange_vec_dec v__9 31 27 in
                                             let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
                                             let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
                                             let rd : mword 5 := subrange_vec_dec v__9 11 7 in
                                             let _mappingpatterns_82_ : mword 3 :=
                                               subrange_vec_dec v__9 14 12 in
                                             (encdec_rounding_mode_backwards _mappingpatterns_82_) >>= fun rm =>
                                             returnm (F_MADD_TYPE_S (rs3, rs2, rs1, rm, rd, FMADD_S))
                                           else
                                             (and_boolM
                                                (let _mappingpatterns_83_ : mword 3 :=
                                                  subrange_vec_dec v__9 14 12 in
                                                (if encdec_rounding_mode_backwards_matches
                                                      _mappingpatterns_83_ then
                                                   (encdec_rounding_mode_backwards
                                                      _mappingpatterns_83_) >>= fun rm =>
                                                   (is_RV32F_or_RV64F tt)
                                                    : M (bool)
                                                 else returnm false)
                                                 : M (bool))
                                                (returnm ((andb
                                                             (eq_vec (subrange_vec_dec v__9 26 25)
                                                                ('b"00"
                                                                 : mword (26 - 25 + 1)))
                                                             (eq_vec (subrange_vec_dec v__9 6 0)
                                                                ('b"1000111"
                                                                 : mword (6 - 0 + 1))))
                                                  : bool))) >>= fun w__37 : bool =>
                                             (if sumbool_of_bool w__37 then
                                                let rs3 : mword 5 := subrange_vec_dec v__9 31 27 in
                                                let rs3 : mword 5 := subrange_vec_dec v__9 31 27 in
                                                let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
                                                let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
                                                let rd : mword 5 := subrange_vec_dec v__9 11 7 in
                                                let _mappingpatterns_83_ : mword 3 :=
                                                  subrange_vec_dec v__9 14 12 in
                                                (encdec_rounding_mode_backwards _mappingpatterns_83_) >>= fun rm =>
                                                returnm (F_MADD_TYPE_S
                                                           (rs3, rs2, rs1, rm, rd, FMSUB_S))
                                              else
                                                (and_boolM
                                                   (let _mappingpatterns_84_ : mword 3 :=
                                                     subrange_vec_dec v__9 14 12 in
                                                   (if encdec_rounding_mode_backwards_matches
                                                         _mappingpatterns_84_ then
                                                      (encdec_rounding_mode_backwards
                                                         _mappingpatterns_84_) >>= fun rm =>
                                                      (is_RV32F_or_RV64F tt)
                                                       : M (bool)
                                                    else returnm false)
                                                    : M (bool))
                                                   (returnm ((andb
                                                                (eq_vec
                                                                   (subrange_vec_dec v__9 26 25)
                                                                   ('b"00"
                                                                    : mword (26 - 25 + 1)))
                                                                (eq_vec (subrange_vec_dec v__9 6 0)
                                                                   ('b"1001011"
                                                                    : mword (6 - 0 + 1))))
                                                     : bool))) >>= fun w__40 : bool =>
                                                (if sumbool_of_bool w__40 then
                                                   let rs3 : mword 5 := subrange_vec_dec v__9 31 27 in
                                                   let rs3 : mword 5 := subrange_vec_dec v__9 31 27 in
                                                   let rs2 : mword 5 := subrange_vec_dec v__9 24 20 in
                                                   let rs1 : mword 5 := subrange_vec_dec v__9 19 15 in
                                                   let rd : mword 5 := subrange_vec_dec v__9 11 7 in
                                                   let _mappingpatterns_84_ : mword 3 :=
                                                     subrange_vec_dec v__9 14 12 in
                                                   (encdec_rounding_mode_backwards
                                                      _mappingpatterns_84_) >>= fun rm =>
                                                   returnm (F_MADD_TYPE_S
                                                              (rs3, rs2, rs1, rm, rd, FNMSUB_S))
                                                 else
                                                   (and_boolM
                                                      (let _mappingpatterns_85_ : mword 3 :=
                                                        subrange_vec_dec v__9 14 12 in
                                                      (if encdec_rounding_mode_backwards_matches
                                                            _mappingpatterns_85_ then
                                                         (encdec_rounding_mode_backwards
                                                            _mappingpatterns_85_) >>= fun rm =>
                                                         (is_RV32F_or_RV64F tt)
                                                          : M (bool)
                                                       else returnm false)
                                                       : M (bool))
                                                      (returnm ((andb
                                                                   (eq_vec
                                                                      (subrange_vec_dec v__9 26 25)
                                                                      ('b"00"
                                                                       : mword (26 - 25 + 1)))
                                                                   (eq_vec
                                                                      (subrange_vec_dec v__9 6 0)
                                                                      ('b"1001111"
                                                                       : mword (6 - 0 + 1))))
                                                        : bool))) >>= fun w__43 : bool =>
                                                   (if sumbool_of_bool w__43 then
                                                      let rs3 : mword 5 :=
                                                        subrange_vec_dec v__9 31 27 in
                                                      let rs3 : mword 5 :=
                                                        subrange_vec_dec v__9 31 27 in
                                                      let rs2 : mword 5 :=
                                                        subrange_vec_dec v__9 24 20 in
                                                      let rs1 : mword 5 :=
                                                        subrange_vec_dec v__9 19 15 in
                                                      let rd : mword 5 := subrange_vec_dec v__9 11 7 in
                                                      let _mappingpatterns_85_ : mword 3 :=
                                                        subrange_vec_dec v__9 14 12 in
                                                      (encdec_rounding_mode_backwards
                                                         _mappingpatterns_85_) >>= fun rm =>
                                                      returnm (F_MADD_TYPE_S
                                                                 (rs3, rs2, rs1, rm, rd, FNMADD_S))
                                                    else
                                                      (and_boolM
                                                         (let _mappingpatterns_86_ : mword 3 :=
                                                           subrange_vec_dec v__9 14 12 in
                                                         (if encdec_rounding_mode_backwards_matches
                                                               _mappingpatterns_86_ then
                                                            (encdec_rounding_mode_backwards
                                                               _mappingpatterns_86_) >>= fun rm =>
                                                            (is_RV32F_or_RV64F tt)
                                                             : M (bool)
                                                          else returnm false)
                                                          : M (bool))
                                                         (returnm ((andb
                                                                      (eq_vec
                                                                         (subrange_vec_dec v__9 31
                                                                            25)
                                                                         ('b"0000000"
                                                                          : mword (31 - 25 + 1)))
                                                                      (eq_vec
                                                                         (subrange_vec_dec v__9 6 0)
                                                                         ('b"1010011"
                                                                          : mword (6 - 0 + 1))))
                                                           : bool))) >>= fun w__46 : bool =>
                                                      (if sumbool_of_bool w__46 then
                                                         let rs2 : mword 5 :=
                                                           subrange_vec_dec v__9 24 20 in
                                                         let rs1 : mword 5 :=
                                                           subrange_vec_dec v__9 19 15 in
                                                         let rd : mword 5 :=
                                                           subrange_vec_dec v__9 11 7 in
                                                         let _mappingpatterns_86_ : mword 3 :=
                                                           subrange_vec_dec v__9 14 12 in
                                                         (encdec_rounding_mode_backwards
                                                            _mappingpatterns_86_) >>= fun rm =>
                                                         returnm (F_BIN_RM_TYPE_S
                                                                    (rs2, rs1, rm, rd, FADD_S))
                                                       else
                                                         (and_boolM
                                                            (let _mappingpatterns_87_ : mword 3 :=
                                                              subrange_vec_dec v__9 14 12 in
                                                            (if encdec_rounding_mode_backwards_matches
                                                                  _mappingpatterns_87_ then
                                                               (encdec_rounding_mode_backwards
                                                                  _mappingpatterns_87_) >>= fun rm =>
                                                               (is_RV32F_or_RV64F tt)
                                                                : M (bool)
                                                             else returnm false)
                                                             : M (bool))
                                                            (returnm ((andb
                                                                         (eq_vec
                                                                            (subrange_vec_dec v__9
                                                                               31 25)
                                                                            ('b"0000100"
                                                                             : mword (31 - 25 + 1)))
                                                                         (eq_vec
                                                                            (subrange_vec_dec v__9 6
                                                                               0)
                                                                            ('b"1010011"
                                                                             : mword (6 - 0 + 1))))
                                                              : bool))) >>= fun w__49 : bool =>
                                                         (if sumbool_of_bool w__49 then
                                                            let rs2 : mword 5 :=
                                                              subrange_vec_dec v__9 24 20 in
                                                            let rs1 : mword 5 :=
                                                              subrange_vec_dec v__9 19 15 in
                                                            let rd : mword 5 :=
                                                              subrange_vec_dec v__9 11 7 in
                                                            let _mappingpatterns_87_ : mword 3 :=
                                                              subrange_vec_dec v__9 14 12 in
                                                            (encdec_rounding_mode_backwards
                                                               _mappingpatterns_87_) >>= fun rm =>
                                                            returnm (F_BIN_RM_TYPE_S
                                                                       (rs2, rs1, rm, rd, FSUB_S))
                                                          else
                                                            (and_boolM
                                                               (let _mappingpatterns_88_ : mword 3 :=
                                                                 subrange_vec_dec v__9 14 12 in
                                                               (if encdec_rounding_mode_backwards_matches
                                                                     _mappingpatterns_88_ then
                                                                  (encdec_rounding_mode_backwards
                                                                     _mappingpatterns_88_) >>= fun rm =>
                                                                  (is_RV32F_or_RV64F tt)
                                                                   : M (bool)
                                                                else returnm false)
                                                                : M (bool))
                                                               (returnm ((andb
                                                                            (eq_vec
                                                                               (subrange_vec_dec
                                                                                  v__9 31 25)
                                                                               ('b"0001000"
                                                                                : mword (31 - 25 + 1)))
                                                                            (eq_vec
                                                                               (subrange_vec_dec
                                                                                  v__9 6 0)
                                                                               ('b"1010011"
                                                                                : mword (6 - 0 + 1))))
                                                                 : bool))) >>= fun w__52 : bool =>
                                                            (if sumbool_of_bool w__52 then
                                                               let rs2 : mword 5 :=
                                                                 subrange_vec_dec v__9 24 20 in
                                                               let rs1 : mword 5 :=
                                                                 subrange_vec_dec v__9 19 15 in
                                                               let rd : mword 5 :=
                                                                 subrange_vec_dec v__9 11 7 in
                                                               let _mappingpatterns_88_ : mword 3 :=
                                                                 subrange_vec_dec v__9 14 12 in
                                                               (encdec_rounding_mode_backwards
                                                                  _mappingpatterns_88_) >>= fun rm =>
                                                               returnm (F_BIN_RM_TYPE_S
                                                                          (rs2, rs1, rm, rd, FMUL_S))
                                                             else
                                                               (and_boolM
                                                                  (let _mappingpatterns_89_ : mword 3 :=
                                                                    subrange_vec_dec v__9 14 12 in
                                                                  (if encdec_rounding_mode_backwards_matches
                                                                        _mappingpatterns_89_ then
                                                                     (encdec_rounding_mode_backwards
                                                                        _mappingpatterns_89_) >>= fun rm =>
                                                                     (is_RV32F_or_RV64F tt)
                                                                      : M (bool)
                                                                   else returnm false)
                                                                   : M (bool))
                                                                  (returnm ((andb
                                                                               (eq_vec
                                                                                  (subrange_vec_dec
                                                                                     v__9 31 25)
                                                                                  ('b"0001100"
                                                                                   : mword (31 - 25 + 1)))
                                                                               (eq_vec
                                                                                  (subrange_vec_dec
                                                                                     v__9 6 0)
                                                                                  ('b"1010011"
                                                                                   : mword (6 - 0 + 1))))
                                                                    : bool))) >>= fun w__55 : bool =>
                                                               (if sumbool_of_bool w__55 then
                                                                  let rs2 : mword 5 :=
                                                                    subrange_vec_dec v__9 24 20 in
                                                                  let rs1 : mword 5 :=
                                                                    subrange_vec_dec v__9 19 15 in
                                                                  let rd : mword 5 :=
                                                                    subrange_vec_dec v__9 11 7 in
                                                                  let _mappingpatterns_89_ : mword 3 :=
                                                                    subrange_vec_dec v__9 14 12 in
                                                                  (encdec_rounding_mode_backwards
                                                                     _mappingpatterns_89_) >>= fun rm =>
                                                                  returnm (F_BIN_RM_TYPE_S
                                                                             (rs2, rs1, rm, rd, FDIV_S))
                                                                else
                                                                  (and_boolM
                                                                     (let _mappingpatterns_90_ : mword 3 :=
                                                                       subrange_vec_dec v__9 14 12 in
                                                                     (if encdec_rounding_mode_backwards_matches
                                                                           _mappingpatterns_90_ then
                                                                        (encdec_rounding_mode_backwards
                                                                           _mappingpatterns_90_) >>= fun rm =>
                                                                        (is_RV32F_or_RV64F tt)
                                                                         : M (bool)
                                                                      else returnm false)
                                                                      : M (bool))
                                                                     (returnm ((andb
                                                                                  (eq_vec
                                                                                     (subrange_vec_dec
                                                                                        v__9 31 20)
                                                                                     (Ox"580"
                                                                                      : mword (31 - 20 + 1)))
                                                                                  (eq_vec
                                                                                     (subrange_vec_dec
                                                                                        v__9 6 0)
                                                                                     ('b"1010011"
                                                                                      : mword (6 - 0 + 1))))
                                                                       : bool))) >>= fun w__58 : bool =>
                                                                  (if sumbool_of_bool w__58 then
                                                                     let rs1 : mword 5 :=
                                                                       subrange_vec_dec v__9 19 15 in
                                                                     let rd : mword 5 :=
                                                                       subrange_vec_dec v__9 11 7 in
                                                                     let _mappingpatterns_90_ : mword 3 :=
                                                                       subrange_vec_dec v__9 14 12 in
                                                                     (encdec_rounding_mode_backwards
                                                                        _mappingpatterns_90_) >>= fun rm =>
                                                                     returnm (F_UN_RM_TYPE_S
                                                                                (rs1, rm, rd, FSQRT_S))
                                                                   else
                                                                     (and_boolM
                                                                        (let _mappingpatterns_91_ : mword 3 :=
                                                                          subrange_vec_dec v__9 14
                                                                            12 in
                                                                        (if encdec_rounding_mode_backwards_matches
                                                                              _mappingpatterns_91_
                                                                         then
                                                                           (encdec_rounding_mode_backwards
                                                                              _mappingpatterns_91_) >>= fun rm =>
                                                                           (is_RV32F_or_RV64F tt)
                                                                            : M (bool)
                                                                         else returnm false)
                                                                         : M (bool))
                                                                        (returnm ((andb
                                                                                     (eq_vec
                                                                                        (subrange_vec_dec
                                                                                           v__9 31
                                                                                           20)
                                                                                        (Ox"C00"
                                                                                         : mword (31 - 20 + 1)))
                                                                                     (eq_vec
                                                                                        (subrange_vec_dec
                                                                                           v__9 6 0)
                                                                                        ('b"1010011"
                                                                                         : mword (6 - 0 + 1))))
                                                                          : bool))) >>= fun w__61 : bool =>
                                                                     (if sumbool_of_bool w__61 then
                                                                        let rs1 : mword 5 :=
                                                                          subrange_vec_dec v__9 19
                                                                            15 in
                                                                        let rd : mword 5 :=
                                                                          subrange_vec_dec v__9 11 7 in
                                                                        let _mappingpatterns_91_ : mword 3 :=
                                                                          subrange_vec_dec v__9 14
                                                                            12 in
                                                                        (encdec_rounding_mode_backwards
                                                                           _mappingpatterns_91_) >>= fun rm =>
                                                                        returnm (F_UN_RM_TYPE_S
                                                                                   (rs1, rm, rd, FCVT_W_S))
                                                                      else
                                                                        (and_boolM
                                                                           (let _mappingpatterns_92_ : mword 3 :=
                                                                             subrange_vec_dec v__9
                                                                               14 12 in
                                                                           (if encdec_rounding_mode_backwards_matches
                                                                                 _mappingpatterns_92_
                                                                            then
                                                                              (encdec_rounding_mode_backwards
                                                                                 _mappingpatterns_92_) >>= fun rm =>
                                                                              (is_RV32F_or_RV64F tt)
                                                                               : M (bool)
                                                                            else returnm false)
                                                                            : M (bool))
                                                                           (returnm ((andb
                                                                                        (eq_vec
                                                                                           (subrange_vec_dec
                                                                                              v__9
                                                                                              31 20)
                                                                                           (Ox"C01"
                                                                                            : mword (31 - 20 + 1)))
                                                                                        (eq_vec
                                                                                           (subrange_vec_dec
                                                                                              v__9 6
                                                                                              0)
                                                                                           ('b"1010011"
                                                                                            : mword (6 - 0 + 1))))
                                                                             : bool))) >>= fun w__64 : bool =>
                                                                        (if sumbool_of_bool
                                                                           w__64 then
                                                                           let rs1 : mword 5 :=
                                                                             subrange_vec_dec v__9
                                                                               19 15 in
                                                                           let rd : mword 5 :=
                                                                             subrange_vec_dec v__9
                                                                               11 7 in
                                                                           let _mappingpatterns_92_ : mword 3 :=
                                                                             subrange_vec_dec v__9
                                                                               14 12 in
                                                                           (encdec_rounding_mode_backwards
                                                                              _mappingpatterns_92_) >>= fun rm =>
                                                                           returnm (F_UN_RM_TYPE_S
                                                                                      (rs1, rm, rd, FCVT_WU_S))
                                                                         else
                                                                           (and_boolM
                                                                              (let _mappingpatterns_93_ : mword 3 :=
                                                                                subrange_vec_dec
                                                                                  v__9 14 12 in
                                                                              (if encdec_rounding_mode_backwards_matches
                                                                                    _mappingpatterns_93_
                                                                               then
                                                                                 (encdec_rounding_mode_backwards
                                                                                    _mappingpatterns_93_) >>= fun rm =>
                                                                                 (is_RV32F_or_RV64F
                                                                                    tt)
                                                                                  : M (bool)
                                                                               else returnm false)
                                                                               : M (bool))
                                                                              (returnm ((andb
                                                                                           (eq_vec
                                                                                              (subrange_vec_dec
                                                                                                 v__9
                                                                                                 31
                                                                                                 20)
                                                                                              (Ox"D00"
                                                                                               : mword (31 - 20 + 1)))
                                                                                           (eq_vec
                                                                                              (subrange_vec_dec
                                                                                                 v__9
                                                                                                 6 0)
                                                                                              ('b"1010011"
                                                                                               : mword (6 - 0 + 1))))
                                                                                : bool))) >>= fun w__67 : bool =>
                                                                           (if sumbool_of_bool
                                                                              w__67 then
                                                                              let rs1 : mword 5 :=
                                                                                subrange_vec_dec
                                                                                  v__9 19 15 in
                                                                              let rd : mword 5 :=
                                                                                subrange_vec_dec
                                                                                  v__9 11 7 in
                                                                              let _mappingpatterns_93_ : mword 3 :=
                                                                                subrange_vec_dec
                                                                                  v__9 14 12 in
                                                                              (encdec_rounding_mode_backwards
                                                                                 _mappingpatterns_93_) >>= fun rm =>
                                                                              returnm (F_UN_RM_TYPE_S
                                                                                         (rs1, rm, rd, FCVT_S_W))
                                                                            else
                                                                              (and_boolM
                                                                                 (let _mappingpatterns_94_ : mword 3 :=
                                                                                   subrange_vec_dec
                                                                                     v__9 14 12 in
                                                                                 (if encdec_rounding_mode_backwards_matches
                                                                                       _mappingpatterns_94_
                                                                                  then
                                                                                    (encdec_rounding_mode_backwards
                                                                                       _mappingpatterns_94_) >>= fun rm =>
                                                                                    (is_RV32F_or_RV64F
                                                                                       tt)
                                                                                     : M (bool)
                                                                                  else returnm false)
                                                                                  : M (bool))
                                                                                 (returnm ((andb
                                                                                              (eq_vec
                                                                                                 (subrange_vec_dec
                                                                                                    v__9
                                                                                                    31
                                                                                                    20)
                                                                                                 (Ox"D01"
                                                                                                  : mword (31 - 20 + 1)))
                                                                                              (eq_vec
                                                                                                 (subrange_vec_dec
                                                                                                    v__9
                                                                                                    6
                                                                                                    0)
                                                                                                 ('b"1010011"
                                                                                                  : mword (6 - 0 + 1))))
                                                                                   : bool))) >>= fun w__70 : bool =>
                                                                              (if sumbool_of_bool
                                                                                 w__70 then
                                                                                 let rs1 : mword 5 :=
                                                                                   subrange_vec_dec
                                                                                     v__9 19 15 in
                                                                                 let rd : mword 5 :=
                                                                                   subrange_vec_dec
                                                                                     v__9 11 7 in
                                                                                 let _mappingpatterns_94_ : mword 3 :=
                                                                                   subrange_vec_dec
                                                                                     v__9 14 12 in
                                                                                 (encdec_rounding_mode_backwards
                                                                                    _mappingpatterns_94_) >>= fun rm =>
                                                                                 returnm (F_UN_RM_TYPE_S
                                                                                            (rs1, rm, rd, FCVT_S_WU))
                                                                               else
                                                                                 (and_boolM
                                                                                    (let _mappingpatterns_95_ : mword 3 :=
                                                                                      subrange_vec_dec
                                                                                        v__9 14 12 in
                                                                                    (if encdec_rounding_mode_backwards_matches
                                                                                          _mappingpatterns_95_
                                                                                     then
                                                                                       (encdec_rounding_mode_backwards
                                                                                          _mappingpatterns_95_) >>= fun rm =>
                                                                                       (is_RV64F tt)
                                                                                        : M (bool)
                                                                                     else
                                                                                       returnm false)
                                                                                     : M (bool))
                                                                                    (returnm ((andb
                                                                                                 (eq_vec
                                                                                                    (subrange_vec_dec
                                                                                                       v__9
                                                                                                       31
                                                                                                       20)
                                                                                                    (Ox"C02"
                                                                                                     : mword (31 - 20 + 1)))
                                                                                                 (eq_vec
                                                                                                    (subrange_vec_dec
                                                                                                       v__9
                                                                                                       6
                                                                                                       0)
                                                                                                    ('b"1010011"
                                                                                                     : mword (6 - 0 + 1))))
                                                                                      : bool))) >>= fun w__73 : bool =>
                                                                                 (if sumbool_of_bool
                                                                                    w__73 then
                                                                                    let rs1 : mword 5 :=
                                                                                      subrange_vec_dec
                                                                                        v__9 19 15 in
                                                                                    let rd : mword 5 :=
                                                                                      subrange_vec_dec
                                                                                        v__9 11 7 in
                                                                                    let _mappingpatterns_95_ : mword 3 :=
                                                                                      subrange_vec_dec
                                                                                        v__9 14 12 in
                                                                                    (encdec_rounding_mode_backwards
                                                                                       _mappingpatterns_95_) >>= fun rm =>
                                                                                    returnm (F_UN_RM_TYPE_S
                                                                                               (rs1, rm, rd, FCVT_L_S))
                                                                                  else
                                                                                    (and_boolM
                                                                                       (let _mappingpatterns_96_ : mword 3 :=
                                                                                         subrange_vec_dec
                                                                                           v__9 14
                                                                                           12 in
                                                                                       (if encdec_rounding_mode_backwards_matches
                                                                                             _mappingpatterns_96_
                                                                                        then
                                                                                          (encdec_rounding_mode_backwards
                                                                                             _mappingpatterns_96_) >>= fun rm =>
                                                                                          (is_RV64F
                                                                                             tt)
                                                                                           : M (bool)
                                                                                        else
                                                                                          returnm false)
                                                                                        : M (bool))
                                                                                       (returnm ((andb
                                                                                                    (eq_vec
                                                                                                       (subrange_vec_dec
                                                                                                          v__9
                                                                                                          31
                                                                                                          20)
                                                                                                       (Ox"C03"
                                                                                                        : mword (31 - 20 + 1)))
                                                                                                    (eq_vec
                                                                                                       (subrange_vec_dec
                                                                                                          v__9
                                                                                                          6
                                                                                                          0)
                                                                                                       ('b"1010011"
                                                                                                        : mword (6 - 0 + 1))))
                                                                                         : bool))) >>= fun w__76 : bool =>
                                                                                    (if sumbool_of_bool
                                                                                       w__76 then
                                                                                       let rs1 : mword 5 :=
                                                                                         subrange_vec_dec
                                                                                           v__9 19
                                                                                           15 in
                                                                                       let rd : mword 5 :=
                                                                                         subrange_vec_dec
                                                                                           v__9 11 7 in
                                                                                       let _mappingpatterns_96_ : mword 3 :=
                                                                                         subrange_vec_dec
                                                                                           v__9 14
                                                                                           12 in
                                                                                       (encdec_rounding_mode_backwards
                                                                                          _mappingpatterns_96_) >>= fun rm =>
                                                                                       returnm (F_UN_RM_TYPE_S
                                                                                                  (rs1, rm, rd, FCVT_LU_S))
                                                                                     else
                                                                                       (and_boolM
                                                                                          (let _mappingpatterns_97_ : mword 3 :=
                                                                                            subrange_vec_dec
                                                                                              v__9
                                                                                              14 12 in
                                                                                          (if encdec_rounding_mode_backwards_matches
                                                                                                _mappingpatterns_97_
                                                                                           then
                                                                                             (encdec_rounding_mode_backwards
                                                                                                _mappingpatterns_97_) >>= fun rm =>
                                                                                             (is_RV64F
                                                                                                tt)
                                                                                              : M (bool)
                                                                                           else
                                                                                             returnm false)
                                                                                           : M (bool))
                                                                                          (returnm ((andb
                                                                                                       (eq_vec
                                                                                                          (subrange_vec_dec
                                                                                                             v__9
                                                                                                             31
                                                                                                             20)
                                                                                                          (Ox"D02"
                                                                                                           : mword (31 - 20 + 1)))
                                                                                                       (eq_vec
                                                                                                          (subrange_vec_dec
                                                                                                             v__9
                                                                                                             6
                                                                                                             0)
                                                                                                          ('b"1010011"
                                                                                                           : mword (6 - 0 + 1))))
                                                                                            : bool))) >>= fun w__79 : bool =>
                                                                                       (if sumbool_of_bool
                                                                                          w__79 then
                                                                                          let rs1 : mword 5 :=
                                                                                            subrange_vec_dec
                                                                                              v__9
                                                                                              19 15 in
                                                                                          let rd : mword 5 :=
                                                                                            subrange_vec_dec
                                                                                              v__9
                                                                                              11 7 in
                                                                                          let _mappingpatterns_97_ : mword 3 :=
                                                                                            subrange_vec_dec
                                                                                              v__9
                                                                                              14 12 in
                                                                                          (encdec_rounding_mode_backwards
                                                                                             _mappingpatterns_97_) >>= fun rm =>
                                                                                          returnm (F_UN_RM_TYPE_S
                                                                                                     (rs1, rm, rd, FCVT_S_L))
                                                                                        else
                                                                                          (and_boolM
                                                                                             (let _mappingpatterns_98_ : mword 3 :=
                                                                                               subrange_vec_dec
                                                                                                 v__9
                                                                                                 14
                                                                                                 12 in
                                                                                             (if encdec_rounding_mode_backwards_matches
                                                                                                   _mappingpatterns_98_
                                                                                              then
                                                                                                (encdec_rounding_mode_backwards
                                                                                                   _mappingpatterns_98_) >>= fun rm =>
                                                                                                (is_RV64F
                                                                                                   tt)
                                                                                                 : M (bool)
                                                                                              else
                                                                                                returnm false)
                                                                                              : M (bool))
                                                                                             (returnm ((andb
                                                                                                          (eq_vec
                                                                                                             (subrange_vec_dec
                                                                                                                v__9
                                                                                                                31
                                                                                                                20)
                                                                                                             (Ox"D03"
                                                                                                              : mword (31 - 20 + 1)))
                                                                                                          (eq_vec
                                                                                                             (subrange_vec_dec
                                                                                                                v__9
                                                                                                                6
                                                                                                                0)
                                                                                                             ('b"1010011"
                                                                                                              : mword (6 - 0 + 1))))
                                                                                               : bool))) >>= fun w__82 : bool =>
                                                                                          (if sumbool_of_bool
                                                                                             w__82
                                                                                           then
                                                                                             let rs1 : mword 5 :=
                                                                                               subrange_vec_dec
                                                                                                 v__9
                                                                                                 19
                                                                                                 15 in
                                                                                             let rd : mword 5 :=
                                                                                               subrange_vec_dec
                                                                                                 v__9
                                                                                                 11
                                                                                                 7 in
                                                                                             let _mappingpatterns_98_ : mword 3 :=
                                                                                               subrange_vec_dec
                                                                                                 v__9
                                                                                                 14
                                                                                                 12 in
                                                                                             (encdec_rounding_mode_backwards
                                                                                                _mappingpatterns_98_) >>= fun rm =>
                                                                                             returnm (F_UN_RM_TYPE_S
                                                                                                        (rs1, rm, rd, FCVT_S_LU))
                                                                                           else
                                                                                             (and_boolM
                                                                                                ((is_RV32F_or_RV64F
                                                                                                    tt)
                                                                                                 : M (bool))
                                                                                                (returnm ((andb
                                                                                                             (eq_vec
                                                                                                                (subrange_vec_dec
                                                                                                                   v__9
                                                                                                                   31
                                                                                                                   25)
                                                                                                                ('b"0010000"
                                                                                                                 : mword (31 - 25 + 1)))
                                                                                                             (andb
                                                                                                                (eq_vec
                                                                                                                   (subrange_vec_dec
                                                                                                                      v__9
                                                                                                                      14
                                                                                                                      12)
                                                                                                                   ('b"000"
                                                                                                                    : mword (14 - 12 + 1)))
                                                                                                                (eq_vec
                                                                                                                   (subrange_vec_dec
                                                                                                                      v__9
                                                                                                                      6
                                                                                                                      0)
                                                                                                                   ('b"1010011"
                                                                                                                    : mword (6 - 0 + 1)))))
                                                                                                  : bool))) >>= fun w__84 : bool =>
                                                                                             (if sumbool_of_bool
                                                                                                w__84
                                                                                              then
                                                                                                let rs2 : mword 5 :=
                                                                                                  subrange_vec_dec
                                                                                                    v__9
                                                                                                    24
                                                                                                    20 in
                                                                                                let rs1 : mword 5 :=
                                                                                                  subrange_vec_dec
                                                                                                    v__9
                                                                                                    19
                                                                                                    15 in
                                                                                                let rd : mword 5 :=
                                                                                                  subrange_vec_dec
                                                                                                    v__9
                                                                                                    11
                                                                                                    7 in
                                                                                                returnm (F_BIN_TYPE_S
                                                                                                           (rs2, rs1, rd, FSGNJ_S))
                                                                                              else
                                                                                                (and_boolM
                                                                                                   ((is_RV32F_or_RV64F
                                                                                                       tt)
                                                                                                    : M (bool))
                                                                                                   (returnm ((andb
                                                                                                                (eq_vec
                                                                                                                   (subrange_vec_dec
                                                                                                                      v__9
                                                                                                                      31
                                                                                                                      25)
                                                                                                                   ('b"0010000"
                                                                                                                    : mword (31 - 25 + 1)))
                                                                                                                (andb
                                                                                                                   (eq_vec
                                                                                                                      (subrange_vec_dec
                                                                                                                         v__9
                                                                                                                         14
                                                                                                                         12)
                                                                                                                      ('b"001"
                                                                                                                       : mword (14 - 12 + 1)))
                                                                                                                   (eq_vec
                                                                                                                      (subrange_vec_dec
                                                                                                                         v__9
                                                                                                                         6
                                                                                                                         0)
                                                                                                                      ('b"1010011"
                                                                                                                       : mword (6 - 0 + 1)))))
                                                                                                     : bool))) >>= fun w__86 : bool =>
                                                                                                (if sumbool_of_bool
                                                                                                   w__86
                                                                                                 then
                                                                                                   let rs2 : mword 5 :=
                                                                                                     subrange_vec_dec
                                                                                                       v__9
                                                                                                       24
                                                                                                       20 in
                                                                                                   let rs1 : mword 5 :=
                                                                                                     subrange_vec_dec
                                                                                                       v__9
                                                                                                       19
                                                                                                       15 in
                                                                                                   let rd : mword 5 :=
                                                                                                     subrange_vec_dec
                                                                                                       v__9
                                                                                                       11
                                                                                                       7 in
                                                                                                   returnm (F_BIN_TYPE_S
                                                                                                              (rs2, rs1, rd, FSGNJN_S))
                                                                                                 else
                                                                                                   (and_boolM
                                                                                                      ((is_RV32F_or_RV64F
                                                                                                          tt)
                                                                                                       : M (bool))
                                                                                                      (returnm ((andb
                                                                                                                   (eq_vec
                                                                                                                      (subrange_vec_dec
                                                                                                                         v__9
                                                                                                                         31
                                                                                                                         25)
                                                                                                                      ('b"0010000"
                                                                                                                       : mword (31 - 25 + 1)))
                                                                                                                   (andb
                                                                                                                      (eq_vec
                                                                                                                         (subrange_vec_dec
                                                                                                                            v__9
                                                                                                                            14
                                                                                                                            12)
                                                                                                                         ('b"010"
                                                                                                                          : mword (14 - 12 + 1)))
                                                                                                                      (eq_vec
                                                                                                                         (subrange_vec_dec
                                                                                                                            v__9
                                                                                                                            6
                                                                                                                            0)
                                                                                                                         ('b"1010011"
                                                                                                                          : mword (6 - 0 + 1)))))
                                                                                                        : bool))) >>= fun w__88 : bool =>
                                                                                                   (if
                                                                                                      sumbool_of_bool
                                                                                                      w__88
                                                                                                    then
                                                                                                      let rs2 : mword 5 :=
                                                                                                        subrange_vec_dec
                                                                                                          v__9
                                                                                                          24
                                                                                                          20 in
                                                                                                      let rs1 : mword 5 :=
                                                                                                        subrange_vec_dec
                                                                                                          v__9
                                                                                                          19
                                                                                                          15 in
                                                                                                      let rd : mword 5 :=
                                                                                                        subrange_vec_dec
                                                                                                          v__9
                                                                                                          11
                                                                                                          7 in
                                                                                                      returnm (F_BIN_TYPE_S
                                                                                                                 (rs2, rs1, rd, FSGNJX_S))
                                                                                                    else
                                                                                                      (and_boolM
                                                                                                         ((is_RV32F_or_RV64F
                                                                                                             tt)
                                                                                                          : M (bool))
                                                                                                         (returnm ((andb
                                                                                                                      (eq_vec
                                                                                                                         (subrange_vec_dec
                                                                                                                            v__9
                                                                                                                            31
                                                                                                                            25)
                                                                                                                         ('b"0010100"
                                                                                                                          : mword (31 - 25 + 1)))
                                                                                                                      (andb
                                                                                                                         (eq_vec
                                                                                                                            (subrange_vec_dec
                                                                                                                               v__9
                                                                                                                               14
                                                                                                                               12)
                                                                                                                            ('b"000"
                                                                                                                             : mword (14 - 12 + 1)))
                                                                                                                         (eq_vec
                                                                                                                            (subrange_vec_dec
                                                                                                                               v__9
                                                                                                                               6
                                                                                                                               0)
                                                                                                                            ('b"1010011"
                                                                                                                             : mword (6 - 0 + 1)))))
                                                                                                           : bool))) >>= fun w__90 : bool =>
                                                                                                      (if
                                                                                                         sumbool_of_bool
                                                                                                         w__90
                                                                                                       then
                                                                                                         let rs2 : mword 5 :=
                                                                                                           subrange_vec_dec
                                                                                                             v__9
                                                                                                             24
                                                                                                             20 in
                                                                                                         let rs1 : mword 5 :=
                                                                                                           subrange_vec_dec
                                                                                                             v__9
                                                                                                             19
                                                                                                             15 in
                                                                                                         let rd : mword 5 :=
                                                                                                           subrange_vec_dec
                                                                                                             v__9
                                                                                                             11
                                                                                                             7 in
                                                                                                         returnm (F_BIN_TYPE_S
                                                                                                                    (rs2, rs1, rd, FMIN_S))
                                                                                                       else
                                                                                                         (and_boolM
                                                                                                            ((is_RV32F_or_RV64F
                                                                                                                tt)
                                                                                                             : M (bool))
                                                                                                            (returnm ((andb
                                                                                                                         (eq_vec
                                                                                                                            (subrange_vec_dec
                                                                                                                               v__9
                                                                                                                               31
                                                                                                                               25)
                                                                                                                            ('b"0010100"
                                                                                                                             : mword (31 - 25 + 1)))
                                                                                                                         (andb
                                                                                                                            (eq_vec
                                                                                                                               (subrange_vec_dec
                                                                                                                                  v__9
                                                                                                                                  14
                                                                                                                                  12)
                                                                                                                               ('b"001"
                                                                                                                                : mword (14 - 12 + 1)))
                                                                                                                            (eq_vec
                                                                                                                               (subrange_vec_dec
                                                                                                                                  v__9
                                                                                                                                  6
                                                                                                                                  0)
                                                                                                                               ('b"1010011"
                                                                                                                                : mword (6 - 0 + 1)))))
                                                                                                              : bool))) >>= fun w__92 : bool =>
                                                                                                         (if
                                                                                                            sumbool_of_bool
                                                                                                            w__92
                                                                                                          then
                                                                                                            let rs2 : mword 5 :=
                                                                                                              subrange_vec_dec
                                                                                                                v__9
                                                                                                                24
                                                                                                                20 in
                                                                                                            let rs1 : mword 5 :=
                                                                                                              subrange_vec_dec
                                                                                                                v__9
                                                                                                                19
                                                                                                                15 in
                                                                                                            let rd : mword 5 :=
                                                                                                              subrange_vec_dec
                                                                                                                v__9
                                                                                                                11
                                                                                                                7 in
                                                                                                            returnm (F_BIN_TYPE_S
                                                                                                                       (rs2, rs1, rd, FMAX_S))
                                                                                                          else
                                                                                                            (and_boolM
                                                                                                               ((is_RV32F_or_RV64F
                                                                                                                   tt)
                                                                                                                : M (bool))
                                                                                                               (returnm ((andb
                                                                                                                            (eq_vec
                                                                                                                               (subrange_vec_dec
                                                                                                                                  v__9
                                                                                                                                  31
                                                                                                                                  25)
                                                                                                                               ('b"1010000"
                                                                                                                                : mword (31 - 25 + 1)))
                                                                                                                            (andb
                                                                                                                               (eq_vec
                                                                                                                                  (subrange_vec_dec
                                                                                                                                     v__9
                                                                                                                                     14
                                                                                                                                     12)
                                                                                                                                  ('b"010"
                                                                                                                                   : mword (14 - 12 + 1)))
                                                                                                                               (eq_vec
                                                                                                                                  (subrange_vec_dec
                                                                                                                                     v__9
                                                                                                                                     6
                                                                                                                                     0)
                                                                                                                                  ('b"1010011"
                                                                                                                                   : mword (6 - 0 + 1)))))
                                                                                                                 : bool))) >>= fun w__94 : bool =>
                                                                                                            (if
                                                                                                               sumbool_of_bool
                                                                                                               w__94
                                                                                                             then
                                                                                                               let rs2 : mword 5 :=
                                                                                                                 subrange_vec_dec
                                                                                                                   v__9
                                                                                                                   24
                                                                                                                   20 in
                                                                                                               let rs1 : mword 5 :=
                                                                                                                 subrange_vec_dec
                                                                                                                   v__9
                                                                                                                   19
                                                                                                                   15 in
                                                                                                               let rd : mword 5 :=
                                                                                                                 subrange_vec_dec
                                                                                                                   v__9
                                                                                                                   11
                                                                                                                   7 in
                                                                                                               returnm (F_BIN_TYPE_S
                                                                                                                          (rs2, rs1, rd, FEQ_S))
                                                                                                             else
                                                                                                               (and_boolM
                                                                                                                  ((is_RV32F_or_RV64F
                                                                                                                      tt)
                                                                                                                   : M (bool))
                                                                                                                  (returnm ((andb
                                                                                                                               (eq_vec
                                                                                                                                  (subrange_vec_dec
                                                                                                                                     v__9
                                                                                                                                     31
                                                                                                                                     25)
                                                                                                                                  ('b"1010000"
                                                                                                                                   : mword (31 - 25 + 1)))
                                                                                                                               (andb
                                                                                                                                  (eq_vec
                                                                                                                                     (subrange_vec_dec
                                                                                                                                        v__9
                                                                                                                                        14
                                                                                                                                        12)
                                                                                                                                     ('b"001"
                                                                                                                                      : mword (14 - 12 + 1)))
                                                                                                                                  (eq_vec
                                                                                                                                     (subrange_vec_dec
                                                                                                                                        v__9
                                                                                                                                        6
                                                                                                                                        0)
                                                                                                                                     ('b"1010011"
                                                                                                                                      : mword (6 - 0 + 1)))))
                                                                                                                    : bool))) >>= fun w__96 : bool =>
                                                                                                               (if
                                                                                                                  sumbool_of_bool
                                                                                                                  w__96
                                                                                                                then
                                                                                                                  let rs2 : mword 5 :=
                                                                                                                    subrange_vec_dec
                                                                                                                      v__9
                                                                                                                      24
                                                                                                                      20 in
                                                                                                                  let rs1 : mword 5 :=
                                                                                                                    subrange_vec_dec
                                                                                                                      v__9
                                                                                                                      19
                                                                                                                      15 in
                                                                                                                  let rd : mword 5 :=
                                                                                                                    subrange_vec_dec
                                                                                                                      v__9
                                                                                                                      11
                                                                                                                      7 in
                                                                                                                  returnm (F_BIN_TYPE_S
                                                                                                                             (rs2, rs1, rd, FLT_S))
                                                                                                                else
                                                                                                                  (and_boolM
                                                                                                                     ((is_RV32F_or_RV64F
                                                                                                                         tt)
                                                                                                                      : M (bool))
                                                                                                                     (returnm ((andb
                                                                                                                                  (eq_vec
                                                                                                                                     (subrange_vec_dec
                                                                                                                                        v__9
                                                                                                                                        31
                                                                                                                                        25)
                                                                                                                                     ('b"1010000"
                                                                                                                                      : mword (31 - 25 + 1)))
                                                                                                                                  (andb
                                                                                                                                     (eq_vec
                                                                                                                                        (subrange_vec_dec
                                                                                                                                           v__9
                                                                                                                                           14
                                                                                                                                           12)
                                                                                                                                        ('b"000"
                                                                                                                                         : mword (14 - 12 + 1)))
                                                                                                                                     (eq_vec
                                                                                                                                        (subrange_vec_dec
                                                                                                                                           v__9
                                                                                                                                           6
                                                                                                                                           0)
                                                                                                                                        ('b"1010011"
                                                                                                                                         : mword (6 - 0 + 1)))))
                                                                                                                       : bool))) >>= fun w__98 : bool =>
                                                                                                                  (if
                                                                                                                     sumbool_of_bool
                                                                                                                     w__98
                                                                                                                   then
                                                                                                                     let rs2 : mword 5 :=
                                                                                                                       subrange_vec_dec
                                                                                                                         v__9
                                                                                                                         24
                                                                                                                         20 in
                                                                                                                     let rs1 : mword 5 :=
                                                                                                                       subrange_vec_dec
                                                                                                                         v__9
                                                                                                                         19
                                                                                                                         15 in
                                                                                                                     let rd : mword 5 :=
                                                                                                                       subrange_vec_dec
                                                                                                                         v__9
                                                                                                                         11
                                                                                                                         7 in
                                                                                                                     returnm (F_BIN_TYPE_S
                                                                                                                                (rs2, rs1, rd, FLE_S))
                                                                                                                   else
                                                                                                                     (and_boolM
                                                                                                                        ((haveFExt
                                                                                                                            tt)
                                                                                                                         : M (bool))
                                                                                                                        (returnm ((andb
                                                                                                                                     (eq_vec
                                                                                                                                        (subrange_vec_dec
                                                                                                                                           v__9
                                                                                                                                           31
                                                                                                                                           20)
                                                                                                                                        (Ox"E00"
                                                                                                                                         : mword (31 - 20 + 1)))
                                                                                                                                     (andb
                                                                                                                                        (eq_vec
                                                                                                                                           (subrange_vec_dec
                                                                                                                                              v__9
                                                                                                                                              14
                                                                                                                                              12)
                                                                                                                                           ('b"001"
                                                                                                                                            : mword (14 - 12 + 1)))
                                                                                                                                        (eq_vec
                                                                                                                                           (subrange_vec_dec
                                                                                                                                              v__9
                                                                                                                                              6
                                                                                                                                              0)
                                                                                                                                           ('b"1010011"
                                                                                                                                            : mword (6 - 0 + 1)))))
                                                                                                                          : bool))) >>= fun w__100 : bool =>
                                                                                                                     (if
                                                                                                                        sumbool_of_bool
                                                                                                                        w__100
                                                                                                                      then
                                                                                                                        let rs1 : mword 5 :=
                                                                                                                          subrange_vec_dec
                                                                                                                            v__9
                                                                                                                            19
                                                                                                                            15 in
                                                                                                                        let rd : mword 5 :=
                                                                                                                          subrange_vec_dec
                                                                                                                            v__9
                                                                                                                            11
                                                                                                                            7 in
                                                                                                                        returnm (F_UN_TYPE_S
                                                                                                                                   (rs1, rd, FCLASS_S))
                                                                                                                      else
                                                                                                                        (and_boolM
                                                                                                                           ((haveFExt
                                                                                                                               tt)
                                                                                                                            : M (bool))
                                                                                                                           (returnm ((andb
                                                                                                                                        (eq_vec
                                                                                                                                           (subrange_vec_dec
                                                                                                                                              v__9
                                                                                                                                              31
                                                                                                                                              20)
                                                                                                                                           (Ox"E00"
                                                                                                                                            : mword (31 - 20 + 1)))
                                                                                                                                        (andb
                                                                                                                                           (eq_vec
                                                                                                                                              (subrange_vec_dec
                                                                                                                                                 v__9
                                                                                                                                                 14
                                                                                                                                                 12)
                                                                                                                                              ('b"000"
                                                                                                                                               : mword (14 - 12 + 1)))
                                                                                                                                           (eq_vec
                                                                                                                                              (subrange_vec_dec
                                                                                                                                                 v__9
                                                                                                                                                 6
                                                                                                                                                 0)
                                                                                                                                              ('b"1010011"
                                                                                                                                               : mword (6 - 0 + 1)))))
                                                                                                                             : bool))) >>= fun w__102 : bool =>
                                                                                                                        (if
                                                                                                                           sumbool_of_bool
                                                                                                                           w__102
                                                                                                                         then
                                                                                                                           let rs1 : mword 5 :=
                                                                                                                             subrange_vec_dec
                                                                                                                               v__9
                                                                                                                               19
                                                                                                                               15 in
                                                                                                                           let rd : mword 5 :=
                                                                                                                             subrange_vec_dec
                                                                                                                               v__9
                                                                                                                               11
                                                                                                                               7 in
                                                                                                                           returnm (F_UN_TYPE_S
                                                                                                                                      (rs1, rd, FMV_X_W))
                                                                                                                         else
                                                                                                                           (and_boolM
                                                                                                                              ((haveFExt
                                                                                                                                  tt)
                                                                                                                               : M (bool))
                                                                                                                              (returnm ((andb
                                                                                                                                           (eq_vec
                                                                                                                                              (subrange_vec_dec
                                                                                                                                                 v__9
                                                                                                                                                 31
                                                                                                                                                 20)
                                                                                                                                              (Ox"F00"
                                                                                                                                               : mword (31 - 20 + 1)))
                                                                                                                                           (andb
                                                                                                                                              (eq_vec
                                                                                                                                                 (subrange_vec_dec
                                                                                                                                                    v__9
                                                                                                                                                    14
                                                                                                                                                    12)
                                                                                                                                                 ('b"000"
                                                                                                                                                  : mword (14 - 12 + 1)))
                                                                                                                                              (eq_vec
                                                                                                                                                 (subrange_vec_dec
                                                                                                                                                    v__9
                                                                                                                                                    6
                                                                                                                                                    0)
                                                                                                                                                 ('b"1010011"
                                                                                                                                                  : mword (6 - 0 + 1)))))
                                                                                                                                : bool))) >>= fun w__104 : bool =>
                                                                                                                           (if
                                                                                                                              sumbool_of_bool
                                                                                                                              w__104
                                                                                                                            then
                                                                                                                              let rs1 : mword 5 :=
                                                                                                                                subrange_vec_dec
                                                                                                                                  v__9
                                                                                                                                  19
                                                                                                                                  15 in
                                                                                                                              let rd : mword 5 :=
                                                                                                                                subrange_vec_dec
                                                                                                                                  v__9
                                                                                                                                  11
                                                                                                                                  7 in
                                                                                                                              returnm (F_UN_TYPE_S
                                                                                                                                         (rs1, rd, FMV_W_X))
                                                                                                                            else
                                                                                                                              (and_boolM
                                                                                                                                 (let _mappingpatterns_99_ : mword 3 :=
                                                                                                                                   subrange_vec_dec
                                                                                                                                     v__9
                                                                                                                                     14
                                                                                                                                     12 in
                                                                                                                                 (if
                                                                                                                                    encdec_rounding_mode_backwards_matches
                                                                                                                                      _mappingpatterns_99_
                                                                                                                                  then
                                                                                                                                    (encdec_rounding_mode_backwards
                                                                                                                                       _mappingpatterns_99_) >>= fun rm =>
                                                                                                                                    (is_RV32D_or_RV64D
                                                                                                                                       tt)
                                                                                                                                     : M (bool)
                                                                                                                                  else
                                                                                                                                    returnm false)
                                                                                                                                  : M (bool))
                                                                                                                                 (returnm ((andb
                                                                                                                                              (eq_vec
                                                                                                                                                 (subrange_vec_dec
                                                                                                                                                    v__9
                                                                                                                                                    26
                                                                                                                                                    25)
                                                                                                                                                 ('b"01"
                                                                                                                                                  : mword (26 - 25 + 1)))
                                                                                                                                              (eq_vec
                                                                                                                                                 (subrange_vec_dec
                                                                                                                                                    v__9
                                                                                                                                                    6
                                                                                                                                                    0)
                                                                                                                                                 ('b"1000011"
                                                                                                                                                  : mword (6 - 0 + 1))))
                                                                                                                                   : bool))) >>= fun w__107 : bool =>
                                                                                                                              (if
                                                                                                                                 sumbool_of_bool
                                                                                                                                 w__107
                                                                                                                               then
                                                                                                                                 let rs3 : mword 5 :=
                                                                                                                                   subrange_vec_dec
                                                                                                                                     v__9
                                                                                                                                     31
                                                                                                                                     27 in
                                                                                                                                 let rs3 : mword 5 :=
                                                                                                                                   subrange_vec_dec
                                                                                                                                     v__9
                                                                                                                                     31
                                                                                                                                     27 in
                                                                                                                                 let rs2 : mword 5 :=
                                                                                                                                   subrange_vec_dec
                                                                                                                                     v__9
                                                                                                                                     24
                                                                                                                                     20 in
                                                                                                                                 let rs1 : mword 5 :=
                                                                                                                                   subrange_vec_dec
                                                                                                                                     v__9
                                                                                                                                     19
                                                                                                                                     15 in
                                                                                                                                 let rd : mword 5 :=
                                                                                                                                   subrange_vec_dec
                                                                                                                                     v__9
                                                                                                                                     11
                                                                                                                                     7 in
                                                                                                                                 let _mappingpatterns_99_ : mword 3 :=
                                                                                                                                   subrange_vec_dec
                                                                                                                                     v__9
                                                                                                                                     14
                                                                                                                                     12 in
                                                                                                                                 (encdec_rounding_mode_backwards
                                                                                                                                    _mappingpatterns_99_) >>= fun rm =>
                                                                                                                                 returnm (F_MADD_TYPE_D
                                                                                                                                            (rs3, rs2, rs1, rm, rd, FMADD_D))
                                                                                                                               else
                                                                                                                                 (and_boolM
                                                                                                                                    (let _mappingpatterns_100_ : mword 3 :=
                                                                                                                                      subrange_vec_dec
                                                                                                                                        v__9
                                                                                                                                        14
                                                                                                                                        12 in
                                                                                                                                    (if
                                                                                                                                       encdec_rounding_mode_backwards_matches
                                                                                                                                         _mappingpatterns_100_
                                                                                                                                     then
                                                                                                                                       (encdec_rounding_mode_backwards
                                                                                                                                          _mappingpatterns_100_) >>= fun rm =>
                                                                                                                                       (is_RV32D_or_RV64D
                                                                                                                                          tt)
                                                                                                                                        : M (bool)
                                                                                                                                     else
                                                                                                                                       returnm false)
                                                                                                                                     : M (bool))
                                                                                                                                    (returnm ((andb
                                                                                                                                                 (eq_vec
                                                                                                                                                    (subrange_vec_dec
                                                                                                                                                       v__9
                                                                                                                                                       26
                                                                                                                                                       25)
                                                                                                                                                    ('b"01"
                                                                                                                                                     : mword (26 - 25 + 1)))
                                                                                                                                                 (eq_vec
                                                                                                                                                    (subrange_vec_dec
                                                                                                                                                       v__9
                                                                                                                                                       6
                                                                                                                                                       0)
                                                                                                                                                    ('b"1000111"
                                                                                                                                                     : mword (6 - 0 + 1))))
                                                                                                                                      : bool))) >>= fun w__110 : bool =>
                                                                                                                                 (if
                                                                                                                                    sumbool_of_bool
                                                                                                                                    w__110
                                                                                                                                  then
                                                                                                                                    let rs3 : mword 5 :=
                                                                                                                                      subrange_vec_dec
                                                                                                                                        v__9
                                                                                                                                        31
                                                                                                                                        27 in
                                                                                                                                    let rs3 : mword 5 :=
                                                                                                                                      subrange_vec_dec
                                                                                                                                        v__9
                                                                                                                                        31
                                                                                                                                        27 in
                                                                                                                                    let rs2 : mword 5 :=
                                                                                                                                      subrange_vec_dec
                                                                                                                                        v__9
                                                                                                                                        24
                                                                                                                                        20 in
                                                                                                                                    let rs1 : mword 5 :=
                                                                                                                                      subrange_vec_dec
                                                                                                                                        v__9
                                                                                                                                        19
                                                                                                                                        15 in
                                                                                                                                    let rd : mword 5 :=
                                                                                                                                      subrange_vec_dec
                                                                                                                                        v__9
                                                                                                                                        11
                                                                                                                                        7 in
                                                                                                                                    let _mappingpatterns_100_ : mword 3 :=
                                                                                                                                      subrange_vec_dec
                                                                                                                                        v__9
                                                                                                                                        14
                                                                                                                                        12 in
                                                                                                                                    (encdec_rounding_mode_backwards
                                                                                                                                       _mappingpatterns_100_) >>= fun rm =>
                                                                                                                                    returnm (F_MADD_TYPE_D
                                                                                                                                               (rs3, rs2, rs1, rm, rd, FMSUB_D))
                                                                                                                                  else
                                                                                                                                    (and_boolM
                                                                                                                                       (let _mappingpatterns_101_ : mword 3 :=
                                                                                                                                         subrange_vec_dec
                                                                                                                                           v__9
                                                                                                                                           14
                                                                                                                                           12 in
                                                                                                                                       (if
                                                                                                                                          encdec_rounding_mode_backwards_matches
                                                                                                                                            _mappingpatterns_101_
                                                                                                                                        then
                                                                                                                                          (encdec_rounding_mode_backwards
                                                                                                                                             _mappingpatterns_101_) >>= fun rm =>
                                                                                                                                          (is_RV32D_or_RV64D
                                                                                                                                             tt)
                                                                                                                                           : M (bool)
                                                                                                                                        else
                                                                                                                                          returnm false)
                                                                                                                                        : M (bool))
                                                                                                                                       (returnm ((andb
                                                                                                                                                    (eq_vec
                                                                                                                                                       (subrange_vec_dec
                                                                                                                                                          v__9
                                                                                                                                                          26
                                                                                                                                                          25)
                                                                                                                                                       ('b"01"
                                                                                                                                                        : mword (26 - 25 + 1)))
                                                                                                                                                    (eq_vec
                                                                                                                                                       (subrange_vec_dec
                                                                                                                                                          v__9
                                                                                                                                                          6
                                                                                                                                                          0)
                                                                                                                                                       ('b"1001011"
                                                                                                                                                        : mword (6 - 0 + 1))))
                                                                                                                                         : bool))) >>= fun w__113 : bool =>
                                                                                                                                    (if
                                                                                                                                       sumbool_of_bool
                                                                                                                                       w__113
                                                                                                                                     then
                                                                                                                                       let rs3 : mword 5 :=
                                                                                                                                         subrange_vec_dec
                                                                                                                                           v__9
                                                                                                                                           31
                                                                                                                                           27 in
                                                                                                                                       let rs3 : mword 5 :=
                                                                                                                                         subrange_vec_dec
                                                                                                                                           v__9
                                                                                                                                           31
                                                                                                                                           27 in
                                                                                                                                       let rs2 : mword 5 :=
                                                                                                                                         subrange_vec_dec
                                                                                                                                           v__9
                                                                                                                                           24
                                                                                                                                           20 in
                                                                                                                                       let rs1 : mword 5 :=
                                                                                                                                         subrange_vec_dec
                                                                                                                                           v__9
                                                                                                                                           19
                                                                                                                                           15 in
                                                                                                                                       let rd : mword 5 :=
                                                                                                                                         subrange_vec_dec
                                                                                                                                           v__9
                                                                                                                                           11
                                                                                                                                           7 in
                                                                                                                                       let _mappingpatterns_101_ : mword 3 :=
                                                                                                                                         subrange_vec_dec
                                                                                                                                           v__9
                                                                                                                                           14
                                                                                                                                           12 in
                                                                                                                                       (encdec_rounding_mode_backwards
                                                                                                                                          _mappingpatterns_101_) >>= fun rm =>
                                                                                                                                       returnm (F_MADD_TYPE_D
                                                                                                                                                  (rs3, rs2, rs1, rm, rd, FNMSUB_D))
                                                                                                                                     else
                                                                                                                                       (and_boolM
                                                                                                                                          (let _mappingpatterns_102_ : mword 3 :=
                                                                                                                                            subrange_vec_dec
                                                                                                                                              v__9
                                                                                                                                              14
                                                                                                                                              12 in
                                                                                                                                          (if
                                                                                                                                             encdec_rounding_mode_backwards_matches
                                                                                                                                               _mappingpatterns_102_
                                                                                                                                           then
                                                                                                                                             (encdec_rounding_mode_backwards
                                                                                                                                                _mappingpatterns_102_) >>= fun rm =>
                                                                                                                                             (is_RV32D_or_RV64D
                                                                                                                                                tt)
                                                                                                                                              : M (bool)
                                                                                                                                           else
                                                                                                                                             returnm false)
                                                                                                                                           : M (bool))
                                                                                                                                          (returnm ((andb
                                                                                                                                                       (eq_vec
                                                                                                                                                          (subrange_vec_dec
                                                                                                                                                             v__9
                                                                                                                                                             26
                                                                                                                                                             25)
                                                                                                                                                          ('b"01"
                                                                                                                                                           : mword (26 - 25 + 1)))
                                                                                                                                                       (eq_vec
                                                                                                                                                          (subrange_vec_dec
                                                                                                                                                             v__9
                                                                                                                                                             6
                                                                                                                                                             0)
                                                                                                                                                          ('b"1001111"
                                                                                                                                                           : mword (6 - 0 + 1))))
                                                                                                                                            : bool))) >>= fun w__116 : bool =>
                                                                                                                                       (if
                                                                                                                                          sumbool_of_bool
                                                                                                                                          w__116
                                                                                                                                        then
                                                                                                                                          let rs3 : mword 5 :=
                                                                                                                                            subrange_vec_dec
                                                                                                                                              v__9
                                                                                                                                              31
                                                                                                                                              27 in
                                                                                                                                          let rs3 : mword 5 :=
                                                                                                                                            subrange_vec_dec
                                                                                                                                              v__9
                                                                                                                                              31
                                                                                                                                              27 in
                                                                                                                                          let rs2 : mword 5 :=
                                                                                                                                            subrange_vec_dec
                                                                                                                                              v__9
                                                                                                                                              24
                                                                                                                                              20 in
                                                                                                                                          let rs1 : mword 5 :=
                                                                                                                                            subrange_vec_dec
                                                                                                                                              v__9
                                                                                                                                              19
                                                                                                                                              15 in
                                                                                                                                          let rd : mword 5 :=
                                                                                                                                            subrange_vec_dec
                                                                                                                                              v__9
                                                                                                                                              11
                                                                                                                                              7 in
                                                                                                                                          let _mappingpatterns_102_ : mword 3 :=
                                                                                                                                            subrange_vec_dec
                                                                                                                                              v__9
                                                                                                                                              14
                                                                                                                                              12 in
                                                                                                                                          (encdec_rounding_mode_backwards
                                                                                                                                             _mappingpatterns_102_) >>= fun rm =>
                                                                                                                                          returnm (F_MADD_TYPE_D
                                                                                                                                                     (rs3, rs2, rs1, rm, rd, FNMADD_D))
                                                                                                                                        else
                                                                                                                                          (and_boolM
                                                                                                                                             (let _mappingpatterns_103_ : mword 3 :=
                                                                                                                                               subrange_vec_dec
                                                                                                                                                 v__9
                                                                                                                                                 14
                                                                                                                                                 12 in
                                                                                                                                             (if
                                                                                                                                                encdec_rounding_mode_backwards_matches
                                                                                                                                                  _mappingpatterns_103_
                                                                                                                                              then
                                                                                                                                                (encdec_rounding_mode_backwards
                                                                                                                                                   _mappingpatterns_103_) >>= fun rm =>
                                                                                                                                                (is_RV32D_or_RV64D
                                                                                                                                                   tt)
                                                                                                                                                 : M (bool)
                                                                                                                                              else
                                                                                                                                                returnm false)
                                                                                                                                              : M (bool))
                                                                                                                                             (returnm ((andb
                                                                                                                                                          (eq_vec
                                                                                                                                                             (subrange_vec_dec
                                                                                                                                                                v__9
                                                                                                                                                                31
                                                                                                                                                                25)
                                                                                                                                                             ('b"0000001"
                                                                                                                                                              : mword (31 - 25 + 1)))
                                                                                                                                                          (eq_vec
                                                                                                                                                             (subrange_vec_dec
                                                                                                                                                                v__9
                                                                                                                                                                6
                                                                                                                                                                0)
                                                                                                                                                             ('b"1010011"
                                                                                                                                                              : mword (6 - 0 + 1))))
                                                                                                                                               : bool))) >>= fun w__119 : bool =>
                                                                                                                                          (if
                                                                                                                                             sumbool_of_bool
                                                                                                                                             w__119
                                                                                                                                           then
                                                                                                                                             let rs2 : mword 5 :=
                                                                                                                                               subrange_vec_dec
                                                                                                                                                 v__9
                                                                                                                                                 24
                                                                                                                                                 20 in
                                                                                                                                             let rs1 : mword 5 :=
                                                                                                                                               subrange_vec_dec
                                                                                                                                                 v__9
                                                                                                                                                 19
                                                                                                                                                 15 in
                                                                                                                                             let rd : mword 5 :=
                                                                                                                                               subrange_vec_dec
                                                                                                                                                 v__9
                                                                                                                                                 11
                                                                                                                                                 7 in
                                                                                                                                             let _mappingpatterns_103_ : mword 3 :=
                                                                                                                                               subrange_vec_dec
                                                                                                                                                 v__9
                                                                                                                                                 14
                                                                                                                                                 12 in
                                                                                                                                             (encdec_rounding_mode_backwards
                                                                                                                                                _mappingpatterns_103_) >>= fun rm =>
                                                                                                                                             returnm (F_BIN_RM_TYPE_D
                                                                                                                                                        (rs2, rs1, rm, rd, FADD_D))
                                                                                                                                           else
                                                                                                                                             (and_boolM
                                                                                                                                                (let _mappingpatterns_104_ : mword 3 :=
                                                                                                                                                  subrange_vec_dec
                                                                                                                                                    v__9
                                                                                                                                                    14
                                                                                                                                                    12 in
                                                                                                                                                (if
                                                                                                                                                   encdec_rounding_mode_backwards_matches
                                                                                                                                                     _mappingpatterns_104_
                                                                                                                                                 then
                                                                                                                                                   (encdec_rounding_mode_backwards
                                                                                                                                                      _mappingpatterns_104_) >>= fun rm =>
                                                                                                                                                   (is_RV32D_or_RV64D
                                                                                                                                                      tt)
                                                                                                                                                    : M (bool)
                                                                                                                                                 else
                                                                                                                                                   returnm false)
                                                                                                                                                 : M (bool))
                                                                                                                                                (returnm ((andb
                                                                                                                                                             (eq_vec
                                                                                                                                                                (subrange_vec_dec
                                                                                                                                                                   v__9
                                                                                                                                                                   31
                                                                                                                                                                   25)
                                                                                                                                                                ('b"0000101"
                                                                                                                                                                 : mword (31 - 25 + 1)))
                                                                                                                                                             (eq_vec
                                                                                                                                                                (subrange_vec_dec
                                                                                                                                                                   v__9
                                                                                                                                                                   6
                                                                                                                                                                   0)
                                                                                                                                                                ('b"1010011"
                                                                                                                                                                 : mword (6 - 0 + 1))))
                                                                                                                                                  : bool))) >>= fun w__122 : bool =>
                                                                                                                                             (if
                                                                                                                                                sumbool_of_bool
                                                                                                                                                w__122
                                                                                                                                              then
                                                                                                                                                let rs2 : mword 5 :=
                                                                                                                                                  subrange_vec_dec
                                                                                                                                                    v__9
                                                                                                                                                    24
                                                                                                                                                    20 in
                                                                                                                                                let rs1 : mword 5 :=
                                                                                                                                                  subrange_vec_dec
                                                                                                                                                    v__9
                                                                                                                                                    19
                                                                                                                                                    15 in
                                                                                                                                                let rd : mword 5 :=
                                                                                                                                                  subrange_vec_dec
                                                                                                                                                    v__9
                                                                                                                                                    11
                                                                                                                                                    7 in
                                                                                                                                                let _mappingpatterns_104_ : mword 3 :=
                                                                                                                                                  subrange_vec_dec
                                                                                                                                                    v__9
                                                                                                                                                    14
                                                                                                                                                    12 in
                                                                                                                                                (encdec_rounding_mode_backwards
                                                                                                                                                   _mappingpatterns_104_) >>= fun rm =>
                                                                                                                                                returnm (F_BIN_RM_TYPE_D
                                                                                                                                                           (rs2, rs1, rm, rd, FSUB_D))
                                                                                                                                              else
                                                                                                                                                (and_boolM
                                                                                                                                                   (let _mappingpatterns_105_ : mword 3 :=
                                                                                                                                                     subrange_vec_dec
                                                                                                                                                       v__9
                                                                                                                                                       14
                                                                                                                                                       12 in
                                                                                                                                                   (if
                                                                                                                                                      encdec_rounding_mode_backwards_matches
                                                                                                                                                        _mappingpatterns_105_
                                                                                                                                                    then
                                                                                                                                                      (encdec_rounding_mode_backwards
                                                                                                                                                         _mappingpatterns_105_) >>= fun rm =>
                                                                                                                                                      (is_RV32D_or_RV64D
                                                                                                                                                         tt)
                                                                                                                                                       : M (bool)
                                                                                                                                                    else
                                                                                                                                                      returnm false)
                                                                                                                                                    : M (bool))
                                                                                                                                                   (returnm ((andb
                                                                                                                                                                (eq_vec
                                                                                                                                                                   (subrange_vec_dec
                                                                                                                                                                      v__9
                                                                                                                                                                      31
                                                                                                                                                                      25)
                                                                                                                                                                   ('b"0001001"
                                                                                                                                                                    : mword (31 - 25 + 1)))
                                                                                                                                                                (eq_vec
                                                                                                                                                                   (subrange_vec_dec
                                                                                                                                                                      v__9
                                                                                                                                                                      6
                                                                                                                                                                      0)
                                                                                                                                                                   ('b"1010011"
                                                                                                                                                                    : mword (6 - 0 + 1))))
                                                                                                                                                     : bool))) >>= fun w__125 : bool =>
                                                                                                                                                (if
                                                                                                                                                   sumbool_of_bool
                                                                                                                                                   w__125
                                                                                                                                                 then
                                                                                                                                                   let rs2 : mword 5 :=
                                                                                                                                                     subrange_vec_dec
                                                                                                                                                       v__9
                                                                                                                                                       24
                                                                                                                                                       20 in
                                                                                                                                                   let rs1 : mword 5 :=
                                                                                                                                                     subrange_vec_dec
                                                                                                                                                       v__9
                                                                                                                                                       19
                                                                                                                                                       15 in
                                                                                                                                                   let rd : mword 5 :=
                                                                                                                                                     subrange_vec_dec
                                                                                                                                                       v__9
                                                                                                                                                       11
                                                                                                                                                       7 in
                                                                                                                                                   let _mappingpatterns_105_ : mword 3 :=
                                                                                                                                                     subrange_vec_dec
                                                                                                                                                       v__9
                                                                                                                                                       14
                                                                                                                                                       12 in
                                                                                                                                                   (encdec_rounding_mode_backwards
                                                                                                                                                      _mappingpatterns_105_) >>= fun rm =>
                                                                                                                                                   returnm (F_BIN_RM_TYPE_D
                                                                                                                                                              (rs2, rs1, rm, rd, FMUL_D))
                                                                                                                                                 else
                                                                                                                                                   (and_boolM
                                                                                                                                                      (let _mappingpatterns_106_ : mword 3 :=
                                                                                                                                                        subrange_vec_dec
                                                                                                                                                          v__9
                                                                                                                                                          14
                                                                                                                                                          12 in
                                                                                                                                                      (if
                                                                                                                                                         encdec_rounding_mode_backwards_matches
                                                                                                                                                           _mappingpatterns_106_
                                                                                                                                                       then
                                                                                                                                                         (encdec_rounding_mode_backwards
                                                                                                                                                            _mappingpatterns_106_) >>= fun rm =>
                                                                                                                                                         (is_RV32D_or_RV64D
                                                                                                                                                            tt)
                                                                                                                                                          : M (bool)
                                                                                                                                                       else
                                                                                                                                                         returnm false)
                                                                                                                                                       : M (bool))
                                                                                                                                                      (returnm ((andb
                                                                                                                                                                   (eq_vec
                                                                                                                                                                      (subrange_vec_dec
                                                                                                                                                                         v__9
                                                                                                                                                                         31
                                                                                                                                                                         25)
                                                                                                                                                                      ('b"0001101"
                                                                                                                                                                       : mword (31 - 25 + 1)))
                                                                                                                                                                   (eq_vec
                                                                                                                                                                      (subrange_vec_dec
                                                                                                                                                                         v__9
                                                                                                                                                                         6
                                                                                                                                                                         0)
                                                                                                                                                                      ('b"1010011"
                                                                                                                                                                       : mword (6 - 0 + 1))))
                                                                                                                                                        : bool))) >>= fun w__128 : bool =>
                                                                                                                                                   (if
                                                                                                                                                      sumbool_of_bool
                                                                                                                                                      w__128
                                                                                                                                                    then
                                                                                                                                                      let rs2 : mword 5 :=
                                                                                                                                                        subrange_vec_dec
                                                                                                                                                          v__9
                                                                                                                                                          24
                                                                                                                                                          20 in
                                                                                                                                                      let rs1 : mword 5 :=
                                                                                                                                                        subrange_vec_dec
                                                                                                                                                          v__9
                                                                                                                                                          19
                                                                                                                                                          15 in
                                                                                                                                                      let rd : mword 5 :=
                                                                                                                                                        subrange_vec_dec
                                                                                                                                                          v__9
                                                                                                                                                          11
                                                                                                                                                          7 in
                                                                                                                                                      let _mappingpatterns_106_ : mword 3 :=
                                                                                                                                                        subrange_vec_dec
                                                                                                                                                          v__9
                                                                                                                                                          14
                                                                                                                                                          12 in
                                                                                                                                                      (encdec_rounding_mode_backwards
                                                                                                                                                         _mappingpatterns_106_) >>= fun rm =>
                                                                                                                                                      returnm (F_BIN_RM_TYPE_D
                                                                                                                                                                 (rs2, rs1, rm, rd, FDIV_D))
                                                                                                                                                    else
                                                                                                                                                      (and_boolM
                                                                                                                                                         (let _mappingpatterns_107_ : mword 3 :=
                                                                                                                                                           subrange_vec_dec
                                                                                                                                                             v__9
                                                                                                                                                             14
                                                                                                                                                             12 in
                                                                                                                                                         (if
                                                                                                                                                            encdec_rounding_mode_backwards_matches
                                                                                                                                                              _mappingpatterns_107_
                                                                                                                                                          then
                                                                                                                                                            (encdec_rounding_mode_backwards
                                                                                                                                                               _mappingpatterns_107_) >>= fun rm =>
                                                                                                                                                            (is_RV32D_or_RV64D
                                                                                                                                                               tt)
                                                                                                                                                             : M (bool)
                                                                                                                                                          else
                                                                                                                                                            returnm false)
                                                                                                                                                          : M (bool))
                                                                                                                                                         (returnm ((andb
                                                                                                                                                                      (eq_vec
                                                                                                                                                                         (subrange_vec_dec
                                                                                                                                                                            v__9
                                                                                                                                                                            31
                                                                                                                                                                            20)
                                                                                                                                                                         (Ox"5A0"
                                                                                                                                                                          : mword (31 - 20 + 1)))
                                                                                                                                                                      (eq_vec
                                                                                                                                                                         (subrange_vec_dec
                                                                                                                                                                            v__9
                                                                                                                                                                            6
                                                                                                                                                                            0)
                                                                                                                                                                         ('b"1010011"
                                                                                                                                                                          : mword (6 - 0 + 1))))
                                                                                                                                                           : bool))) >>= fun w__131 : bool =>
                                                                                                                                                      (if
                                                                                                                                                         sumbool_of_bool
                                                                                                                                                         w__131
                                                                                                                                                       then
                                                                                                                                                         let rs1 : mword 5 :=
                                                                                                                                                           subrange_vec_dec
                                                                                                                                                             v__9
                                                                                                                                                             19
                                                                                                                                                             15 in
                                                                                                                                                         let rd : mword 5 :=
                                                                                                                                                           subrange_vec_dec
                                                                                                                                                             v__9
                                                                                                                                                             11
                                                                                                                                                             7 in
                                                                                                                                                         let _mappingpatterns_107_ : mword 3 :=
                                                                                                                                                           subrange_vec_dec
                                                                                                                                                             v__9
                                                                                                                                                             14
                                                                                                                                                             12 in
                                                                                                                                                         (encdec_rounding_mode_backwards
                                                                                                                                                            _mappingpatterns_107_) >>= fun rm =>
                                                                                                                                                         returnm (F_UN_RM_TYPE_D
                                                                                                                                                                    (rs1, rm, rd, FSQRT_D))
                                                                                                                                                       else
                                                                                                                                                         (and_boolM
                                                                                                                                                            (let _mappingpatterns_108_ : mword 3 :=
                                                                                                                                                              subrange_vec_dec
                                                                                                                                                                v__9
                                                                                                                                                                14
                                                                                                                                                                12 in
                                                                                                                                                            (if
                                                                                                                                                               encdec_rounding_mode_backwards_matches
                                                                                                                                                                 _mappingpatterns_108_
                                                                                                                                                             then
                                                                                                                                                               (encdec_rounding_mode_backwards
                                                                                                                                                                  _mappingpatterns_108_) >>= fun rm =>
                                                                                                                                                               (is_RV32D_or_RV64D
                                                                                                                                                                  tt)
                                                                                                                                                                : M (bool)
                                                                                                                                                             else
                                                                                                                                                               returnm false)
                                                                                                                                                             : M (bool))
                                                                                                                                                            (returnm ((andb
                                                                                                                                                                         (eq_vec
                                                                                                                                                                            (subrange_vec_dec
                                                                                                                                                                               v__9
                                                                                                                                                                               31
                                                                                                                                                                               20)
                                                                                                                                                                            (Ox"C20"
                                                                                                                                                                             : mword (31 - 20 + 1)))
                                                                                                                                                                         (eq_vec
                                                                                                                                                                            (subrange_vec_dec
                                                                                                                                                                               v__9
                                                                                                                                                                               6
                                                                                                                                                                               0)
                                                                                                                                                                            ('b"1010011"
                                                                                                                                                                             : mword (6 - 0 + 1))))
                                                                                                                                                              : bool))) >>= fun w__134 : bool =>
                                                                                                                                                         (if
                                                                                                                                                            sumbool_of_bool
                                                                                                                                                            w__134
                                                                                                                                                          then
                                                                                                                                                            let rs1 : mword 5 :=
                                                                                                                                                              subrange_vec_dec
                                                                                                                                                                v__9
                                                                                                                                                                19
                                                                                                                                                                15 in
                                                                                                                                                            let rd : mword 5 :=
                                                                                                                                                              subrange_vec_dec
                                                                                                                                                                v__9
                                                                                                                                                                11
                                                                                                                                                                7 in
                                                                                                                                                            let _mappingpatterns_108_ : mword 3 :=
                                                                                                                                                              subrange_vec_dec
                                                                                                                                                                v__9
                                                                                                                                                                14
                                                                                                                                                                12 in
                                                                                                                                                            (encdec_rounding_mode_backwards
                                                                                                                                                               _mappingpatterns_108_) >>= fun rm =>
                                                                                                                                                            returnm (F_UN_RM_TYPE_D
                                                                                                                                                                       (rs1, rm, rd, FCVT_W_D))
                                                                                                                                                          else
                                                                                                                                                            (and_boolM
                                                                                                                                                               (let _mappingpatterns_109_ : mword 3 :=
                                                                                                                                                                 subrange_vec_dec
                                                                                                                                                                   v__9
                                                                                                                                                                   14
                                                                                                                                                                   12 in
                                                                                                                                                               (if
                                                                                                                                                                  encdec_rounding_mode_backwards_matches
                                                                                                                                                                    _mappingpatterns_109_
                                                                                                                                                                then
                                                                                                                                                                  (encdec_rounding_mode_backwards
                                                                                                                                                                     _mappingpatterns_109_) >>= fun rm =>
                                                                                                                                                                  (is_RV32D_or_RV64D
                                                                                                                                                                     tt)
                                                                                                                                                                   : M (bool)
                                                                                                                                                                else
                                                                                                                                                                  returnm false)
                                                                                                                                                                : M (bool))
                                                                                                                                                               (returnm ((andb
                                                                                                                                                                            (eq_vec
                                                                                                                                                                               (subrange_vec_dec
                                                                                                                                                                                  v__9
                                                                                                                                                                                  31
                                                                                                                                                                                  20)
                                                                                                                                                                               (Ox"C21"
                                                                                                                                                                                : mword (31 - 20 + 1)))
                                                                                                                                                                            (eq_vec
                                                                                                                                                                               (subrange_vec_dec
                                                                                                                                                                                  v__9
                                                                                                                                                                                  6
                                                                                                                                                                                  0)
                                                                                                                                                                               ('b"1010011"
                                                                                                                                                                                : mword (6 - 0 + 1))))
                                                                                                                                                                 : bool))) >>= fun w__137 : bool =>
                                                                                                                                                            (if
                                                                                                                                                               sumbool_of_bool
                                                                                                                                                               w__137
                                                                                                                                                             then
                                                                                                                                                               let rs1 : mword 5 :=
                                                                                                                                                                 subrange_vec_dec
                                                                                                                                                                   v__9
                                                                                                                                                                   19
                                                                                                                                                                   15 in
                                                                                                                                                               let rd : mword 5 :=
                                                                                                                                                                 subrange_vec_dec
                                                                                                                                                                   v__9
                                                                                                                                                                   11
                                                                                                                                                                   7 in
                                                                                                                                                               let _mappingpatterns_109_ : mword 3 :=
                                                                                                                                                                 subrange_vec_dec
                                                                                                                                                                   v__9
                                                                                                                                                                   14
                                                                                                                                                                   12 in
                                                                                                                                                               (encdec_rounding_mode_backwards
                                                                                                                                                                  _mappingpatterns_109_) >>= fun rm =>
                                                                                                                                                               returnm (F_UN_RM_TYPE_D
                                                                                                                                                                          (rs1, rm, rd, FCVT_WU_D))
                                                                                                                                                             else
                                                                                                                                                               (and_boolM
                                                                                                                                                                  (let _mappingpatterns_110_ : mword 3 :=
                                                                                                                                                                    subrange_vec_dec
                                                                                                                                                                      v__9
                                                                                                                                                                      14
                                                                                                                                                                      12 in
                                                                                                                                                                  (if
                                                                                                                                                                     encdec_rounding_mode_backwards_matches
                                                                                                                                                                       _mappingpatterns_110_
                                                                                                                                                                   then
                                                                                                                                                                     (encdec_rounding_mode_backwards
                                                                                                                                                                        _mappingpatterns_110_) >>= fun rm =>
                                                                                                                                                                     (is_RV32D_or_RV64D
                                                                                                                                                                        tt)
                                                                                                                                                                      : M (bool)
                                                                                                                                                                   else
                                                                                                                                                                     returnm false)
                                                                                                                                                                   : M (bool))
                                                                                                                                                                  (returnm ((andb
                                                                                                                                                                               (eq_vec
                                                                                                                                                                                  (subrange_vec_dec
                                                                                                                                                                                     v__9
                                                                                                                                                                                     31
                                                                                                                                                                                     20)
                                                                                                                                                                                  (Ox"D20"
                                                                                                                                                                                   : mword (31 - 20 + 1)))
                                                                                                                                                                               (eq_vec
                                                                                                                                                                                  (subrange_vec_dec
                                                                                                                                                                                     v__9
                                                                                                                                                                                     6
                                                                                                                                                                                     0)
                                                                                                                                                                                  ('b"1010011"
                                                                                                                                                                                   : mword (6 - 0 + 1))))
                                                                                                                                                                    : bool))) >>= fun w__140 : bool =>
                                                                                                                                                               (if
                                                                                                                                                                  sumbool_of_bool
                                                                                                                                                                  w__140
                                                                                                                                                                then
                                                                                                                                                                  let rs1 : mword 5 :=
                                                                                                                                                                    subrange_vec_dec
                                                                                                                                                                      v__9
                                                                                                                                                                      19
                                                                                                                                                                      15 in
                                                                                                                                                                  let rd : mword 5 :=
                                                                                                                                                                    subrange_vec_dec
                                                                                                                                                                      v__9
                                                                                                                                                                      11
                                                                                                                                                                      7 in
                                                                                                                                                                  let _mappingpatterns_110_ : mword 3 :=
                                                                                                                                                                    subrange_vec_dec
                                                                                                                                                                      v__9
                                                                                                                                                                      14
                                                                                                                                                                      12 in
                                                                                                                                                                  (encdec_rounding_mode_backwards
                                                                                                                                                                     _mappingpatterns_110_) >>= fun rm =>
                                                                                                                                                                  returnm (F_UN_RM_TYPE_D
                                                                                                                                                                             (rs1, rm, rd, FCVT_D_W))
                                                                                                                                                                else
                                                                                                                                                                  (and_boolM
                                                                                                                                                                     (let _mappingpatterns_111_ : mword 3 :=
                                                                                                                                                                       subrange_vec_dec
                                                                                                                                                                         v__9
                                                                                                                                                                         14
                                                                                                                                                                         12 in
                                                                                                                                                                     (if
                                                                                                                                                                        encdec_rounding_mode_backwards_matches
                                                                                                                                                                          _mappingpatterns_111_
                                                                                                                                                                      then
                                                                                                                                                                        (encdec_rounding_mode_backwards
                                                                                                                                                                           _mappingpatterns_111_) >>= fun rm =>
                                                                                                                                                                        (is_RV32D_or_RV64D
                                                                                                                                                                           tt)
                                                                                                                                                                         : M (bool)
                                                                                                                                                                      else
                                                                                                                                                                        returnm false)
                                                                                                                                                                      : M (bool))
                                                                                                                                                                     (returnm ((andb
                                                                                                                                                                                  (eq_vec
                                                                                                                                                                                     (subrange_vec_dec
                                                                                                                                                                                        v__9
                                                                                                                                                                                        31
                                                                                                                                                                                        20)
                                                                                                                                                                                     (Ox"D21"
                                                                                                                                                                                      : mword (31 - 20 + 1)))
                                                                                                                                                                                  (eq_vec
                                                                                                                                                                                     (subrange_vec_dec
                                                                                                                                                                                        v__9
                                                                                                                                                                                        6
                                                                                                                                                                                        0)
                                                                                                                                                                                     ('b"1010011"
                                                                                                                                                                                      : mword (6 - 0 + 1))))
                                                                                                                                                                       : bool))) >>= fun w__143 : bool =>
                                                                                                                                                                  (if
                                                                                                                                                                     sumbool_of_bool
                                                                                                                                                                     w__143
                                                                                                                                                                   then
                                                                                                                                                                     let rs1 : mword 5 :=
                                                                                                                                                                       subrange_vec_dec
                                                                                                                                                                         v__9
                                                                                                                                                                         19
                                                                                                                                                                         15 in
                                                                                                                                                                     let rd : mword 5 :=
                                                                                                                                                                       subrange_vec_dec
                                                                                                                                                                         v__9
                                                                                                                                                                         11
                                                                                                                                                                         7 in
                                                                                                                                                                     let _mappingpatterns_111_ : mword 3 :=
                                                                                                                                                                       subrange_vec_dec
                                                                                                                                                                         v__9
                                                                                                                                                                         14
                                                                                                                                                                         12 in
                                                                                                                                                                     (encdec_rounding_mode_backwards
                                                                                                                                                                        _mappingpatterns_111_) >>= fun rm =>
                                                                                                                                                                     returnm (F_UN_RM_TYPE_D
                                                                                                                                                                                (rs1, rm, rd, FCVT_D_WU))
                                                                                                                                                                   else
                                                                                                                                                                     (and_boolM
                                                                                                                                                                        (let _mappingpatterns_112_ : mword 3 :=
                                                                                                                                                                          subrange_vec_dec
                                                                                                                                                                            v__9
                                                                                                                                                                            14
                                                                                                                                                                            12 in
                                                                                                                                                                        (if
                                                                                                                                                                           encdec_rounding_mode_backwards_matches
                                                                                                                                                                             _mappingpatterns_112_
                                                                                                                                                                         then
                                                                                                                                                                           (encdec_rounding_mode_backwards
                                                                                                                                                                              _mappingpatterns_112_) >>= fun rm =>
                                                                                                                                                                           (is_RV32D_or_RV64D
                                                                                                                                                                              tt)
                                                                                                                                                                            : M (bool)
                                                                                                                                                                         else
                                                                                                                                                                           returnm false)
                                                                                                                                                                         : M (bool))
                                                                                                                                                                        (returnm ((andb
                                                                                                                                                                                     (eq_vec
                                                                                                                                                                                        (subrange_vec_dec
                                                                                                                                                                                           v__9
                                                                                                                                                                                           31
                                                                                                                                                                                           20)
                                                                                                                                                                                        (Ox"401"
                                                                                                                                                                                         : mword (31 - 20 + 1)))
                                                                                                                                                                                     (eq_vec
                                                                                                                                                                                        (subrange_vec_dec
                                                                                                                                                                                           v__9
                                                                                                                                                                                           6
                                                                                                                                                                                           0)
                                                                                                                                                                                        ('b"1010011"
                                                                                                                                                                                         : mword (6 - 0 + 1))))
                                                                                                                                                                          : bool))) >>= fun w__146 : bool =>
                                                                                                                                                                     (if
                                                                                                                                                                        sumbool_of_bool
                                                                                                                                                                        w__146
                                                                                                                                                                      then
                                                                                                                                                                        let rs1 : mword 5 :=
                                                                                                                                                                          subrange_vec_dec
                                                                                                                                                                            v__9
                                                                                                                                                                            19
                                                                                                                                                                            15 in
                                                                                                                                                                        let rd : mword 5 :=
                                                                                                                                                                          subrange_vec_dec
                                                                                                                                                                            v__9
                                                                                                                                                                            11
                                                                                                                                                                            7 in
                                                                                                                                                                        let _mappingpatterns_112_ : mword 3 :=
                                                                                                                                                                          subrange_vec_dec
                                                                                                                                                                            v__9
                                                                                                                                                                            14
                                                                                                                                                                            12 in
                                                                                                                                                                        (encdec_rounding_mode_backwards
                                                                                                                                                                           _mappingpatterns_112_) >>= fun rm =>
                                                                                                                                                                        returnm (F_UN_RM_TYPE_D
                                                                                                                                                                                   (rs1, rm, rd, FCVT_S_D))
                                                                                                                                                                      else
                                                                                                                                                                        (and_boolM
                                                                                                                                                                           (let _mappingpatterns_113_ : mword 3 :=
                                                                                                                                                                             subrange_vec_dec
                                                                                                                                                                               v__9
                                                                                                                                                                               14
                                                                                                                                                                               12 in
                                                                                                                                                                           (if
                                                                                                                                                                              encdec_rounding_mode_backwards_matches
                                                                                                                                                                                _mappingpatterns_113_
                                                                                                                                                                            then
                                                                                                                                                                              (encdec_rounding_mode_backwards
                                                                                                                                                                                 _mappingpatterns_113_) >>= fun rm =>
                                                                                                                                                                              (is_RV32D_or_RV64D
                                                                                                                                                                                 tt)
                                                                                                                                                                               : M (bool)
                                                                                                                                                                            else
                                                                                                                                                                              returnm false)
                                                                                                                                                                            : M (bool))
                                                                                                                                                                           (returnm ((andb
                                                                                                                                                                                        (eq_vec
                                                                                                                                                                                           (subrange_vec_dec
                                                                                                                                                                                              v__9
                                                                                                                                                                                              31
                                                                                                                                                                                              20)
                                                                                                                                                                                           (Ox"420"
                                                                                                                                                                                            : mword (31 - 20 + 1)))
                                                                                                                                                                                        (eq_vec
                                                                                                                                                                                           (subrange_vec_dec
                                                                                                                                                                                              v__9
                                                                                                                                                                                              6
                                                                                                                                                                                              0)
                                                                                                                                                                                           ('b"1010011"
                                                                                                                                                                                            : mword (6 - 0 + 1))))
                                                                                                                                                                             : bool))) >>= fun w__149 : bool =>
                                                                                                                                                                        (if
                                                                                                                                                                           sumbool_of_bool
                                                                                                                                                                           w__149
                                                                                                                                                                         then
                                                                                                                                                                           let rs1 : mword 5 :=
                                                                                                                                                                             subrange_vec_dec
                                                                                                                                                                               v__9
                                                                                                                                                                               19
                                                                                                                                                                               15 in
                                                                                                                                                                           let rd : mword 5 :=
                                                                                                                                                                             subrange_vec_dec
                                                                                                                                                                               v__9
                                                                                                                                                                               11
                                                                                                                                                                               7 in
                                                                                                                                                                           let _mappingpatterns_113_ : mword 3 :=
                                                                                                                                                                             subrange_vec_dec
                                                                                                                                                                               v__9
                                                                                                                                                                               14
                                                                                                                                                                               12 in
                                                                                                                                                                           (encdec_rounding_mode_backwards
                                                                                                                                                                              _mappingpatterns_113_) >>= fun rm =>
                                                                                                                                                                           returnm (F_UN_RM_TYPE_D
                                                                                                                                                                                      (rs1, rm, rd, FCVT_D_S))
                                                                                                                                                                         else
                                                                                                                                                                           (and_boolM
                                                                                                                                                                              (let _mappingpatterns_114_ : mword 3 :=
                                                                                                                                                                                subrange_vec_dec
                                                                                                                                                                                  v__9
                                                                                                                                                                                  14
                                                                                                                                                                                  12 in
                                                                                                                                                                              (if
                                                                                                                                                                                 encdec_rounding_mode_backwards_matches
                                                                                                                                                                                   _mappingpatterns_114_
                                                                                                                                                                               then
                                                                                                                                                                                 (encdec_rounding_mode_backwards
                                                                                                                                                                                    _mappingpatterns_114_) >>= fun rm =>
                                                                                                                                                                                 (is_RV64D
                                                                                                                                                                                    tt)
                                                                                                                                                                                  : M (bool)
                                                                                                                                                                               else
                                                                                                                                                                                 returnm false)
                                                                                                                                                                               : M (bool))
                                                                                                                                                                              (returnm ((andb
                                                                                                                                                                                           (eq_vec
                                                                                                                                                                                              (subrange_vec_dec
                                                                                                                                                                                                 v__9
                                                                                                                                                                                                 31
                                                                                                                                                                                                 20)
                                                                                                                                                                                              (Ox"C22"
                                                                                                                                                                                               : mword (31 - 20 + 1)))
                                                                                                                                                                                           (eq_vec
                                                                                                                                                                                              (subrange_vec_dec
                                                                                                                                                                                                 v__9
                                                                                                                                                                                                 6
                                                                                                                                                                                                 0)
                                                                                                                                                                                              ('b"1010011"
                                                                                                                                                                                               : mword (6 - 0 + 1))))
                                                                                                                                                                                : bool))) >>= fun w__152 : bool =>
                                                                                                                                                                           (if
                                                                                                                                                                              sumbool_of_bool
                                                                                                                                                                              w__152
                                                                                                                                                                            then
                                                                                                                                                                              let rs1 : mword 5 :=
                                                                                                                                                                                subrange_vec_dec
                                                                                                                                                                                  v__9
                                                                                                                                                                                  19
                                                                                                                                                                                  15 in
                                                                                                                                                                              let rd : mword 5 :=
                                                                                                                                                                                subrange_vec_dec
                                                                                                                                                                                  v__9
                                                                                                                                                                                  11
                                                                                                                                                                                  7 in
                                                                                                                                                                              let _mappingpatterns_114_ : mword 3 :=
                                                                                                                                                                                subrange_vec_dec
                                                                                                                                                                                  v__9
                                                                                                                                                                                  14
                                                                                                                                                                                  12 in
                                                                                                                                                                              (encdec_rounding_mode_backwards
                                                                                                                                                                                 _mappingpatterns_114_) >>= fun rm =>
                                                                                                                                                                              returnm (F_UN_RM_TYPE_D
                                                                                                                                                                                         (rs1, rm, rd, FCVT_L_D))
                                                                                                                                                                            else
                                                                                                                                                                              (and_boolM
                                                                                                                                                                                 (let _mappingpatterns_115_ : mword 3 :=
                                                                                                                                                                                   subrange_vec_dec
                                                                                                                                                                                     v__9
                                                                                                                                                                                     14
                                                                                                                                                                                     12 in
                                                                                                                                                                                 (if
                                                                                                                                                                                    encdec_rounding_mode_backwards_matches
                                                                                                                                                                                      _mappingpatterns_115_
                                                                                                                                                                                  then
                                                                                                                                                                                    (encdec_rounding_mode_backwards
                                                                                                                                                                                       _mappingpatterns_115_) >>= fun rm =>
                                                                                                                                                                                    (is_RV64D
                                                                                                                                                                                       tt)
                                                                                                                                                                                     : M (bool)
                                                                                                                                                                                  else
                                                                                                                                                                                    returnm false)
                                                                                                                                                                                  : M (bool))
                                                                                                                                                                                 (returnm ((andb
                                                                                                                                                                                              (eq_vec
                                                                                                                                                                                                 (subrange_vec_dec
                                                                                                                                                                                                    v__9
                                                                                                                                                                                                    31
                                                                                                                                                                                                    20)
                                                                                                                                                                                                 (Ox"C23"
                                                                                                                                                                                                  : mword (31 - 20 + 1)))
                                                                                                                                                                                              (eq_vec
                                                                                                                                                                                                 (subrange_vec_dec
                                                                                                                                                                                                    v__9
                                                                                                                                                                                                    6
                                                                                                                                                                                                    0)
                                                                                                                                                                                                 ('b"1010011"
                                                                                                                                                                                                  : mword (6 - 0 + 1))))
                                                                                                                                                                                   : bool))) >>= fun w__155 : bool =>
                                                                                                                                                                              (if
                                                                                                                                                                                 sumbool_of_bool
                                                                                                                                                                                 w__155
                                                                                                                                                                               then
                                                                                                                                                                                 let rs1 : mword 5 :=
                                                                                                                                                                                   subrange_vec_dec
                                                                                                                                                                                     v__9
                                                                                                                                                                                     19
                                                                                                                                                                                     15 in
                                                                                                                                                                                 let rd : mword 5 :=
                                                                                                                                                                                   subrange_vec_dec
                                                                                                                                                                                     v__9
                                                                                                                                                                                     11
                                                                                                                                                                                     7 in
                                                                                                                                                                                 let _mappingpatterns_115_ : mword 3 :=
                                                                                                                                                                                   subrange_vec_dec
                                                                                                                                                                                     v__9
                                                                                                                                                                                     14
                                                                                                                                                                                     12 in
                                                                                                                                                                                 (encdec_rounding_mode_backwards
                                                                                                                                                                                    _mappingpatterns_115_) >>= fun rm =>
                                                                                                                                                                                 returnm (F_UN_RM_TYPE_D
                                                                                                                                                                                            (rs1, rm, rd, FCVT_LU_D))
                                                                                                                                                                               else
                                                                                                                                                                                 (and_boolM
                                                                                                                                                                                    (let _mappingpatterns_116_ : mword 3 :=
                                                                                                                                                                                      subrange_vec_dec
                                                                                                                                                                                        v__9
                                                                                                                                                                                        14
                                                                                                                                                                                        12 in
                                                                                                                                                                                    (if
                                                                                                                                                                                       encdec_rounding_mode_backwards_matches
                                                                                                                                                                                         _mappingpatterns_116_
                                                                                                                                                                                     then
                                                                                                                                                                                       (encdec_rounding_mode_backwards
                                                                                                                                                                                          _mappingpatterns_116_) >>= fun rm =>
                                                                                                                                                                                       (is_RV64D
                                                                                                                                                                                          tt)
                                                                                                                                                                                        : M (bool)
                                                                                                                                                                                     else
                                                                                                                                                                                       returnm false)
                                                                                                                                                                                     : M (bool))
                                                                                                                                                                                    (returnm ((andb
                                                                                                                                                                                                 (eq_vec
                                                                                                                                                                                                    (subrange_vec_dec
                                                                                                                                                                                                       v__9
                                                                                                                                                                                                       31
                                                                                                                                                                                                       20)
                                                                                                                                                                                                    (Ox"D22"
                                                                                                                                                                                                     : mword (31 - 20 + 1)))
                                                                                                                                                                                                 (eq_vec
                                                                                                                                                                                                    (subrange_vec_dec
                                                                                                                                                                                                       v__9
                                                                                                                                                                                                       6
                                                                                                                                                                                                       0)
                                                                                                                                                                                                    ('b"1010011"
                                                                                                                                                                                                     : mword (6 - 0 + 1))))
                                                                                                                                                                                      : bool))) >>= fun w__158 : bool =>
                                                                                                                                                                                 (if
                                                                                                                                                                                    sumbool_of_bool
                                                                                                                                                                                    w__158
                                                                                                                                                                                  then
                                                                                                                                                                                    let rs1 : mword 5 :=
                                                                                                                                                                                      subrange_vec_dec
                                                                                                                                                                                        v__9
                                                                                                                                                                                        19
                                                                                                                                                                                        15 in
                                                                                                                                                                                    let rd : mword 5 :=
                                                                                                                                                                                      subrange_vec_dec
                                                                                                                                                                                        v__9
                                                                                                                                                                                        11
                                                                                                                                                                                        7 in
                                                                                                                                                                                    let _mappingpatterns_116_ : mword 3 :=
                                                                                                                                                                                      subrange_vec_dec
                                                                                                                                                                                        v__9
                                                                                                                                                                                        14
                                                                                                                                                                                        12 in
                                                                                                                                                                                    (encdec_rounding_mode_backwards
                                                                                                                                                                                       _mappingpatterns_116_) >>= fun rm =>
                                                                                                                                                                                    returnm (F_UN_RM_TYPE_D
                                                                                                                                                                                               (rs1, rm, rd, FCVT_D_L))
                                                                                                                                                                                  else
                                                                                                                                                                                    (and_boolM
                                                                                                                                                                                       (let _mappingpatterns_117_ : mword 3 :=
                                                                                                                                                                                         subrange_vec_dec
                                                                                                                                                                                           v__9
                                                                                                                                                                                           14
                                                                                                                                                                                           12 in
                                                                                                                                                                                       (if
                                                                                                                                                                                          encdec_rounding_mode_backwards_matches
                                                                                                                                                                                            _mappingpatterns_117_
                                                                                                                                                                                        then
                                                                                                                                                                                          (encdec_rounding_mode_backwards
                                                                                                                                                                                             _mappingpatterns_117_) >>= fun rm =>
                                                                                                                                                                                          (is_RV64D
                                                                                                                                                                                             tt)
                                                                                                                                                                                           : M (bool)
                                                                                                                                                                                        else
                                                                                                                                                                                          returnm false)
                                                                                                                                                                                        : M (bool))
                                                                                                                                                                                       (returnm ((andb
                                                                                                                                                                                                    (eq_vec
                                                                                                                                                                                                       (subrange_vec_dec
                                                                                                                                                                                                          v__9
                                                                                                                                                                                                          31
                                                                                                                                                                                                          20)
                                                                                                                                                                                                       (Ox"D23"
                                                                                                                                                                                                        : mword (31 - 20 + 1)))
                                                                                                                                                                                                    (eq_vec
                                                                                                                                                                                                       (subrange_vec_dec
                                                                                                                                                                                                          v__9
                                                                                                                                                                                                          6
                                                                                                                                                                                                          0)
                                                                                                                                                                                                       ('b"1010011"
                                                                                                                                                                                                        : mword (6 - 0 + 1))))
                                                                                                                                                                                         : bool))) >>= fun w__161 : bool =>
                                                                                                                                                                                    (if
                                                                                                                                                                                       sumbool_of_bool
                                                                                                                                                                                       w__161
                                                                                                                                                                                     then
                                                                                                                                                                                       let rs1 : mword 5 :=
                                                                                                                                                                                         subrange_vec_dec
                                                                                                                                                                                           v__9
                                                                                                                                                                                           19
                                                                                                                                                                                           15 in
                                                                                                                                                                                       let rd : mword 5 :=
                                                                                                                                                                                         subrange_vec_dec
                                                                                                                                                                                           v__9
                                                                                                                                                                                           11
                                                                                                                                                                                           7 in
                                                                                                                                                                                       let _mappingpatterns_117_ : mword 3 :=
                                                                                                                                                                                         subrange_vec_dec
                                                                                                                                                                                           v__9
                                                                                                                                                                                           14
                                                                                                                                                                                           12 in
                                                                                                                                                                                       (encdec_rounding_mode_backwards
                                                                                                                                                                                          _mappingpatterns_117_) >>= fun rm =>
                                                                                                                                                                                       returnm (F_UN_RM_TYPE_D
                                                                                                                                                                                                  (rs1, rm, rd, FCVT_D_LU))
                                                                                                                                                                                     else
                                                                                                                                                                                       (and_boolM
                                                                                                                                                                                          ((is_RV32D_or_RV64D
                                                                                                                                                                                              tt)
                                                                                                                                                                                           : M (bool))
                                                                                                                                                                                          (returnm ((andb
                                                                                                                                                                                                       (eq_vec
                                                                                                                                                                                                          (subrange_vec_dec
                                                                                                                                                                                                             v__9
                                                                                                                                                                                                             31
                                                                                                                                                                                                             25)
                                                                                                                                                                                                          ('b"0010001"
                                                                                                                                                                                                           : mword (31 - 25 + 1)))
                                                                                                                                                                                                       (andb
                                                                                                                                                                                                          (eq_vec
                                                                                                                                                                                                             (subrange_vec_dec
                                                                                                                                                                                                                v__9
                                                                                                                                                                                                                14
                                                                                                                                                                                                                12)
                                                                                                                                                                                                             ('b"000"
                                                                                                                                                                                                              : mword (14 - 12 + 1)))
                                                                                                                                                                                                          (eq_vec
                                                                                                                                                                                                             (subrange_vec_dec
                                                                                                                                                                                                                v__9
                                                                                                                                                                                                                6
                                                                                                                                                                                                                0)
                                                                                                                                                                                                             ('b"1010011"
                                                                                                                                                                                                              : mword (6 - 0 + 1)))))
                                                                                                                                                                                            : bool))) >>= fun w__163 : bool =>
                                                                                                                                                                                       (if
                                                                                                                                                                                          sumbool_of_bool
                                                                                                                                                                                          w__163
                                                                                                                                                                                        then
                                                                                                                                                                                          let rs2 : mword 5 :=
                                                                                                                                                                                            subrange_vec_dec
                                                                                                                                                                                              v__9
                                                                                                                                                                                              24
                                                                                                                                                                                              20 in
                                                                                                                                                                                          let rs1 : mword 5 :=
                                                                                                                                                                                            subrange_vec_dec
                                                                                                                                                                                              v__9
                                                                                                                                                                                              19
                                                                                                                                                                                              15 in
                                                                                                                                                                                          let rd : mword 5 :=
                                                                                                                                                                                            subrange_vec_dec
                                                                                                                                                                                              v__9
                                                                                                                                                                                              11
                                                                                                                                                                                              7 in
                                                                                                                                                                                          returnm (F_BIN_TYPE_D
                                                                                                                                                                                                     (rs2, rs1, rd, FSGNJ_D))
                                                                                                                                                                                        else
                                                                                                                                                                                          (and_boolM
                                                                                                                                                                                             ((is_RV32D_or_RV64D
                                                                                                                                                                                                 tt)
                                                                                                                                                                                              : M (bool))
                                                                                                                                                                                             (returnm ((andb
                                                                                                                                                                                                          (eq_vec
                                                                                                                                                                                                             (subrange_vec_dec
                                                                                                                                                                                                                v__9
                                                                                                                                                                                                                31
                                                                                                                                                                                                                25)
                                                                                                                                                                                                             ('b"0010001"
                                                                                                                                                                                                              : mword (31 - 25 + 1)))
                                                                                                                                                                                                          (andb
                                                                                                                                                                                                             (eq_vec
                                                                                                                                                                                                                (subrange_vec_dec
                                                                                                                                                                                                                   v__9
                                                                                                                                                                                                                   14
                                                                                                                                                                                                                   12)
                                                                                                                                                                                                                ('b"001"
                                                                                                                                                                                                                 : mword (14 - 12 + 1)))
                                                                                                                                                                                                             (eq_vec
                                                                                                                                                                                                                (subrange_vec_dec
                                                                                                                                                                                                                   v__9
                                                                                                                                                                                                                   6
                                                                                                                                                                                                                   0)
                                                                                                                                                                                                                ('b"1010011"
                                                                                                                                                                                                                 : mword (6 - 0 + 1)))))
                                                                                                                                                                                               : bool))) >>= fun w__165 : bool =>
                                                                                                                                                                                          (if
                                                                                                                                                                                             sumbool_of_bool
                                                                                                                                                                                             w__165
                                                                                                                                                                                           then
                                                                                                                                                                                             let rs2 : mword 5 :=
                                                                                                                                                                                               subrange_vec_dec
                                                                                                                                                                                                 v__9
                                                                                                                                                                                                 24
                                                                                                                                                                                                 20 in
                                                                                                                                                                                             let rs1 : mword 5 :=
                                                                                                                                                                                               subrange_vec_dec
                                                                                                                                                                                                 v__9
                                                                                                                                                                                                 19
                                                                                                                                                                                                 15 in
                                                                                                                                                                                             let rd : mword 5 :=
                                                                                                                                                                                               subrange_vec_dec
                                                                                                                                                                                                 v__9
                                                                                                                                                                                                 11
                                                                                                                                                                                                 7 in
                                                                                                                                                                                             returnm (F_BIN_TYPE_D
                                                                                                                                                                                                        (rs2, rs1, rd, FSGNJN_D))
                                                                                                                                                                                           else
                                                                                                                                                                                             (and_boolM
                                                                                                                                                                                                ((is_RV32D_or_RV64D
                                                                                                                                                                                                    tt)
                                                                                                                                                                                                 : M (bool))
                                                                                                                                                                                                (returnm ((andb
                                                                                                                                                                                                             (eq_vec
                                                                                                                                                                                                                (subrange_vec_dec
                                                                                                                                                                                                                   v__9
                                                                                                                                                                                                                   31
                                                                                                                                                                                                                   25)
                                                                                                                                                                                                                ('b"0010001"
                                                                                                                                                                                                                 : mword (31 - 25 + 1)))
                                                                                                                                                                                                             (andb
                                                                                                                                                                                                                (eq_vec
                                                                                                                                                                                                                   (subrange_vec_dec
                                                                                                                                                                                                                      v__9
                                                                                                                                                                                                                      14
                                                                                                                                                                                                                      12)
                                                                                                                                                                                                                   ('b"010"
                                                                                                                                                                                                                    : mword (14 - 12 + 1)))
                                                                                                                                                                                                                (eq_vec
                                                                                                                                                                                                                   (subrange_vec_dec
                                                                                                                                                                                                                      v__9
                                                                                                                                                                                                                      6
                                                                                                                                                                                                                      0)
                                                                                                                                                                                                                   ('b"1010011"
                                                                                                                                                                                                                    : mword (6 - 0 + 1)))))
                                                                                                                                                                                                  : bool))) >>= fun w__167 : bool =>
                                                                                                                                                                                             (if
                                                                                                                                                                                                sumbool_of_bool
                                                                                                                                                                                                w__167
                                                                                                                                                                                              then
                                                                                                                                                                                                let rs2 : mword 5 :=
                                                                                                                                                                                                  subrange_vec_dec
                                                                                                                                                                                                    v__9
                                                                                                                                                                                                    24
                                                                                                                                                                                                    20 in
                                                                                                                                                                                                let rs1 : mword 5 :=
                                                                                                                                                                                                  subrange_vec_dec
                                                                                                                                                                                                    v__9
                                                                                                                                                                                                    19
                                                                                                                                                                                                    15 in
                                                                                                                                                                                                let rd : mword 5 :=
                                                                                                                                                                                                  subrange_vec_dec
                                                                                                                                                                                                    v__9
                                                                                                                                                                                                    11
                                                                                                                                                                                                    7 in
                                                                                                                                                                                                returnm (F_BIN_TYPE_D
                                                                                                                                                                                                           (rs2, rs1, rd, FSGNJX_D))
                                                                                                                                                                                              else
                                                                                                                                                                                                (and_boolM
                                                                                                                                                                                                   ((is_RV32D_or_RV64D
                                                                                                                                                                                                       tt)
                                                                                                                                                                                                    : M (bool))
                                                                                                                                                                                                   (returnm ((andb
                                                                                                                                                                                                                (eq_vec
                                                                                                                                                                                                                   (subrange_vec_dec
                                                                                                                                                                                                                      v__9
                                                                                                                                                                                                                      31
                                                                                                                                                                                                                      25)
                                                                                                                                                                                                                   ('b"0010101"
                                                                                                                                                                                                                    : mword (31 - 25 + 1)))
                                                                                                                                                                                                                (andb
                                                                                                                                                                                                                   (eq_vec
                                                                                                                                                                                                                      (subrange_vec_dec
                                                                                                                                                                                                                         v__9
                                                                                                                                                                                                                         14
                                                                                                                                                                                                                         12)
                                                                                                                                                                                                                      ('b"000"
                                                                                                                                                                                                                       : mword (14 - 12 + 1)))
                                                                                                                                                                                                                   (eq_vec
                                                                                                                                                                                                                      (subrange_vec_dec
                                                                                                                                                                                                                         v__9
                                                                                                                                                                                                                         6
                                                                                                                                                                                                                         0)
                                                                                                                                                                                                                      ('b"1010011"
                                                                                                                                                                                                                       : mword (6 - 0 + 1)))))
                                                                                                                                                                                                     : bool))) >>= fun w__169 : bool =>
                                                                                                                                                                                                (if
                                                                                                                                                                                                   sumbool_of_bool
                                                                                                                                                                                                   w__169
                                                                                                                                                                                                 then
                                                                                                                                                                                                   let rs2 : mword 5 :=
                                                                                                                                                                                                     subrange_vec_dec
                                                                                                                                                                                                       v__9
                                                                                                                                                                                                       24
                                                                                                                                                                                                       20 in
                                                                                                                                                                                                   let rs1 : mword 5 :=
                                                                                                                                                                                                     subrange_vec_dec
                                                                                                                                                                                                       v__9
                                                                                                                                                                                                       19
                                                                                                                                                                                                       15 in
                                                                                                                                                                                                   let rd : mword 5 :=
                                                                                                                                                                                                     subrange_vec_dec
                                                                                                                                                                                                       v__9
                                                                                                                                                                                                       11
                                                                                                                                                                                                       7 in
                                                                                                                                                                                                   returnm (F_BIN_TYPE_D
                                                                                                                                                                                                              (rs2, rs1, rd, FMIN_D))
                                                                                                                                                                                                 else
                                                                                                                                                                                                   (and_boolM
                                                                                                                                                                                                      ((is_RV32D_or_RV64D
                                                                                                                                                                                                          tt)
                                                                                                                                                                                                       : M (bool))
                                                                                                                                                                                                      (returnm ((andb
                                                                                                                                                                                                                   (eq_vec
                                                                                                                                                                                                                      (subrange_vec_dec
                                                                                                                                                                                                                         v__9
                                                                                                                                                                                                                         31
                                                                                                                                                                                                                         25)
                                                                                                                                                                                                                      ('b"0010101"
                                                                                                                                                                                                                       : mword (31 - 25 + 1)))
                                                                                                                                                                                                                   (andb
                                                                                                                                                                                                                      (eq_vec
                                                                                                                                                                                                                         (subrange_vec_dec
                                                                                                                                                                                                                            v__9
                                                                                                                                                                                                                            14
                                                                                                                                                                                                                            12)
                                                                                                                                                                                                                         ('b"001"
                                                                                                                                                                                                                          : mword (14 - 12 + 1)))
                                                                                                                                                                                                                      (eq_vec
                                                                                                                                                                                                                         (subrange_vec_dec
                                                                                                                                                                                                                            v__9
                                                                                                                                                                                                                            6
                                                                                                                                                                                                                            0)
                                                                                                                                                                                                                         ('b"1010011"
                                                                                                                                                                                                                          : mword (6 - 0 + 1)))))
                                                                                                                                                                                                        : bool))) >>= fun w__171 : bool =>
                                                                                                                                                                                                   (if
                                                                                                                                                                                                      sumbool_of_bool
                                                                                                                                                                                                      w__171
                                                                                                                                                                                                    then
                                                                                                                                                                                                      let rs2 : mword 5 :=
                                                                                                                                                                                                        subrange_vec_dec
                                                                                                                                                                                                          v__9
                                                                                                                                                                                                          24
                                                                                                                                                                                                          20 in
                                                                                                                                                                                                      let rs1 : mword 5 :=
                                                                                                                                                                                                        subrange_vec_dec
                                                                                                                                                                                                          v__9
                                                                                                                                                                                                          19
                                                                                                                                                                                                          15 in
                                                                                                                                                                                                      let rd : mword 5 :=
                                                                                                                                                                                                        subrange_vec_dec
                                                                                                                                                                                                          v__9
                                                                                                                                                                                                          11
                                                                                                                                                                                                          7 in
                                                                                                                                                                                                      returnm (F_BIN_TYPE_D
                                                                                                                                                                                                                 (rs2, rs1, rd, FMAX_D))
                                                                                                                                                                                                    else
                                                                                                                                                                                                      (and_boolM
                                                                                                                                                                                                         ((is_RV32D_or_RV64D
                                                                                                                                                                                                             tt)
                                                                                                                                                                                                          : M (bool))
                                                                                                                                                                                                         (returnm ((andb
                                                                                                                                                                                                                      (eq_vec
                                                                                                                                                                                                                         (subrange_vec_dec
                                                                                                                                                                                                                            v__9
                                                                                                                                                                                                                            31
                                                                                                                                                                                                                            25)
                                                                                                                                                                                                                         ('b"1010001"
                                                                                                                                                                                                                          : mword (31 - 25 + 1)))
                                                                                                                                                                                                                      (andb
                                                                                                                                                                                                                         (eq_vec
                                                                                                                                                                                                                            (subrange_vec_dec
                                                                                                                                                                                                                               v__9
                                                                                                                                                                                                                               14
                                                                                                                                                                                                                               12)
                                                                                                                                                                                                                            ('b"010"
                                                                                                                                                                                                                             : mword (14 - 12 + 1)))
                                                                                                                                                                                                                         (eq_vec
                                                                                                                                                                                                                            (subrange_vec_dec
                                                                                                                                                                                                                               v__9
                                                                                                                                                                                                                               6
                                                                                                                                                                                                                               0)
                                                                                                                                                                                                                            ('b"1010011"
                                                                                                                                                                                                                             : mword (6 - 0 + 1)))))
                                                                                                                                                                                                           : bool))) >>= fun w__173 : bool =>
                                                                                                                                                                                                      (if
                                                                                                                                                                                                         sumbool_of_bool
                                                                                                                                                                                                         w__173
                                                                                                                                                                                                       then
                                                                                                                                                                                                         let rs2 : mword 5 :=
                                                                                                                                                                                                           subrange_vec_dec
                                                                                                                                                                                                             v__9
                                                                                                                                                                                                             24
                                                                                                                                                                                                             20 in
                                                                                                                                                                                                         let rs1 : mword 5 :=
                                                                                                                                                                                                           subrange_vec_dec
                                                                                                                                                                                                             v__9
                                                                                                                                                                                                             19
                                                                                                                                                                                                             15 in
                                                                                                                                                                                                         let rd : mword 5 :=
                                                                                                                                                                                                           subrange_vec_dec
                                                                                                                                                                                                             v__9
                                                                                                                                                                                                             11
                                                                                                                                                                                                             7 in
                                                                                                                                                                                                         returnm (F_BIN_TYPE_D
                                                                                                                                                                                                                    (rs2, rs1, rd, FEQ_D))
                                                                                                                                                                                                       else
                                                                                                                                                                                                         (and_boolM
                                                                                                                                                                                                            ((is_RV32D_or_RV64D
                                                                                                                                                                                                                tt)
                                                                                                                                                                                                             : M (bool))
                                                                                                                                                                                                            (returnm ((andb
                                                                                                                                                                                                                         (eq_vec
                                                                                                                                                                                                                            (subrange_vec_dec
                                                                                                                                                                                                                               v__9
                                                                                                                                                                                                                               31
                                                                                                                                                                                                                               25)
                                                                                                                                                                                                                            ('b"1010001"
                                                                                                                                                                                                                             : mword (31 - 25 + 1)))
                                                                                                                                                                                                                         (andb
                                                                                                                                                                                                                            (eq_vec
                                                                                                                                                                                                                               (subrange_vec_dec
                                                                                                                                                                                                                                  v__9
                                                                                                                                                                                                                                  14
                                                                                                                                                                                                                                  12)
                                                                                                                                                                                                                               ('b"001"
                                                                                                                                                                                                                                : mword (14 - 12 + 1)))
                                                                                                                                                                                                                            (eq_vec
                                                                                                                                                                                                                               (subrange_vec_dec
                                                                                                                                                                                                                                  v__9
                                                                                                                                                                                                                                  6
                                                                                                                                                                                                                                  0)
                                                                                                                                                                                                                               ('b"1010011"
                                                                                                                                                                                                                                : mword (6 - 0 + 1)))))
                                                                                                                                                                                                              : bool))) >>= fun w__175 : bool =>
                                                                                                                                                                                                         (if
                                                                                                                                                                                                            sumbool_of_bool
                                                                                                                                                                                                            w__175
                                                                                                                                                                                                          then
                                                                                                                                                                                                            let rs2 : mword 5 :=
                                                                                                                                                                                                              subrange_vec_dec
                                                                                                                                                                                                                v__9
                                                                                                                                                                                                                24
                                                                                                                                                                                                                20 in
                                                                                                                                                                                                            let rs1 : mword 5 :=
                                                                                                                                                                                                              subrange_vec_dec
                                                                                                                                                                                                                v__9
                                                                                                                                                                                                                19
                                                                                                                                                                                                                15 in
                                                                                                                                                                                                            let rd : mword 5 :=
                                                                                                                                                                                                              subrange_vec_dec
                                                                                                                                                                                                                v__9
                                                                                                                                                                                                                11
                                                                                                                                                                                                                7 in
                                                                                                                                                                                                            returnm (F_BIN_TYPE_D
                                                                                                                                                                                                                       (rs2, rs1, rd, FLT_D))
                                                                                                                                                                                                          else
                                                                                                                                                                                                            (and_boolM
                                                                                                                                                                                                               ((is_RV32D_or_RV64D
                                                                                                                                                                                                                   tt)
                                                                                                                                                                                                                : M (bool))
                                                                                                                                                                                                               (returnm ((andb
                                                                                                                                                                                                                            (eq_vec
                                                                                                                                                                                                                               (subrange_vec_dec
                                                                                                                                                                                                                                  v__9
                                                                                                                                                                                                                                  31
                                                                                                                                                                                                                                  25)
                                                                                                                                                                                                                               ('b"1010001"
                                                                                                                                                                                                                                : mword (31 - 25 + 1)))
                                                                                                                                                                                                                            (andb
                                                                                                                                                                                                                               (eq_vec
                                                                                                                                                                                                                                  (subrange_vec_dec
                                                                                                                                                                                                                                     v__9
                                                                                                                                                                                                                                     14
                                                                                                                                                                                                                                     12)
                                                                                                                                                                                                                                  ('b"000"
                                                                                                                                                                                                                                   : mword (14 - 12 + 1)))
                                                                                                                                                                                                                               (eq_vec
                                                                                                                                                                                                                                  (subrange_vec_dec
                                                                                                                                                                                                                                     v__9
                                                                                                                                                                                                                                     6
                                                                                                                                                                                                                                     0)
                                                                                                                                                                                                                                  ('b"1010011"
                                                                                                                                                                                                                                   : mword (6 - 0 + 1)))))
                                                                                                                                                                                                                 : bool))) >>= fun w__177 : bool =>
                                                                                                                                                                                                            (if
                                                                                                                                                                                                               sumbool_of_bool
                                                                                                                                                                                                               w__177
                                                                                                                                                                                                             then
                                                                                                                                                                                                               let rs2 : mword 5 :=
                                                                                                                                                                                                                 subrange_vec_dec
                                                                                                                                                                                                                   v__9
                                                                                                                                                                                                                   24
                                                                                                                                                                                                                   20 in
                                                                                                                                                                                                               let rs1 : mword 5 :=
                                                                                                                                                                                                                 subrange_vec_dec
                                                                                                                                                                                                                   v__9
                                                                                                                                                                                                                   19
                                                                                                                                                                                                                   15 in
                                                                                                                                                                                                               let rd : mword 5 :=
                                                                                                                                                                                                                 subrange_vec_dec
                                                                                                                                                                                                                   v__9
                                                                                                                                                                                                                   11
                                                                                                                                                                                                                   7 in
                                                                                                                                                                                                               returnm (F_BIN_TYPE_D
                                                                                                                                                                                                                          (rs2, rs1, rd, FLE_D))
                                                                                                                                                                                                             else
                                                                                                                                                                                                               (and_boolM
                                                                                                                                                                                                                  ((haveDExt
                                                                                                                                                                                                                      tt)
                                                                                                                                                                                                                   : M (bool))
                                                                                                                                                                                                                  (returnm ((andb
                                                                                                                                                                                                                               (eq_vec
                                                                                                                                                                                                                                  (subrange_vec_dec
                                                                                                                                                                                                                                     v__9
                                                                                                                                                                                                                                     31
                                                                                                                                                                                                                                     20)
                                                                                                                                                                                                                                  (Ox"E20"
                                                                                                                                                                                                                                   : mword (31 - 20 + 1)))
                                                                                                                                                                                                                               (andb
                                                                                                                                                                                                                                  (eq_vec
                                                                                                                                                                                                                                     (subrange_vec_dec
                                                                                                                                                                                                                                        v__9
                                                                                                                                                                                                                                        14
                                                                                                                                                                                                                                        12)
                                                                                                                                                                                                                                     ('b"001"
                                                                                                                                                                                                                                      : mword (14 - 12 + 1)))
                                                                                                                                                                                                                                  (eq_vec
                                                                                                                                                                                                                                     (subrange_vec_dec
                                                                                                                                                                                                                                        v__9
                                                                                                                                                                                                                                        6
                                                                                                                                                                                                                                        0)
                                                                                                                                                                                                                                     ('b"1010011"
                                                                                                                                                                                                                                      : mword (6 - 0 + 1)))))
                                                                                                                                                                                                                    : bool))) >>= fun w__179 : bool =>
                                                                                                                                                                                                               (if
                                                                                                                                                                                                                  sumbool_of_bool
                                                                                                                                                                                                                  w__179
                                                                                                                                                                                                                then
                                                                                                                                                                                                                  let rs1 : mword 5 :=
                                                                                                                                                                                                                    subrange_vec_dec
                                                                                                                                                                                                                      v__9
                                                                                                                                                                                                                      19
                                                                                                                                                                                                                      15 in
                                                                                                                                                                                                                  let rd : mword 5 :=
                                                                                                                                                                                                                    subrange_vec_dec
                                                                                                                                                                                                                      v__9
                                                                                                                                                                                                                      11
                                                                                                                                                                                                                      7 in
                                                                                                                                                                                                                  returnm (F_UN_TYPE_D
                                                                                                                                                                                                                             (rs1, rd, FCLASS_D))
                                                                                                                                                                                                                else
                                                                                                                                                                                                                  (and_boolM
                                                                                                                                                                                                                     ((is_RV64D
                                                                                                                                                                                                                         tt)
                                                                                                                                                                                                                      : M (bool))
                                                                                                                                                                                                                     (returnm ((andb
                                                                                                                                                                                                                                  (eq_vec
                                                                                                                                                                                                                                     (subrange_vec_dec
                                                                                                                                                                                                                                        v__9
                                                                                                                                                                                                                                        31
                                                                                                                                                                                                                                        20)
                                                                                                                                                                                                                                     (Ox"E20"
                                                                                                                                                                                                                                      : mword (31 - 20 + 1)))
                                                                                                                                                                                                                                  (andb
                                                                                                                                                                                                                                     (eq_vec
                                                                                                                                                                                                                                        (subrange_vec_dec
                                                                                                                                                                                                                                           v__9
                                                                                                                                                                                                                                           14
                                                                                                                                                                                                                                           12)
                                                                                                                                                                                                                                        ('b"000"
                                                                                                                                                                                                                                         : mword (14 - 12 + 1)))
                                                                                                                                                                                                                                     (eq_vec
                                                                                                                                                                                                                                        (subrange_vec_dec
                                                                                                                                                                                                                                           v__9
                                                                                                                                                                                                                                           6
                                                                                                                                                                                                                                           0)
                                                                                                                                                                                                                                        ('b"1010011"
                                                                                                                                                                                                                                         : mword (6 - 0 + 1)))))
                                                                                                                                                                                                                       : bool))) >>= fun w__181 : bool =>
                                                                                                                                                                                                                  (if
                                                                                                                                                                                                                     sumbool_of_bool
                                                                                                                                                                                                                     w__181
                                                                                                                                                                                                                   then
                                                                                                                                                                                                                     let rs1 : mword 5 :=
                                                                                                                                                                                                                       subrange_vec_dec
                                                                                                                                                                                                                         v__9
                                                                                                                                                                                                                         19
                                                                                                                                                                                                                         15 in
                                                                                                                                                                                                                     let rd : mword 5 :=
                                                                                                                                                                                                                       subrange_vec_dec
                                                                                                                                                                                                                         v__9
                                                                                                                                                                                                                         11
                                                                                                                                                                                                                         7 in
                                                                                                                                                                                                                     returnm (F_UN_TYPE_D
                                                                                                                                                                                                                                (rs1, rd, FMV_X_D))
                                                                                                                                                                                                                   else
                                                                                                                                                                                                                     (and_boolM
                                                                                                                                                                                                                        ((is_RV64D
                                                                                                                                                                                                                            tt)
                                                                                                                                                                                                                         : M (bool))
                                                                                                                                                                                                                        (returnm ((andb
                                                                                                                                                                                                                                     (eq_vec
                                                                                                                                                                                                                                        (subrange_vec_dec
                                                                                                                                                                                                                                           v__9
                                                                                                                                                                                                                                           31
                                                                                                                                                                                                                                           20)
                                                                                                                                                                                                                                        (Ox"F20"
                                                                                                                                                                                                                                         : mword (31 - 20 + 1)))
                                                                                                                                                                                                                                     (andb
                                                                                                                                                                                                                                        (eq_vec
                                                                                                                                                                                                                                           (subrange_vec_dec
                                                                                                                                                                                                                                              v__9
                                                                                                                                                                                                                                              14
                                                                                                                                                                                                                                              12)
                                                                                                                                                                                                                                           ('b"000"
                                                                                                                                                                                                                                            : mword (14 - 12 + 1)))
                                                                                                                                                                                                                                        (eq_vec
                                                                                                                                                                                                                                           (subrange_vec_dec
                                                                                                                                                                                                                                              v__9
                                                                                                                                                                                                                                              6
                                                                                                                                                                                                                                              0)
                                                                                                                                                                                                                                           ('b"1010011"
                                                                                                                                                                                                                                            : mword (6 - 0 + 1)))))
                                                                                                                                                                                                                          : bool))) >>= fun w__183 : bool =>
                                                                                                                                                                                                                     returnm (if
                                                                                                                                                                                                                                sumbool_of_bool
                                                                                                                                                                                                                                w__183
                                                                                                                                                                                                                              then
                                                                                                                                                                                                                                let rs1 : mword 5 :=
                                                                                                                                                                                                                                  subrange_vec_dec
                                                                                                                                                                                                                                    v__9
                                                                                                                                                                                                                                    19
                                                                                                                                                                                                                                    15 in
                                                                                                                                                                                                                                let rd : mword 5 :=
                                                                                                                                                                                                                                  subrange_vec_dec
                                                                                                                                                                                                                                    v__9
                                                                                                                                                                                                                                    11
                                                                                                                                                                                                                                    7 in
                                                                                                                                                                                                                                F_UN_TYPE_D
                                                                                                                                                                                                                                  (rs1, rd, FMV_D_X)
                                                                                                                                                                                                                              else
                                                                                                                                                                                                                                ILLEGAL
                                                                                                                                                                                                                                  v__9))
                                                                                                                                                                                                                   : M (ast))
                                                                                                                                                                                                                : M (ast))
                                                                                                                                                                                                             : M (ast))
                                                                                                                                                                                                          : M (ast))
                                                                                                                                                                                                       : M (ast))
                                                                                                                                                                                                    : M (ast))
                                                                                                                                                                                                 : M (ast))
                                                                                                                                                                                              : M (ast))
                                                                                                                                                                                           : M (ast))
                                                                                                                                                                                        : M (ast))
                                                                                                                                                                                     : M (ast))
                                                                                                                                                                                  : M (ast))
                                                                                                                                                                               : M (ast))
                                                                                                                                                                            : M (ast))
                                                                                                                                                                         : M (ast))
                                                                                                                                                                      : M (ast))
                                                                                                                                                                   : M (ast))
                                                                                                                                                                : M (ast))
                                                                                                                                                             : M (ast))
                                                                                                                                                          : M (ast))
                                                                                                                                                       : M (ast))
                                                                                                                                                    : M (ast))
                                                                                                                                                 : M (ast))
                                                                                                                                              : M (ast))
                                                                                                                                           : M (ast))
                                                                                                                                        : M (ast))
                                                                                                                                     : M (ast))
                                                                                                                                  : M (ast))
                                                                                                                               : M (ast))
                                                                                                                            : M (ast))
                                                                                                                         : M (ast))
                                                                                                                      : M (ast))
                                                                                                                   : M (ast))
                                                                                                                : M (ast))
                                                                                                             : M (ast))
                                                                                                          : M (ast))
                                                                                                       : M (ast))
                                                                                                    : M (ast))
                                                                                                 : M (ast))
                                                                                              : M (ast))
                                                                                           : M (ast))
                                                                                        : M (ast))
                                                                                     : M (ast))
                                                                                  : M (ast))
                                                                               : M (ast))
                                                                            : M (ast))
                                                                         : M (ast))
                                                                      : M (ast))
                                                                   : M (ast))
                                                                : M (ast))
                                                             : M (ast))
                                                          : M (ast))
                                                       : M (ast))
                                                    : M (ast))
                                                 : M (ast))
                                              : M (ast))
                                           : M (ast))
                                        : M (ast))
                                     : M (ast))
                                  : M (ast))
                               : M (ast))
                            : M (ast))
                         : M (ast))
                      : M (ast))
                   : M (ast))
                : M (ast))
             : M (ast))
          : M (ast))
       : M (ast))
    : M (ast).

Definition encdec_forwards_matches (arg_ : ast) : M (bool) :=
   (match arg_ with
    | UTYPE (imm, rd, op) => returnm true
    | RISCV_JAL (v__462, rd) =>
       returnm (if eq_vec (subrange_vec_dec v__462 0 0) ('b"0"  : mword (0 - 0 + 1)) then true
                else false)
    | RISCV_JALR (imm, rs1, rd) => returnm true
    | BTYPE (v__464, rs2, rs1, op) =>
       returnm (if eq_vec (subrange_vec_dec v__464 0 0) ('b"0"  : mword (0 - 0 + 1)) then true
                else false)
    | ITYPE (imm, rs1, rd, op) => returnm true
    | SHIFTIOP (shamt, rs1, rd, RISCV_SLLI) => returnm true
    | SHIFTIOP (shamt, rs1, rd, RISCV_SRLI) => returnm true
    | SHIFTIOP (shamt, rs1, rd, RISCV_SRAI) => returnm true
    | RTYPE (rs2, rs1, rd, RISCV_ADD) => returnm true
    | RTYPE (rs2, rs1, rd, RISCV_SLT) => returnm true
    | RTYPE (rs2, rs1, rd, RISCV_SLTU) => returnm true
    | RTYPE (rs2, rs1, rd, RISCV_AND) => returnm true
    | RTYPE (rs2, rs1, rd, RISCV_OR) => returnm true
    | RTYPE (rs2, rs1, rd, RISCV_XOR) => returnm true
    | RTYPE (rs2, rs1, rd, RISCV_SLL) => returnm true
    | RTYPE (rs2, rs1, rd, RISCV_SRL) => returnm true
    | RTYPE (rs2, rs1, rd, RISCV_SUB) => returnm true
    | RTYPE (rs2, rs1, rd, RISCV_SRA) => returnm true
    | LOAD (imm, rs1, rd, is_unsigned, size, false, false) =>
       returnm (if sumbool_of_bool
                  (orb (Z.ltb (projT1 (word_width_bytes size)) 8)
                     (andb (negb is_unsigned) ((Z.leb (projT1 (word_width_bytes size)) 8)  : bool)))
                then
                  true
                else false)
    | STORE (v__466, rs2, rs1, size, false, false) =>
       returnm (if sumbool_of_bool (Z.leb (projT1 (word_width_bytes size)) 8) then true else false)
    | ADDIW (imm, rs1, rd) => returnm (if sumbool_of_bool (Z.eqb 64 64) then true else false)
    | SHIFTW (shamt, rs1, rd, RISCV_SLLI) =>
       returnm (if sumbool_of_bool (Z.eqb 64 64) then true else false)
    | SHIFTW (shamt, rs1, rd, RISCV_SRLI) =>
       returnm (if sumbool_of_bool (Z.eqb 64 64) then true else false)
    | SHIFTW (shamt, rs1, rd, RISCV_SRAI) =>
       returnm (if sumbool_of_bool (Z.eqb 64 64) then true else false)
    | RTYPEW (rs2, rs1, rd, RISCV_ADDW) =>
       returnm (if sumbool_of_bool (Z.eqb 64 64) then true else false)
    | RTYPEW (rs2, rs1, rd, RISCV_SUBW) =>
       returnm (if sumbool_of_bool (Z.eqb 64 64) then true else false)
    | RTYPEW (rs2, rs1, rd, RISCV_SLLW) =>
       returnm (if sumbool_of_bool (Z.eqb 64 64) then true else false)
    | RTYPEW (rs2, rs1, rd, RISCV_SRLW) =>
       returnm (if sumbool_of_bool (Z.eqb 64 64) then true else false)
    | RTYPEW (rs2, rs1, rd, RISCV_SRAW) =>
       returnm (if sumbool_of_bool (Z.eqb 64 64) then true else false)
    | SHIFTIWOP (shamt, rs1, rd, RISCV_SLLIW) =>
       returnm (if sumbool_of_bool (Z.eqb 64 64) then true else false)
    | SHIFTIWOP (shamt, rs1, rd, RISCV_SRLIW) =>
       returnm (if sumbool_of_bool (Z.eqb 64 64) then true else false)
    | SHIFTIWOP (shamt, rs1, rd, RISCV_SRAIW) =>
       returnm (if sumbool_of_bool (Z.eqb 64 64) then true else false)
    | FENCE (pred, succ) => returnm true
    | FENCE_TSO (pred, succ) => returnm true
    | FENCEI tt => returnm true
    | ECALL tt => returnm true
    | MRET tt => returnm true
    | SRET tt => returnm true
    | EBREAK tt => returnm true
    | WFI tt => returnm true
    | SFENCE_VMA (rs1, rs2) => returnm true
    | LOADRES (aq, rl, rs1, size, rd) => returnm (if amo_width_valid size then true else false)
    | STORECON (aq, rl, rs2, rs1, size, rd) =>
       returnm (if amo_width_valid size then true else false)
    | AMO (op, aq, rl, rs2, rs1, size, rd) => returnm (if amo_width_valid size then true else false)
    | MUL (rs2, rs1, rd, high, signed1, signed2) => returnm true
    | DIV (rs2, rs1, rd, s) => returnm true
    | REM (rs2, rs1, rd, s) => returnm true
    | MULW (rs2, rs1, rd) => returnm (if sumbool_of_bool (Z.eqb 64 64) then true else false)
    | DIVW (rs2, rs1, rd, s) => returnm (if sumbool_of_bool (Z.eqb 64 64) then true else false)
    | REMW (rs2, rs1, rd, s) => returnm (if sumbool_of_bool (Z.eqb 64 64) then true else false)
    | CSR (csr, rs1, rd, is_imm, op) => returnm true
    | URET tt => returnm true
    | FENCE_RESERVED (fm, pred, succ, rs, rd) =>
       returnm (if orb (andb (neq_vec fm (Ox"0"  : mword 4)) (neq_vec fm (Ox"8"  : mword 4)))
                     (orb (neq_vec rs ('b"00000"  : mword 5)) (neq_vec rd ('b"00000"  : mword 5)))
                then
                  true
                else false)
    | FENCEI_RESERVED (imm, rs, rd) =>
       returnm (if orb (neq_vec imm (Ox"000"  : mword 12)) (orb (neq_vec rs zreg) (neq_vec rd zreg))
                then
                  true
                else false)
    | LOAD_FP (imm, rs1, rd, WORD) =>
       (is_RV32F_or_RV64F tt) >>= fun w__0 : bool =>
       returnm (if sumbool_of_bool w__0 then true else false)
    | LOAD_FP (imm, rs1, rd, DOUBLE) =>
       (is_RV32D_or_RV64D tt) >>= fun w__1 : bool =>
       returnm (if sumbool_of_bool w__1 then true else false)
    | STORE_FP (v__467, rs2, rs1, WORD) =>
       (is_RV32F_or_RV64F tt) >>= fun w__2 : bool =>
       returnm (if sumbool_of_bool w__2 then true else false)
    | STORE_FP (v__468, rs2, rs1, DOUBLE) =>
       (is_RV32D_or_RV64D tt) >>= fun w__3 : bool =>
       returnm (if sumbool_of_bool w__3 then true else false)
    | F_MADD_TYPE_S (rs3, rs2, rs1, rm, rd, FMADD_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__4 : bool =>
       returnm (if sumbool_of_bool w__4 then true else false)
    | F_MADD_TYPE_S (rs3, rs2, rs1, rm, rd, FMSUB_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__5 : bool =>
       returnm (if sumbool_of_bool w__5 then true else false)
    | F_MADD_TYPE_S (rs3, rs2, rs1, rm, rd, FNMSUB_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__6 : bool =>
       returnm (if sumbool_of_bool w__6 then true else false)
    | F_MADD_TYPE_S (rs3, rs2, rs1, rm, rd, FNMADD_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__7 : bool =>
       returnm (if sumbool_of_bool w__7 then true else false)
    | F_BIN_RM_TYPE_S (rs2, rs1, rm, rd, FADD_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__8 : bool =>
       returnm (if sumbool_of_bool w__8 then true else false)
    | F_BIN_RM_TYPE_S (rs2, rs1, rm, rd, FSUB_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__9 : bool =>
       returnm (if sumbool_of_bool w__9 then true else false)
    | F_BIN_RM_TYPE_S (rs2, rs1, rm, rd, FMUL_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__10 : bool =>
       returnm (if sumbool_of_bool w__10 then true else false)
    | F_BIN_RM_TYPE_S (rs2, rs1, rm, rd, FDIV_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__11 : bool =>
       returnm (if sumbool_of_bool w__11 then true else false)
    | F_UN_RM_TYPE_S (rs1, rm, rd, FSQRT_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__12 : bool =>
       returnm (if sumbool_of_bool w__12 then true else false)
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_W_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__13 : bool =>
       returnm (if sumbool_of_bool w__13 then true else false)
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_WU_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__14 : bool =>
       returnm (if sumbool_of_bool w__14 then true else false)
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_W) =>
       (is_RV32F_or_RV64F tt) >>= fun w__15 : bool =>
       returnm (if sumbool_of_bool w__15 then true else false)
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_WU) =>
       (is_RV32F_or_RV64F tt) >>= fun w__16 : bool =>
       returnm (if sumbool_of_bool w__16 then true else false)
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_L_S) =>
       (is_RV64F tt) >>= fun w__17 : bool => returnm (if sumbool_of_bool w__17 then true else false)
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_LU_S) =>
       (is_RV64F tt) >>= fun w__18 : bool => returnm (if sumbool_of_bool w__18 then true else false)
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_L) =>
       (is_RV64F tt) >>= fun w__19 : bool => returnm (if sumbool_of_bool w__19 then true else false)
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_LU) =>
       (is_RV64F tt) >>= fun w__20 : bool => returnm (if sumbool_of_bool w__20 then true else false)
    | F_BIN_TYPE_S (rs2, rs1, rd, FSGNJ_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__21 : bool =>
       returnm (if sumbool_of_bool w__21 then true else false)
    | F_BIN_TYPE_S (rs2, rs1, rd, FSGNJN_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__22 : bool =>
       returnm (if sumbool_of_bool w__22 then true else false)
    | F_BIN_TYPE_S (rs2, rs1, rd, FSGNJX_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__23 : bool =>
       returnm (if sumbool_of_bool w__23 then true else false)
    | F_BIN_TYPE_S (rs2, rs1, rd, FMIN_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__24 : bool =>
       returnm (if sumbool_of_bool w__24 then true else false)
    | F_BIN_TYPE_S (rs2, rs1, rd, FMAX_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__25 : bool =>
       returnm (if sumbool_of_bool w__25 then true else false)
    | F_BIN_TYPE_S (rs2, rs1, rd, FEQ_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__26 : bool =>
       returnm (if sumbool_of_bool w__26 then true else false)
    | F_BIN_TYPE_S (rs2, rs1, rd, FLT_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__27 : bool =>
       returnm (if sumbool_of_bool w__27 then true else false)
    | F_BIN_TYPE_S (rs2, rs1, rd, FLE_S) =>
       (is_RV32F_or_RV64F tt) >>= fun w__28 : bool =>
       returnm (if sumbool_of_bool w__28 then true else false)
    | F_UN_TYPE_S (rs1, rd, FCLASS_S) =>
       (haveFExt tt) >>= fun w__29 : bool => returnm (if sumbool_of_bool w__29 then true else false)
    | F_UN_TYPE_S (rs1, rd, FMV_X_W) =>
       (haveFExt tt) >>= fun w__30 : bool => returnm (if sumbool_of_bool w__30 then true else false)
    | F_UN_TYPE_S (rs1, rd, FMV_W_X) =>
       (haveFExt tt) >>= fun w__31 : bool => returnm (if sumbool_of_bool w__31 then true else false)
    | F_MADD_TYPE_D (rs3, rs2, rs1, rm, rd, FMADD_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__32 : bool =>
       returnm (if sumbool_of_bool w__32 then true else false)
    | F_MADD_TYPE_D (rs3, rs2, rs1, rm, rd, FMSUB_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__33 : bool =>
       returnm (if sumbool_of_bool w__33 then true else false)
    | F_MADD_TYPE_D (rs3, rs2, rs1, rm, rd, FNMSUB_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__34 : bool =>
       returnm (if sumbool_of_bool w__34 then true else false)
    | F_MADD_TYPE_D (rs3, rs2, rs1, rm, rd, FNMADD_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__35 : bool =>
       returnm (if sumbool_of_bool w__35 then true else false)
    | F_BIN_RM_TYPE_D (rs2, rs1, rm, rd, FADD_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__36 : bool =>
       returnm (if sumbool_of_bool w__36 then true else false)
    | F_BIN_RM_TYPE_D (rs2, rs1, rm, rd, FSUB_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__37 : bool =>
       returnm (if sumbool_of_bool w__37 then true else false)
    | F_BIN_RM_TYPE_D (rs2, rs1, rm, rd, FMUL_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__38 : bool =>
       returnm (if sumbool_of_bool w__38 then true else false)
    | F_BIN_RM_TYPE_D (rs2, rs1, rm, rd, FDIV_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__39 : bool =>
       returnm (if sumbool_of_bool w__39 then true else false)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FSQRT_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__40 : bool =>
       returnm (if sumbool_of_bool w__40 then true else false)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_W_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__41 : bool =>
       returnm (if sumbool_of_bool w__41 then true else false)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_WU_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__42 : bool =>
       returnm (if sumbool_of_bool w__42 then true else false)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_W) =>
       (is_RV32D_or_RV64D tt) >>= fun w__43 : bool =>
       returnm (if sumbool_of_bool w__43 then true else false)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_WU) =>
       (is_RV32D_or_RV64D tt) >>= fun w__44 : bool =>
       returnm (if sumbool_of_bool w__44 then true else false)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_S_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__45 : bool =>
       returnm (if sumbool_of_bool w__45 then true else false)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_S) =>
       (is_RV32D_or_RV64D tt) >>= fun w__46 : bool =>
       returnm (if sumbool_of_bool w__46 then true else false)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_L_D) =>
       (is_RV64D tt) >>= fun w__47 : bool => returnm (if sumbool_of_bool w__47 then true else false)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_LU_D) =>
       (is_RV64D tt) >>= fun w__48 : bool => returnm (if sumbool_of_bool w__48 then true else false)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_L) =>
       (is_RV64D tt) >>= fun w__49 : bool => returnm (if sumbool_of_bool w__49 then true else false)
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_LU) =>
       (is_RV64D tt) >>= fun w__50 : bool => returnm (if sumbool_of_bool w__50 then true else false)
    | F_BIN_TYPE_D (rs2, rs1, rd, FSGNJ_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__51 : bool =>
       returnm (if sumbool_of_bool w__51 then true else false)
    | F_BIN_TYPE_D (rs2, rs1, rd, FSGNJN_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__52 : bool =>
       returnm (if sumbool_of_bool w__52 then true else false)
    | F_BIN_TYPE_D (rs2, rs1, rd, FSGNJX_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__53 : bool =>
       returnm (if sumbool_of_bool w__53 then true else false)
    | F_BIN_TYPE_D (rs2, rs1, rd, FMIN_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__54 : bool =>
       returnm (if sumbool_of_bool w__54 then true else false)
    | F_BIN_TYPE_D (rs2, rs1, rd, FMAX_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__55 : bool =>
       returnm (if sumbool_of_bool w__55 then true else false)
    | F_BIN_TYPE_D (rs2, rs1, rd, FEQ_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__56 : bool =>
       returnm (if sumbool_of_bool w__56 then true else false)
    | F_BIN_TYPE_D (rs2, rs1, rd, FLT_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__57 : bool =>
       returnm (if sumbool_of_bool w__57 then true else false)
    | F_BIN_TYPE_D (rs2, rs1, rd, FLE_D) =>
       (is_RV32D_or_RV64D tt) >>= fun w__58 : bool =>
       returnm (if sumbool_of_bool w__58 then true else false)
    | F_UN_TYPE_D (rs1, rd, FCLASS_D) =>
       (haveDExt tt) >>= fun w__59 : bool => returnm (if sumbool_of_bool w__59 then true else false)
    | F_UN_TYPE_D (rs1, rd, FMV_X_D) =>
       (is_RV64D tt) >>= fun w__60 : bool => returnm (if sumbool_of_bool w__60 then true else false)
    | F_UN_TYPE_D (rs1, rd, FMV_D_X) =>
       (is_RV64D tt) >>= fun w__61 : bool => returnm (if sumbool_of_bool w__61 then true else false)
    | ILLEGAL s => returnm true
    | _ => returnm false
    end)
    : M (bool).

Definition encdec_backwards_matches (arg_ : mword 32) : M (bool) :=
   let v__469 := arg_ in
   (if let _mappingpatterns_0_ : mword 7 := subrange_vec_dec v__469 6 0 in
      encdec_uop_backwards_matches _mappingpatterns_0_ then
      let _mappingpatterns_0_ : mword 7 := subrange_vec_dec v__469 6 0 in
      (encdec_uop_backwards _mappingpatterns_0_) >>= fun op => returnm true
    else if eq_vec (subrange_vec_dec v__469 6 0) ('b"1101111"  : mword (6 - 0 + 1)) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"000"  : mword (14 - 12 + 1)))
              (eq_vec (subrange_vec_dec v__469 6 0) ('b"1100111"  : mword (6 - 0 + 1))) then
      returnm true
    else if andb
              (let _mappingpatterns_1_ : mword 3 := subrange_vec_dec v__469 14 12 in
              encdec_bop_backwards_matches _mappingpatterns_1_)
              (eq_vec (subrange_vec_dec v__469 6 0) ('b"1100011"  : mword (6 - 0 + 1))) then
      let _mappingpatterns_1_ : mword 3 := subrange_vec_dec v__469 14 12 in
      (encdec_bop_backwards _mappingpatterns_1_) >>= fun op => returnm true
    else if andb
              (let _mappingpatterns_2_ : mword 3 := subrange_vec_dec v__469 14 12 in
              encdec_iop_backwards_matches _mappingpatterns_2_)
              (eq_vec (subrange_vec_dec v__469 6 0) ('b"0010011"  : mword (6 - 0 + 1))) then
      let _mappingpatterns_2_ : mword 3 := subrange_vec_dec v__469 14 12 in
      (encdec_iop_backwards _mappingpatterns_2_) >>= fun op => returnm true
    else if sumbool_of_bool
      (andb
         (let shamt : mword 6 := subrange_vec_dec v__469 25 20 in
         orb (Z.eqb 64 64) (eq_bit (access_vec_dec shamt 5) B0))
         (andb (eq_vec (subrange_vec_dec v__469 31 26) ('b"000000"  : mword (31 - 26 + 1)))
            (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"001"  : mword (14 - 12 + 1)))
               (eq_vec (subrange_vec_dec v__469 6 0) ('b"0010011"  : mword (6 - 0 + 1)))))) then
      returnm true
    else if sumbool_of_bool
      (andb
         (let shamt : mword 6 := subrange_vec_dec v__469 25 20 in
         orb (Z.eqb 64 64) (eq_bit (access_vec_dec shamt 5) B0))
         (andb (eq_vec (subrange_vec_dec v__469 31 26) ('b"000000"  : mword (31 - 26 + 1)))
            (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"101"  : mword (14 - 12 + 1)))
               (eq_vec (subrange_vec_dec v__469 6 0) ('b"0010011"  : mword (6 - 0 + 1)))))) then
      returnm true
    else if sumbool_of_bool
      (andb
         (let shamt : mword 6 := subrange_vec_dec v__469 25 20 in
         orb (Z.eqb 64 64) (eq_bit (access_vec_dec shamt 5) B0))
         (andb (eq_vec (subrange_vec_dec v__469 31 26) ('b"010000"  : mword (31 - 26 + 1)))
            (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"101"  : mword (14 - 12 + 1)))
               (eq_vec (subrange_vec_dec v__469 6 0) ('b"0010011"  : mword (6 - 0 + 1)))))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
              (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"000"  : mword (14 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__469 6 0) ('b"0110011"  : mword (6 - 0 + 1)))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
              (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"010"  : mword (14 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__469 6 0) ('b"0110011"  : mword (6 - 0 + 1)))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
              (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"011"  : mword (14 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__469 6 0) ('b"0110011"  : mword (6 - 0 + 1)))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
              (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"111"  : mword (14 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__469 6 0) ('b"0110011"  : mword (6 - 0 + 1)))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
              (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"110"  : mword (14 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__469 6 0) ('b"0110011"  : mword (6 - 0 + 1)))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
              (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"100"  : mword (14 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__469 6 0) ('b"0110011"  : mword (6 - 0 + 1)))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
              (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"001"  : mword (14 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__469 6 0) ('b"0110011"  : mword (6 - 0 + 1)))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
              (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"101"  : mword (14 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__469 6 0) ('b"0110011"  : mword (6 - 0 + 1)))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0100000"  : mword (31 - 25 + 1)))
              (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"000"  : mword (14 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__469 6 0) ('b"0110011"  : mword (6 - 0 + 1)))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0100000"  : mword (31 - 25 + 1)))
              (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"101"  : mword (14 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__469 6 0) ('b"0110011"  : mword (6 - 0 + 1)))) then
      returnm true
    else
      (and_boolM
         (let _mappingpatterns_4_ : mword 2 := subrange_vec_dec v__469 13 12 in
         let _mappingpatterns_3_ : mword 1 := subrange_vec_dec v__469 14 14 in
         (if size_bits_backwards_matches _mappingpatterns_4_ then
            (size_bits_backwards _mappingpatterns_4_) >>= fun size =>
            (if bool_bits_backwards_matches _mappingpatterns_3_ then
               (bool_bits_backwards _mappingpatterns_3_) >>= fun is_unsigned =>
               returnm ((orb (Z.ltb (projT1 (word_width_bytes size)) 8)
                           (andb (negb is_unsigned)
                              ((Z.leb (projT1 (word_width_bytes size)) 8)
                               : bool)))
                : bool)
             else returnm false)
             : M (bool)
          else returnm false)
          : M (bool))
         (returnm ((eq_vec (subrange_vec_dec v__469 6 0) ('b"0000011"  : mword (6 - 0 + 1)))
           : bool))) >>= fun w__2 : bool =>
      (if sumbool_of_bool w__2 then
         let _mappingpatterns_4_ : mword 2 := subrange_vec_dec v__469 13 12 in
         let _mappingpatterns_3_ : mword 1 := subrange_vec_dec v__469 14 14 in
         (size_bits_backwards _mappingpatterns_4_) >>= fun size =>
         (bool_bits_backwards _mappingpatterns_3_) >>= fun is_unsigned => returnm true
       else
         (and_boolM
            (let _mappingpatterns_5_ : mword 2 := subrange_vec_dec v__469 13 12 in
            (if size_bits_backwards_matches _mappingpatterns_5_ then
               (size_bits_backwards _mappingpatterns_5_) >>= fun size =>
               returnm ((Z.leb (projT1 (word_width_bytes size)) 8)  : bool)
             else returnm false)
             : M (bool))
            (returnm ((andb (eq_vec (subrange_vec_dec v__469 14 14) ('b"0"  : mword (14 - 14 + 1)))
                         (eq_vec (subrange_vec_dec v__469 6 0) ('b"0100011"  : mword (6 - 0 + 1))))
              : bool))) >>= fun w__4 : bool =>
         (if sumbool_of_bool w__4 then
            let _mappingpatterns_5_ : mword 2 := subrange_vec_dec v__469 13 12 in
            (size_bits_backwards _mappingpatterns_5_) >>= fun size => returnm true
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"000"  : mword (14 - 12 + 1)))
                  (eq_vec (subrange_vec_dec v__469 6 0) ('b"0011011"  : mword (6 - 0 + 1))))) then
            returnm true
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"001"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__469 6 0) ('b"0011011"  : mword (6 - 0 + 1))))))
          then
            returnm true
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"101"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__469 6 0) ('b"0011011"  : mword (6 - 0 + 1))))))
          then
            returnm true
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0100000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"101"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__469 6 0) ('b"0011011"  : mword (6 - 0 + 1))))))
          then
            returnm true
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"000"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__469 6 0) ('b"0111011"  : mword (6 - 0 + 1))))))
          then
            returnm true
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0100000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"000"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__469 6 0) ('b"0111011"  : mword (6 - 0 + 1))))))
          then
            returnm true
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"001"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__469 6 0) ('b"0111011"  : mword (6 - 0 + 1))))))
          then
            returnm true
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"101"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__469 6 0) ('b"0111011"  : mword (6 - 0 + 1))))))
          then
            returnm true
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0100000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"101"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__469 6 0) ('b"0111011"  : mword (6 - 0 + 1))))))
          then
            returnm true
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"001"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__469 6 0) ('b"0011011"  : mword (6 - 0 + 1))))))
          then
            returnm true
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0000000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"101"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__469 6 0) ('b"0011011"  : mword (6 - 0 + 1))))))
          then
            returnm true
          else if sumbool_of_bool
            (andb (Z.eqb 64 64)
               (andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0100000"  : mword (31 - 25 + 1)))
                  (andb (eq_vec (subrange_vec_dec v__469 14 12) ('b"101"  : mword (14 - 12 + 1)))
                     (eq_vec (subrange_vec_dec v__469 6 0) ('b"0011011"  : mword (6 - 0 + 1))))))
          then
            returnm true
          else if andb (eq_vec (subrange_vec_dec v__469 31 28) (Ox"0"  : mword (31 - 28 + 1)))
                    (eq_vec (subrange_vec_dec v__469 19 0) (Ox"0000F"  : mword (19 - 0 + 1))) then
            returnm true
          else if andb (eq_vec (subrange_vec_dec v__469 31 28) (Ox"8"  : mword (31 - 28 + 1)))
                    (eq_vec (subrange_vec_dec v__469 19 0) (Ox"0000F"  : mword (19 - 0 + 1))) then
            returnm true
          else if eq_vec v__469 (Ox"0000100F"  : mword 32) then returnm true
          else if eq_vec v__469 (Ox"00000073"  : mword 32) then returnm true
          else if eq_vec v__469 (Ox"30200073"  : mword 32) then returnm true
          else if eq_vec v__469 (Ox"10200073"  : mword 32) then returnm true
          else if eq_vec v__469 (Ox"00100073"  : mword 32) then returnm true
          else if eq_vec v__469 (Ox"10500073"  : mword 32) then returnm true
          else if andb (eq_vec (subrange_vec_dec v__469 31 25) ('b"0001001"  : mword (31 - 25 + 1)))
                    (eq_vec (subrange_vec_dec v__469 14 0)
                       ('b"000000001110011"
                        : mword (14 - 0 + 1))) then
            returnm true
          else
            (and_boolM
               (let _mappingpatterns_8_ : mword 2 := subrange_vec_dec v__469 13 12 in
               let _mappingpatterns_7_ : mword 1 := subrange_vec_dec v__469 25 25 in
               let _mappingpatterns_6_ : mword 1 := subrange_vec_dec v__469 26 26 in
               (if size_bits_backwards_matches _mappingpatterns_8_ then
                  (size_bits_backwards _mappingpatterns_8_) >>= fun size =>
                  (if bool_bits_backwards_matches _mappingpatterns_7_ then
                     (bool_bits_backwards _mappingpatterns_7_) >>= fun rl =>
                     (if bool_bits_backwards_matches _mappingpatterns_6_ then
                        (bool_bits_backwards _mappingpatterns_6_) >>= fun aq =>
                        returnm ((amo_width_valid size)  : bool)
                      else returnm false)
                      : M (bool)
                   else returnm false)
                   : M (bool)
                else returnm false)
                : M (bool))
               (returnm ((andb
                            (eq_vec (subrange_vec_dec v__469 31 27)
                               ('b"00010"
                                : mword (31 - 27 + 1)))
                            (andb
                               (eq_vec (subrange_vec_dec v__469 24 20)
                                  ('b"00000"
                                   : mword (24 - 20 + 1)))
                               (andb
                                  (eq_vec (subrange_vec_dec v__469 14 14)
                                     ('b"0"
                                      : mword (14 - 14 + 1)))
                                  (eq_vec (subrange_vec_dec v__469 6 0)
                                     ('b"0101111"
                                      : mword (6 - 0 + 1))))))
                 : bool))) >>= fun w__8 : bool =>
            (if sumbool_of_bool w__8 then
               let _mappingpatterns_8_ : mword 2 := subrange_vec_dec v__469 13 12 in
               let _mappingpatterns_7_ : mword 1 := subrange_vec_dec v__469 25 25 in
               let _mappingpatterns_6_ : mword 1 := subrange_vec_dec v__469 26 26 in
               (size_bits_backwards _mappingpatterns_8_) >>= fun size =>
               (bool_bits_backwards _mappingpatterns_7_) >>= fun rl =>
               (bool_bits_backwards _mappingpatterns_6_) >>= fun aq => returnm true
             else
               (and_boolM
                  (let _mappingpatterns_9_ : mword 1 := subrange_vec_dec v__469 26 26 in
                  let _mappingpatterns_11_ : mword 2 := subrange_vec_dec v__469 13 12 in
                  let _mappingpatterns_10_ : mword 1 := subrange_vec_dec v__469 25 25 in
                  (if size_bits_backwards_matches _mappingpatterns_11_ then
                     (size_bits_backwards _mappingpatterns_11_) >>= fun size =>
                     (if bool_bits_backwards_matches _mappingpatterns_10_ then
                        (bool_bits_backwards _mappingpatterns_10_) >>= fun rl =>
                        (if bool_bits_backwards_matches _mappingpatterns_9_ then
                           (bool_bits_backwards _mappingpatterns_9_) >>= fun aq =>
                           returnm ((amo_width_valid size)  : bool)
                         else returnm false)
                         : M (bool)
                      else returnm false)
                      : M (bool)
                   else returnm false)
                   : M (bool))
                  (returnm ((andb
                               (eq_vec (subrange_vec_dec v__469 31 27)
                                  ('b"00011"
                                   : mword (31 - 27 + 1)))
                               (andb
                                  (eq_vec (subrange_vec_dec v__469 14 14)
                                     ('b"0"
                                      : mword (14 - 14 + 1)))
                                  (eq_vec (subrange_vec_dec v__469 6 0)
                                     ('b"0101111"
                                      : mword (6 - 0 + 1)))))
                    : bool))) >>= fun w__12 : bool =>
               (if sumbool_of_bool w__12 then
                  let _mappingpatterns_9_ : mword 1 := subrange_vec_dec v__469 26 26 in
                  let _mappingpatterns_11_ : mword 2 := subrange_vec_dec v__469 13 12 in
                  let _mappingpatterns_10_ : mword 1 := subrange_vec_dec v__469 25 25 in
                  (size_bits_backwards _mappingpatterns_11_) >>= fun size =>
                  (bool_bits_backwards _mappingpatterns_10_) >>= fun rl =>
                  (bool_bits_backwards _mappingpatterns_9_) >>= fun aq => returnm true
                else
                  (and_boolM
                     (let _mappingpatterns_12_ : mword 5 := subrange_vec_dec v__469 31 27 in
                     let _mappingpatterns_15_ : mword 2 := subrange_vec_dec v__469 13 12 in
                     let _mappingpatterns_14_ : mword 1 := subrange_vec_dec v__469 25 25 in
                     let _mappingpatterns_13_ : mword 1 := subrange_vec_dec v__469 26 26 in
                     let _mappingpatterns_12_ : mword 5 := subrange_vec_dec v__469 31 27 in
                     (if size_bits_backwards_matches _mappingpatterns_15_ then
                        (size_bits_backwards _mappingpatterns_15_) >>= fun size =>
                        (if bool_bits_backwards_matches _mappingpatterns_14_ then
                           (bool_bits_backwards _mappingpatterns_14_) >>= fun rl =>
                           (if bool_bits_backwards_matches _mappingpatterns_13_ then
                              (bool_bits_backwards _mappingpatterns_13_) >>= fun aq =>
                              (if encdec_amoop_backwards_matches _mappingpatterns_12_ then
                                 (encdec_amoop_backwards _mappingpatterns_12_) >>= fun op =>
                                 returnm ((amo_width_valid size)  : bool)
                               else returnm false)
                               : M (bool)
                            else returnm false)
                            : M (bool)
                         else returnm false)
                         : M (bool)
                      else returnm false)
                      : M (bool))
                     (returnm ((andb
                                  (eq_vec (subrange_vec_dec v__469 14 14)
                                     ('b"0"
                                      : mword (14 - 14 + 1)))
                                  (eq_vec (subrange_vec_dec v__469 6 0)
                                     ('b"0101111"
                                      : mword (6 - 0 + 1))))
                       : bool))) >>= fun w__17 : bool =>
                  (if sumbool_of_bool w__17 then
                     let _mappingpatterns_12_ : mword 5 := subrange_vec_dec v__469 31 27 in
                     let _mappingpatterns_15_ : mword 2 := subrange_vec_dec v__469 13 12 in
                     let _mappingpatterns_14_ : mword 1 := subrange_vec_dec v__469 25 25 in
                     let _mappingpatterns_13_ : mword 1 := subrange_vec_dec v__469 26 26 in
                     let _mappingpatterns_12_ : mword 5 := subrange_vec_dec v__469 31 27 in
                     (size_bits_backwards _mappingpatterns_15_) >>= fun size =>
                     (bool_bits_backwards _mappingpatterns_14_) >>= fun rl =>
                     (bool_bits_backwards _mappingpatterns_13_) >>= fun aq =>
                     (encdec_amoop_backwards _mappingpatterns_12_) >>= fun op => returnm true
                   else if andb
                             (let _mappingpatterns_16_ : mword 3 := subrange_vec_dec v__469 14 12 in
                             encdec_mul_op_backwards_matches _mappingpatterns_16_)
                             (andb
                                (eq_vec (subrange_vec_dec v__469 31 25)
                                   ('b"0000001"
                                    : mword (31 - 25 + 1)))
                                (eq_vec (subrange_vec_dec v__469 6 0)
                                   ('b"0110011"
                                    : mword (6 - 0 + 1)))) then
                     let _mappingpatterns_16_ : mword 3 := subrange_vec_dec v__469 14 12 in
                     (encdec_mul_op_backwards _mappingpatterns_16_) >>= fun '(high, signed1, signed2) =>
                     returnm true
                   else if andb
                             (let _mappingpatterns_17_ : mword 1 := subrange_vec_dec v__469 12 12 in
                             bool_not_bits_backwards_matches _mappingpatterns_17_)
                             (andb
                                (eq_vec (subrange_vec_dec v__469 31 25)
                                   ('b"0000001"
                                    : mword (31 - 25 + 1)))
                                (andb
                                   (eq_vec (subrange_vec_dec v__469 14 13)
                                      ('b"10"
                                       : mword (14 - 13 + 1)))
                                   (eq_vec (subrange_vec_dec v__469 6 0)
                                      ('b"0110011"
                                       : mword (6 - 0 + 1))))) then
                     let _mappingpatterns_17_ : mword 1 := subrange_vec_dec v__469 12 12 in
                     (bool_not_bits_backwards _mappingpatterns_17_) >>= fun s => returnm true
                   else if andb
                             (let _mappingpatterns_18_ : mword 1 := subrange_vec_dec v__469 12 12 in
                             bool_not_bits_backwards_matches _mappingpatterns_18_)
                             (andb
                                (eq_vec (subrange_vec_dec v__469 31 25)
                                   ('b"0000001"
                                    : mword (31 - 25 + 1)))
                                (andb
                                   (eq_vec (subrange_vec_dec v__469 14 13)
                                      ('b"11"
                                       : mword (14 - 13 + 1)))
                                   (eq_vec (subrange_vec_dec v__469 6 0)
                                      ('b"0110011"
                                       : mword (6 - 0 + 1))))) then
                     let _mappingpatterns_18_ : mword 1 := subrange_vec_dec v__469 12 12 in
                     (bool_not_bits_backwards _mappingpatterns_18_) >>= fun s => returnm true
                   else if sumbool_of_bool
                     (andb (Z.eqb 64 64)
                        (andb
                           (eq_vec (subrange_vec_dec v__469 31 25)
                              ('b"0000001"
                               : mword (31 - 25 + 1)))
                           (andb
                              (eq_vec (subrange_vec_dec v__469 14 12)
                                 ('b"000"
                                  : mword (14 - 12 + 1)))
                              (eq_vec (subrange_vec_dec v__469 6 0)
                                 ('b"0111011"
                                  : mword (6 - 0 + 1)))))) then
                     returnm true
                   else
                     (and_boolM
                        (let _mappingpatterns_19_ : mword 1 := subrange_vec_dec v__469 12 12 in
                        (if bool_not_bits_backwards_matches _mappingpatterns_19_ then
                           (bool_not_bits_backwards _mappingpatterns_19_) >>= fun s =>
                           returnm ((Z.eqb 64 64)  : bool)
                         else returnm false)
                         : M (bool))
                        (returnm ((andb
                                     (eq_vec (subrange_vec_dec v__469 31 25)
                                        ('b"0000001"
                                         : mword (31 - 25 + 1)))
                                     (andb
                                        (eq_vec (subrange_vec_dec v__469 14 13)
                                           ('b"10"
                                            : mword (14 - 13 + 1)))
                                        (eq_vec (subrange_vec_dec v__469 6 0)
                                           ('b"0111011"
                                            : mword (6 - 0 + 1)))))
                          : bool))) >>= fun w__19 : bool =>
                     (if sumbool_of_bool w__19 then
                        let _mappingpatterns_19_ : mword 1 := subrange_vec_dec v__469 12 12 in
                        (bool_not_bits_backwards _mappingpatterns_19_) >>= fun s => returnm true
                      else
                        (and_boolM
                           (let _mappingpatterns_20_ : mword 1 := subrange_vec_dec v__469 12 12 in
                           (if bool_not_bits_backwards_matches _mappingpatterns_20_ then
                              (bool_not_bits_backwards _mappingpatterns_20_) >>= fun s =>
                              returnm ((Z.eqb 64 64)  : bool)
                            else returnm false)
                            : M (bool))
                           (returnm ((andb
                                        (eq_vec (subrange_vec_dec v__469 31 25)
                                           ('b"0000001"
                                            : mword (31 - 25 + 1)))
                                        (andb
                                           (eq_vec (subrange_vec_dec v__469 14 13)
                                              ('b"11"
                                               : mword (14 - 13 + 1)))
                                           (eq_vec (subrange_vec_dec v__469 6 0)
                                              ('b"0111011"
                                               : mword (6 - 0 + 1)))))
                             : bool))) >>= fun w__21 : bool =>
                        (if sumbool_of_bool w__21 then
                           let _mappingpatterns_20_ : mword 1 := subrange_vec_dec v__469 12 12 in
                           (bool_not_bits_backwards _mappingpatterns_20_) >>= fun s => returnm true
                         else
                           (and_boolM
                              (let _mappingpatterns_22_ : mword 2 := subrange_vec_dec v__469 13 12 in
                              let _mappingpatterns_21_ : mword 1 := subrange_vec_dec v__469 14 14 in
                              (if encdec_csrop_backwards_matches _mappingpatterns_22_ then
                                 (encdec_csrop_backwards _mappingpatterns_22_) >>= fun op =>
                                 returnm ((bool_bits_backwards_matches _mappingpatterns_21_)
                                  : bool)
                               else returnm false)
                               : M (bool))
                              (returnm ((eq_vec (subrange_vec_dec v__469 6 0)
                                           ('b"1110011"
                                            : mword (6 - 0 + 1)))
                                : bool))) >>= fun w__23 : bool =>
                           (if sumbool_of_bool w__23 then
                              let _mappingpatterns_22_ : mword 2 := subrange_vec_dec v__469 13 12 in
                              let _mappingpatterns_21_ : mword 1 := subrange_vec_dec v__469 14 14 in
                              (encdec_csrop_backwards _mappingpatterns_22_) >>= fun op =>
                              (bool_bits_backwards _mappingpatterns_21_) >>= fun is_imm =>
                              returnm true
                            else if eq_vec v__469 (Ox"00200073"  : mword 32) then returnm true
                            else if andb
                                      (let fm : bits 4 := subrange_vec_dec v__469 31 28 in
                                      let rs : regidx := subrange_vec_dec v__469 19 15 in
                                      let rd : regidx := subrange_vec_dec v__469 11 7 in
                                      let fm : bits 4 := subrange_vec_dec v__469 31 28 in
                                      orb
                                        (andb (neq_vec fm (Ox"0"  : mword 4))
                                           (neq_vec fm (Ox"8"  : mword 4)))
                                        (orb (neq_vec rs ('b"00000"  : mword 5))
                                           (neq_vec rd ('b"00000"  : mword 5))))
                                      (andb
                                         (eq_vec (subrange_vec_dec v__469 14 12)
                                            ('b"000"
                                             : mword (14 - 12 + 1)))
                                         (eq_vec (subrange_vec_dec v__469 6 0)
                                            ('b"0001111"
                                             : mword (6 - 0 + 1)))) then
                              returnm true
                            else if andb
                                      (let imm : bits 12 := subrange_vec_dec v__469 31 20 in
                                      let rs : regidx := subrange_vec_dec v__469 19 15 in
                                      let rd : regidx := subrange_vec_dec v__469 11 7 in
                                      let imm : bits 12 := subrange_vec_dec v__469 31 20 in
                                      orb (neq_vec imm (Ox"000"  : mword 12))
                                        (orb (neq_vec rs zreg) (neq_vec rd zreg)))
                                      (andb
                                         (eq_vec (subrange_vec_dec v__469 14 12)
                                            ('b"001"
                                             : mword (14 - 12 + 1)))
                                         (eq_vec (subrange_vec_dec v__469 6 0)
                                            ('b"0001111"
                                             : mword (6 - 0 + 1)))) then
                              returnm true
                            else
                              (and_boolM ((is_RV32F_or_RV64F tt)  : M (bool))
                                 (returnm ((andb
                                              (eq_vec (subrange_vec_dec v__469 14 12)
                                                 ('b"010"
                                                  : mword (14 - 12 + 1)))
                                              (eq_vec (subrange_vec_dec v__469 6 0)
                                                 ('b"0000111"
                                                  : mword (6 - 0 + 1))))
                                   : bool))) >>= fun w__25 : bool =>
                              (if sumbool_of_bool w__25 then returnm true
                               else
                                 (and_boolM ((is_RV32D_or_RV64D tt)  : M (bool))
                                    (returnm ((andb
                                                 (eq_vec (subrange_vec_dec v__469 14 12)
                                                    ('b"011"
                                                     : mword (14 - 12 + 1)))
                                                 (eq_vec (subrange_vec_dec v__469 6 0)
                                                    ('b"0000111"
                                                     : mword (6 - 0 + 1))))
                                      : bool))) >>= fun w__27 : bool =>
                                 (if sumbool_of_bool w__27 then returnm true
                                  else
                                    (and_boolM ((is_RV32F_or_RV64F tt)  : M (bool))
                                       (returnm ((andb
                                                    (eq_vec (subrange_vec_dec v__469 14 12)
                                                       ('b"010"
                                                        : mword (14 - 12 + 1)))
                                                    (eq_vec (subrange_vec_dec v__469 6 0)
                                                       ('b"0100111"
                                                        : mword (6 - 0 + 1))))
                                         : bool))) >>= fun w__29 : bool =>
                                    (if sumbool_of_bool w__29 then returnm true
                                     else
                                       (and_boolM ((is_RV32D_or_RV64D tt)  : M (bool))
                                          (returnm ((andb
                                                       (eq_vec (subrange_vec_dec v__469 14 12)
                                                          ('b"011"
                                                           : mword (14 - 12 + 1)))
                                                       (eq_vec (subrange_vec_dec v__469 6 0)
                                                          ('b"0100111"
                                                           : mword (6 - 0 + 1))))
                                            : bool))) >>= fun w__31 : bool =>
                                       (if sumbool_of_bool w__31 then returnm true
                                        else
                                          (and_boolM
                                             (let _mappingpatterns_23_ : mword 3 :=
                                               subrange_vec_dec v__469 14 12 in
                                             (if encdec_rounding_mode_backwards_matches
                                                   _mappingpatterns_23_ then
                                                (encdec_rounding_mode_backwards _mappingpatterns_23_) >>= fun rm =>
                                                (is_RV32F_or_RV64F tt)
                                                 : M (bool)
                                              else returnm false)
                                              : M (bool))
                                             (returnm ((andb
                                                          (eq_vec (subrange_vec_dec v__469 26 25)
                                                             ('b"00"
                                                              : mword (26 - 25 + 1)))
                                                          (eq_vec (subrange_vec_dec v__469 6 0)
                                                             ('b"1000011"
                                                              : mword (6 - 0 + 1))))
                                               : bool))) >>= fun w__34 : bool =>
                                          (if sumbool_of_bool w__34 then
                                             let _mappingpatterns_23_ : mword 3 :=
                                               subrange_vec_dec v__469 14 12 in
                                             (encdec_rounding_mode_backwards _mappingpatterns_23_) >>= fun rm =>
                                             returnm true
                                           else
                                             (and_boolM
                                                (let _mappingpatterns_24_ : mword 3 :=
                                                  subrange_vec_dec v__469 14 12 in
                                                (if encdec_rounding_mode_backwards_matches
                                                      _mappingpatterns_24_ then
                                                   (encdec_rounding_mode_backwards
                                                      _mappingpatterns_24_) >>= fun rm =>
                                                   (is_RV32F_or_RV64F tt)
                                                    : M (bool)
                                                 else returnm false)
                                                 : M (bool))
                                                (returnm ((andb
                                                             (eq_vec (subrange_vec_dec v__469 26 25)
                                                                ('b"00"
                                                                 : mword (26 - 25 + 1)))
                                                             (eq_vec (subrange_vec_dec v__469 6 0)
                                                                ('b"1000111"
                                                                 : mword (6 - 0 + 1))))
                                                  : bool))) >>= fun w__37 : bool =>
                                             (if sumbool_of_bool w__37 then
                                                let _mappingpatterns_24_ : mword 3 :=
                                                  subrange_vec_dec v__469 14 12 in
                                                (encdec_rounding_mode_backwards _mappingpatterns_24_) >>= fun rm =>
                                                returnm true
                                              else
                                                (and_boolM
                                                   (let _mappingpatterns_25_ : mword 3 :=
                                                     subrange_vec_dec v__469 14 12 in
                                                   (if encdec_rounding_mode_backwards_matches
                                                         _mappingpatterns_25_ then
                                                      (encdec_rounding_mode_backwards
                                                         _mappingpatterns_25_) >>= fun rm =>
                                                      (is_RV32F_or_RV64F tt)
                                                       : M (bool)
                                                    else returnm false)
                                                    : M (bool))
                                                   (returnm ((andb
                                                                (eq_vec
                                                                   (subrange_vec_dec v__469 26 25)
                                                                   ('b"00"
                                                                    : mword (26 - 25 + 1)))
                                                                (eq_vec
                                                                   (subrange_vec_dec v__469 6 0)
                                                                   ('b"1001011"
                                                                    : mword (6 - 0 + 1))))
                                                     : bool))) >>= fun w__40 : bool =>
                                                (if sumbool_of_bool w__40 then
                                                   let _mappingpatterns_25_ : mword 3 :=
                                                     subrange_vec_dec v__469 14 12 in
                                                   (encdec_rounding_mode_backwards
                                                      _mappingpatterns_25_) >>= fun rm =>
                                                   returnm true
                                                 else
                                                   (and_boolM
                                                      (let _mappingpatterns_26_ : mword 3 :=
                                                        subrange_vec_dec v__469 14 12 in
                                                      (if encdec_rounding_mode_backwards_matches
                                                            _mappingpatterns_26_ then
                                                         (encdec_rounding_mode_backwards
                                                            _mappingpatterns_26_) >>= fun rm =>
                                                         (is_RV32F_or_RV64F tt)
                                                          : M (bool)
                                                       else returnm false)
                                                       : M (bool))
                                                      (returnm ((andb
                                                                   (eq_vec
                                                                      (subrange_vec_dec v__469 26 25)
                                                                      ('b"00"
                                                                       : mword (26 - 25 + 1)))
                                                                   (eq_vec
                                                                      (subrange_vec_dec v__469 6 0)
                                                                      ('b"1001111"
                                                                       : mword (6 - 0 + 1))))
                                                        : bool))) >>= fun w__43 : bool =>
                                                   (if sumbool_of_bool w__43 then
                                                      let _mappingpatterns_26_ : mword 3 :=
                                                        subrange_vec_dec v__469 14 12 in
                                                      (encdec_rounding_mode_backwards
                                                         _mappingpatterns_26_) >>= fun rm =>
                                                      returnm true
                                                    else
                                                      (and_boolM
                                                         (let _mappingpatterns_27_ : mword 3 :=
                                                           subrange_vec_dec v__469 14 12 in
                                                         (if encdec_rounding_mode_backwards_matches
                                                               _mappingpatterns_27_ then
                                                            (encdec_rounding_mode_backwards
                                                               _mappingpatterns_27_) >>= fun rm =>
                                                            (is_RV32F_or_RV64F tt)
                                                             : M (bool)
                                                          else returnm false)
                                                          : M (bool))
                                                         (returnm ((andb
                                                                      (eq_vec
                                                                         (subrange_vec_dec v__469 31
                                                                            25)
                                                                         ('b"0000000"
                                                                          : mword (31 - 25 + 1)))
                                                                      (eq_vec
                                                                         (subrange_vec_dec v__469 6
                                                                            0)
                                                                         ('b"1010011"
                                                                          : mword (6 - 0 + 1))))
                                                           : bool))) >>= fun w__46 : bool =>
                                                      (if sumbool_of_bool w__46 then
                                                         let _mappingpatterns_27_ : mword 3 :=
                                                           subrange_vec_dec v__469 14 12 in
                                                         (encdec_rounding_mode_backwards
                                                            _mappingpatterns_27_) >>= fun rm =>
                                                         returnm true
                                                       else
                                                         (and_boolM
                                                            (let _mappingpatterns_28_ : mword 3 :=
                                                              subrange_vec_dec v__469 14 12 in
                                                            (if encdec_rounding_mode_backwards_matches
                                                                  _mappingpatterns_28_ then
                                                               (encdec_rounding_mode_backwards
                                                                  _mappingpatterns_28_) >>= fun rm =>
                                                               (is_RV32F_or_RV64F tt)
                                                                : M (bool)
                                                             else returnm false)
                                                             : M (bool))
                                                            (returnm ((andb
                                                                         (eq_vec
                                                                            (subrange_vec_dec v__469
                                                                               31 25)
                                                                            ('b"0000100"
                                                                             : mword (31 - 25 + 1)))
                                                                         (eq_vec
                                                                            (subrange_vec_dec v__469
                                                                               6 0)
                                                                            ('b"1010011"
                                                                             : mword (6 - 0 + 1))))
                                                              : bool))) >>= fun w__49 : bool =>
                                                         (if sumbool_of_bool w__49 then
                                                            let _mappingpatterns_28_ : mword 3 :=
                                                              subrange_vec_dec v__469 14 12 in
                                                            (encdec_rounding_mode_backwards
                                                               _mappingpatterns_28_) >>= fun rm =>
                                                            returnm true
                                                          else
                                                            (and_boolM
                                                               (let _mappingpatterns_29_ : mword 3 :=
                                                                 subrange_vec_dec v__469 14 12 in
                                                               (if encdec_rounding_mode_backwards_matches
                                                                     _mappingpatterns_29_ then
                                                                  (encdec_rounding_mode_backwards
                                                                     _mappingpatterns_29_) >>= fun rm =>
                                                                  (is_RV32F_or_RV64F tt)
                                                                   : M (bool)
                                                                else returnm false)
                                                                : M (bool))
                                                               (returnm ((andb
                                                                            (eq_vec
                                                                               (subrange_vec_dec
                                                                                  v__469 31 25)
                                                                               ('b"0001000"
                                                                                : mword (31 - 25 + 1)))
                                                                            (eq_vec
                                                                               (subrange_vec_dec
                                                                                  v__469 6 0)
                                                                               ('b"1010011"
                                                                                : mword (6 - 0 + 1))))
                                                                 : bool))) >>= fun w__52 : bool =>
                                                            (if sumbool_of_bool w__52 then
                                                               let _mappingpatterns_29_ : mword 3 :=
                                                                 subrange_vec_dec v__469 14 12 in
                                                               (encdec_rounding_mode_backwards
                                                                  _mappingpatterns_29_) >>= fun rm =>
                                                               returnm true
                                                             else
                                                               (and_boolM
                                                                  (let _mappingpatterns_30_ : mword 3 :=
                                                                    subrange_vec_dec v__469 14 12 in
                                                                  (if encdec_rounding_mode_backwards_matches
                                                                        _mappingpatterns_30_ then
                                                                     (encdec_rounding_mode_backwards
                                                                        _mappingpatterns_30_) >>= fun rm =>
                                                                     (is_RV32F_or_RV64F tt)
                                                                      : M (bool)
                                                                   else returnm false)
                                                                   : M (bool))
                                                                  (returnm ((andb
                                                                               (eq_vec
                                                                                  (subrange_vec_dec
                                                                                     v__469 31 25)
                                                                                  ('b"0001100"
                                                                                   : mword (31 - 25 + 1)))
                                                                               (eq_vec
                                                                                  (subrange_vec_dec
                                                                                     v__469 6 0)
                                                                                  ('b"1010011"
                                                                                   : mword (6 - 0 + 1))))
                                                                    : bool))) >>= fun w__55 : bool =>
                                                               (if sumbool_of_bool w__55 then
                                                                  let _mappingpatterns_30_ : mword 3 :=
                                                                    subrange_vec_dec v__469 14 12 in
                                                                  (encdec_rounding_mode_backwards
                                                                     _mappingpatterns_30_) >>= fun rm =>
                                                                  returnm true
                                                                else
                                                                  (and_boolM
                                                                     (let _mappingpatterns_31_ : mword 3 :=
                                                                       subrange_vec_dec v__469 14 12 in
                                                                     (if encdec_rounding_mode_backwards_matches
                                                                           _mappingpatterns_31_ then
                                                                        (encdec_rounding_mode_backwards
                                                                           _mappingpatterns_31_) >>= fun rm =>
                                                                        (is_RV32F_or_RV64F tt)
                                                                         : M (bool)
                                                                      else returnm false)
                                                                      : M (bool))
                                                                     (returnm ((andb
                                                                                  (eq_vec
                                                                                     (subrange_vec_dec
                                                                                        v__469 31 20)
                                                                                     (Ox"580"
                                                                                      : mword (31 - 20 + 1)))
                                                                                  (eq_vec
                                                                                     (subrange_vec_dec
                                                                                        v__469 6 0)
                                                                                     ('b"1010011"
                                                                                      : mword (6 - 0 + 1))))
                                                                       : bool))) >>= fun w__58 : bool =>
                                                                  (if sumbool_of_bool w__58 then
                                                                     let _mappingpatterns_31_ : mword 3 :=
                                                                       subrange_vec_dec v__469 14 12 in
                                                                     (encdec_rounding_mode_backwards
                                                                        _mappingpatterns_31_) >>= fun rm =>
                                                                     returnm true
                                                                   else
                                                                     (and_boolM
                                                                        (let _mappingpatterns_32_ : mword 3 :=
                                                                          subrange_vec_dec v__469 14
                                                                            12 in
                                                                        (if encdec_rounding_mode_backwards_matches
                                                                              _mappingpatterns_32_
                                                                         then
                                                                           (encdec_rounding_mode_backwards
                                                                              _mappingpatterns_32_) >>= fun rm =>
                                                                           (is_RV32F_or_RV64F tt)
                                                                            : M (bool)
                                                                         else returnm false)
                                                                         : M (bool))
                                                                        (returnm ((andb
                                                                                     (eq_vec
                                                                                        (subrange_vec_dec
                                                                                           v__469 31
                                                                                           20)
                                                                                        (Ox"C00"
                                                                                         : mword (31 - 20 + 1)))
                                                                                     (eq_vec
                                                                                        (subrange_vec_dec
                                                                                           v__469 6
                                                                                           0)
                                                                                        ('b"1010011"
                                                                                         : mword (6 - 0 + 1))))
                                                                          : bool))) >>= fun w__61 : bool =>
                                                                     (if sumbool_of_bool w__61 then
                                                                        let _mappingpatterns_32_ : mword 3 :=
                                                                          subrange_vec_dec v__469 14
                                                                            12 in
                                                                        (encdec_rounding_mode_backwards
                                                                           _mappingpatterns_32_) >>= fun rm =>
                                                                        returnm true
                                                                      else
                                                                        (and_boolM
                                                                           (let _mappingpatterns_33_ : mword 3 :=
                                                                             subrange_vec_dec v__469
                                                                               14 12 in
                                                                           (if encdec_rounding_mode_backwards_matches
                                                                                 _mappingpatterns_33_
                                                                            then
                                                                              (encdec_rounding_mode_backwards
                                                                                 _mappingpatterns_33_) >>= fun rm =>
                                                                              (is_RV32F_or_RV64F tt)
                                                                               : M (bool)
                                                                            else returnm false)
                                                                            : M (bool))
                                                                           (returnm ((andb
                                                                                        (eq_vec
                                                                                           (subrange_vec_dec
                                                                                              v__469
                                                                                              31 20)
                                                                                           (Ox"C01"
                                                                                            : mword (31 - 20 + 1)))
                                                                                        (eq_vec
                                                                                           (subrange_vec_dec
                                                                                              v__469
                                                                                              6 0)
                                                                                           ('b"1010011"
                                                                                            : mword (6 - 0 + 1))))
                                                                             : bool))) >>= fun w__64 : bool =>
                                                                        (if sumbool_of_bool
                                                                           w__64 then
                                                                           let _mappingpatterns_33_ : mword 3 :=
                                                                             subrange_vec_dec v__469
                                                                               14 12 in
                                                                           (encdec_rounding_mode_backwards
                                                                              _mappingpatterns_33_) >>= fun rm =>
                                                                           returnm true
                                                                         else
                                                                           (and_boolM
                                                                              (let _mappingpatterns_34_ : mword 3 :=
                                                                                subrange_vec_dec
                                                                                  v__469 14 12 in
                                                                              (if encdec_rounding_mode_backwards_matches
                                                                                    _mappingpatterns_34_
                                                                               then
                                                                                 (encdec_rounding_mode_backwards
                                                                                    _mappingpatterns_34_) >>= fun rm =>
                                                                                 (is_RV32F_or_RV64F
                                                                                    tt)
                                                                                  : M (bool)
                                                                               else returnm false)
                                                                               : M (bool))
                                                                              (returnm ((andb
                                                                                           (eq_vec
                                                                                              (subrange_vec_dec
                                                                                                 v__469
                                                                                                 31
                                                                                                 20)
                                                                                              (Ox"D00"
                                                                                               : mword (31 - 20 + 1)))
                                                                                           (eq_vec
                                                                                              (subrange_vec_dec
                                                                                                 v__469
                                                                                                 6 0)
                                                                                              ('b"1010011"
                                                                                               : mword (6 - 0 + 1))))
                                                                                : bool))) >>= fun w__67 : bool =>
                                                                           (if sumbool_of_bool
                                                                              w__67 then
                                                                              let _mappingpatterns_34_ : mword 3 :=
                                                                                subrange_vec_dec
                                                                                  v__469 14 12 in
                                                                              (encdec_rounding_mode_backwards
                                                                                 _mappingpatterns_34_) >>= fun rm =>
                                                                              returnm true
                                                                            else
                                                                              (and_boolM
                                                                                 (let _mappingpatterns_35_ : mword 3 :=
                                                                                   subrange_vec_dec
                                                                                     v__469 14 12 in
                                                                                 (if encdec_rounding_mode_backwards_matches
                                                                                       _mappingpatterns_35_
                                                                                  then
                                                                                    (encdec_rounding_mode_backwards
                                                                                       _mappingpatterns_35_) >>= fun rm =>
                                                                                    (is_RV32F_or_RV64F
                                                                                       tt)
                                                                                     : M (bool)
                                                                                  else returnm false)
                                                                                  : M (bool))
                                                                                 (returnm ((andb
                                                                                              (eq_vec
                                                                                                 (subrange_vec_dec
                                                                                                    v__469
                                                                                                    31
                                                                                                    20)
                                                                                                 (Ox"D01"
                                                                                                  : mword (31 - 20 + 1)))
                                                                                              (eq_vec
                                                                                                 (subrange_vec_dec
                                                                                                    v__469
                                                                                                    6
                                                                                                    0)
                                                                                                 ('b"1010011"
                                                                                                  : mword (6 - 0 + 1))))
                                                                                   : bool))) >>= fun w__70 : bool =>
                                                                              (if sumbool_of_bool
                                                                                 w__70 then
                                                                                 let _mappingpatterns_35_ : mword 3 :=
                                                                                   subrange_vec_dec
                                                                                     v__469 14 12 in
                                                                                 (encdec_rounding_mode_backwards
                                                                                    _mappingpatterns_35_) >>= fun rm =>
                                                                                 returnm true
                                                                               else
                                                                                 (and_boolM
                                                                                    (let _mappingpatterns_36_ : mword 3 :=
                                                                                      subrange_vec_dec
                                                                                        v__469 14 12 in
                                                                                    (if encdec_rounding_mode_backwards_matches
                                                                                          _mappingpatterns_36_
                                                                                     then
                                                                                       (encdec_rounding_mode_backwards
                                                                                          _mappingpatterns_36_) >>= fun rm =>
                                                                                       (is_RV64F tt)
                                                                                        : M (bool)
                                                                                     else
                                                                                       returnm false)
                                                                                     : M (bool))
                                                                                    (returnm ((andb
                                                                                                 (eq_vec
                                                                                                    (subrange_vec_dec
                                                                                                       v__469
                                                                                                       31
                                                                                                       20)
                                                                                                    (Ox"C02"
                                                                                                     : mword (31 - 20 + 1)))
                                                                                                 (eq_vec
                                                                                                    (subrange_vec_dec
                                                                                                       v__469
                                                                                                       6
                                                                                                       0)
                                                                                                    ('b"1010011"
                                                                                                     : mword (6 - 0 + 1))))
                                                                                      : bool))) >>= fun w__73 : bool =>
                                                                                 (if sumbool_of_bool
                                                                                    w__73 then
                                                                                    let _mappingpatterns_36_ : mword 3 :=
                                                                                      subrange_vec_dec
                                                                                        v__469 14 12 in
                                                                                    (encdec_rounding_mode_backwards
                                                                                       _mappingpatterns_36_) >>= fun rm =>
                                                                                    returnm true
                                                                                  else
                                                                                    (and_boolM
                                                                                       (let _mappingpatterns_37_ : mword 3 :=
                                                                                         subrange_vec_dec
                                                                                           v__469 14
                                                                                           12 in
                                                                                       (if encdec_rounding_mode_backwards_matches
                                                                                             _mappingpatterns_37_
                                                                                        then
                                                                                          (encdec_rounding_mode_backwards
                                                                                             _mappingpatterns_37_) >>= fun rm =>
                                                                                          (is_RV64F
                                                                                             tt)
                                                                                           : M (bool)
                                                                                        else
                                                                                          returnm false)
                                                                                        : M (bool))
                                                                                       (returnm ((andb
                                                                                                    (eq_vec
                                                                                                       (subrange_vec_dec
                                                                                                          v__469
                                                                                                          31
                                                                                                          20)
                                                                                                       (Ox"C03"
                                                                                                        : mword (31 - 20 + 1)))
                                                                                                    (eq_vec
                                                                                                       (subrange_vec_dec
                                                                                                          v__469
                                                                                                          6
                                                                                                          0)
                                                                                                       ('b"1010011"
                                                                                                        : mword (6 - 0 + 1))))
                                                                                         : bool))) >>= fun w__76 : bool =>
                                                                                    (if sumbool_of_bool
                                                                                       w__76 then
                                                                                       let _mappingpatterns_37_ : mword 3 :=
                                                                                         subrange_vec_dec
                                                                                           v__469 14
                                                                                           12 in
                                                                                       (encdec_rounding_mode_backwards
                                                                                          _mappingpatterns_37_) >>= fun rm =>
                                                                                       returnm true
                                                                                     else
                                                                                       (and_boolM
                                                                                          (let _mappingpatterns_38_ : mword 3 :=
                                                                                            subrange_vec_dec
                                                                                              v__469
                                                                                              14 12 in
                                                                                          (if encdec_rounding_mode_backwards_matches
                                                                                                _mappingpatterns_38_
                                                                                           then
                                                                                             (encdec_rounding_mode_backwards
                                                                                                _mappingpatterns_38_) >>= fun rm =>
                                                                                             (is_RV64F
                                                                                                tt)
                                                                                              : M (bool)
                                                                                           else
                                                                                             returnm false)
                                                                                           : M (bool))
                                                                                          (returnm ((andb
                                                                                                       (eq_vec
                                                                                                          (subrange_vec_dec
                                                                                                             v__469
                                                                                                             31
                                                                                                             20)
                                                                                                          (Ox"D02"
                                                                                                           : mword (31 - 20 + 1)))
                                                                                                       (eq_vec
                                                                                                          (subrange_vec_dec
                                                                                                             v__469
                                                                                                             6
                                                                                                             0)
                                                                                                          ('b"1010011"
                                                                                                           : mword (6 - 0 + 1))))
                                                                                            : bool))) >>= fun w__79 : bool =>
                                                                                       (if sumbool_of_bool
                                                                                          w__79 then
                                                                                          let _mappingpatterns_38_ : mword 3 :=
                                                                                            subrange_vec_dec
                                                                                              v__469
                                                                                              14 12 in
                                                                                          (encdec_rounding_mode_backwards
                                                                                             _mappingpatterns_38_) >>= fun rm =>
                                                                                          returnm true
                                                                                        else
                                                                                          (and_boolM
                                                                                             (let _mappingpatterns_39_ : mword 3 :=
                                                                                               subrange_vec_dec
                                                                                                 v__469
                                                                                                 14
                                                                                                 12 in
                                                                                             (if encdec_rounding_mode_backwards_matches
                                                                                                   _mappingpatterns_39_
                                                                                              then
                                                                                                (encdec_rounding_mode_backwards
                                                                                                   _mappingpatterns_39_) >>= fun rm =>
                                                                                                (is_RV64F
                                                                                                   tt)
                                                                                                 : M (bool)
                                                                                              else
                                                                                                returnm false)
                                                                                              : M (bool))
                                                                                             (returnm ((andb
                                                                                                          (eq_vec
                                                                                                             (subrange_vec_dec
                                                                                                                v__469
                                                                                                                31
                                                                                                                20)
                                                                                                             (Ox"D03"
                                                                                                              : mword (31 - 20 + 1)))
                                                                                                          (eq_vec
                                                                                                             (subrange_vec_dec
                                                                                                                v__469
                                                                                                                6
                                                                                                                0)
                                                                                                             ('b"1010011"
                                                                                                              : mword (6 - 0 + 1))))
                                                                                               : bool))) >>= fun w__82 : bool =>
                                                                                          (if sumbool_of_bool
                                                                                             w__82
                                                                                           then
                                                                                             let _mappingpatterns_39_ : mword 3 :=
                                                                                               subrange_vec_dec
                                                                                                 v__469
                                                                                                 14
                                                                                                 12 in
                                                                                             (encdec_rounding_mode_backwards
                                                                                                _mappingpatterns_39_) >>= fun rm =>
                                                                                             returnm true
                                                                                           else
                                                                                             (and_boolM
                                                                                                ((is_RV32F_or_RV64F
                                                                                                    tt)
                                                                                                 : M (bool))
                                                                                                (returnm ((andb
                                                                                                             (eq_vec
                                                                                                                (subrange_vec_dec
                                                                                                                   v__469
                                                                                                                   31
                                                                                                                   25)
                                                                                                                ('b"0010000"
                                                                                                                 : mword (31 - 25 + 1)))
                                                                                                             (andb
                                                                                                                (eq_vec
                                                                                                                   (subrange_vec_dec
                                                                                                                      v__469
                                                                                                                      14
                                                                                                                      12)
                                                                                                                   ('b"000"
                                                                                                                    : mword (14 - 12 + 1)))
                                                                                                                (eq_vec
                                                                                                                   (subrange_vec_dec
                                                                                                                      v__469
                                                                                                                      6
                                                                                                                      0)
                                                                                                                   ('b"1010011"
                                                                                                                    : mword (6 - 0 + 1)))))
                                                                                                  : bool))) >>= fun w__84 : bool =>
                                                                                             (if sumbool_of_bool
                                                                                                w__84
                                                                                              then
                                                                                                returnm true
                                                                                              else
                                                                                                (and_boolM
                                                                                                   ((is_RV32F_or_RV64F
                                                                                                       tt)
                                                                                                    : M (bool))
                                                                                                   (returnm ((andb
                                                                                                                (eq_vec
                                                                                                                   (subrange_vec_dec
                                                                                                                      v__469
                                                                                                                      31
                                                                                                                      25)
                                                                                                                   ('b"0010000"
                                                                                                                    : mword (31 - 25 + 1)))
                                                                                                                (andb
                                                                                                                   (eq_vec
                                                                                                                      (subrange_vec_dec
                                                                                                                         v__469
                                                                                                                         14
                                                                                                                         12)
                                                                                                                      ('b"001"
                                                                                                                       : mword (14 - 12 + 1)))
                                                                                                                   (eq_vec
                                                                                                                      (subrange_vec_dec
                                                                                                                         v__469
                                                                                                                         6
                                                                                                                         0)
                                                                                                                      ('b"1010011"
                                                                                                                       : mword (6 - 0 + 1)))))
                                                                                                     : bool))) >>= fun w__86 : bool =>
                                                                                                (if sumbool_of_bool
                                                                                                   w__86
                                                                                                 then
                                                                                                   returnm true
                                                                                                 else
                                                                                                   (and_boolM
                                                                                                      ((is_RV32F_or_RV64F
                                                                                                          tt)
                                                                                                       : M (bool))
                                                                                                      (returnm ((andb
                                                                                                                   (eq_vec
                                                                                                                      (subrange_vec_dec
                                                                                                                         v__469
                                                                                                                         31
                                                                                                                         25)
                                                                                                                      ('b"0010000"
                                                                                                                       : mword (31 - 25 + 1)))
                                                                                                                   (andb
                                                                                                                      (eq_vec
                                                                                                                         (subrange_vec_dec
                                                                                                                            v__469
                                                                                                                            14
                                                                                                                            12)
                                                                                                                         ('b"010"
                                                                                                                          : mword (14 - 12 + 1)))
                                                                                                                      (eq_vec
                                                                                                                         (subrange_vec_dec
                                                                                                                            v__469
                                                                                                                            6
                                                                                                                            0)
                                                                                                                         ('b"1010011"
                                                                                                                          : mword (6 - 0 + 1)))))
                                                                                                        : bool))) >>= fun w__88 : bool =>
                                                                                                   (if
                                                                                                      sumbool_of_bool
                                                                                                      w__88
                                                                                                    then
                                                                                                      returnm true
                                                                                                    else
                                                                                                      (and_boolM
                                                                                                         ((is_RV32F_or_RV64F
                                                                                                             tt)
                                                                                                          : M (bool))
                                                                                                         (returnm ((andb
                                                                                                                      (eq_vec
                                                                                                                         (subrange_vec_dec
                                                                                                                            v__469
                                                                                                                            31
                                                                                                                            25)
                                                                                                                         ('b"0010100"
                                                                                                                          : mword (31 - 25 + 1)))
                                                                                                                      (andb
                                                                                                                         (eq_vec
                                                                                                                            (subrange_vec_dec
                                                                                                                               v__469
                                                                                                                               14
                                                                                                                               12)
                                                                                                                            ('b"000"
                                                                                                                             : mword (14 - 12 + 1)))
                                                                                                                         (eq_vec
                                                                                                                            (subrange_vec_dec
                                                                                                                               v__469
                                                                                                                               6
                                                                                                                               0)
                                                                                                                            ('b"1010011"
                                                                                                                             : mword (6 - 0 + 1)))))
                                                                                                           : bool))) >>= fun w__90 : bool =>
                                                                                                      (if
                                                                                                         sumbool_of_bool
                                                                                                         w__90
                                                                                                       then
                                                                                                         returnm true
                                                                                                       else
                                                                                                         (and_boolM
                                                                                                            ((is_RV32F_or_RV64F
                                                                                                                tt)
                                                                                                             : M (bool))
                                                                                                            (returnm ((andb
                                                                                                                         (eq_vec
                                                                                                                            (subrange_vec_dec
                                                                                                                               v__469
                                                                                                                               31
                                                                                                                               25)
                                                                                                                            ('b"0010100"
                                                                                                                             : mword (31 - 25 + 1)))
                                                                                                                         (andb
                                                                                                                            (eq_vec
                                                                                                                               (subrange_vec_dec
                                                                                                                                  v__469
                                                                                                                                  14
                                                                                                                                  12)
                                                                                                                               ('b"001"
                                                                                                                                : mword (14 - 12 + 1)))
                                                                                                                            (eq_vec
                                                                                                                               (subrange_vec_dec
                                                                                                                                  v__469
                                                                                                                                  6
                                                                                                                                  0)
                                                                                                                               ('b"1010011"
                                                                                                                                : mword (6 - 0 + 1)))))
                                                                                                              : bool))) >>= fun w__92 : bool =>
                                                                                                         (if
                                                                                                            sumbool_of_bool
                                                                                                            w__92
                                                                                                          then
                                                                                                            returnm true
                                                                                                          else
                                                                                                            (and_boolM
                                                                                                               ((is_RV32F_or_RV64F
                                                                                                                   tt)
                                                                                                                : M (bool))
                                                                                                               (returnm ((andb
                                                                                                                            (eq_vec
                                                                                                                               (subrange_vec_dec
                                                                                                                                  v__469
                                                                                                                                  31
                                                                                                                                  25)
                                                                                                                               ('b"1010000"
                                                                                                                                : mword (31 - 25 + 1)))
                                                                                                                            (andb
                                                                                                                               (eq_vec
                                                                                                                                  (subrange_vec_dec
                                                                                                                                     v__469
                                                                                                                                     14
                                                                                                                                     12)
                                                                                                                                  ('b"010"
                                                                                                                                   : mword (14 - 12 + 1)))
                                                                                                                               (eq_vec
                                                                                                                                  (subrange_vec_dec
                                                                                                                                     v__469
                                                                                                                                     6
                                                                                                                                     0)
                                                                                                                                  ('b"1010011"
                                                                                                                                   : mword (6 - 0 + 1)))))
                                                                                                                 : bool))) >>= fun w__94 : bool =>
                                                                                                            (if
                                                                                                               sumbool_of_bool
                                                                                                               w__94
                                                                                                             then
                                                                                                               returnm true
                                                                                                             else
                                                                                                               (and_boolM
                                                                                                                  ((is_RV32F_or_RV64F
                                                                                                                      tt)
                                                                                                                   : M (bool))
                                                                                                                  (returnm ((andb
                                                                                                                               (eq_vec
                                                                                                                                  (subrange_vec_dec
                                                                                                                                     v__469
                                                                                                                                     31
                                                                                                                                     25)
                                                                                                                                  ('b"1010000"
                                                                                                                                   : mword (31 - 25 + 1)))
                                                                                                                               (andb
                                                                                                                                  (eq_vec
                                                                                                                                     (subrange_vec_dec
                                                                                                                                        v__469
                                                                                                                                        14
                                                                                                                                        12)
                                                                                                                                     ('b"001"
                                                                                                                                      : mword (14 - 12 + 1)))
                                                                                                                                  (eq_vec
                                                                                                                                     (subrange_vec_dec
                                                                                                                                        v__469
                                                                                                                                        6
                                                                                                                                        0)
                                                                                                                                     ('b"1010011"
                                                                                                                                      : mword (6 - 0 + 1)))))
                                                                                                                    : bool))) >>= fun w__96 : bool =>
                                                                                                               (if
                                                                                                                  sumbool_of_bool
                                                                                                                  w__96
                                                                                                                then
                                                                                                                  returnm true
                                                                                                                else
                                                                                                                  (and_boolM
                                                                                                                     ((is_RV32F_or_RV64F
                                                                                                                         tt)
                                                                                                                      : M (bool))
                                                                                                                     (returnm ((andb
                                                                                                                                  (eq_vec
                                                                                                                                     (subrange_vec_dec
                                                                                                                                        v__469
                                                                                                                                        31
                                                                                                                                        25)
                                                                                                                                     ('b"1010000"
                                                                                                                                      : mword (31 - 25 + 1)))
                                                                                                                                  (andb
                                                                                                                                     (eq_vec
                                                                                                                                        (subrange_vec_dec
                                                                                                                                           v__469
                                                                                                                                           14
                                                                                                                                           12)
                                                                                                                                        ('b"000"
                                                                                                                                         : mword (14 - 12 + 1)))
                                                                                                                                     (eq_vec
                                                                                                                                        (subrange_vec_dec
                                                                                                                                           v__469
                                                                                                                                           6
                                                                                                                                           0)
                                                                                                                                        ('b"1010011"
                                                                                                                                         : mword (6 - 0 + 1)))))
                                                                                                                       : bool))) >>= fun w__98 : bool =>
                                                                                                                  (if
                                                                                                                     sumbool_of_bool
                                                                                                                     w__98
                                                                                                                   then
                                                                                                                     returnm true
                                                                                                                   else
                                                                                                                     (and_boolM
                                                                                                                        ((haveFExt
                                                                                                                            tt)
                                                                                                                         : M (bool))
                                                                                                                        (returnm ((andb
                                                                                                                                     (eq_vec
                                                                                                                                        (subrange_vec_dec
                                                                                                                                           v__469
                                                                                                                                           31
                                                                                                                                           20)
                                                                                                                                        (Ox"E00"
                                                                                                                                         : mword (31 - 20 + 1)))
                                                                                                                                     (andb
                                                                                                                                        (eq_vec
                                                                                                                                           (subrange_vec_dec
                                                                                                                                              v__469
                                                                                                                                              14
                                                                                                                                              12)
                                                                                                                                           ('b"001"
                                                                                                                                            : mword (14 - 12 + 1)))
                                                                                                                                        (eq_vec
                                                                                                                                           (subrange_vec_dec
                                                                                                                                              v__469
                                                                                                                                              6
                                                                                                                                              0)
                                                                                                                                           ('b"1010011"
                                                                                                                                            : mword (6 - 0 + 1)))))
                                                                                                                          : bool))) >>= fun w__100 : bool =>
                                                                                                                     (if
                                                                                                                        sumbool_of_bool
                                                                                                                        w__100
                                                                                                                      then
                                                                                                                        returnm true
                                                                                                                      else
                                                                                                                        (and_boolM
                                                                                                                           ((haveFExt
                                                                                                                               tt)
                                                                                                                            : M (bool))
                                                                                                                           (returnm ((andb
                                                                                                                                        (eq_vec
                                                                                                                                           (subrange_vec_dec
                                                                                                                                              v__469
                                                                                                                                              31
                                                                                                                                              20)
                                                                                                                                           (Ox"E00"
                                                                                                                                            : mword (31 - 20 + 1)))
                                                                                                                                        (andb
                                                                                                                                           (eq_vec
                                                                                                                                              (subrange_vec_dec
                                                                                                                                                 v__469
                                                                                                                                                 14
                                                                                                                                                 12)
                                                                                                                                              ('b"000"
                                                                                                                                               : mword (14 - 12 + 1)))
                                                                                                                                           (eq_vec
                                                                                                                                              (subrange_vec_dec
                                                                                                                                                 v__469
                                                                                                                                                 6
                                                                                                                                                 0)
                                                                                                                                              ('b"1010011"
                                                                                                                                               : mword (6 - 0 + 1)))))
                                                                                                                             : bool))) >>= fun w__102 : bool =>
                                                                                                                        (if
                                                                                                                           sumbool_of_bool
                                                                                                                           w__102
                                                                                                                         then
                                                                                                                           returnm true
                                                                                                                         else
                                                                                                                           (and_boolM
                                                                                                                              ((haveFExt
                                                                                                                                  tt)
                                                                                                                               : M (bool))
                                                                                                                              (returnm ((andb
                                                                                                                                           (eq_vec
                                                                                                                                              (subrange_vec_dec
                                                                                                                                                 v__469
                                                                                                                                                 31
                                                                                                                                                 20)
                                                                                                                                              (Ox"F00"
                                                                                                                                               : mword (31 - 20 + 1)))
                                                                                                                                           (andb
                                                                                                                                              (eq_vec
                                                                                                                                                 (subrange_vec_dec
                                                                                                                                                    v__469
                                                                                                                                                    14
                                                                                                                                                    12)
                                                                                                                                                 ('b"000"
                                                                                                                                                  : mword (14 - 12 + 1)))
                                                                                                                                              (eq_vec
                                                                                                                                                 (subrange_vec_dec
                                                                                                                                                    v__469
                                                                                                                                                    6
                                                                                                                                                    0)
                                                                                                                                                 ('b"1010011"
                                                                                                                                                  : mword (6 - 0 + 1)))))
                                                                                                                                : bool))) >>= fun w__104 : bool =>
                                                                                                                           (if
                                                                                                                              sumbool_of_bool
                                                                                                                              w__104
                                                                                                                            then
                                                                                                                              returnm true
                                                                                                                            else
                                                                                                                              (and_boolM
                                                                                                                                 (let _mappingpatterns_40_ : mword 3 :=
                                                                                                                                   subrange_vec_dec
                                                                                                                                     v__469
                                                                                                                                     14
                                                                                                                                     12 in
                                                                                                                                 (if
                                                                                                                                    encdec_rounding_mode_backwards_matches
                                                                                                                                      _mappingpatterns_40_
                                                                                                                                  then
                                                                                                                                    (encdec_rounding_mode_backwards
                                                                                                                                       _mappingpatterns_40_) >>= fun rm =>
                                                                                                                                    (is_RV32D_or_RV64D
                                                                                                                                       tt)
                                                                                                                                     : M (bool)
                                                                                                                                  else
                                                                                                                                    returnm false)
                                                                                                                                  : M (bool))
                                                                                                                                 (returnm ((andb
                                                                                                                                              (eq_vec
                                                                                                                                                 (subrange_vec_dec
                                                                                                                                                    v__469
                                                                                                                                                    26
                                                                                                                                                    25)
                                                                                                                                                 ('b"01"
                                                                                                                                                  : mword (26 - 25 + 1)))
                                                                                                                                              (eq_vec
                                                                                                                                                 (subrange_vec_dec
                                                                                                                                                    v__469
                                                                                                                                                    6
                                                                                                                                                    0)
                                                                                                                                                 ('b"1000011"
                                                                                                                                                  : mword (6 - 0 + 1))))
                                                                                                                                   : bool))) >>= fun w__107 : bool =>
                                                                                                                              (if
                                                                                                                                 sumbool_of_bool
                                                                                                                                 w__107
                                                                                                                               then
                                                                                                                                 let _mappingpatterns_40_ : mword 3 :=
                                                                                                                                   subrange_vec_dec
                                                                                                                                     v__469
                                                                                                                                     14
                                                                                                                                     12 in
                                                                                                                                 (encdec_rounding_mode_backwards
                                                                                                                                    _mappingpatterns_40_) >>= fun rm =>
                                                                                                                                 returnm true
                                                                                                                               else
                                                                                                                                 (and_boolM
                                                                                                                                    (let _mappingpatterns_41_ : mword 3 :=
                                                                                                                                      subrange_vec_dec
                                                                                                                                        v__469
                                                                                                                                        14
                                                                                                                                        12 in
                                                                                                                                    (if
                                                                                                                                       encdec_rounding_mode_backwards_matches
                                                                                                                                         _mappingpatterns_41_
                                                                                                                                     then
                                                                                                                                       (encdec_rounding_mode_backwards
                                                                                                                                          _mappingpatterns_41_) >>= fun rm =>
                                                                                                                                       (is_RV32D_or_RV64D
                                                                                                                                          tt)
                                                                                                                                        : M (bool)
                                                                                                                                     else
                                                                                                                                       returnm false)
                                                                                                                                     : M (bool))
                                                                                                                                    (returnm ((andb
                                                                                                                                                 (eq_vec
                                                                                                                                                    (subrange_vec_dec
                                                                                                                                                       v__469
                                                                                                                                                       26
                                                                                                                                                       25)
                                                                                                                                                    ('b"01"
                                                                                                                                                     : mword (26 - 25 + 1)))
                                                                                                                                                 (eq_vec
                                                                                                                                                    (subrange_vec_dec
                                                                                                                                                       v__469
                                                                                                                                                       6
                                                                                                                                                       0)
                                                                                                                                                    ('b"1000111"
                                                                                                                                                     : mword (6 - 0 + 1))))
                                                                                                                                      : bool))) >>= fun w__110 : bool =>
                                                                                                                                 (if
                                                                                                                                    sumbool_of_bool
                                                                                                                                    w__110
                                                                                                                                  then
                                                                                                                                    let _mappingpatterns_41_ : mword 3 :=
                                                                                                                                      subrange_vec_dec
                                                                                                                                        v__469
                                                                                                                                        14
                                                                                                                                        12 in
                                                                                                                                    (encdec_rounding_mode_backwards
                                                                                                                                       _mappingpatterns_41_) >>= fun rm =>
                                                                                                                                    returnm true
                                                                                                                                  else
                                                                                                                                    (and_boolM
                                                                                                                                       (let _mappingpatterns_42_ : mword 3 :=
                                                                                                                                         subrange_vec_dec
                                                                                                                                           v__469
                                                                                                                                           14
                                                                                                                                           12 in
                                                                                                                                       (if
                                                                                                                                          encdec_rounding_mode_backwards_matches
                                                                                                                                            _mappingpatterns_42_
                                                                                                                                        then
                                                                                                                                          (encdec_rounding_mode_backwards
                                                                                                                                             _mappingpatterns_42_) >>= fun rm =>
                                                                                                                                          (is_RV32D_or_RV64D
                                                                                                                                             tt)
                                                                                                                                           : M (bool)
                                                                                                                                        else
                                                                                                                                          returnm false)
                                                                                                                                        : M (bool))
                                                                                                                                       (returnm ((andb
                                                                                                                                                    (eq_vec
                                                                                                                                                       (subrange_vec_dec
                                                                                                                                                          v__469
                                                                                                                                                          26
                                                                                                                                                          25)
                                                                                                                                                       ('b"01"
                                                                                                                                                        : mword (26 - 25 + 1)))
                                                                                                                                                    (eq_vec
                                                                                                                                                       (subrange_vec_dec
                                                                                                                                                          v__469
                                                                                                                                                          6
                                                                                                                                                          0)
                                                                                                                                                       ('b"1001011"
                                                                                                                                                        : mword (6 - 0 + 1))))
                                                                                                                                         : bool))) >>= fun w__113 : bool =>
                                                                                                                                    (if
                                                                                                                                       sumbool_of_bool
                                                                                                                                       w__113
                                                                                                                                     then
                                                                                                                                       let _mappingpatterns_42_ : mword 3 :=
                                                                                                                                         subrange_vec_dec
                                                                                                                                           v__469
                                                                                                                                           14
                                                                                                                                           12 in
                                                                                                                                       (encdec_rounding_mode_backwards
                                                                                                                                          _mappingpatterns_42_) >>= fun rm =>
                                                                                                                                       returnm true
                                                                                                                                     else
                                                                                                                                       (and_boolM
                                                                                                                                          (let _mappingpatterns_43_ : mword 3 :=
                                                                                                                                            subrange_vec_dec
                                                                                                                                              v__469
                                                                                                                                              14
                                                                                                                                              12 in
                                                                                                                                          (if
                                                                                                                                             encdec_rounding_mode_backwards_matches
                                                                                                                                               _mappingpatterns_43_
                                                                                                                                           then
                                                                                                                                             (encdec_rounding_mode_backwards
                                                                                                                                                _mappingpatterns_43_) >>= fun rm =>
                                                                                                                                             (is_RV32D_or_RV64D
                                                                                                                                                tt)
                                                                                                                                              : M (bool)
                                                                                                                                           else
                                                                                                                                             returnm false)
                                                                                                                                           : M (bool))
                                                                                                                                          (returnm ((andb
                                                                                                                                                       (eq_vec
                                                                                                                                                          (subrange_vec_dec
                                                                                                                                                             v__469
                                                                                                                                                             26
                                                                                                                                                             25)
                                                                                                                                                          ('b"01"
                                                                                                                                                           : mword (26 - 25 + 1)))
                                                                                                                                                       (eq_vec
                                                                                                                                                          (subrange_vec_dec
                                                                                                                                                             v__469
                                                                                                                                                             6
                                                                                                                                                             0)
                                                                                                                                                          ('b"1001111"
                                                                                                                                                           : mword (6 - 0 + 1))))
                                                                                                                                            : bool))) >>= fun w__116 : bool =>
                                                                                                                                       (if
                                                                                                                                          sumbool_of_bool
                                                                                                                                          w__116
                                                                                                                                        then
                                                                                                                                          let _mappingpatterns_43_ : mword 3 :=
                                                                                                                                            subrange_vec_dec
                                                                                                                                              v__469
                                                                                                                                              14
                                                                                                                                              12 in
                                                                                                                                          (encdec_rounding_mode_backwards
                                                                                                                                             _mappingpatterns_43_) >>= fun rm =>
                                                                                                                                          returnm true
                                                                                                                                        else
                                                                                                                                          (and_boolM
                                                                                                                                             (let _mappingpatterns_44_ : mword 3 :=
                                                                                                                                               subrange_vec_dec
                                                                                                                                                 v__469
                                                                                                                                                 14
                                                                                                                                                 12 in
                                                                                                                                             (if
                                                                                                                                                encdec_rounding_mode_backwards_matches
                                                                                                                                                  _mappingpatterns_44_
                                                                                                                                              then
                                                                                                                                                (encdec_rounding_mode_backwards
                                                                                                                                                   _mappingpatterns_44_) >>= fun rm =>
                                                                                                                                                (is_RV32D_or_RV64D
                                                                                                                                                   tt)
                                                                                                                                                 : M (bool)
                                                                                                                                              else
                                                                                                                                                returnm false)
                                                                                                                                              : M (bool))
                                                                                                                                             (returnm ((andb
                                                                                                                                                          (eq_vec
                                                                                                                                                             (subrange_vec_dec
                                                                                                                                                                v__469
                                                                                                                                                                31
                                                                                                                                                                25)
                                                                                                                                                             ('b"0000001"
                                                                                                                                                              : mword (31 - 25 + 1)))
                                                                                                                                                          (eq_vec
                                                                                                                                                             (subrange_vec_dec
                                                                                                                                                                v__469
                                                                                                                                                                6
                                                                                                                                                                0)
                                                                                                                                                             ('b"1010011"
                                                                                                                                                              : mword (6 - 0 + 1))))
                                                                                                                                               : bool))) >>= fun w__119 : bool =>
                                                                                                                                          (if
                                                                                                                                             sumbool_of_bool
                                                                                                                                             w__119
                                                                                                                                           then
                                                                                                                                             let _mappingpatterns_44_ : mword 3 :=
                                                                                                                                               subrange_vec_dec
                                                                                                                                                 v__469
                                                                                                                                                 14
                                                                                                                                                 12 in
                                                                                                                                             (encdec_rounding_mode_backwards
                                                                                                                                                _mappingpatterns_44_) >>= fun rm =>
                                                                                                                                             returnm true
                                                                                                                                           else
                                                                                                                                             (and_boolM
                                                                                                                                                (let _mappingpatterns_45_ : mword 3 :=
                                                                                                                                                  subrange_vec_dec
                                                                                                                                                    v__469
                                                                                                                                                    14
                                                                                                                                                    12 in
                                                                                                                                                (if
                                                                                                                                                   encdec_rounding_mode_backwards_matches
                                                                                                                                                     _mappingpatterns_45_
                                                                                                                                                 then
                                                                                                                                                   (encdec_rounding_mode_backwards
                                                                                                                                                      _mappingpatterns_45_) >>= fun rm =>
                                                                                                                                                   (is_RV32D_or_RV64D
                                                                                                                                                      tt)
                                                                                                                                                    : M (bool)
                                                                                                                                                 else
                                                                                                                                                   returnm false)
                                                                                                                                                 : M (bool))
                                                                                                                                                (returnm ((andb
                                                                                                                                                             (eq_vec
                                                                                                                                                                (subrange_vec_dec
                                                                                                                                                                   v__469
                                                                                                                                                                   31
                                                                                                                                                                   25)
                                                                                                                                                                ('b"0000101"
                                                                                                                                                                 : mword (31 - 25 + 1)))
                                                                                                                                                             (eq_vec
                                                                                                                                                                (subrange_vec_dec
                                                                                                                                                                   v__469
                                                                                                                                                                   6
                                                                                                                                                                   0)
                                                                                                                                                                ('b"1010011"
                                                                                                                                                                 : mword (6 - 0 + 1))))
                                                                                                                                                  : bool))) >>= fun w__122 : bool =>
                                                                                                                                             (if
                                                                                                                                                sumbool_of_bool
                                                                                                                                                w__122
                                                                                                                                              then
                                                                                                                                                let _mappingpatterns_45_ : mword 3 :=
                                                                                                                                                  subrange_vec_dec
                                                                                                                                                    v__469
                                                                                                                                                    14
                                                                                                                                                    12 in
                                                                                                                                                (encdec_rounding_mode_backwards
                                                                                                                                                   _mappingpatterns_45_) >>= fun rm =>
                                                                                                                                                returnm true
                                                                                                                                              else
                                                                                                                                                (and_boolM
                                                                                                                                                   (let _mappingpatterns_46_ : mword 3 :=
                                                                                                                                                     subrange_vec_dec
                                                                                                                                                       v__469
                                                                                                                                                       14
                                                                                                                                                       12 in
                                                                                                                                                   (if
                                                                                                                                                      encdec_rounding_mode_backwards_matches
                                                                                                                                                        _mappingpatterns_46_
                                                                                                                                                    then
                                                                                                                                                      (encdec_rounding_mode_backwards
                                                                                                                                                         _mappingpatterns_46_) >>= fun rm =>
                                                                                                                                                      (is_RV32D_or_RV64D
                                                                                                                                                         tt)
                                                                                                                                                       : M (bool)
                                                                                                                                                    else
                                                                                                                                                      returnm false)
                                                                                                                                                    : M (bool))
                                                                                                                                                   (returnm ((andb
                                                                                                                                                                (eq_vec
                                                                                                                                                                   (subrange_vec_dec
                                                                                                                                                                      v__469
                                                                                                                                                                      31
                                                                                                                                                                      25)
                                                                                                                                                                   ('b"0001001"
                                                                                                                                                                    : mword (31 - 25 + 1)))
                                                                                                                                                                (eq_vec
                                                                                                                                                                   (subrange_vec_dec
                                                                                                                                                                      v__469
                                                                                                                                                                      6
                                                                                                                                                                      0)
                                                                                                                                                                   ('b"1010011"
                                                                                                                                                                    : mword (6 - 0 + 1))))
                                                                                                                                                     : bool))) >>= fun w__125 : bool =>
                                                                                                                                                (if
                                                                                                                                                   sumbool_of_bool
                                                                                                                                                   w__125
                                                                                                                                                 then
                                                                                                                                                   let _mappingpatterns_46_ : mword 3 :=
                                                                                                                                                     subrange_vec_dec
                                                                                                                                                       v__469
                                                                                                                                                       14
                                                                                                                                                       12 in
                                                                                                                                                   (encdec_rounding_mode_backwards
                                                                                                                                                      _mappingpatterns_46_) >>= fun rm =>
                                                                                                                                                   returnm true
                                                                                                                                                 else
                                                                                                                                                   (and_boolM
                                                                                                                                                      (let _mappingpatterns_47_ : mword 3 :=
                                                                                                                                                        subrange_vec_dec
                                                                                                                                                          v__469
                                                                                                                                                          14
                                                                                                                                                          12 in
                                                                                                                                                      (if
                                                                                                                                                         encdec_rounding_mode_backwards_matches
                                                                                                                                                           _mappingpatterns_47_
                                                                                                                                                       then
                                                                                                                                                         (encdec_rounding_mode_backwards
                                                                                                                                                            _mappingpatterns_47_) >>= fun rm =>
                                                                                                                                                         (is_RV32D_or_RV64D
                                                                                                                                                            tt)
                                                                                                                                                          : M (bool)
                                                                                                                                                       else
                                                                                                                                                         returnm false)
                                                                                                                                                       : M (bool))
                                                                                                                                                      (returnm ((andb
                                                                                                                                                                   (eq_vec
                                                                                                                                                                      (subrange_vec_dec
                                                                                                                                                                         v__469
                                                                                                                                                                         31
                                                                                                                                                                         25)
                                                                                                                                                                      ('b"0001101"
                                                                                                                                                                       : mword (31 - 25 + 1)))
                                                                                                                                                                   (eq_vec
                                                                                                                                                                      (subrange_vec_dec
                                                                                                                                                                         v__469
                                                                                                                                                                         6
                                                                                                                                                                         0)
                                                                                                                                                                      ('b"1010011"
                                                                                                                                                                       : mword (6 - 0 + 1))))
                                                                                                                                                        : bool))) >>= fun w__128 : bool =>
                                                                                                                                                   (if
                                                                                                                                                      sumbool_of_bool
                                                                                                                                                      w__128
                                                                                                                                                    then
                                                                                                                                                      let _mappingpatterns_47_ : mword 3 :=
                                                                                                                                                        subrange_vec_dec
                                                                                                                                                          v__469
                                                                                                                                                          14
                                                                                                                                                          12 in
                                                                                                                                                      (encdec_rounding_mode_backwards
                                                                                                                                                         _mappingpatterns_47_) >>= fun rm =>
                                                                                                                                                      returnm true
                                                                                                                                                    else
                                                                                                                                                      (and_boolM
                                                                                                                                                         (let _mappingpatterns_48_ : mword 3 :=
                                                                                                                                                           subrange_vec_dec
                                                                                                                                                             v__469
                                                                                                                                                             14
                                                                                                                                                             12 in
                                                                                                                                                         (if
                                                                                                                                                            encdec_rounding_mode_backwards_matches
                                                                                                                                                              _mappingpatterns_48_
                                                                                                                                                          then
                                                                                                                                                            (encdec_rounding_mode_backwards
                                                                                                                                                               _mappingpatterns_48_) >>= fun rm =>
                                                                                                                                                            (is_RV32D_or_RV64D
                                                                                                                                                               tt)
                                                                                                                                                             : M (bool)
                                                                                                                                                          else
                                                                                                                                                            returnm false)
                                                                                                                                                          : M (bool))
                                                                                                                                                         (returnm ((andb
                                                                                                                                                                      (eq_vec
                                                                                                                                                                         (subrange_vec_dec
                                                                                                                                                                            v__469
                                                                                                                                                                            31
                                                                                                                                                                            20)
                                                                                                                                                                         (Ox"5A0"
                                                                                                                                                                          : mword (31 - 20 + 1)))
                                                                                                                                                                      (eq_vec
                                                                                                                                                                         (subrange_vec_dec
                                                                                                                                                                            v__469
                                                                                                                                                                            6
                                                                                                                                                                            0)
                                                                                                                                                                         ('b"1010011"
                                                                                                                                                                          : mword (6 - 0 + 1))))
                                                                                                                                                           : bool))) >>= fun w__131 : bool =>
                                                                                                                                                      (if
                                                                                                                                                         sumbool_of_bool
                                                                                                                                                         w__131
                                                                                                                                                       then
                                                                                                                                                         let _mappingpatterns_48_ : mword 3 :=
                                                                                                                                                           subrange_vec_dec
                                                                                                                                                             v__469
                                                                                                                                                             14
                                                                                                                                                             12 in
                                                                                                                                                         (encdec_rounding_mode_backwards
                                                                                                                                                            _mappingpatterns_48_) >>= fun rm =>
                                                                                                                                                         returnm true
                                                                                                                                                       else
                                                                                                                                                         (and_boolM
                                                                                                                                                            (let _mappingpatterns_49_ : mword 3 :=
                                                                                                                                                              subrange_vec_dec
                                                                                                                                                                v__469
                                                                                                                                                                14
                                                                                                                                                                12 in
                                                                                                                                                            (if
                                                                                                                                                               encdec_rounding_mode_backwards_matches
                                                                                                                                                                 _mappingpatterns_49_
                                                                                                                                                             then
                                                                                                                                                               (encdec_rounding_mode_backwards
                                                                                                                                                                  _mappingpatterns_49_) >>= fun rm =>
                                                                                                                                                               (is_RV32D_or_RV64D
                                                                                                                                                                  tt)
                                                                                                                                                                : M (bool)
                                                                                                                                                             else
                                                                                                                                                               returnm false)
                                                                                                                                                             : M (bool))
                                                                                                                                                            (returnm ((andb
                                                                                                                                                                         (eq_vec
                                                                                                                                                                            (subrange_vec_dec
                                                                                                                                                                               v__469
                                                                                                                                                                               31
                                                                                                                                                                               20)
                                                                                                                                                                            (Ox"C20"
                                                                                                                                                                             : mword (31 - 20 + 1)))
                                                                                                                                                                         (eq_vec
                                                                                                                                                                            (subrange_vec_dec
                                                                                                                                                                               v__469
                                                                                                                                                                               6
                                                                                                                                                                               0)
                                                                                                                                                                            ('b"1010011"
                                                                                                                                                                             : mword (6 - 0 + 1))))
                                                                                                                                                              : bool))) >>= fun w__134 : bool =>
                                                                                                                                                         (if
                                                                                                                                                            sumbool_of_bool
                                                                                                                                                            w__134
                                                                                                                                                          then
                                                                                                                                                            let _mappingpatterns_49_ : mword 3 :=
                                                                                                                                                              subrange_vec_dec
                                                                                                                                                                v__469
                                                                                                                                                                14
                                                                                                                                                                12 in
                                                                                                                                                            (encdec_rounding_mode_backwards
                                                                                                                                                               _mappingpatterns_49_) >>= fun rm =>
                                                                                                                                                            returnm true
                                                                                                                                                          else
                                                                                                                                                            (and_boolM
                                                                                                                                                               (let _mappingpatterns_50_ : mword 3 :=
                                                                                                                                                                 subrange_vec_dec
                                                                                                                                                                   v__469
                                                                                                                                                                   14
                                                                                                                                                                   12 in
                                                                                                                                                               (if
                                                                                                                                                                  encdec_rounding_mode_backwards_matches
                                                                                                                                                                    _mappingpatterns_50_
                                                                                                                                                                then
                                                                                                                                                                  (encdec_rounding_mode_backwards
                                                                                                                                                                     _mappingpatterns_50_) >>= fun rm =>
                                                                                                                                                                  (is_RV32D_or_RV64D
                                                                                                                                                                     tt)
                                                                                                                                                                   : M (bool)
                                                                                                                                                                else
                                                                                                                                                                  returnm false)
                                                                                                                                                                : M (bool))
                                                                                                                                                               (returnm ((andb
                                                                                                                                                                            (eq_vec
                                                                                                                                                                               (subrange_vec_dec
                                                                                                                                                                                  v__469
                                                                                                                                                                                  31
                                                                                                                                                                                  20)
                                                                                                                                                                               (Ox"C21"
                                                                                                                                                                                : mword (31 - 20 + 1)))
                                                                                                                                                                            (eq_vec
                                                                                                                                                                               (subrange_vec_dec
                                                                                                                                                                                  v__469
                                                                                                                                                                                  6
                                                                                                                                                                                  0)
                                                                                                                                                                               ('b"1010011"
                                                                                                                                                                                : mword (6 - 0 + 1))))
                                                                                                                                                                 : bool))) >>= fun w__137 : bool =>
                                                                                                                                                            (if
                                                                                                                                                               sumbool_of_bool
                                                                                                                                                               w__137
                                                                                                                                                             then
                                                                                                                                                               let _mappingpatterns_50_ : mword 3 :=
                                                                                                                                                                 subrange_vec_dec
                                                                                                                                                                   v__469
                                                                                                                                                                   14
                                                                                                                                                                   12 in
                                                                                                                                                               (encdec_rounding_mode_backwards
                                                                                                                                                                  _mappingpatterns_50_) >>= fun rm =>
                                                                                                                                                               returnm true
                                                                                                                                                             else
                                                                                                                                                               (and_boolM
                                                                                                                                                                  (let _mappingpatterns_51_ : mword 3 :=
                                                                                                                                                                    subrange_vec_dec
                                                                                                                                                                      v__469
                                                                                                                                                                      14
                                                                                                                                                                      12 in
                                                                                                                                                                  (if
                                                                                                                                                                     encdec_rounding_mode_backwards_matches
                                                                                                                                                                       _mappingpatterns_51_
                                                                                                                                                                   then
                                                                                                                                                                     (encdec_rounding_mode_backwards
                                                                                                                                                                        _mappingpatterns_51_) >>= fun rm =>
                                                                                                                                                                     (is_RV32D_or_RV64D
                                                                                                                                                                        tt)
                                                                                                                                                                      : M (bool)
                                                                                                                                                                   else
                                                                                                                                                                     returnm false)
                                                                                                                                                                   : M (bool))
                                                                                                                                                                  (returnm ((andb
                                                                                                                                                                               (eq_vec
                                                                                                                                                                                  (subrange_vec_dec
                                                                                                                                                                                     v__469
                                                                                                                                                                                     31
                                                                                                                                                                                     20)
                                                                                                                                                                                  (Ox"D20"
                                                                                                                                                                                   : mword (31 - 20 + 1)))
                                                                                                                                                                               (eq_vec
                                                                                                                                                                                  (subrange_vec_dec
                                                                                                                                                                                     v__469
                                                                                                                                                                                     6
                                                                                                                                                                                     0)
                                                                                                                                                                                  ('b"1010011"
                                                                                                                                                                                   : mword (6 - 0 + 1))))
                                                                                                                                                                    : bool))) >>= fun w__140 : bool =>
                                                                                                                                                               (if
                                                                                                                                                                  sumbool_of_bool
                                                                                                                                                                  w__140
                                                                                                                                                                then
                                                                                                                                                                  let _mappingpatterns_51_ : mword 3 :=
                                                                                                                                                                    subrange_vec_dec
                                                                                                                                                                      v__469
                                                                                                                                                                      14
                                                                                                                                                                      12 in
                                                                                                                                                                  (encdec_rounding_mode_backwards
                                                                                                                                                                     _mappingpatterns_51_) >>= fun rm =>
                                                                                                                                                                  returnm true
                                                                                                                                                                else
                                                                                                                                                                  (and_boolM
                                                                                                                                                                     (let _mappingpatterns_52_ : mword 3 :=
                                                                                                                                                                       subrange_vec_dec
                                                                                                                                                                         v__469
                                                                                                                                                                         14
                                                                                                                                                                         12 in
                                                                                                                                                                     (if
                                                                                                                                                                        encdec_rounding_mode_backwards_matches
                                                                                                                                                                          _mappingpatterns_52_
                                                                                                                                                                      then
                                                                                                                                                                        (encdec_rounding_mode_backwards
                                                                                                                                                                           _mappingpatterns_52_) >>= fun rm =>
                                                                                                                                                                        (is_RV32D_or_RV64D
                                                                                                                                                                           tt)
                                                                                                                                                                         : M (bool)
                                                                                                                                                                      else
                                                                                                                                                                        returnm false)
                                                                                                                                                                      : M (bool))
                                                                                                                                                                     (returnm ((andb
                                                                                                                                                                                  (eq_vec
                                                                                                                                                                                     (subrange_vec_dec
                                                                                                                                                                                        v__469
                                                                                                                                                                                        31
                                                                                                                                                                                        20)
                                                                                                                                                                                     (Ox"D21"
                                                                                                                                                                                      : mword (31 - 20 + 1)))
                                                                                                                                                                                  (eq_vec
                                                                                                                                                                                     (subrange_vec_dec
                                                                                                                                                                                        v__469
                                                                                                                                                                                        6
                                                                                                                                                                                        0)
                                                                                                                                                                                     ('b"1010011"
                                                                                                                                                                                      : mword (6 - 0 + 1))))
                                                                                                                                                                       : bool))) >>= fun w__143 : bool =>
                                                                                                                                                                  (if
                                                                                                                                                                     sumbool_of_bool
                                                                                                                                                                     w__143
                                                                                                                                                                   then
                                                                                                                                                                     let _mappingpatterns_52_ : mword 3 :=
                                                                                                                                                                       subrange_vec_dec
                                                                                                                                                                         v__469
                                                                                                                                                                         14
                                                                                                                                                                         12 in
                                                                                                                                                                     (encdec_rounding_mode_backwards
                                                                                                                                                                        _mappingpatterns_52_) >>= fun rm =>
                                                                                                                                                                     returnm true
                                                                                                                                                                   else
                                                                                                                                                                     (and_boolM
                                                                                                                                                                        (let _mappingpatterns_53_ : mword 3 :=
                                                                                                                                                                          subrange_vec_dec
                                                                                                                                                                            v__469
                                                                                                                                                                            14
                                                                                                                                                                            12 in
                                                                                                                                                                        (if
                                                                                                                                                                           encdec_rounding_mode_backwards_matches
                                                                                                                                                                             _mappingpatterns_53_
                                                                                                                                                                         then
                                                                                                                                                                           (encdec_rounding_mode_backwards
                                                                                                                                                                              _mappingpatterns_53_) >>= fun rm =>
                                                                                                                                                                           (is_RV32D_or_RV64D
                                                                                                                                                                              tt)
                                                                                                                                                                            : M (bool)
                                                                                                                                                                         else
                                                                                                                                                                           returnm false)
                                                                                                                                                                         : M (bool))
                                                                                                                                                                        (returnm ((andb
                                                                                                                                                                                     (eq_vec
                                                                                                                                                                                        (subrange_vec_dec
                                                                                                                                                                                           v__469
                                                                                                                                                                                           31
                                                                                                                                                                                           20)
                                                                                                                                                                                        (Ox"401"
                                                                                                                                                                                         : mword (31 - 20 + 1)))
                                                                                                                                                                                     (eq_vec
                                                                                                                                                                                        (subrange_vec_dec
                                                                                                                                                                                           v__469
                                                                                                                                                                                           6
                                                                                                                                                                                           0)
                                                                                                                                                                                        ('b"1010011"
                                                                                                                                                                                         : mword (6 - 0 + 1))))
                                                                                                                                                                          : bool))) >>= fun w__146 : bool =>
                                                                                                                                                                     (if
                                                                                                                                                                        sumbool_of_bool
                                                                                                                                                                        w__146
                                                                                                                                                                      then
                                                                                                                                                                        let _mappingpatterns_53_ : mword 3 :=
                                                                                                                                                                          subrange_vec_dec
                                                                                                                                                                            v__469
                                                                                                                                                                            14
                                                                                                                                                                            12 in
                                                                                                                                                                        (encdec_rounding_mode_backwards
                                                                                                                                                                           _mappingpatterns_53_) >>= fun rm =>
                                                                                                                                                                        returnm true
                                                                                                                                                                      else
                                                                                                                                                                        (and_boolM
                                                                                                                                                                           (let _mappingpatterns_54_ : mword 3 :=
                                                                                                                                                                             subrange_vec_dec
                                                                                                                                                                               v__469
                                                                                                                                                                               14
                                                                                                                                                                               12 in
                                                                                                                                                                           (if
                                                                                                                                                                              encdec_rounding_mode_backwards_matches
                                                                                                                                                                                _mappingpatterns_54_
                                                                                                                                                                            then
                                                                                                                                                                              (encdec_rounding_mode_backwards
                                                                                                                                                                                 _mappingpatterns_54_) >>= fun rm =>
                                                                                                                                                                              (is_RV32D_or_RV64D
                                                                                                                                                                                 tt)
                                                                                                                                                                               : M (bool)
                                                                                                                                                                            else
                                                                                                                                                                              returnm false)
                                                                                                                                                                            : M (bool))
                                                                                                                                                                           (returnm ((andb
                                                                                                                                                                                        (eq_vec
                                                                                                                                                                                           (subrange_vec_dec
                                                                                                                                                                                              v__469
                                                                                                                                                                                              31
                                                                                                                                                                                              20)
                                                                                                                                                                                           (Ox"420"
                                                                                                                                                                                            : mword (31 - 20 + 1)))
                                                                                                                                                                                        (eq_vec
                                                                                                                                                                                           (subrange_vec_dec
                                                                                                                                                                                              v__469
                                                                                                                                                                                              6
                                                                                                                                                                                              0)
                                                                                                                                                                                           ('b"1010011"
                                                                                                                                                                                            : mword (6 - 0 + 1))))
                                                                                                                                                                             : bool))) >>= fun w__149 : bool =>
                                                                                                                                                                        (if
                                                                                                                                                                           sumbool_of_bool
                                                                                                                                                                           w__149
                                                                                                                                                                         then
                                                                                                                                                                           let _mappingpatterns_54_ : mword 3 :=
                                                                                                                                                                             subrange_vec_dec
                                                                                                                                                                               v__469
                                                                                                                                                                               14
                                                                                                                                                                               12 in
                                                                                                                                                                           (encdec_rounding_mode_backwards
                                                                                                                                                                              _mappingpatterns_54_) >>= fun rm =>
                                                                                                                                                                           returnm true
                                                                                                                                                                         else
                                                                                                                                                                           (and_boolM
                                                                                                                                                                              (let _mappingpatterns_55_ : mword 3 :=
                                                                                                                                                                                subrange_vec_dec
                                                                                                                                                                                  v__469
                                                                                                                                                                                  14
                                                                                                                                                                                  12 in
                                                                                                                                                                              (if
                                                                                                                                                                                 encdec_rounding_mode_backwards_matches
                                                                                                                                                                                   _mappingpatterns_55_
                                                                                                                                                                               then
                                                                                                                                                                                 (encdec_rounding_mode_backwards
                                                                                                                                                                                    _mappingpatterns_55_) >>= fun rm =>
                                                                                                                                                                                 (is_RV64D
                                                                                                                                                                                    tt)
                                                                                                                                                                                  : M (bool)
                                                                                                                                                                               else
                                                                                                                                                                                 returnm false)
                                                                                                                                                                               : M (bool))
                                                                                                                                                                              (returnm ((andb
                                                                                                                                                                                           (eq_vec
                                                                                                                                                                                              (subrange_vec_dec
                                                                                                                                                                                                 v__469
                                                                                                                                                                                                 31
                                                                                                                                                                                                 20)
                                                                                                                                                                                              (Ox"C22"
                                                                                                                                                                                               : mword (31 - 20 + 1)))
                                                                                                                                                                                           (eq_vec
                                                                                                                                                                                              (subrange_vec_dec
                                                                                                                                                                                                 v__469
                                                                                                                                                                                                 6
                                                                                                                                                                                                 0)
                                                                                                                                                                                              ('b"1010011"
                                                                                                                                                                                               : mword (6 - 0 + 1))))
                                                                                                                                                                                : bool))) >>= fun w__152 : bool =>
                                                                                                                                                                           (if
                                                                                                                                                                              sumbool_of_bool
                                                                                                                                                                              w__152
                                                                                                                                                                            then
                                                                                                                                                                              let _mappingpatterns_55_ : mword 3 :=
                                                                                                                                                                                subrange_vec_dec
                                                                                                                                                                                  v__469
                                                                                                                                                                                  14
                                                                                                                                                                                  12 in
                                                                                                                                                                              (encdec_rounding_mode_backwards
                                                                                                                                                                                 _mappingpatterns_55_) >>= fun rm =>
                                                                                                                                                                              returnm true
                                                                                                                                                                            else
                                                                                                                                                                              (and_boolM
                                                                                                                                                                                 (let _mappingpatterns_56_ : mword 3 :=
                                                                                                                                                                                   subrange_vec_dec
                                                                                                                                                                                     v__469
                                                                                                                                                                                     14
                                                                                                                                                                                     12 in
                                                                                                                                                                                 (if
                                                                                                                                                                                    encdec_rounding_mode_backwards_matches
                                                                                                                                                                                      _mappingpatterns_56_
                                                                                                                                                                                  then
                                                                                                                                                                                    (encdec_rounding_mode_backwards
                                                                                                                                                                                       _mappingpatterns_56_) >>= fun rm =>
                                                                                                                                                                                    (is_RV64D
                                                                                                                                                                                       tt)
                                                                                                                                                                                     : M (bool)
                                                                                                                                                                                  else
                                                                                                                                                                                    returnm false)
                                                                                                                                                                                  : M (bool))
                                                                                                                                                                                 (returnm ((andb
                                                                                                                                                                                              (eq_vec
                                                                                                                                                                                                 (subrange_vec_dec
                                                                                                                                                                                                    v__469
                                                                                                                                                                                                    31
                                                                                                                                                                                                    20)
                                                                                                                                                                                                 (Ox"C23"
                                                                                                                                                                                                  : mword (31 - 20 + 1)))
                                                                                                                                                                                              (eq_vec
                                                                                                                                                                                                 (subrange_vec_dec
                                                                                                                                                                                                    v__469
                                                                                                                                                                                                    6
                                                                                                                                                                                                    0)
                                                                                                                                                                                                 ('b"1010011"
                                                                                                                                                                                                  : mword (6 - 0 + 1))))
                                                                                                                                                                                   : bool))) >>= fun w__155 : bool =>
                                                                                                                                                                              (if
                                                                                                                                                                                 sumbool_of_bool
                                                                                                                                                                                 w__155
                                                                                                                                                                               then
                                                                                                                                                                                 let _mappingpatterns_56_ : mword 3 :=
                                                                                                                                                                                   subrange_vec_dec
                                                                                                                                                                                     v__469
                                                                                                                                                                                     14
                                                                                                                                                                                     12 in
                                                                                                                                                                                 (encdec_rounding_mode_backwards
                                                                                                                                                                                    _mappingpatterns_56_) >>= fun rm =>
                                                                                                                                                                                 returnm true
                                                                                                                                                                               else
                                                                                                                                                                                 (and_boolM
                                                                                                                                                                                    (let _mappingpatterns_57_ : mword 3 :=
                                                                                                                                                                                      subrange_vec_dec
                                                                                                                                                                                        v__469
                                                                                                                                                                                        14
                                                                                                                                                                                        12 in
                                                                                                                                                                                    (if
                                                                                                                                                                                       encdec_rounding_mode_backwards_matches
                                                                                                                                                                                         _mappingpatterns_57_
                                                                                                                                                                                     then
                                                                                                                                                                                       (encdec_rounding_mode_backwards
                                                                                                                                                                                          _mappingpatterns_57_) >>= fun rm =>
                                                                                                                                                                                       (is_RV64D
                                                                                                                                                                                          tt)
                                                                                                                                                                                        : M (bool)
                                                                                                                                                                                     else
                                                                                                                                                                                       returnm false)
                                                                                                                                                                                     : M (bool))
                                                                                                                                                                                    (returnm ((andb
                                                                                                                                                                                                 (eq_vec
                                                                                                                                                                                                    (subrange_vec_dec
                                                                                                                                                                                                       v__469
                                                                                                                                                                                                       31
                                                                                                                                                                                                       20)
                                                                                                                                                                                                    (Ox"D22"
                                                                                                                                                                                                     : mword (31 - 20 + 1)))
                                                                                                                                                                                                 (eq_vec
                                                                                                                                                                                                    (subrange_vec_dec
                                                                                                                                                                                                       v__469
                                                                                                                                                                                                       6
                                                                                                                                                                                                       0)
                                                                                                                                                                                                    ('b"1010011"
                                                                                                                                                                                                     : mword (6 - 0 + 1))))
                                                                                                                                                                                      : bool))) >>= fun w__158 : bool =>
                                                                                                                                                                                 (if
                                                                                                                                                                                    sumbool_of_bool
                                                                                                                                                                                    w__158
                                                                                                                                                                                  then
                                                                                                                                                                                    let _mappingpatterns_57_ : mword 3 :=
                                                                                                                                                                                      subrange_vec_dec
                                                                                                                                                                                        v__469
                                                                                                                                                                                        14
                                                                                                                                                                                        12 in
                                                                                                                                                                                    (encdec_rounding_mode_backwards
                                                                                                                                                                                       _mappingpatterns_57_) >>= fun rm =>
                                                                                                                                                                                    returnm true
                                                                                                                                                                                  else
                                                                                                                                                                                    (and_boolM
                                                                                                                                                                                       (let _mappingpatterns_58_ : mword 3 :=
                                                                                                                                                                                         subrange_vec_dec
                                                                                                                                                                                           v__469
                                                                                                                                                                                           14
                                                                                                                                                                                           12 in
                                                                                                                                                                                       (if
                                                                                                                                                                                          encdec_rounding_mode_backwards_matches
                                                                                                                                                                                            _mappingpatterns_58_
                                                                                                                                                                                        then
                                                                                                                                                                                          (encdec_rounding_mode_backwards
                                                                                                                                                                                             _mappingpatterns_58_) >>= fun rm =>
                                                                                                                                                                                          (is_RV64D
                                                                                                                                                                                             tt)
                                                                                                                                                                                           : M (bool)
                                                                                                                                                                                        else
                                                                                                                                                                                          returnm false)
                                                                                                                                                                                        : M (bool))
                                                                                                                                                                                       (returnm ((andb
                                                                                                                                                                                                    (eq_vec
                                                                                                                                                                                                       (subrange_vec_dec
                                                                                                                                                                                                          v__469
                                                                                                                                                                                                          31
                                                                                                                                                                                                          20)
                                                                                                                                                                                                       (Ox"D23"
                                                                                                                                                                                                        : mword (31 - 20 + 1)))
                                                                                                                                                                                                    (eq_vec
                                                                                                                                                                                                       (subrange_vec_dec
                                                                                                                                                                                                          v__469
                                                                                                                                                                                                          6
                                                                                                                                                                                                          0)
                                                                                                                                                                                                       ('b"1010011"
                                                                                                                                                                                                        : mword (6 - 0 + 1))))
                                                                                                                                                                                         : bool))) >>= fun w__161 : bool =>
                                                                                                                                                                                    (if
                                                                                                                                                                                       sumbool_of_bool
                                                                                                                                                                                       w__161
                                                                                                                                                                                     then
                                                                                                                                                                                       let _mappingpatterns_58_ : mword 3 :=
                                                                                                                                                                                         subrange_vec_dec
                                                                                                                                                                                           v__469
                                                                                                                                                                                           14
                                                                                                                                                                                           12 in
                                                                                                                                                                                       (encdec_rounding_mode_backwards
                                                                                                                                                                                          _mappingpatterns_58_) >>= fun rm =>
                                                                                                                                                                                       returnm true
                                                                                                                                                                                     else
                                                                                                                                                                                       (and_boolM
                                                                                                                                                                                          ((is_RV32D_or_RV64D
                                                                                                                                                                                              tt)
                                                                                                                                                                                           : M (bool))
                                                                                                                                                                                          (returnm ((andb
                                                                                                                                                                                                       (eq_vec
                                                                                                                                                                                                          (subrange_vec_dec
                                                                                                                                                                                                             v__469
                                                                                                                                                                                                             31
                                                                                                                                                                                                             25)
                                                                                                                                                                                                          ('b"0010001"
                                                                                                                                                                                                           : mword (31 - 25 + 1)))
                                                                                                                                                                                                       (andb
                                                                                                                                                                                                          (eq_vec
                                                                                                                                                                                                             (subrange_vec_dec
                                                                                                                                                                                                                v__469
                                                                                                                                                                                                                14
                                                                                                                                                                                                                12)
                                                                                                                                                                                                             ('b"000"
                                                                                                                                                                                                              : mword (14 - 12 + 1)))
                                                                                                                                                                                                          (eq_vec
                                                                                                                                                                                                             (subrange_vec_dec
                                                                                                                                                                                                                v__469
                                                                                                                                                                                                                6
                                                                                                                                                                                                                0)
                                                                                                                                                                                                             ('b"1010011"
                                                                                                                                                                                                              : mword (6 - 0 + 1)))))
                                                                                                                                                                                            : bool))) >>= fun w__163 : bool =>
                                                                                                                                                                                       (if
                                                                                                                                                                                          sumbool_of_bool
                                                                                                                                                                                          w__163
                                                                                                                                                                                        then
                                                                                                                                                                                          returnm true
                                                                                                                                                                                        else
                                                                                                                                                                                          (and_boolM
                                                                                                                                                                                             ((is_RV32D_or_RV64D
                                                                                                                                                                                                 tt)
                                                                                                                                                                                              : M (bool))
                                                                                                                                                                                             (returnm ((andb
                                                                                                                                                                                                          (eq_vec
                                                                                                                                                                                                             (subrange_vec_dec
                                                                                                                                                                                                                v__469
                                                                                                                                                                                                                31
                                                                                                                                                                                                                25)
                                                                                                                                                                                                             ('b"0010001"
                                                                                                                                                                                                              : mword (31 - 25 + 1)))
                                                                                                                                                                                                          (andb
                                                                                                                                                                                                             (eq_vec
                                                                                                                                                                                                                (subrange_vec_dec
                                                                                                                                                                                                                   v__469
                                                                                                                                                                                                                   14
                                                                                                                                                                                                                   12)
                                                                                                                                                                                                                ('b"001"
                                                                                                                                                                                                                 : mword (14 - 12 + 1)))
                                                                                                                                                                                                             (eq_vec
                                                                                                                                                                                                                (subrange_vec_dec
                                                                                                                                                                                                                   v__469
                                                                                                                                                                                                                   6
                                                                                                                                                                                                                   0)
                                                                                                                                                                                                                ('b"1010011"
                                                                                                                                                                                                                 : mword (6 - 0 + 1)))))
                                                                                                                                                                                               : bool))) >>= fun w__165 : bool =>
                                                                                                                                                                                          (if
                                                                                                                                                                                             sumbool_of_bool
                                                                                                                                                                                             w__165
                                                                                                                                                                                           then
                                                                                                                                                                                             returnm true
                                                                                                                                                                                           else
                                                                                                                                                                                             (and_boolM
                                                                                                                                                                                                ((is_RV32D_or_RV64D
                                                                                                                                                                                                    tt)
                                                                                                                                                                                                 : M (bool))
                                                                                                                                                                                                (returnm ((andb
                                                                                                                                                                                                             (eq_vec
                                                                                                                                                                                                                (subrange_vec_dec
                                                                                                                                                                                                                   v__469
                                                                                                                                                                                                                   31
                                                                                                                                                                                                                   25)
                                                                                                                                                                                                                ('b"0010001"
                                                                                                                                                                                                                 : mword (31 - 25 + 1)))
                                                                                                                                                                                                             (andb
                                                                                                                                                                                                                (eq_vec
                                                                                                                                                                                                                   (subrange_vec_dec
                                                                                                                                                                                                                      v__469
                                                                                                                                                                                                                      14
                                                                                                                                                                                                                      12)
                                                                                                                                                                                                                   ('b"010"
                                                                                                                                                                                                                    : mword (14 - 12 + 1)))
                                                                                                                                                                                                                (eq_vec
                                                                                                                                                                                                                   (subrange_vec_dec
                                                                                                                                                                                                                      v__469
                                                                                                                                                                                                                      6
                                                                                                                                                                                                                      0)
                                                                                                                                                                                                                   ('b"1010011"
                                                                                                                                                                                                                    : mword (6 - 0 + 1)))))
                                                                                                                                                                                                  : bool))) >>= fun w__167 : bool =>
                                                                                                                                                                                             (if
                                                                                                                                                                                                sumbool_of_bool
                                                                                                                                                                                                w__167
                                                                                                                                                                                              then
                                                                                                                                                                                                returnm true
                                                                                                                                                                                              else
                                                                                                                                                                                                (and_boolM
                                                                                                                                                                                                   ((is_RV32D_or_RV64D
                                                                                                                                                                                                       tt)
                                                                                                                                                                                                    : M (bool))
                                                                                                                                                                                                   (returnm ((andb
                                                                                                                                                                                                                (eq_vec
                                                                                                                                                                                                                   (subrange_vec_dec
                                                                                                                                                                                                                      v__469
                                                                                                                                                                                                                      31
                                                                                                                                                                                                                      25)
                                                                                                                                                                                                                   ('b"0010101"
                                                                                                                                                                                                                    : mword (31 - 25 + 1)))
                                                                                                                                                                                                                (andb
                                                                                                                                                                                                                   (eq_vec
                                                                                                                                                                                                                      (subrange_vec_dec
                                                                                                                                                                                                                         v__469
                                                                                                                                                                                                                         14
                                                                                                                                                                                                                         12)
                                                                                                                                                                                                                      ('b"000"
                                                                                                                                                                                                                       : mword (14 - 12 + 1)))
                                                                                                                                                                                                                   (eq_vec
                                                                                                                                                                                                                      (subrange_vec_dec
                                                                                                                                                                                                                         v__469
                                                                                                                                                                                                                         6
                                                                                                                                                                                                                         0)
                                                                                                                                                                                                                      ('b"1010011"
                                                                                                                                                                                                                       : mword (6 - 0 + 1)))))
                                                                                                                                                                                                     : bool))) >>= fun w__169 : bool =>
                                                                                                                                                                                                (if
                                                                                                                                                                                                   sumbool_of_bool
                                                                                                                                                                                                   w__169
                                                                                                                                                                                                 then
                                                                                                                                                                                                   returnm true
                                                                                                                                                                                                 else
                                                                                                                                                                                                   (and_boolM
                                                                                                                                                                                                      ((is_RV32D_or_RV64D
                                                                                                                                                                                                          tt)
                                                                                                                                                                                                       : M (bool))
                                                                                                                                                                                                      (returnm ((andb
                                                                                                                                                                                                                   (eq_vec
                                                                                                                                                                                                                      (subrange_vec_dec
                                                                                                                                                                                                                         v__469
                                                                                                                                                                                                                         31
                                                                                                                                                                                                                         25)
                                                                                                                                                                                                                      ('b"0010101"
                                                                                                                                                                                                                       : mword (31 - 25 + 1)))
                                                                                                                                                                                                                   (andb
                                                                                                                                                                                                                      (eq_vec
                                                                                                                                                                                                                         (subrange_vec_dec
                                                                                                                                                                                                                            v__469
                                                                                                                                                                                                                            14
                                                                                                                                                                                                                            12)
                                                                                                                                                                                                                         ('b"001"
                                                                                                                                                                                                                          : mword (14 - 12 + 1)))
                                                                                                                                                                                                                      (eq_vec
                                                                                                                                                                                                                         (subrange_vec_dec
                                                                                                                                                                                                                            v__469
                                                                                                                                                                                                                            6
                                                                                                                                                                                                                            0)
                                                                                                                                                                                                                         ('b"1010011"
                                                                                                                                                                                                                          : mword (6 - 0 + 1)))))
                                                                                                                                                                                                        : bool))) >>= fun w__171 : bool =>
                                                                                                                                                                                                   (if
                                                                                                                                                                                                      sumbool_of_bool
                                                                                                                                                                                                      w__171
                                                                                                                                                                                                    then
                                                                                                                                                                                                      returnm true
                                                                                                                                                                                                    else
                                                                                                                                                                                                      (and_boolM
                                                                                                                                                                                                         ((is_RV32D_or_RV64D
                                                                                                                                                                                                             tt)
                                                                                                                                                                                                          : M (bool))
                                                                                                                                                                                                         (returnm ((andb
                                                                                                                                                                                                                      (eq_vec
                                                                                                                                                                                                                         (subrange_vec_dec
                                                                                                                                                                                                                            v__469
                                                                                                                                                                                                                            31
                                                                                                                                                                                                                            25)
                                                                                                                                                                                                                         ('b"1010001"
                                                                                                                                                                                                                          : mword (31 - 25 + 1)))
                                                                                                                                                                                                                      (andb
                                                                                                                                                                                                                         (eq_vec
                                                                                                                                                                                                                            (subrange_vec_dec
                                                                                                                                                                                                                               v__469
                                                                                                                                                                                                                               14
                                                                                                                                                                                                                               12)
                                                                                                                                                                                                                            ('b"010"
                                                                                                                                                                                                                             : mword (14 - 12 + 1)))
                                                                                                                                                                                                                         (eq_vec
                                                                                                                                                                                                                            (subrange_vec_dec
                                                                                                                                                                                                                               v__469
                                                                                                                                                                                                                               6
                                                                                                                                                                                                                               0)
                                                                                                                                                                                                                            ('b"1010011"
                                                                                                                                                                                                                             : mword (6 - 0 + 1)))))
                                                                                                                                                                                                           : bool))) >>= fun w__173 : bool =>
                                                                                                                                                                                                      (if
                                                                                                                                                                                                         sumbool_of_bool
                                                                                                                                                                                                         w__173
                                                                                                                                                                                                       then
                                                                                                                                                                                                         returnm true
                                                                                                                                                                                                       else
                                                                                                                                                                                                         (and_boolM
                                                                                                                                                                                                            ((is_RV32D_or_RV64D
                                                                                                                                                                                                                tt)
                                                                                                                                                                                                             : M (bool))
                                                                                                                                                                                                            (returnm ((andb
                                                                                                                                                                                                                         (eq_vec
                                                                                                                                                                                                                            (subrange_vec_dec
                                                                                                                                                                                                                               v__469
                                                                                                                                                                                                                               31
                                                                                                                                                                                                                               25)
                                                                                                                                                                                                                            ('b"1010001"
                                                                                                                                                                                                                             : mword (31 - 25 + 1)))
                                                                                                                                                                                                                         (andb
                                                                                                                                                                                                                            (eq_vec
                                                                                                                                                                                                                               (subrange_vec_dec
                                                                                                                                                                                                                                  v__469
                                                                                                                                                                                                                                  14
                                                                                                                                                                                                                                  12)
                                                                                                                                                                                                                               ('b"001"
                                                                                                                                                                                                                                : mword (14 - 12 + 1)))
                                                                                                                                                                                                                            (eq_vec
                                                                                                                                                                                                                               (subrange_vec_dec
                                                                                                                                                                                                                                  v__469
                                                                                                                                                                                                                                  6
                                                                                                                                                                                                                                  0)
                                                                                                                                                                                                                               ('b"1010011"
                                                                                                                                                                                                                                : mword (6 - 0 + 1)))))
                                                                                                                                                                                                              : bool))) >>= fun w__175 : bool =>
                                                                                                                                                                                                         (if
                                                                                                                                                                                                            sumbool_of_bool
                                                                                                                                                                                                            w__175
                                                                                                                                                                                                          then
                                                                                                                                                                                                            returnm true
                                                                                                                                                                                                          else
                                                                                                                                                                                                            (and_boolM
                                                                                                                                                                                                               ((is_RV32D_or_RV64D
                                                                                                                                                                                                                   tt)
                                                                                                                                                                                                                : M (bool))
                                                                                                                                                                                                               (returnm ((andb
                                                                                                                                                                                                                            (eq_vec
                                                                                                                                                                                                                               (subrange_vec_dec
                                                                                                                                                                                                                                  v__469
                                                                                                                                                                                                                                  31
                                                                                                                                                                                                                                  25)
                                                                                                                                                                                                                               ('b"1010001"
                                                                                                                                                                                                                                : mword (31 - 25 + 1)))
                                                                                                                                                                                                                            (andb
                                                                                                                                                                                                                               (eq_vec
                                                                                                                                                                                                                                  (subrange_vec_dec
                                                                                                                                                                                                                                     v__469
                                                                                                                                                                                                                                     14
                                                                                                                                                                                                                                     12)
                                                                                                                                                                                                                                  ('b"000"
                                                                                                                                                                                                                                   : mword (14 - 12 + 1)))
                                                                                                                                                                                                                               (eq_vec
                                                                                                                                                                                                                                  (subrange_vec_dec
                                                                                                                                                                                                                                     v__469
                                                                                                                                                                                                                                     6
                                                                                                                                                                                                                                     0)
                                                                                                                                                                                                                                  ('b"1010011"
                                                                                                                                                                                                                                   : mword (6 - 0 + 1)))))
                                                                                                                                                                                                                 : bool))) >>= fun w__177 : bool =>
                                                                                                                                                                                                            (if
                                                                                                                                                                                                               sumbool_of_bool
                                                                                                                                                                                                               w__177
                                                                                                                                                                                                             then
                                                                                                                                                                                                               returnm true
                                                                                                                                                                                                             else
                                                                                                                                                                                                               (and_boolM
                                                                                                                                                                                                                  ((haveDExt
                                                                                                                                                                                                                      tt)
                                                                                                                                                                                                                   : M (bool))
                                                                                                                                                                                                                  (returnm ((andb
                                                                                                                                                                                                                               (eq_vec
                                                                                                                                                                                                                                  (subrange_vec_dec
                                                                                                                                                                                                                                     v__469
                                                                                                                                                                                                                                     31
                                                                                                                                                                                                                                     20)
                                                                                                                                                                                                                                  (Ox"E20"
                                                                                                                                                                                                                                   : mword (31 - 20 + 1)))
                                                                                                                                                                                                                               (andb
                                                                                                                                                                                                                                  (eq_vec
                                                                                                                                                                                                                                     (subrange_vec_dec
                                                                                                                                                                                                                                        v__469
                                                                                                                                                                                                                                        14
                                                                                                                                                                                                                                        12)
                                                                                                                                                                                                                                     ('b"001"
                                                                                                                                                                                                                                      : mword (14 - 12 + 1)))
                                                                                                                                                                                                                                  (eq_vec
                                                                                                                                                                                                                                     (subrange_vec_dec
                                                                                                                                                                                                                                        v__469
                                                                                                                                                                                                                                        6
                                                                                                                                                                                                                                        0)
                                                                                                                                                                                                                                     ('b"1010011"
                                                                                                                                                                                                                                      : mword (6 - 0 + 1)))))
                                                                                                                                                                                                                    : bool))) >>= fun w__179 : bool =>
                                                                                                                                                                                                               (if
                                                                                                                                                                                                                  sumbool_of_bool
                                                                                                                                                                                                                  w__179
                                                                                                                                                                                                                then
                                                                                                                                                                                                                  returnm true
                                                                                                                                                                                                                else
                                                                                                                                                                                                                  (and_boolM
                                                                                                                                                                                                                     ((is_RV64D
                                                                                                                                                                                                                         tt)
                                                                                                                                                                                                                      : M (bool))
                                                                                                                                                                                                                     (returnm ((andb
                                                                                                                                                                                                                                  (eq_vec
                                                                                                                                                                                                                                     (subrange_vec_dec
                                                                                                                                                                                                                                        v__469
                                                                                                                                                                                                                                        31
                                                                                                                                                                                                                                        20)
                                                                                                                                                                                                                                     (Ox"E20"
                                                                                                                                                                                                                                      : mword (31 - 20 + 1)))
                                                                                                                                                                                                                                  (andb
                                                                                                                                                                                                                                     (eq_vec
                                                                                                                                                                                                                                        (subrange_vec_dec
                                                                                                                                                                                                                                           v__469
                                                                                                                                                                                                                                           14
                                                                                                                                                                                                                                           12)
                                                                                                                                                                                                                                        ('b"000"
                                                                                                                                                                                                                                         : mword (14 - 12 + 1)))
                                                                                                                                                                                                                                     (eq_vec
                                                                                                                                                                                                                                        (subrange_vec_dec
                                                                                                                                                                                                                                           v__469
                                                                                                                                                                                                                                           6
                                                                                                                                                                                                                                           0)
                                                                                                                                                                                                                                        ('b"1010011"
                                                                                                                                                                                                                                         : mword (6 - 0 + 1)))))
                                                                                                                                                                                                                       : bool))) >>= fun w__181 : bool =>
                                                                                                                                                                                                                  (if
                                                                                                                                                                                                                     sumbool_of_bool
                                                                                                                                                                                                                     w__181
                                                                                                                                                                                                                   then
                                                                                                                                                                                                                     returnm true
                                                                                                                                                                                                                   else
                                                                                                                                                                                                                     (and_boolM
                                                                                                                                                                                                                        ((is_RV64D
                                                                                                                                                                                                                            tt)
                                                                                                                                                                                                                         : M (bool))
                                                                                                                                                                                                                        (returnm ((andb
                                                                                                                                                                                                                                     (eq_vec
                                                                                                                                                                                                                                        (subrange_vec_dec
                                                                                                                                                                                                                                           v__469
                                                                                                                                                                                                                                           31
                                                                                                                                                                                                                                           20)
                                                                                                                                                                                                                                        (Ox"F20"
                                                                                                                                                                                                                                         : mword (31 - 20 + 1)))
                                                                                                                                                                                                                                     (andb
                                                                                                                                                                                                                                        (eq_vec
                                                                                                                                                                                                                                           (subrange_vec_dec
                                                                                                                                                                                                                                              v__469
                                                                                                                                                                                                                                              14
                                                                                                                                                                                                                                              12)
                                                                                                                                                                                                                                           ('b"000"
                                                                                                                                                                                                                                            : mword (14 - 12 + 1)))
                                                                                                                                                                                                                                        (eq_vec
                                                                                                                                                                                                                                           (subrange_vec_dec
                                                                                                                                                                                                                                              v__469
                                                                                                                                                                                                                                              6
                                                                                                                                                                                                                                              0)
                                                                                                                                                                                                                                           ('b"1010011"
                                                                                                                                                                                                                                            : mword (6 - 0 + 1)))))
                                                                                                                                                                                                                          : bool))) >>= fun w__183 : bool =>
                                                                                                                                                                                                                     returnm (if
                                                                                                                                                                                                                                sumbool_of_bool
                                                                                                                                                                                                                                w__183
                                                                                                                                                                                                                              then
                                                                                                                                                                                                                                true
                                                                                                                                                                                                                              else
                                                                                                                                                                                                                                true))
                                                                                                                                                                                                                   : M (bool))
                                                                                                                                                                                                                : M (bool))
                                                                                                                                                                                                             : M (bool))
                                                                                                                                                                                                          : M (bool))
                                                                                                                                                                                                       : M (bool))
                                                                                                                                                                                                    : M (bool))
                                                                                                                                                                                                 : M (bool))
                                                                                                                                                                                              : M (bool))
                                                                                                                                                                                           : M (bool))
                                                                                                                                                                                        : M (bool))
                                                                                                                                                                                     : M (bool))
                                                                                                                                                                                  : M (bool))
                                                                                                                                                                               : M (bool))
                                                                                                                                                                            : M (bool))
                                                                                                                                                                         : M (bool))
                                                                                                                                                                      : M (bool))
                                                                                                                                                                   : M (bool))
                                                                                                                                                                : M (bool))
                                                                                                                                                             : M (bool))
                                                                                                                                                          : M (bool))
                                                                                                                                                       : M (bool))
                                                                                                                                                    : M (bool))
                                                                                                                                                 : M (bool))
                                                                                                                                              : M (bool))
                                                                                                                                           : M (bool))
                                                                                                                                        : M (bool))
                                                                                                                                     : M (bool))
                                                                                                                                  : M (bool))
                                                                                                                               : M (bool))
                                                                                                                            : M (bool))
                                                                                                                         : M (bool))
                                                                                                                      : M (bool))
                                                                                                                   : M (bool))
                                                                                                                : M (bool))
                                                                                                             : M (bool))
                                                                                                          : M (bool))
                                                                                                       : M (bool))
                                                                                                    : M (bool))
                                                                                                 : M (bool))
                                                                                              : M (bool))
                                                                                           : M (bool))
                                                                                        : M (bool))
                                                                                     : M (bool))
                                                                                  : M (bool))
                                                                               : M (bool))
                                                                            : M (bool))
                                                                         : M (bool))
                                                                      : M (bool))
                                                                   : M (bool))
                                                                : M (bool))
                                                             : M (bool))
                                                          : M (bool))
                                                       : M (bool))
                                                    : M (bool))
                                                 : M (bool))
                                              : M (bool))
                                           : M (bool))
                                        : M (bool))
                                     : M (bool))
                                  : M (bool))
                               : M (bool))
                            : M (bool))
                         : M (bool))
                      : M (bool))
                   : M (bool))
                : M (bool))
             : M (bool))
          : M (bool))
       : M (bool))
    : M (bool).

Definition encdec_compressed_forwards (arg_ : ast) : M (mword 16) :=
   (match arg_ with
    | C_NOP tt =>
       returnm (concat_vec ('b"000"  : mword 3)
                  (concat_vec ('b"0"  : mword 1)
                     (concat_vec ('b"00000"  : mword 5)
                        (concat_vec ('b"00000"  : mword 5) ('b"01"  : mword 2)))))
    | C_ADDI4SPN (rd, v__922) =>
       (if let nz96 : bits 4 := subrange_vec_dec v__922 7 4 in
          let nz96 : bits 4 := subrange_vec_dec v__922 7 4 in
          let nz54 : bits 2 := subrange_vec_dec v__922 3 2 in
          let nz3 : bits 1 := subrange_vec_dec v__922 1 1 in
          let nz2 : bits 1 := subrange_vec_dec v__922 0 0 in
          neq_vec (concat_vec nz96 (concat_vec nz54 (concat_vec nz3 nz2)))
            (Ox"00"
             : mword (4 + (2 + (1 + 1)))) then
          let nz96 : bits 4 := subrange_vec_dec v__922 7 4 in
          let nz96 : bits 4 := subrange_vec_dec v__922 7 4 in
          let nz54 : bits 2 := subrange_vec_dec v__922 3 2 in
          let nz3 : bits 1 := subrange_vec_dec v__922 1 1 in
          let nz2 : bits 1 := subrange_vec_dec v__922 0 0 in
          returnm (concat_vec ('b"000"  : mword 3)
                     (concat_vec (nz54  : bits 2)
                        (concat_vec (nz96  : bits 4)
                           (concat_vec (nz2  : bits 1)
                              (concat_vec (nz3  : bits 1)
                                 (concat_vec (rd  : cregidx) ('b"00"  : mword 2)))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_LW (v__923, rs1, rd) =>
       let ui6 : bits 1 := subrange_vec_dec v__923 4 4 in
       let ui6 : bits 1 := subrange_vec_dec v__923 4 4 in
       let ui53 : bits 3 := subrange_vec_dec v__923 3 1 in
       let ui2 : bits 1 := subrange_vec_dec v__923 0 0 in
       returnm (concat_vec ('b"010"  : mword 3)
                  (concat_vec (ui53  : bits 3)
                     (concat_vec (rs1  : cregidx)
                        (concat_vec (ui2  : bits 1)
                           (concat_vec (ui6  : bits 1)
                              (concat_vec (rd  : cregidx) ('b"00"  : mword 2)))))))
    | C_LD (v__924, rs1, rd) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          let ui76 : bits 2 := subrange_vec_dec v__924 4 3 in
          let ui76 : bits 2 := subrange_vec_dec v__924 4 3 in
          let ui53 : bits 3 := subrange_vec_dec v__924 2 0 in
          returnm (concat_vec ('b"011"  : mword 3)
                     (concat_vec (ui53  : bits 3)
                        (concat_vec (rs1  : cregidx)
                           (concat_vec (ui76  : bits 2)
                              (concat_vec (rd  : cregidx) ('b"00"  : mword 2))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_SW (v__925, rs1, rs2) =>
       let ui6 : bits 1 := subrange_vec_dec v__925 4 4 in
       let ui6 : bits 1 := subrange_vec_dec v__925 4 4 in
       let ui53 : bits 3 := subrange_vec_dec v__925 3 1 in
       let ui2 : bits 1 := subrange_vec_dec v__925 0 0 in
       returnm (concat_vec ('b"110"  : mword 3)
                  (concat_vec (ui53  : bits 3)
                     (concat_vec (rs1  : cregidx)
                        (concat_vec (ui2  : bits 1)
                           (concat_vec (ui6  : bits 1)
                              (concat_vec (rs2  : cregidx) ('b"00"  : mword 2)))))))
    | C_SD (v__926, rs1, rs2) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          let ui76 : bits 2 := subrange_vec_dec v__926 4 3 in
          let ui76 : bits 2 := subrange_vec_dec v__926 4 3 in
          let ui53 : bits 3 := subrange_vec_dec v__926 2 0 in
          returnm (concat_vec ('b"111"  : mword 3)
                     (concat_vec (ui53  : bits 3)
                        (concat_vec (rs1  : bits 3)
                           (concat_vec (ui76  : bits 2)
                              (concat_vec (rs2  : bits 3) ('b"00"  : mword 2))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_ADDI (v__927, rsd) =>
       (if let nzi5 : bits 1 := subrange_vec_dec v__927 5 5 in
          let nzi5 : bits 1 := subrange_vec_dec v__927 5 5 in
          let nzi40 : bits 5 := subrange_vec_dec v__927 4 0 in
          andb (neq_vec (concat_vec nzi5 nzi40) ('b"000000"  : mword (1 + 5))) (neq_vec rsd zreg)
        then
          let nzi5 : bits 1 := subrange_vec_dec v__927 5 5 in
          let nzi5 : bits 1 := subrange_vec_dec v__927 5 5 in
          let nzi40 : bits 5 := subrange_vec_dec v__927 4 0 in
          returnm (concat_vec ('b"000"  : mword 3)
                     (concat_vec (nzi5  : bits 1)
                        (concat_vec (rsd  : regidx)
                           (concat_vec (nzi40  : bits 5) ('b"01"  : mword 2)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_JAL v__928 =>
       (if sumbool_of_bool (Z.eqb 64 32) then
          let i11 : bits 1 := subrange_vec_dec v__928 10 10 in
          let i98 : bits 2 := subrange_vec_dec v__928 8 7 in
          let i7 : bits 1 := subrange_vec_dec v__928 6 6 in
          let i6 : bits 1 := subrange_vec_dec v__928 5 5 in
          let i5 : bits 1 := subrange_vec_dec v__928 4 4 in
          let i4 : bits 1 := subrange_vec_dec v__928 3 3 in
          let i31 : bits 3 := subrange_vec_dec v__928 2 0 in
          let i11 : bits 1 := subrange_vec_dec v__928 10 10 in
          let i10 : bits 1 := subrange_vec_dec v__928 9 9 in
          returnm (concat_vec ('b"001"  : mword 3)
                     (concat_vec (i11  : bits 1)
                        (concat_vec (i4  : bits 1)
                           (concat_vec (i98  : bits 2)
                              (concat_vec (i10  : bits 1)
                                 (concat_vec (i6  : bits 1)
                                    (concat_vec (i7  : bits 1)
                                       (concat_vec (i31  : bits 3)
                                          (concat_vec (i5  : bits 1) ('b"01"  : mword 2))))))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_ADDIW (v__929, rsd) =>
       (if sumbool_of_bool (andb (neq_vec rsd zreg) (Z.eqb 64 64)) then
          let imm5 : bits 1 := subrange_vec_dec v__929 5 5 in
          let imm5 : bits 1 := subrange_vec_dec v__929 5 5 in
          let imm40 : bits 5 := subrange_vec_dec v__929 4 0 in
          returnm (concat_vec ('b"001"  : mword 3)
                     (concat_vec (imm5  : bits 1)
                        (concat_vec (rsd  : regidx)
                           (concat_vec (imm40  : bits 5) ('b"01"  : mword 2)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_LI (v__930, rd) =>
       (if neq_vec rd zreg then
          let imm5 : bits 1 := subrange_vec_dec v__930 5 5 in
          let imm5 : bits 1 := subrange_vec_dec v__930 5 5 in
          let imm40 : bits 5 := subrange_vec_dec v__930 4 0 in
          returnm (concat_vec ('b"010"  : mword 3)
                     (concat_vec (imm5  : bits 1)
                        (concat_vec (rd  : regidx)
                           (concat_vec (imm40  : bits 5) ('b"01"  : mword 2)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_ADDI16SP v__931 =>
       (if let nzi9 : bits 1 := subrange_vec_dec v__931 5 5 in
          let nzi9 : bits 1 := subrange_vec_dec v__931 5 5 in
          let nzi87 : bits 2 := subrange_vec_dec v__931 4 3 in
          let nzi6 : bits 1 := subrange_vec_dec v__931 2 2 in
          let nzi5 : bits 1 := subrange_vec_dec v__931 1 1 in
          let nzi4 : bits 1 := subrange_vec_dec v__931 0 0 in
          neq_vec (concat_vec nzi9 (concat_vec nzi87 (concat_vec nzi6 (concat_vec nzi5 nzi4))))
            ('b"000000"
             : mword (1 + (2 + (1 + (1 + 1))))) then
          let nzi9 : bits 1 := subrange_vec_dec v__931 5 5 in
          let nzi9 : bits 1 := subrange_vec_dec v__931 5 5 in
          let nzi87 : bits 2 := subrange_vec_dec v__931 4 3 in
          let nzi6 : bits 1 := subrange_vec_dec v__931 2 2 in
          let nzi5 : bits 1 := subrange_vec_dec v__931 1 1 in
          let nzi4 : bits 1 := subrange_vec_dec v__931 0 0 in
          returnm (concat_vec ('b"011"  : mword 3)
                     (concat_vec (nzi9  : bits 1)
                        (concat_vec ('b"00010"  : mword 5)
                           (concat_vec (nzi4  : bits 1)
                              (concat_vec (nzi6  : bits 1)
                                 (concat_vec (nzi87  : bits 2)
                                    (concat_vec (nzi5  : bits 1) ('b"01"  : mword 2))))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_LUI (v__932, rd) =>
       (if let imm17 : bits 1 := subrange_vec_dec v__932 5 5 in
          let imm17 : bits 1 := subrange_vec_dec v__932 5 5 in
          let imm1612 : bits 5 := subrange_vec_dec v__932 4 0 in
          andb (neq_vec rd zreg)
            (andb (neq_vec rd sp) (neq_vec (concat_vec imm17 imm1612) ('b"000000"  : mword (1 + 5))))
        then
          let imm17 : bits 1 := subrange_vec_dec v__932 5 5 in
          let imm17 : bits 1 := subrange_vec_dec v__932 5 5 in
          let imm1612 : bits 5 := subrange_vec_dec v__932 4 0 in
          returnm (concat_vec ('b"011"  : mword 3)
                     (concat_vec (imm17  : bits 1)
                        (concat_vec (rd  : regidx)
                           (concat_vec (imm1612  : bits 5) ('b"01"  : mword 2)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_SRLI (v__933, rsd) =>
       (if let nzui5 : bits 1 := subrange_vec_dec v__933 5 5 in
          let nzui5 : bits 1 := subrange_vec_dec v__933 5 5 in
          let nzui40 : bits 5 := subrange_vec_dec v__933 4 0 in
          neq_vec (concat_vec nzui5 nzui40) ('b"000000"  : mword (1 + 5)) then
          let nzui5 : bits 1 := subrange_vec_dec v__933 5 5 in
          let nzui5 : bits 1 := subrange_vec_dec v__933 5 5 in
          let nzui40 : bits 5 := subrange_vec_dec v__933 4 0 in
          returnm (concat_vec ('b"100"  : mword 3)
                     (concat_vec (nzui5  : bits 1)
                        (concat_vec ('b"00"  : mword 2)
                           (concat_vec (rsd  : cregidx)
                              (concat_vec (nzui40  : bits 5) ('b"01"  : mword 2))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_SRAI (v__934, rsd) =>
       (if let nzui5 : bits 1 := subrange_vec_dec v__934 5 5 in
          let nzui5 : bits 1 := subrange_vec_dec v__934 5 5 in
          let nzui40 : bits 5 := subrange_vec_dec v__934 4 0 in
          neq_vec (concat_vec nzui5 nzui40) ('b"000000"  : mword (1 + 5)) then
          let nzui5 : bits 1 := subrange_vec_dec v__934 5 5 in
          let nzui5 : bits 1 := subrange_vec_dec v__934 5 5 in
          let nzui40 : bits 5 := subrange_vec_dec v__934 4 0 in
          returnm (concat_vec ('b"100"  : mword 3)
                     (concat_vec (nzui5  : bits 1)
                        (concat_vec ('b"01"  : mword 2)
                           (concat_vec (rsd  : cregidx)
                              (concat_vec (nzui40  : bits 5) ('b"01"  : mword 2))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_ANDI (v__935, rsd) =>
       let i5 : bits 1 := subrange_vec_dec v__935 5 5 in
       let i5 : bits 1 := subrange_vec_dec v__935 5 5 in
       let i40 : bits 5 := subrange_vec_dec v__935 4 0 in
       returnm (concat_vec ('b"100"  : mword 3)
                  (concat_vec (i5  : bits 1)
                     (concat_vec ('b"10"  : mword 2)
                        (concat_vec (rsd  : cregidx)
                           (concat_vec (i40  : bits 5) ('b"01"  : mword 2))))))
    | C_SUB (rsd, rs2) =>
       returnm (concat_vec ('b"100"  : mword 3)
                  (concat_vec ('b"0"  : mword 1)
                     (concat_vec ('b"11"  : mword 2)
                        (concat_vec (rsd  : cregidx)
                           (concat_vec ('b"00"  : mword 2)
                              (concat_vec (rs2  : cregidx) ('b"01"  : mword 2)))))))
    | C_XOR (rsd, rs2) =>
       returnm (concat_vec ('b"100"  : mword 3)
                  (concat_vec ('b"0"  : mword 1)
                     (concat_vec ('b"11"  : mword 2)
                        (concat_vec (rsd  : cregidx)
                           (concat_vec ('b"01"  : mword 2)
                              (concat_vec (rs2  : cregidx) ('b"01"  : mword 2)))))))
    | C_OR (rsd, rs2) =>
       returnm (concat_vec ('b"100"  : mword 3)
                  (concat_vec ('b"0"  : mword 1)
                     (concat_vec ('b"11"  : mword 2)
                        (concat_vec (rsd  : cregidx)
                           (concat_vec ('b"10"  : mword 2)
                              (concat_vec (rs2  : cregidx) ('b"01"  : mword 2)))))))
    | C_AND (rsd, rs2) =>
       returnm (concat_vec ('b"100"  : mword 3)
                  (concat_vec ('b"0"  : mword 1)
                     (concat_vec ('b"11"  : mword 2)
                        (concat_vec (rsd  : cregidx)
                           (concat_vec ('b"11"  : mword 2)
                              (concat_vec (rs2  : cregidx) ('b"01"  : mword 2)))))))
    | C_SUBW (rsd, rs2) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          returnm (concat_vec ('b"100"  : mword 3)
                     (concat_vec ('b"1"  : mword 1)
                        (concat_vec ('b"11"  : mword 2)
                           (concat_vec (rsd  : cregidx)
                              (concat_vec ('b"00"  : mword 2)
                                 (concat_vec (rs2  : cregidx) ('b"01"  : mword 2)))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_ADDW (rsd, rs2) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          returnm (concat_vec ('b"100"  : mword 3)
                     (concat_vec ('b"1"  : mword 1)
                        (concat_vec ('b"11"  : mword 2)
                           (concat_vec (rsd  : cregidx)
                              (concat_vec ('b"01"  : mword 2)
                                 (concat_vec (rs2  : cregidx) ('b"01"  : mword 2)))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_J v__936 =>
       let i11 : bits 1 := subrange_vec_dec v__936 10 10 in
       let i98 : bits 2 := subrange_vec_dec v__936 8 7 in
       let i7 : bits 1 := subrange_vec_dec v__936 6 6 in
       let i6 : bits 1 := subrange_vec_dec v__936 5 5 in
       let i5 : bits 1 := subrange_vec_dec v__936 4 4 in
       let i4 : bits 1 := subrange_vec_dec v__936 3 3 in
       let i31 : bits 3 := subrange_vec_dec v__936 2 0 in
       let i11 : bits 1 := subrange_vec_dec v__936 10 10 in
       let i10 : bits 1 := subrange_vec_dec v__936 9 9 in
       returnm (concat_vec ('b"101"  : mword 3)
                  (concat_vec (i11  : bits 1)
                     (concat_vec (i4  : bits 1)
                        (concat_vec (i98  : bits 2)
                           (concat_vec (i10  : bits 1)
                              (concat_vec (i6  : bits 1)
                                 (concat_vec (i7  : bits 1)
                                    (concat_vec (i31  : bits 3)
                                       (concat_vec (i5  : bits 1) ('b"01"  : mword 2))))))))))
    | C_BEQZ (v__937, rs) =>
       let i8 : bits 1 := subrange_vec_dec v__937 7 7 in
       let i8 : bits 1 := subrange_vec_dec v__937 7 7 in
       let i76 : bits 2 := subrange_vec_dec v__937 6 5 in
       let i5 : bits 1 := subrange_vec_dec v__937 4 4 in
       let i43 : bits 2 := subrange_vec_dec v__937 3 2 in
       let i21 : bits 2 := subrange_vec_dec v__937 1 0 in
       returnm (concat_vec ('b"110"  : mword 3)
                  (concat_vec (i8  : bits 1)
                     (concat_vec (i43  : bits 2)
                        (concat_vec (rs  : cregidx)
                           (concat_vec (i76  : bits 2)
                              (concat_vec (i21  : bits 2)
                                 (concat_vec (i5  : bits 1) ('b"01"  : mword 2))))))))
    | C_BNEZ (v__938, rs) =>
       let i8 : bits 1 := subrange_vec_dec v__938 7 7 in
       let i8 : bits 1 := subrange_vec_dec v__938 7 7 in
       let i76 : bits 2 := subrange_vec_dec v__938 6 5 in
       let i5 : bits 1 := subrange_vec_dec v__938 4 4 in
       let i43 : bits 2 := subrange_vec_dec v__938 3 2 in
       let i21 : bits 2 := subrange_vec_dec v__938 1 0 in
       returnm (concat_vec ('b"111"  : mword 3)
                  (concat_vec (i8  : bits 1)
                     (concat_vec (i43  : bits 2)
                        (concat_vec (rs  : cregidx)
                           (concat_vec (i76  : bits 2)
                              (concat_vec (i21  : bits 2)
                                 (concat_vec (i5  : bits 1) ('b"01"  : mword 2))))))))
    | C_SLLI (v__939, rsd) =>
       (if sumbool_of_bool
          (let nzui5 : bits 1 := subrange_vec_dec v__939 5 5 in
          let nzui5 : bits 1 := subrange_vec_dec v__939 5 5 in
          let nzui40 : bits 5 := subrange_vec_dec v__939 4 0 in
          andb (neq_vec (concat_vec nzui5 nzui40) ('b"000000"  : mword (1 + 5)))
            (andb (neq_vec rsd zreg) (orb (Z.eqb 64 64) (eq_vec nzui5 ('b"0"  : mword 1))))) then
          let nzui5 : bits 1 := subrange_vec_dec v__939 5 5 in
          let nzui5 : bits 1 := subrange_vec_dec v__939 5 5 in
          let nzui40 : bits 5 := subrange_vec_dec v__939 4 0 in
          returnm (concat_vec ('b"000"  : mword 3)
                     (concat_vec (nzui5  : bits 1)
                        (concat_vec (rsd  : regidx)
                           (concat_vec (nzui40  : bits 5) ('b"10"  : mword 2)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_LWSP (v__940, rd) =>
       (if neq_vec rd zreg then
          let ui76 : bits 2 := subrange_vec_dec v__940 5 4 in
          let ui76 : bits 2 := subrange_vec_dec v__940 5 4 in
          let ui5 : bits 1 := subrange_vec_dec v__940 3 3 in
          let ui42 : bits 3 := subrange_vec_dec v__940 2 0 in
          returnm (concat_vec ('b"010"  : mword 3)
                     (concat_vec (ui5  : bits 1)
                        (concat_vec (rd  : regidx)
                           (concat_vec (ui42  : bits 3)
                              (concat_vec (ui76  : bits 2) ('b"10"  : mword 2))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_LDSP (v__941, rd) =>
       (if sumbool_of_bool (andb (neq_vec rd zreg) (Z.eqb 64 64)) then
          let ui86 : bits 3 := subrange_vec_dec v__941 5 3 in
          let ui86 : bits 3 := subrange_vec_dec v__941 5 3 in
          let ui5 : bits 1 := subrange_vec_dec v__941 2 2 in
          let ui43 : bits 2 := subrange_vec_dec v__941 1 0 in
          returnm (concat_vec ('b"011"  : mword 3)
                     (concat_vec (ui5  : bits 1)
                        (concat_vec (rd  : regidx)
                           (concat_vec (ui43  : bits 2)
                              (concat_vec (ui86  : bits 3) ('b"10"  : mword 2))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_SWSP (v__942, rs2) =>
       let ui76 : bits 2 := subrange_vec_dec v__942 5 4 in
       let ui76 : bits 2 := subrange_vec_dec v__942 5 4 in
       let ui52 : bits 4 := subrange_vec_dec v__942 3 0 in
       returnm (concat_vec ('b"110"  : mword 3)
                  (concat_vec (ui52  : bits 4)
                     (concat_vec (ui76  : bits 2) (concat_vec (rs2  : regidx) ('b"10"  : mword 2)))))
    | C_SDSP (v__943, rs2) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          let ui86 : bits 3 := subrange_vec_dec v__943 5 3 in
          let ui86 : bits 3 := subrange_vec_dec v__943 5 3 in
          let ui53 : bits 3 := subrange_vec_dec v__943 2 0 in
          returnm (concat_vec ('b"111"  : mword 3)
                     (concat_vec (ui53  : bits 3)
                        (concat_vec (ui86  : bits 3)
                           (concat_vec (rs2  : regidx) ('b"10"  : mword 2)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_JR rs1 =>
       (if neq_vec rs1 zreg then
          returnm (concat_vec ('b"100"  : mword 3)
                     (concat_vec ('b"0"  : mword 1)
                        (concat_vec (rs1  : regidx)
                           (concat_vec ('b"00000"  : mword 5) ('b"10"  : mword 2)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_JALR rs1 =>
       (if neq_vec rs1 zreg then
          returnm (concat_vec ('b"100"  : mword 3)
                     (concat_vec ('b"1"  : mword 1)
                        (concat_vec (rs1  : regidx)
                           (concat_vec ('b"00000"  : mword 5) ('b"10"  : mword 2)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_MV (rd, rs2) =>
       (if andb (neq_vec rd zreg) (neq_vec rs2 zreg) then
          returnm (concat_vec ('b"100"  : mword 3)
                     (concat_vec ('b"0"  : mword 1)
                        (concat_vec (rd  : regidx) (concat_vec (rs2  : regidx) ('b"10"  : mword 2)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_EBREAK tt =>
       returnm (concat_vec ('b"100"  : mword 3)
                  (concat_vec ('b"1"  : mword 1)
                     (concat_vec ('b"00000"  : mword 5)
                        (concat_vec ('b"00000"  : mword 5) ('b"10"  : mword 2)))))
    | C_ADD (rsd, rs2) =>
       (if andb (neq_vec rsd zreg) (neq_vec rs2 zreg) then
          returnm (concat_vec ('b"100"  : mword 3)
                     (concat_vec ('b"1"  : mword 1)
                        (concat_vec (rsd  : regidx) (concat_vec (rs2  : regidx) ('b"10"  : mword 2)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_NOP_HINT v__944 =>
       (if let im5 : bits 1 := subrange_vec_dec v__944 5 5 in
          let im5 : bits 1 := subrange_vec_dec v__944 5 5 in
          let im40 : bits 5 := subrange_vec_dec v__944 4 0 in
          neq_vec (concat_vec im5 im40) ('b"000000"  : mword (1 + 5)) then
          let im5 : bits 1 := subrange_vec_dec v__944 5 5 in
          let im5 : bits 1 := subrange_vec_dec v__944 5 5 in
          let im40 : bits 5 := subrange_vec_dec v__944 4 0 in
          returnm (concat_vec ('b"000"  : mword 3)
                     (concat_vec (im5  : bits 1)
                        (concat_vec ('b"00000"  : mword 5)
                           (concat_vec (im40  : bits 5) ('b"01"  : mword 2)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_ADDI_HINT rsd =>
       (if neq_vec rsd zreg then
          returnm (concat_vec ('b"000"  : mword 3)
                     (concat_vec ('b"0"  : mword 1)
                        (concat_vec (rsd  : regidx)
                           (concat_vec ('b"00000"  : mword 5) ('b"01"  : mword 2)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_LI_HINT v__945 =>
       let imm5 : bits 1 := subrange_vec_dec v__945 5 5 in
       let imm5 : bits 1 := subrange_vec_dec v__945 5 5 in
       let imm40 : bits 5 := subrange_vec_dec v__945 4 0 in
       returnm (concat_vec ('b"010"  : mword 3)
                  (concat_vec (imm5  : bits 1)
                     (concat_vec ('b"00000"  : mword 5)
                        (concat_vec (imm40  : bits 5) ('b"01"  : mword 2)))))
    | C_LUI_HINT v__946 =>
       (if let imm17 : bits 1 := subrange_vec_dec v__946 5 5 in
          let imm17 : bits 1 := subrange_vec_dec v__946 5 5 in
          let imm1612 : bits 5 := subrange_vec_dec v__946 4 0 in
          neq_vec (concat_vec imm17 imm1612) ('b"000000"  : mword (1 + 5)) then
          let imm17 : bits 1 := subrange_vec_dec v__946 5 5 in
          let imm17 : bits 1 := subrange_vec_dec v__946 5 5 in
          let imm1612 : bits 5 := subrange_vec_dec v__946 4 0 in
          returnm (concat_vec ('b"011"  : mword 3)
                     (concat_vec (imm17  : bits 1)
                        (concat_vec ('b"00000"  : mword 5)
                           (concat_vec (imm1612  : bits 5) ('b"01"  : mword 2)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_MV_HINT rs2 =>
       (if neq_vec rs2 zreg then
          returnm (concat_vec ('b"100"  : mword 3)
                     (concat_vec ('b"0"  : mword 1)
                        (concat_vec ('b"00000"  : mword 5)
                           (concat_vec (rs2  : regidx) ('b"10"  : mword 2)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_ADD_HINT rs2 =>
       (if neq_vec rs2 zreg then
          returnm (concat_vec ('b"100"  : mword 3)
                     (concat_vec ('b"1"  : mword 1)
                        (concat_vec ('b"00000"  : mword 5)
                           (concat_vec (rs2  : regidx) ('b"10"  : mword 2)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_SLLI_HINT (v__947, rsd) =>
       (if sumbool_of_bool
          (let nzui5 : bits 1 := subrange_vec_dec v__947 5 5 in
          let nzui5 : bits 1 := subrange_vec_dec v__947 5 5 in
          let nzui40 : bits 5 := subrange_vec_dec v__947 4 0 in
          andb
            (orb (eq_vec (concat_vec nzui5 nzui40) ('b"000000"  : mword (1 + 5))) (eq_vec rsd zreg))
            (orb (Z.eqb 64 64) (eq_vec nzui5 ('b"0"  : mword 1)))) then
          let nzui5 : bits 1 := subrange_vec_dec v__947 5 5 in
          let nzui5 : bits 1 := subrange_vec_dec v__947 5 5 in
          let nzui40 : bits 5 := subrange_vec_dec v__947 4 0 in
          returnm (concat_vec ('b"000"  : mword 3)
                     (concat_vec (nzui5  : bits 1)
                        (concat_vec (rsd  : regidx)
                           (concat_vec (nzui40  : bits 5) ('b"10"  : mword 2)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_SRLI_HINT rsd =>
       returnm (concat_vec ('b"100"  : mword 3)
                  (concat_vec ('b"0"  : mword 1)
                     (concat_vec ('b"00"  : mword 2)
                        (concat_vec (rsd  : cregidx)
                           (concat_vec ('b"00000"  : mword 5) ('b"01"  : mword 2))))))
    | C_SRAI_HINT rsd =>
       returnm (concat_vec ('b"100"  : mword 3)
                  (concat_vec ('b"0"  : mword 1)
                     (concat_vec ('b"01"  : mword 2)
                        (concat_vec (rsd  : cregidx)
                           (concat_vec ('b"00000"  : mword 5) ('b"01"  : mword 2))))))
    | C_FLWSP (v__948, rd) =>
       (and_boolMP
          ((returnm (build_ex
            (projT1
            (build_ex
            (Z.eqb 64 32)
             : {_bool : bool & ArithFact (Bool.eqb (64 =? 32) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
            32) _bool)}))
          (build_trivial_ex
          ((and_boolM ((haveRVC tt)  : M (bool)) ((haveFExt tt)  : M (bool)))
           : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         (64 =? 32)) _bool = true)})) >>= fun '(existT _ w__57 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         (64 =? 32)) _bool = true)}) =>
       (if sumbool_of_bool w__57 then
          let ui76 : bits 2 := subrange_vec_dec v__948 5 4 in
          let ui76 : bits 2 := subrange_vec_dec v__948 5 4 in
          let ui5 : bits 1 := subrange_vec_dec v__948 3 3 in
          let ui42 : bits 3 := subrange_vec_dec v__948 2 0 in
          returnm (concat_vec ('b"011"  : mword 3)
                     (concat_vec (ui5  : bits 1)
                        (concat_vec (rd  : regidx)
                           (concat_vec (ui42  : bits 3)
                              (concat_vec (ui76  : bits 2) ('b"10"  : mword 2))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_FSWSP (v__949, rs2) =>
       (and_boolMP
          ((returnm (build_ex
            (projT1
            (build_ex
            (Z.eqb 64 32)
             : {_bool : bool & ArithFact (Bool.eqb (64 =? 32) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
            32) _bool)}))
          (build_trivial_ex
          ((and_boolM ((haveRVC tt)  : M (bool)) ((haveFExt tt)  : M (bool)))
           : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         (64 =? 32)) _bool = true)})) >>= fun '(existT _ w__63 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         (64 =? 32)) _bool = true)}) =>
       (if sumbool_of_bool w__63 then
          let ui76 : bits 2 := subrange_vec_dec v__949 5 4 in
          let ui76 : bits 2 := subrange_vec_dec v__949 5 4 in
          let ui52 : bits 4 := subrange_vec_dec v__949 3 0 in
          returnm (concat_vec ('b"111"  : mword 3)
                     (concat_vec (ui52  : bits 4)
                        (concat_vec (ui76  : bits 2)
                           (concat_vec (rs2  : regidx) ('b"10"  : mword 2)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_FLW (v__950, rs1, rd) =>
       (and_boolMP
          ((returnm (build_ex
            (projT1
            (build_ex
            (Z.eqb 64 32)
             : {_bool : bool & ArithFact (Bool.eqb (64 =? 32) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
            32) _bool)}))
          (build_trivial_ex
          ((and_boolM ((haveRVC tt)  : M (bool)) ((haveFExt tt)  : M (bool)))
           : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         (64 =? 32)) _bool = true)})) >>= fun '(existT _ w__69 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         (64 =? 32)) _bool = true)}) =>
       (if sumbool_of_bool w__69 then
          let ui6 : bits 1 := subrange_vec_dec v__950 4 4 in
          let ui6 : bits 1 := subrange_vec_dec v__950 4 4 in
          let ui53 : bits 3 := subrange_vec_dec v__950 3 1 in
          let ui2 : bits 1 := subrange_vec_dec v__950 0 0 in
          returnm (concat_vec ('b"011"  : mword 3)
                     (concat_vec (ui53  : bits 3)
                        (concat_vec (rs1  : cregidx)
                           (concat_vec (ui2  : bits 1)
                              (concat_vec (ui6  : bits 1)
                                 (concat_vec (rd  : cregidx) ('b"00"  : mword 2)))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_FSW (v__951, rs1, rs2) =>
       (and_boolMP
          ((returnm (build_ex
            (projT1
            (build_ex
            (Z.eqb 64 32)
             : {_bool : bool & ArithFact (Bool.eqb (64 =? 32) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
            32) _bool)}))
          (build_trivial_ex
          ((and_boolM ((haveRVC tt)  : M (bool)) ((haveFExt tt)  : M (bool)))
           : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         (64 =? 32)) _bool = true)})) >>= fun '(existT _ w__75 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         (64 =? 32)) _bool = true)}) =>
       (if sumbool_of_bool w__75 then
          let ui6 : bits 1 := subrange_vec_dec v__951 4 4 in
          let ui6 : bits 1 := subrange_vec_dec v__951 4 4 in
          let ui53 : bits 3 := subrange_vec_dec v__951 3 1 in
          let ui2 : bits 1 := subrange_vec_dec v__951 0 0 in
          returnm (concat_vec ('b"111"  : mword 3)
                     (concat_vec (ui53  : bits 3)
                        (concat_vec (rs1  : cregidx)
                           (concat_vec (ui2  : bits 1)
                              (concat_vec (ui6  : bits 1)
                                 (concat_vec (rs2  : cregidx) ('b"00"  : mword 2)))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_FLDSP (v__952, rd) =>
       (and_boolMP
          ((returnm (build_ex
            (projT1
            (build_ex
            (orb (Z.eqb 64 32) (Z.eqb 64 64))
             : {_bool : bool & ArithFact (Bool.eqb ((64 =? 32) || (64 =? 64)) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb ((64 =?
            32) ||
            (64 =? 64)) _bool)}))
          (build_trivial_ex
          ((and_boolM ((haveRVC tt)  : M (bool)) ((haveDExt tt)  : M (bool)))
           : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         ((64 =? 32) || (64 =? 64))) _bool = true)})) >>= fun '(existT _ w__81 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         ((64 =? 32) || (64 =? 64))) _bool = true)}) =>
       (if sumbool_of_bool w__81 then
          let ui86 : bits 3 := subrange_vec_dec v__952 5 3 in
          let ui86 : bits 3 := subrange_vec_dec v__952 5 3 in
          let ui5 : bits 1 := subrange_vec_dec v__952 2 2 in
          let ui43 : bits 2 := subrange_vec_dec v__952 1 0 in
          returnm (concat_vec ('b"001"  : mword 3)
                     (concat_vec (ui5  : bits 1)
                        (concat_vec (rd  : regidx)
                           (concat_vec (ui43  : bits 2)
                              (concat_vec (ui86  : bits 3) ('b"10"  : mword 2))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_FSDSP (v__953, rs2) =>
       (and_boolMP
          ((returnm (build_ex
            (projT1
            (build_ex
            (orb (Z.eqb 64 32) (Z.eqb 64 64))
             : {_bool : bool & ArithFact (Bool.eqb ((64 =? 32) || (64 =? 64)) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb ((64 =?
            32) ||
            (64 =? 64)) _bool)}))
          (build_trivial_ex
          ((and_boolM ((haveRVC tt)  : M (bool)) ((haveDExt tt)  : M (bool)))
           : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         ((64 =? 32) || (64 =? 64))) _bool = true)})) >>= fun '(existT _ w__87 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         ((64 =? 32) || (64 =? 64))) _bool = true)}) =>
       (if sumbool_of_bool w__87 then
          let ui86 : bits 3 := subrange_vec_dec v__953 5 3 in
          let ui86 : bits 3 := subrange_vec_dec v__953 5 3 in
          let ui53 : bits 3 := subrange_vec_dec v__953 2 0 in
          returnm (concat_vec ('b"101"  : mword 3)
                     (concat_vec (ui53  : bits 3)
                        (concat_vec (ui86  : bits 3)
                           (concat_vec (rs2  : regidx) ('b"10"  : mword 2)))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_FLD (v__954, rs1, rd) =>
       (and_boolMP
          ((returnm (build_ex
            (projT1
            (build_ex
            (orb (Z.eqb 64 32) (Z.eqb 64 64))
             : {_bool : bool & ArithFact (Bool.eqb ((64 =? 32) || (64 =? 64)) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb ((64 =?
            32) ||
            (64 =? 64)) _bool)}))
          (build_trivial_ex
          ((and_boolM ((haveRVC tt)  : M (bool)) ((haveDExt tt)  : M (bool)))
           : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         ((64 =? 32) || (64 =? 64))) _bool = true)})) >>= fun '(existT _ w__93 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         ((64 =? 32) || (64 =? 64))) _bool = true)}) =>
       (if sumbool_of_bool w__93 then
          let ui76 : bits 2 := subrange_vec_dec v__954 4 3 in
          let ui76 : bits 2 := subrange_vec_dec v__954 4 3 in
          let ui53 : bits 3 := subrange_vec_dec v__954 2 0 in
          returnm (concat_vec ('b"001"  : mword 3)
                     (concat_vec (ui53  : bits 3)
                        (concat_vec (rs1  : cregidx)
                           (concat_vec (ui76  : bits 2)
                              (concat_vec (rd  : cregidx) ('b"00"  : mword 2))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_FSD (v__955, rs1, rs2) =>
       (and_boolMP
          ((returnm (build_ex
            (projT1
            (build_ex
            (orb (Z.eqb 64 32) (Z.eqb 64 64))
             : {_bool : bool & ArithFact (Bool.eqb ((64 =? 32) || (64 =? 64)) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb ((64 =?
            32) ||
            (64 =? 64)) _bool)}))
          (build_trivial_ex
          ((and_boolM ((haveRVC tt)  : M (bool)) ((haveDExt tt)  : M (bool)))
           : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         ((64 =? 32) || (64 =? 64))) _bool = true)})) >>= fun '(existT _ w__99 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         ((64 =? 32) || (64 =? 64))) _bool = true)}) =>
       (if sumbool_of_bool w__99 then
          let ui76 : bits 2 := subrange_vec_dec v__955 4 3 in
          let ui76 : bits 2 := subrange_vec_dec v__955 4 3 in
          let ui53 : bits 3 := subrange_vec_dec v__955 2 0 in
          returnm (concat_vec ('b"101"  : mword 3)
                     (concat_vec (ui53  : bits 3)
                        (concat_vec (rs1  : bits 3)
                           (concat_vec (ui76  : bits 2)
                              (concat_vec (rs2  : bits 3) ('b"00"  : mword 2))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (mword 16)
    | C_ILLEGAL s => returnm s
    | _ => assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt
    end)
    : M (mword 16).

Definition encdec_compressed_backwards (arg_ : mword 16) : M (ast) :=
   let v__956 := arg_ in
   (if eq_vec v__956 (Ox"0001"  : mword 16) then returnm (C_NOP tt)
    else if andb
              (let nz96 : bits 4 := subrange_vec_dec v__956 10 7 in
              let nz54 : bits 2 := subrange_vec_dec v__956 12 11 in
              let nz3 : bits 1 := subrange_vec_dec v__956 5 5 in
              let nz2 : bits 1 := subrange_vec_dec v__956 6 6 in
              neq_vec (concat_vec nz96 (concat_vec nz54 (concat_vec nz3 nz2)))
                (Ox"00"
                 : mword (4 + (2 + (1 + 1)))))
              (andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"000"  : mword (15 - 13 + 1)))
                 (eq_vec (subrange_vec_dec v__956 1 0) ('b"00"  : mword (1 - 0 + 1)))) then
      let rd : cregidx := subrange_vec_dec v__956 4 2 in
      let nz96 : bits 4 := subrange_vec_dec v__956 10 7 in
      let nz54 : bits 2 := subrange_vec_dec v__956 12 11 in
      let nz3 : bits 1 := subrange_vec_dec v__956 5 5 in
      let nz2 : bits 1 := subrange_vec_dec v__956 6 6 in
      returnm (C_ADDI4SPN
                 (rd, concat_vec (nz96  : bits 4)
                        (concat_vec (nz54  : bits 2) (concat_vec (nz3  : bits 1) (nz2  : bits 1)))))
    else if andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"010"  : mword (15 - 13 + 1)))
              (eq_vec (subrange_vec_dec v__956 1 0) ('b"00"  : mword (1 - 0 + 1))) then
      let ui6 : bits 1 := subrange_vec_dec v__956 5 5 in
      let ui53 : bits 3 := subrange_vec_dec v__956 12 10 in
      let ui2 : bits 1 := subrange_vec_dec v__956 6 6 in
      let rs1 : cregidx := subrange_vec_dec v__956 9 7 in
      let rd : cregidx := subrange_vec_dec v__956 4 2 in
      returnm (C_LW
                 (concat_vec (ui6  : bits 1) (concat_vec (ui53  : bits 3) (ui2  : bits 1)), rs1, rd))
    else if sumbool_of_bool
      (andb (Z.eqb 64 64)
         (andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"011"  : mword (15 - 13 + 1)))
            (eq_vec (subrange_vec_dec v__956 1 0) ('b"00"  : mword (1 - 0 + 1))))) then
      let ui76 : bits 2 := subrange_vec_dec v__956 6 5 in
      let ui53 : bits 3 := subrange_vec_dec v__956 12 10 in
      let rs1 : cregidx := subrange_vec_dec v__956 9 7 in
      let rd : cregidx := subrange_vec_dec v__956 4 2 in
      returnm (C_LD (concat_vec (ui76  : bits 2) (ui53  : bits 3), rs1, rd))
    else if andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"110"  : mword (15 - 13 + 1)))
              (eq_vec (subrange_vec_dec v__956 1 0) ('b"00"  : mword (1 - 0 + 1))) then
      let ui6 : bits 1 := subrange_vec_dec v__956 5 5 in
      let ui53 : bits 3 := subrange_vec_dec v__956 12 10 in
      let ui2 : bits 1 := subrange_vec_dec v__956 6 6 in
      let rs2 : cregidx := subrange_vec_dec v__956 4 2 in
      let rs1 : cregidx := subrange_vec_dec v__956 9 7 in
      returnm (C_SW
                 (concat_vec (ui6  : bits 1) (concat_vec (ui53  : bits 3) (ui2  : bits 1)), rs1, rs2))
    else if sumbool_of_bool
      (andb (Z.eqb 64 64)
         (andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"111"  : mword (15 - 13 + 1)))
            (eq_vec (subrange_vec_dec v__956 1 0) ('b"00"  : mword (1 - 0 + 1))))) then
      let ui76 : bits 2 := subrange_vec_dec v__956 6 5 in
      let ui53 : bits 3 := subrange_vec_dec v__956 12 10 in
      let rs2 : bits 3 := subrange_vec_dec v__956 4 2 in
      let rs1 : bits 3 := subrange_vec_dec v__956 9 7 in
      returnm (C_SD (concat_vec (ui76  : bits 2) (ui53  : bits 3), rs1, rs2))
    else if andb
              (let rsd : regidx := subrange_vec_dec v__956 11 7 in
              let nzi5 : bits 1 := subrange_vec_dec v__956 12 12 in
              let nzi40 : bits 5 := subrange_vec_dec v__956 6 2 in
              andb (neq_vec (concat_vec nzi5 nzi40) ('b"000000"  : mword (1 + 5)))
                (neq_vec rsd zreg))
              (andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"000"  : mword (15 - 13 + 1)))
                 (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1)))) then
      let rsd : regidx := subrange_vec_dec v__956 11 7 in
      let nzi5 : bits 1 := subrange_vec_dec v__956 12 12 in
      let nzi40 : bits 5 := subrange_vec_dec v__956 6 2 in
      returnm (C_ADDI (concat_vec (nzi5  : bits 1) (nzi40  : bits 5), rsd))
    else if sumbool_of_bool
      (andb (Z.eqb 64 32)
         (andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"001"  : mword (15 - 13 + 1)))
            (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1))))) then
      let i98 : bits 2 := subrange_vec_dec v__956 10 9 in
      let i7 : bits 1 := subrange_vec_dec v__956 6 6 in
      let i6 : bits 1 := subrange_vec_dec v__956 7 7 in
      let i5 : bits 1 := subrange_vec_dec v__956 2 2 in
      let i4 : bits 1 := subrange_vec_dec v__956 11 11 in
      let i31 : bits 3 := subrange_vec_dec v__956 5 3 in
      let i11 : bits 1 := subrange_vec_dec v__956 12 12 in
      let i10 : bits 1 := subrange_vec_dec v__956 8 8 in
      returnm (C_JAL
                 (concat_vec (i11  : bits 1)
                    (concat_vec (i10  : bits 1)
                       (concat_vec (i98  : bits 2)
                          (concat_vec (i7  : bits 1)
                             (concat_vec (i6  : bits 1)
                                (concat_vec (i5  : bits 1)
                                   (concat_vec (i4  : bits 1) (i31  : bits 3)))))))))
    else if sumbool_of_bool
      (andb
         (let rsd : regidx := subrange_vec_dec v__956 11 7 in
         andb (neq_vec rsd zreg) (Z.eqb 64 64))
         (andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"001"  : mword (15 - 13 + 1)))
            (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1))))) then
      let rsd : regidx := subrange_vec_dec v__956 11 7 in
      let imm5 : bits 1 := subrange_vec_dec v__956 12 12 in
      let imm40 : bits 5 := subrange_vec_dec v__956 6 2 in
      returnm (C_ADDIW (concat_vec (imm5  : bits 1) (imm40  : bits 5), rsd))
    else if andb
              (let rd : regidx := subrange_vec_dec v__956 11 7 in
              neq_vec rd zreg)
              (andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"010"  : mword (15 - 13 + 1)))
                 (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1)))) then
      let rd : regidx := subrange_vec_dec v__956 11 7 in
      let imm5 : bits 1 := subrange_vec_dec v__956 12 12 in
      let imm40 : bits 5 := subrange_vec_dec v__956 6 2 in
      returnm (C_LI (concat_vec (imm5  : bits 1) (imm40  : bits 5), rd))
    else if andb
              (let nzi9 : bits 1 := subrange_vec_dec v__956 12 12 in
              let nzi87 : bits 2 := subrange_vec_dec v__956 4 3 in
              let nzi6 : bits 1 := subrange_vec_dec v__956 5 5 in
              let nzi5 : bits 1 := subrange_vec_dec v__956 2 2 in
              let nzi4 : bits 1 := subrange_vec_dec v__956 6 6 in
              neq_vec (concat_vec nzi9 (concat_vec nzi87 (concat_vec nzi6 (concat_vec nzi5 nzi4))))
                ('b"000000"
                 : mword (1 + (2 + (1 + (1 + 1))))))
              (andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"011"  : mword (15 - 13 + 1)))
                 (andb (eq_vec (subrange_vec_dec v__956 11 7) ('b"00010"  : mword (11 - 7 + 1)))
                    (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1))))) then
      let nzi9 : bits 1 := subrange_vec_dec v__956 12 12 in
      let nzi87 : bits 2 := subrange_vec_dec v__956 4 3 in
      let nzi6 : bits 1 := subrange_vec_dec v__956 5 5 in
      let nzi5 : bits 1 := subrange_vec_dec v__956 2 2 in
      let nzi4 : bits 1 := subrange_vec_dec v__956 6 6 in
      returnm (C_ADDI16SP
                 (concat_vec (nzi9  : bits 1)
                    (concat_vec (nzi87  : bits 2)
                       (concat_vec (nzi6  : bits 1) (concat_vec (nzi5  : bits 1) (nzi4  : bits 1))))))
    else if andb
              (let rd : regidx := subrange_vec_dec v__956 11 7 in
              let imm17 : bits 1 := subrange_vec_dec v__956 12 12 in
              let imm1612 : bits 5 := subrange_vec_dec v__956 6 2 in
              andb (neq_vec rd zreg)
                (andb (neq_vec rd sp)
                   (neq_vec (concat_vec imm17 imm1612) ('b"000000"  : mword (1 + 5)))))
              (andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"011"  : mword (15 - 13 + 1)))
                 (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1)))) then
      let rd : regidx := subrange_vec_dec v__956 11 7 in
      let imm17 : bits 1 := subrange_vec_dec v__956 12 12 in
      let imm1612 : bits 5 := subrange_vec_dec v__956 6 2 in
      returnm (C_LUI (concat_vec (imm17  : bits 1) (imm1612  : bits 5), rd))
    else if andb
              (let nzui5 : bits 1 := subrange_vec_dec v__956 12 12 in
              let nzui40 : bits 5 := subrange_vec_dec v__956 6 2 in
              neq_vec (concat_vec nzui5 nzui40) ('b"000000"  : mword (1 + 5)))
              (andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"100"  : mword (15 - 13 + 1)))
                 (andb (eq_vec (subrange_vec_dec v__956 11 10) ('b"00"  : mword (11 - 10 + 1)))
                    (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1))))) then
      let rsd : cregidx := subrange_vec_dec v__956 9 7 in
      let nzui5 : bits 1 := subrange_vec_dec v__956 12 12 in
      let nzui40 : bits 5 := subrange_vec_dec v__956 6 2 in
      returnm (C_SRLI (concat_vec (nzui5  : bits 1) (nzui40  : bits 5), rsd))
    else if andb
              (let nzui5 : bits 1 := subrange_vec_dec v__956 12 12 in
              let nzui40 : bits 5 := subrange_vec_dec v__956 6 2 in
              neq_vec (concat_vec nzui5 nzui40) ('b"000000"  : mword (1 + 5)))
              (andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"100"  : mword (15 - 13 + 1)))
                 (andb (eq_vec (subrange_vec_dec v__956 11 10) ('b"01"  : mword (11 - 10 + 1)))
                    (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1))))) then
      let rsd : cregidx := subrange_vec_dec v__956 9 7 in
      let nzui5 : bits 1 := subrange_vec_dec v__956 12 12 in
      let nzui40 : bits 5 := subrange_vec_dec v__956 6 2 in
      returnm (C_SRAI (concat_vec (nzui5  : bits 1) (nzui40  : bits 5), rsd))
    else if andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"100"  : mword (15 - 13 + 1)))
              (andb (eq_vec (subrange_vec_dec v__956 11 10) ('b"10"  : mword (11 - 10 + 1)))
                 (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1)))) then
      let rsd : cregidx := subrange_vec_dec v__956 9 7 in
      let i5 : bits 1 := subrange_vec_dec v__956 12 12 in
      let i40 : bits 5 := subrange_vec_dec v__956 6 2 in
      returnm (C_ANDI (concat_vec (i5  : bits 1) (i40  : bits 5), rsd))
    else if andb (eq_vec (subrange_vec_dec v__956 15 10) ('b"100011"  : mword (15 - 10 + 1)))
              (andb (eq_vec (subrange_vec_dec v__956 6 5) ('b"00"  : mword (6 - 5 + 1)))
                 (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1)))) then
      let rsd : cregidx := subrange_vec_dec v__956 9 7 in
      let rs2 : cregidx := subrange_vec_dec v__956 4 2 in
      returnm (C_SUB (rsd, rs2))
    else if andb (eq_vec (subrange_vec_dec v__956 15 10) ('b"100011"  : mword (15 - 10 + 1)))
              (andb (eq_vec (subrange_vec_dec v__956 6 5) ('b"01"  : mword (6 - 5 + 1)))
                 (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1)))) then
      let rsd : cregidx := subrange_vec_dec v__956 9 7 in
      let rs2 : cregidx := subrange_vec_dec v__956 4 2 in
      returnm (C_XOR (rsd, rs2))
    else if andb (eq_vec (subrange_vec_dec v__956 15 10) ('b"100011"  : mword (15 - 10 + 1)))
              (andb (eq_vec (subrange_vec_dec v__956 6 5) ('b"10"  : mword (6 - 5 + 1)))
                 (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1)))) then
      let rsd : cregidx := subrange_vec_dec v__956 9 7 in
      let rs2 : cregidx := subrange_vec_dec v__956 4 2 in
      returnm (C_OR (rsd, rs2))
    else if andb (eq_vec (subrange_vec_dec v__956 15 10) ('b"100011"  : mword (15 - 10 + 1)))
              (andb (eq_vec (subrange_vec_dec v__956 6 5) ('b"11"  : mword (6 - 5 + 1)))
                 (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1)))) then
      let rsd : cregidx := subrange_vec_dec v__956 9 7 in
      let rs2 : cregidx := subrange_vec_dec v__956 4 2 in
      returnm (C_AND (rsd, rs2))
    else if sumbool_of_bool
      (andb (Z.eqb 64 64)
         (andb (eq_vec (subrange_vec_dec v__956 15 10) ('b"100111"  : mword (15 - 10 + 1)))
            (andb (eq_vec (subrange_vec_dec v__956 6 5) ('b"00"  : mword (6 - 5 + 1)))
               (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1)))))) then
      let rsd : cregidx := subrange_vec_dec v__956 9 7 in
      let rs2 : cregidx := subrange_vec_dec v__956 4 2 in
      returnm (C_SUBW (rsd, rs2))
    else if sumbool_of_bool
      (andb (Z.eqb 64 64)
         (andb (eq_vec (subrange_vec_dec v__956 15 10) ('b"100111"  : mword (15 - 10 + 1)))
            (andb (eq_vec (subrange_vec_dec v__956 6 5) ('b"01"  : mword (6 - 5 + 1)))
               (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1)))))) then
      let rsd : cregidx := subrange_vec_dec v__956 9 7 in
      let rs2 : cregidx := subrange_vec_dec v__956 4 2 in
      returnm (C_ADDW (rsd, rs2))
    else if andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"101"  : mword (15 - 13 + 1)))
              (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1))) then
      let i98 : bits 2 := subrange_vec_dec v__956 10 9 in
      let i7 : bits 1 := subrange_vec_dec v__956 6 6 in
      let i6 : bits 1 := subrange_vec_dec v__956 7 7 in
      let i5 : bits 1 := subrange_vec_dec v__956 2 2 in
      let i4 : bits 1 := subrange_vec_dec v__956 11 11 in
      let i31 : bits 3 := subrange_vec_dec v__956 5 3 in
      let i11 : bits 1 := subrange_vec_dec v__956 12 12 in
      let i10 : bits 1 := subrange_vec_dec v__956 8 8 in
      returnm (C_J
                 (concat_vec (i11  : bits 1)
                    (concat_vec (i10  : bits 1)
                       (concat_vec (i98  : bits 2)
                          (concat_vec (i7  : bits 1)
                             (concat_vec (i6  : bits 1)
                                (concat_vec (i5  : bits 1)
                                   (concat_vec (i4  : bits 1) (i31  : bits 3)))))))))
    else if andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"110"  : mword (15 - 13 + 1)))
              (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1))) then
      let rs : cregidx := subrange_vec_dec v__956 9 7 in
      let i8 : bits 1 := subrange_vec_dec v__956 12 12 in
      let i76 : bits 2 := subrange_vec_dec v__956 6 5 in
      let i5 : bits 1 := subrange_vec_dec v__956 2 2 in
      let i43 : bits 2 := subrange_vec_dec v__956 11 10 in
      let i21 : bits 2 := subrange_vec_dec v__956 4 3 in
      returnm (C_BEQZ
                 (concat_vec (i8  : bits 1)
                    (concat_vec (i76  : bits 2)
                       (concat_vec (i5  : bits 1) (concat_vec (i43  : bits 2) (i21  : bits 2)))), rs))
    else if andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"111"  : mword (15 - 13 + 1)))
              (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1))) then
      let rs : cregidx := subrange_vec_dec v__956 9 7 in
      let i8 : bits 1 := subrange_vec_dec v__956 12 12 in
      let i76 : bits 2 := subrange_vec_dec v__956 6 5 in
      let i5 : bits 1 := subrange_vec_dec v__956 2 2 in
      let i43 : bits 2 := subrange_vec_dec v__956 11 10 in
      let i21 : bits 2 := subrange_vec_dec v__956 4 3 in
      returnm (C_BNEZ
                 (concat_vec (i8  : bits 1)
                    (concat_vec (i76  : bits 2)
                       (concat_vec (i5  : bits 1) (concat_vec (i43  : bits 2) (i21  : bits 2)))), rs))
    else if sumbool_of_bool
      (andb
         (let rsd : regidx := subrange_vec_dec v__956 11 7 in
         let nzui5 : bits 1 := subrange_vec_dec v__956 12 12 in
         let nzui40 : bits 5 := subrange_vec_dec v__956 6 2 in
         andb (neq_vec (concat_vec nzui5 nzui40) ('b"000000"  : mword (1 + 5)))
           (andb (neq_vec rsd zreg) (orb (Z.eqb 64 64) (eq_vec nzui5 ('b"0"  : mword 1)))))
         (andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"000"  : mword (15 - 13 + 1)))
            (eq_vec (subrange_vec_dec v__956 1 0) ('b"10"  : mword (1 - 0 + 1))))) then
      let rsd : regidx := subrange_vec_dec v__956 11 7 in
      let nzui5 : bits 1 := subrange_vec_dec v__956 12 12 in
      let nzui40 : bits 5 := subrange_vec_dec v__956 6 2 in
      returnm (C_SLLI (concat_vec (nzui5  : bits 1) (nzui40  : bits 5), rsd))
    else if andb
              (let rd : regidx := subrange_vec_dec v__956 11 7 in
              neq_vec rd zreg)
              (andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"010"  : mword (15 - 13 + 1)))
                 (eq_vec (subrange_vec_dec v__956 1 0) ('b"10"  : mword (1 - 0 + 1)))) then
      let ui76 : bits 2 := subrange_vec_dec v__956 3 2 in
      let ui5 : bits 1 := subrange_vec_dec v__956 12 12 in
      let ui42 : bits 3 := subrange_vec_dec v__956 6 4 in
      let rd : regidx := subrange_vec_dec v__956 11 7 in
      returnm (C_LWSP
                 (concat_vec (ui76  : bits 2) (concat_vec (ui5  : bits 1) (ui42  : bits 3)), rd))
    else if sumbool_of_bool
      (andb
         (let rd : regidx := subrange_vec_dec v__956 11 7 in
         andb (neq_vec rd zreg) (Z.eqb 64 64))
         (andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"011"  : mword (15 - 13 + 1)))
            (eq_vec (subrange_vec_dec v__956 1 0) ('b"10"  : mword (1 - 0 + 1))))) then
      let ui86 : bits 3 := subrange_vec_dec v__956 4 2 in
      let ui5 : bits 1 := subrange_vec_dec v__956 12 12 in
      let ui43 : bits 2 := subrange_vec_dec v__956 6 5 in
      let rd : regidx := subrange_vec_dec v__956 11 7 in
      returnm (C_LDSP
                 (concat_vec (ui86  : bits 3) (concat_vec (ui5  : bits 1) (ui43  : bits 2)), rd))
    else if andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"110"  : mword (15 - 13 + 1)))
              (eq_vec (subrange_vec_dec v__956 1 0) ('b"10"  : mword (1 - 0 + 1))) then
      let ui76 : bits 2 := subrange_vec_dec v__956 8 7 in
      let ui52 : bits 4 := subrange_vec_dec v__956 12 9 in
      let rs2 : regidx := subrange_vec_dec v__956 6 2 in
      returnm (C_SWSP (concat_vec (ui76  : bits 2) (ui52  : bits 4), rs2))
    else if sumbool_of_bool
      (andb (Z.eqb 64 64)
         (andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"111"  : mword (15 - 13 + 1)))
            (eq_vec (subrange_vec_dec v__956 1 0) ('b"10"  : mword (1 - 0 + 1))))) then
      let ui86 : bits 3 := subrange_vec_dec v__956 9 7 in
      let ui53 : bits 3 := subrange_vec_dec v__956 12 10 in
      let rs2 : regidx := subrange_vec_dec v__956 6 2 in
      returnm (C_SDSP (concat_vec (ui86  : bits 3) (ui53  : bits 3), rs2))
    else if andb
              (let rs1 : regidx := subrange_vec_dec v__956 11 7 in
              neq_vec rs1 zreg)
              (andb (eq_vec (subrange_vec_dec v__956 15 12) (Ox"8"  : mword (15 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__956 6 0) ('b"0000010"  : mword (6 - 0 + 1)))) then
      let rs1 : regidx := subrange_vec_dec v__956 11 7 in
      returnm (C_JR rs1)
    else if andb
              (let rs1 : regidx := subrange_vec_dec v__956 11 7 in
              neq_vec rs1 zreg)
              (andb (eq_vec (subrange_vec_dec v__956 15 12) (Ox"9"  : mword (15 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__956 6 0) ('b"0000010"  : mword (6 - 0 + 1)))) then
      let rs1 : regidx := subrange_vec_dec v__956 11 7 in
      returnm (C_JALR rs1)
    else if andb
              (let rs2 : regidx := subrange_vec_dec v__956 6 2 in
              let rd : regidx := subrange_vec_dec v__956 11 7 in
              andb (neq_vec rd zreg) (neq_vec rs2 zreg))
              (andb (eq_vec (subrange_vec_dec v__956 15 12) (Ox"8"  : mword (15 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__956 1 0) ('b"10"  : mword (1 - 0 + 1)))) then
      let rs2 : regidx := subrange_vec_dec v__956 6 2 in
      let rd : regidx := subrange_vec_dec v__956 11 7 in
      returnm (C_MV (rd, rs2))
    else if eq_vec v__956 (Ox"9002"  : mword 16) then returnm (C_EBREAK tt)
    else if andb
              (let rsd : regidx := subrange_vec_dec v__956 11 7 in
              let rs2 : regidx := subrange_vec_dec v__956 6 2 in
              andb (neq_vec rsd zreg) (neq_vec rs2 zreg))
              (andb (eq_vec (subrange_vec_dec v__956 15 12) (Ox"9"  : mword (15 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__956 1 0) ('b"10"  : mword (1 - 0 + 1)))) then
      let rsd : regidx := subrange_vec_dec v__956 11 7 in
      let rs2 : regidx := subrange_vec_dec v__956 6 2 in
      returnm (C_ADD (rsd, rs2))
    else if andb
              (let im5 : bits 1 := subrange_vec_dec v__956 12 12 in
              let im40 : bits 5 := subrange_vec_dec v__956 6 2 in
              neq_vec (concat_vec im5 im40) ('b"000000"  : mword (1 + 5)))
              (andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"000"  : mword (15 - 13 + 1)))
                 (andb (eq_vec (subrange_vec_dec v__956 11 7) ('b"00000"  : mword (11 - 7 + 1)))
                    (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1))))) then
      let im5 : bits 1 := subrange_vec_dec v__956 12 12 in
      let im40 : bits 5 := subrange_vec_dec v__956 6 2 in
      returnm (C_NOP_HINT (concat_vec (im5  : bits 1) (im40  : bits 5)))
    else if andb
              (let rsd : regidx := subrange_vec_dec v__956 11 7 in
              neq_vec rsd zreg)
              (andb (eq_vec (subrange_vec_dec v__956 15 12) (Ox"0"  : mword (15 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__956 6 0) ('b"0000001"  : mword (6 - 0 + 1)))) then
      let rsd : regidx := subrange_vec_dec v__956 11 7 in
      returnm (C_ADDI_HINT rsd)
    else if andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"010"  : mword (15 - 13 + 1)))
              (andb (eq_vec (subrange_vec_dec v__956 11 7) ('b"00000"  : mword (11 - 7 + 1)))
                 (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1)))) then
      let imm5 : bits 1 := subrange_vec_dec v__956 12 12 in
      let imm40 : bits 5 := subrange_vec_dec v__956 6 2 in
      returnm (C_LI_HINT (concat_vec (imm5  : bits 1) (imm40  : bits 5)))
    else if andb
              (let imm17 : bits 1 := subrange_vec_dec v__956 12 12 in
              let imm1612 : bits 5 := subrange_vec_dec v__956 6 2 in
              neq_vec (concat_vec imm17 imm1612) ('b"000000"  : mword (1 + 5)))
              (andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"011"  : mword (15 - 13 + 1)))
                 (andb (eq_vec (subrange_vec_dec v__956 11 7) ('b"00000"  : mword (11 - 7 + 1)))
                    (eq_vec (subrange_vec_dec v__956 1 0) ('b"01"  : mword (1 - 0 + 1))))) then
      let imm17 : bits 1 := subrange_vec_dec v__956 12 12 in
      let imm1612 : bits 5 := subrange_vec_dec v__956 6 2 in
      returnm (C_LUI_HINT (concat_vec (imm17  : bits 1) (imm1612  : bits 5)))
    else if andb
              (let rs2 : regidx := subrange_vec_dec v__956 6 2 in
              neq_vec rs2 zreg)
              (andb (eq_vec (subrange_vec_dec v__956 15 7) ('b"100000000"  : mword (15 - 7 + 1)))
                 (eq_vec (subrange_vec_dec v__956 1 0) ('b"10"  : mword (1 - 0 + 1)))) then
      let rs2 : regidx := subrange_vec_dec v__956 6 2 in
      returnm (C_MV_HINT rs2)
    else if andb
              (let rs2 : regidx := subrange_vec_dec v__956 6 2 in
              neq_vec rs2 zreg)
              (andb (eq_vec (subrange_vec_dec v__956 15 7) ('b"100100000"  : mword (15 - 7 + 1)))
                 (eq_vec (subrange_vec_dec v__956 1 0) ('b"10"  : mword (1 - 0 + 1)))) then
      let rs2 : regidx := subrange_vec_dec v__956 6 2 in
      returnm (C_ADD_HINT rs2)
    else if sumbool_of_bool
      (andb
         (let rsd : regidx := subrange_vec_dec v__956 11 7 in
         let nzui5 : bits 1 := subrange_vec_dec v__956 12 12 in
         let nzui40 : bits 5 := subrange_vec_dec v__956 6 2 in
         andb
           (orb (eq_vec (concat_vec nzui5 nzui40) ('b"000000"  : mword (1 + 5))) (eq_vec rsd zreg))
           (orb (Z.eqb 64 64) (eq_vec nzui5 ('b"0"  : mword 1))))
         (andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"000"  : mword (15 - 13 + 1)))
            (eq_vec (subrange_vec_dec v__956 1 0) ('b"10"  : mword (1 - 0 + 1))))) then
      let rsd : regidx := subrange_vec_dec v__956 11 7 in
      let nzui5 : bits 1 := subrange_vec_dec v__956 12 12 in
      let nzui40 : bits 5 := subrange_vec_dec v__956 6 2 in
      returnm (C_SLLI_HINT (concat_vec (nzui5  : bits 1) (nzui40  : bits 5), rsd))
    else if andb (eq_vec (subrange_vec_dec v__956 15 10) ('b"100000"  : mword (15 - 10 + 1)))
              (eq_vec (subrange_vec_dec v__956 6 0) ('b"0000001"  : mword (6 - 0 + 1))) then
      let rsd : cregidx := subrange_vec_dec v__956 9 7 in
      returnm (C_SRLI_HINT rsd)
    else if andb (eq_vec (subrange_vec_dec v__956 15 10) ('b"100001"  : mword (15 - 10 + 1)))
              (eq_vec (subrange_vec_dec v__956 6 0) ('b"0000001"  : mword (6 - 0 + 1))) then
      let rsd : cregidx := subrange_vec_dec v__956 9 7 in
      returnm (C_SRAI_HINT rsd)
    else
      (and_boolMP
         (((and_boolMP
              ((returnm (build_ex
                (projT1
                (build_ex
                (Z.eqb 64 32)
                 : {_bool : bool & ArithFact (Bool.eqb (64 =? 32) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
                32) _bool)}))
              (build_trivial_ex
              ((and_boolM ((haveRVC tt)  : M (bool)) ((haveFExt tt)  : M (bool)))
               : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
           (64 =? 32)) _bool = true)}))
          : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 && (64 =? 32)) _bool = true)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
           (64 =? 32)) _bool = true)}))
         (build_trivial_ex
         (returnm ((andb (eq_vec (subrange_vec_dec v__956 15 13) ('b"011"  : mword (15 - 13 + 1)))
                      (eq_vec (subrange_vec_dec v__956 1 0) ('b"10"  : mword (1 - 0 + 1))))
           : bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 && (64 =? 32)) _bool = true)})) >>= fun '(existT _ w__4 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
        (64 =? 32)) _bool = true)}) =>
      (if sumbool_of_bool w__4 then
         let ui76 : bits 2 := subrange_vec_dec v__956 3 2 in
         let ui5 : bits 1 := subrange_vec_dec v__956 12 12 in
         let ui42 : bits 3 := subrange_vec_dec v__956 6 4 in
         let rd : regidx := subrange_vec_dec v__956 11 7 in
         returnm (C_FLWSP
                    (concat_vec (ui76  : bits 2) (concat_vec (ui5  : bits 1) (ui42  : bits 3)), rd))
       else
         (and_boolMP
            (((and_boolMP
                 ((returnm (build_ex
                   (projT1
                   (build_ex
                   (Z.eqb 64 32)
                    : {_bool : bool & ArithFact (Bool.eqb (64 =? 32) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
                   32) _bool)}))
                 (build_trivial_ex
                 ((and_boolM ((haveRVC tt)  : M (bool)) ((haveFExt tt)  : M (bool)))
                  : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
              (64 =? 32)) _bool = true)}))
             : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 && (64 =? 32)) _bool = true)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
              (64 =? 32)) _bool = true)}))
            (build_trivial_ex
            (returnm ((andb
                         (eq_vec (subrange_vec_dec v__956 15 13) ('b"111"  : mword (15 - 13 + 1)))
                         (eq_vec (subrange_vec_dec v__956 1 0) ('b"10"  : mword (1 - 0 + 1))))
              : bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
           (64 =? 32)) _bool = true)})) >>= fun '(existT _ w__9 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
           (64 =? 32)) _bool = true)}) =>
         (if sumbool_of_bool w__9 then
            let ui76 : bits 2 := subrange_vec_dec v__956 8 7 in
            let ui52 : bits 4 := subrange_vec_dec v__956 12 9 in
            let rs2 : regidx := subrange_vec_dec v__956 6 2 in
            returnm (C_FSWSP (concat_vec (ui76  : bits 2) (ui52  : bits 4), rs2))
          else
            (and_boolMP
               (((and_boolMP
                    ((returnm (build_ex
                      (projT1
                      (build_ex
                      (Z.eqb 64 32)
                       : {_bool : bool & ArithFact (Bool.eqb (64 =? 32) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
                      32) _bool)}))
                    (build_trivial_ex
                    ((and_boolM ((haveRVC tt)  : M (bool)) ((haveFExt tt)  : M (bool)))
                     : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                 (64 =? 32)) _bool = true)}))
                : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 && (64 =? 32)) _bool = true)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                 (64 =? 32)) _bool = true)}))
               (build_trivial_ex
               (returnm ((andb
                            (eq_vec (subrange_vec_dec v__956 15 13) ('b"011"  : mword (15 - 13 + 1)))
                            (eq_vec (subrange_vec_dec v__956 1 0) ('b"00"  : mword (1 - 0 + 1))))
                 : bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
              (64 =? 32)) _bool = true)})) >>= fun '(existT _ w__14 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
              (64 =? 32)) _bool = true)}) =>
            (if sumbool_of_bool w__14 then
               let ui6 : bits 1 := subrange_vec_dec v__956 5 5 in
               let ui53 : bits 3 := subrange_vec_dec v__956 12 10 in
               let ui2 : bits 1 := subrange_vec_dec v__956 6 6 in
               let rs1 : cregidx := subrange_vec_dec v__956 9 7 in
               let rd : cregidx := subrange_vec_dec v__956 4 2 in
               returnm (C_FLW
                          (concat_vec (ui6  : bits 1) (concat_vec (ui53  : bits 3) (ui2  : bits 1)), rs1, rd))
             else
               (and_boolMP
                  (((and_boolMP
                       ((returnm (build_ex
                         (projT1
                         (build_ex
                         (Z.eqb 64 32)
                          : {_bool : bool & ArithFact (Bool.eqb (64 =? 32) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
                         32) _bool)}))
                       (build_trivial_ex
                       ((and_boolM ((haveRVC tt)  : M (bool)) ((haveFExt tt)  : M (bool)))
                        : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                    (64 =? 32)) _bool = true)}))
                   : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 && (64 =? 32)) _bool = true)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                    (64 =? 32)) _bool = true)}))
                  (build_trivial_ex
                  (returnm ((andb
                               (eq_vec (subrange_vec_dec v__956 15 13)
                                  ('b"111"
                                   : mword (15 - 13 + 1)))
                               (eq_vec (subrange_vec_dec v__956 1 0) ('b"00"  : mword (1 - 0 + 1))))
                    : bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                 (64 =? 32)) _bool = true)})) >>= fun '(existT _ w__19 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                 (64 =? 32)) _bool = true)}) =>
               (if sumbool_of_bool w__19 then
                  let ui6 : bits 1 := subrange_vec_dec v__956 5 5 in
                  let ui53 : bits 3 := subrange_vec_dec v__956 12 10 in
                  let ui2 : bits 1 := subrange_vec_dec v__956 6 6 in
                  let rs2 : cregidx := subrange_vec_dec v__956 4 2 in
                  let rs1 : cregidx := subrange_vec_dec v__956 9 7 in
                  returnm (C_FSW
                             (concat_vec (ui6  : bits 1)
                                (concat_vec (ui53  : bits 3) (ui2  : bits 1)), rs1, rs2))
                else
                  (and_boolMP
                     (((and_boolMP
                          ((returnm (build_ex
                            (projT1
                            (build_ex
                            (orb (Z.eqb 64 32) (Z.eqb 64 64))
                             : {_bool : bool & ArithFact (Bool.eqb ((64 =? 32) || (64 =? 64)) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb ((64 =?
                            32) ||
                            (64 =? 64)) _bool)}))
                          (build_trivial_ex
                          ((and_boolM ((haveRVC tt)  : M (bool)) ((haveDExt tt)  : M (bool)))
                           : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                       ((64 =? 32) || (64 =? 64))) _bool = true)}))
                      : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                       ((64 =? 32) || (64 =? 64))) _bool = true)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                       ((64 =? 32) || (64 =? 64))) _bool = true)}))
                     (build_trivial_ex
                     (returnm ((andb
                                  (eq_vec (subrange_vec_dec v__956 15 13)
                                     ('b"001"
                                      : mword (15 - 13 + 1)))
                                  (eq_vec (subrange_vec_dec v__956 1 0)
                                     ('b"10"
                                      : mword (1 - 0 + 1))))
                       : bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                    ((64 =? 32) || (64 =? 64))) _bool = true)})) >>= fun '(existT _ w__24 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                    ((64 =? 32) || (64 =? 64))) _bool = true)}) =>
                  (if sumbool_of_bool w__24 then
                     let ui86 : bits 3 := subrange_vec_dec v__956 4 2 in
                     let ui5 : bits 1 := subrange_vec_dec v__956 12 12 in
                     let ui43 : bits 2 := subrange_vec_dec v__956 6 5 in
                     let rd : regidx := subrange_vec_dec v__956 11 7 in
                     returnm (C_FLDSP
                                (concat_vec (ui86  : bits 3)
                                   (concat_vec (ui5  : bits 1) (ui43  : bits 2)), rd))
                   else
                     (and_boolMP
                        (((and_boolMP
                             ((returnm (build_ex
                               (projT1
                               (build_ex
                               (orb (Z.eqb 64 32) (Z.eqb 64 64))
                                : {_bool : bool & ArithFact (Bool.eqb ((64 =? 32) || (64 =? 64)) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb ((64 =?
                               32) ||
                               (64 =? 64)) _bool)}))
                             (build_trivial_ex
                             ((and_boolM ((haveRVC tt)  : M (bool)) ((haveDExt tt)  : M (bool)))
                              : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                          ((64 =? 32) || (64 =? 64))) _bool = true)}))
                         : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                          ((64 =? 32) || (64 =? 64))) _bool = true)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                          ((64 =? 32) || (64 =? 64))) _bool = true)}))
                        (build_trivial_ex
                        (returnm ((andb
                                     (eq_vec (subrange_vec_dec v__956 15 13)
                                        ('b"101"
                                         : mword (15 - 13 + 1)))
                                     (eq_vec (subrange_vec_dec v__956 1 0)
                                        ('b"10"
                                         : mword (1 - 0 + 1))))
                          : bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                       ((64 =? 32) || (64 =? 64))) _bool = true)})) >>= fun '(existT _ w__29 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                       ((64 =? 32) || (64 =? 64))) _bool = true)}) =>
                     (if sumbool_of_bool w__29 then
                        let ui86 : bits 3 := subrange_vec_dec v__956 9 7 in
                        let ui53 : bits 3 := subrange_vec_dec v__956 12 10 in
                        let rs2 : regidx := subrange_vec_dec v__956 6 2 in
                        returnm (C_FSDSP (concat_vec (ui86  : bits 3) (ui53  : bits 3), rs2))
                      else
                        (and_boolMP
                           (((and_boolMP
                                ((returnm (build_ex
                                  (projT1
                                  (build_ex
                                  (orb (Z.eqb 64 32) (Z.eqb 64 64))
                                   : {_bool : bool & ArithFact (Bool.eqb ((64 =? 32) || (64 =? 64)) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb ((64 =?
                                  32) ||
                                  (64 =? 64)) _bool)}))
                                (build_trivial_ex
                                ((and_boolM ((haveRVC tt)  : M (bool)) ((haveDExt tt)  : M (bool)))
                                 : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                             ((64 =? 32) || (64 =? 64))) _bool = true)}))
                            : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                             ((64 =? 32) || (64 =? 64))) _bool = true)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                             ((64 =? 32) || (64 =? 64))) _bool = true)}))
                           (build_trivial_ex
                           (returnm ((andb
                                        (eq_vec (subrange_vec_dec v__956 15 13)
                                           ('b"001"
                                            : mword (15 - 13 + 1)))
                                        (eq_vec (subrange_vec_dec v__956 1 0)
                                           ('b"00"
                                            : mword (1 - 0 + 1))))
                             : bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                          ((64 =? 32) || (64 =? 64))) _bool = true)})) >>= fun '(existT _ w__34 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                          ((64 =? 32) || (64 =? 64))) _bool = true)}) =>
                        (if sumbool_of_bool w__34 then
                           let ui76 : bits 2 := subrange_vec_dec v__956 6 5 in
                           let ui53 : bits 3 := subrange_vec_dec v__956 12 10 in
                           let rs1 : cregidx := subrange_vec_dec v__956 9 7 in
                           let rd : cregidx := subrange_vec_dec v__956 4 2 in
                           returnm (C_FLD (concat_vec (ui76  : bits 2) (ui53  : bits 3), rs1, rd))
                         else
                           (and_boolMP
                              (((and_boolMP
                                   ((returnm (build_ex
                                     (projT1
                                     (build_ex
                                     (orb (Z.eqb 64 32) (Z.eqb 64 64))
                                      : {_bool : bool & ArithFact (Bool.eqb ((64 =? 32) ||
                                       (64 =? 64)) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb ((64 =?
                                     32) ||
                                     (64 =? 64)) _bool)}))
                                   (build_trivial_ex
                                   ((and_boolM ((haveRVC tt)  : M (bool))
                                       ((haveDExt tt)
                                        : M (bool)))
                                    : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                                ((64 =? 32) || (64 =? 64))) _bool = true)}))
                               : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                                ((64 =? 32) || (64 =? 64))) _bool = true)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                                ((64 =? 32) || (64 =? 64))) _bool = true)}))
                              (build_trivial_ex
                              (returnm ((andb
                                           (eq_vec (subrange_vec_dec v__956 15 13)
                                              ('b"101"
                                               : mword (15 - 13 + 1)))
                                           (eq_vec (subrange_vec_dec v__956 1 0)
                                              ('b"00"
                                               : mword (1 - 0 + 1))))
                                : bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                             ((64 =? 32) || (64 =? 64))) _bool = true)})) >>= fun '(existT _ w__39 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                             ((64 =? 32) || (64 =? 64))) _bool = true)}) =>
                           returnm (if sumbool_of_bool w__39 then
                                      let ui76 : bits 2 := subrange_vec_dec v__956 6 5 in
                                      let ui53 : bits 3 := subrange_vec_dec v__956 12 10 in
                                      let rs2 : bits 3 := subrange_vec_dec v__956 4 2 in
                                      let rs1 : bits 3 := subrange_vec_dec v__956 9 7 in
                                      C_FSD (concat_vec (ui76  : bits 2) (ui53  : bits 3), rs1, rs2)
                                    else C_ILLEGAL v__956))
                         : M (ast))
                      : M (ast))
                   : M (ast))
                : M (ast))
             : M (ast))
          : M (ast))
       : M (ast))
    : M (ast).

Definition encdec_compressed_forwards_matches (arg_ : ast) : M (bool) :=
   (match arg_ with
    | C_NOP tt => returnm true
    | C_ADDI4SPN (rd, v__1158) =>
       returnm (if let nz96 : bits 4 := subrange_vec_dec v__1158 7 4 in
                  let nz96 : bits 4 := subrange_vec_dec v__1158 7 4 in
                  let nz54 : bits 2 := subrange_vec_dec v__1158 3 2 in
                  let nz3 : bits 1 := subrange_vec_dec v__1158 1 1 in
                  let nz2 : bits 1 := subrange_vec_dec v__1158 0 0 in
                  neq_vec (concat_vec nz96 (concat_vec nz54 (concat_vec nz3 nz2)))
                    (Ox"00"
                     : mword (4 + (2 + (1 + 1)))) then
                  true
                else false)
    | C_LW (v__1159, rs1, rd) => returnm true
    | C_LD (v__1160, rs1, rd) => returnm (if sumbool_of_bool (Z.eqb 64 64) then true else false)
    | C_SW (v__1161, rs1, rs2) => returnm true
    | C_SD (v__1162, rs1, rs2) => returnm (if sumbool_of_bool (Z.eqb 64 64) then true else false)
    | C_ADDI (v__1163, rsd) =>
       returnm (if let nzi5 : bits 1 := subrange_vec_dec v__1163 5 5 in
                  let nzi5 : bits 1 := subrange_vec_dec v__1163 5 5 in
                  let nzi40 : bits 5 := subrange_vec_dec v__1163 4 0 in
                  andb (neq_vec (concat_vec nzi5 nzi40) ('b"000000"  : mword (1 + 5)))
                    (neq_vec rsd zreg) then
                  true
                else false)
    | C_JAL v__1164 => returnm (if sumbool_of_bool (Z.eqb 64 32) then true else false)
    | C_ADDIW (v__1165, rsd) =>
       returnm (if sumbool_of_bool (andb (neq_vec rsd zreg) (Z.eqb 64 64)) then true else false)
    | C_LI (v__1166, rd) => returnm (if neq_vec rd zreg then true else false)
    | C_ADDI16SP v__1167 =>
       returnm (if let nzi9 : bits 1 := subrange_vec_dec v__1167 5 5 in
                  let nzi9 : bits 1 := subrange_vec_dec v__1167 5 5 in
                  let nzi87 : bits 2 := subrange_vec_dec v__1167 4 3 in
                  let nzi6 : bits 1 := subrange_vec_dec v__1167 2 2 in
                  let nzi5 : bits 1 := subrange_vec_dec v__1167 1 1 in
                  let nzi4 : bits 1 := subrange_vec_dec v__1167 0 0 in
                  neq_vec
                    (concat_vec nzi9 (concat_vec nzi87 (concat_vec nzi6 (concat_vec nzi5 nzi4))))
                    ('b"000000"
                     : mword (1 + (2 + (1 + (1 + 1))))) then
                  true
                else false)
    | C_LUI (v__1168, rd) =>
       returnm (if let imm17 : bits 1 := subrange_vec_dec v__1168 5 5 in
                  let imm17 : bits 1 := subrange_vec_dec v__1168 5 5 in
                  let imm1612 : bits 5 := subrange_vec_dec v__1168 4 0 in
                  andb (neq_vec rd zreg)
                    (andb (neq_vec rd sp)
                       (neq_vec (concat_vec imm17 imm1612) ('b"000000"  : mword (1 + 5)))) then
                  true
                else false)
    | C_SRLI (v__1169, rsd) =>
       returnm (if let nzui5 : bits 1 := subrange_vec_dec v__1169 5 5 in
                  let nzui5 : bits 1 := subrange_vec_dec v__1169 5 5 in
                  let nzui40 : bits 5 := subrange_vec_dec v__1169 4 0 in
                  neq_vec (concat_vec nzui5 nzui40) ('b"000000"  : mword (1 + 5)) then
                  true
                else false)
    | C_SRAI (v__1170, rsd) =>
       returnm (if let nzui5 : bits 1 := subrange_vec_dec v__1170 5 5 in
                  let nzui5 : bits 1 := subrange_vec_dec v__1170 5 5 in
                  let nzui40 : bits 5 := subrange_vec_dec v__1170 4 0 in
                  neq_vec (concat_vec nzui5 nzui40) ('b"000000"  : mword (1 + 5)) then
                  true
                else false)
    | C_ANDI (v__1171, rsd) => returnm true
    | C_SUB (rsd, rs2) => returnm true
    | C_XOR (rsd, rs2) => returnm true
    | C_OR (rsd, rs2) => returnm true
    | C_AND (rsd, rs2) => returnm true
    | C_SUBW (rsd, rs2) => returnm (if sumbool_of_bool (Z.eqb 64 64) then true else false)
    | C_ADDW (rsd, rs2) => returnm (if sumbool_of_bool (Z.eqb 64 64) then true else false)
    | C_J v__1172 => returnm true
    | C_BEQZ (v__1173, rs) => returnm true
    | C_BNEZ (v__1174, rs) => returnm true
    | C_SLLI (v__1175, rsd) =>
       returnm (if sumbool_of_bool
                  (let nzui5 : bits 1 := subrange_vec_dec v__1175 5 5 in
                  let nzui5 : bits 1 := subrange_vec_dec v__1175 5 5 in
                  let nzui40 : bits 5 := subrange_vec_dec v__1175 4 0 in
                  andb (neq_vec (concat_vec nzui5 nzui40) ('b"000000"  : mword (1 + 5)))
                    (andb (neq_vec rsd zreg) (orb (Z.eqb 64 64) (eq_vec nzui5 ('b"0"  : mword 1)))))
                then
                  true
                else false)
    | C_LWSP (v__1176, rd) => returnm (if neq_vec rd zreg then true else false)
    | C_LDSP (v__1177, rd) =>
       returnm (if sumbool_of_bool (andb (neq_vec rd zreg) (Z.eqb 64 64)) then true else false)
    | C_SWSP (v__1178, rs2) => returnm true
    | C_SDSP (v__1179, rs2) => returnm (if sumbool_of_bool (Z.eqb 64 64) then true else false)
    | C_JR rs1 => returnm (if neq_vec rs1 zreg then true else false)
    | C_JALR rs1 => returnm (if neq_vec rs1 zreg then true else false)
    | C_MV (rd, rs2) => returnm (if andb (neq_vec rd zreg) (neq_vec rs2 zreg) then true else false)
    | C_EBREAK tt => returnm true
    | C_ADD (rsd, rs2) =>
       returnm (if andb (neq_vec rsd zreg) (neq_vec rs2 zreg) then true else false)
    | C_NOP_HINT v__1180 =>
       returnm (if let im5 : bits 1 := subrange_vec_dec v__1180 5 5 in
                  let im5 : bits 1 := subrange_vec_dec v__1180 5 5 in
                  let im40 : bits 5 := subrange_vec_dec v__1180 4 0 in
                  neq_vec (concat_vec im5 im40) ('b"000000"  : mword (1 + 5)) then
                  true
                else false)
    | C_ADDI_HINT rsd => returnm (if neq_vec rsd zreg then true else false)
    | C_LI_HINT v__1181 => returnm true
    | C_LUI_HINT v__1182 =>
       returnm (if let imm17 : bits 1 := subrange_vec_dec v__1182 5 5 in
                  let imm17 : bits 1 := subrange_vec_dec v__1182 5 5 in
                  let imm1612 : bits 5 := subrange_vec_dec v__1182 4 0 in
                  neq_vec (concat_vec imm17 imm1612) ('b"000000"  : mword (1 + 5)) then
                  true
                else false)
    | C_MV_HINT rs2 => returnm (if neq_vec rs2 zreg then true else false)
    | C_ADD_HINT rs2 => returnm (if neq_vec rs2 zreg then true else false)
    | C_SLLI_HINT (v__1183, rsd) =>
       returnm (if sumbool_of_bool
                  (let nzui5 : bits 1 := subrange_vec_dec v__1183 5 5 in
                  let nzui5 : bits 1 := subrange_vec_dec v__1183 5 5 in
                  let nzui40 : bits 5 := subrange_vec_dec v__1183 4 0 in
                  andb
                    (orb (eq_vec (concat_vec nzui5 nzui40) ('b"000000"  : mword (1 + 5)))
                       (eq_vec rsd zreg)) (orb (Z.eqb 64 64) (eq_vec nzui5 ('b"0"  : mword 1))))
                then
                  true
                else false)
    | C_SRLI_HINT rsd => returnm true
    | C_SRAI_HINT rsd => returnm true
    | C_FLWSP (v__1184, rd) =>
       (and_boolMP
          ((returnm (build_ex
            (projT1
            (build_ex
            (Z.eqb 64 32)
             : {_bool : bool & ArithFact (Bool.eqb (64 =? 32) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
            32) _bool)}))
          (build_trivial_ex
          ((and_boolM ((haveRVC tt)  : M (bool)) ((haveFExt tt)  : M (bool)))
           : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         (64 =? 32)) _bool = true)})) >>= fun '(existT _ w__3 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         (64 =? 32)) _bool = true)}) =>
       returnm (if sumbool_of_bool w__3 then true else false)
    | C_FSWSP (v__1185, rs2) =>
       (and_boolMP
          ((returnm (build_ex
            (projT1
            (build_ex
            (Z.eqb 64 32)
             : {_bool : bool & ArithFact (Bool.eqb (64 =? 32) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
            32) _bool)}))
          (build_trivial_ex
          ((and_boolM ((haveRVC tt)  : M (bool)) ((haveFExt tt)  : M (bool)))
           : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         (64 =? 32)) _bool = true)})) >>= fun '(existT _ w__7 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         (64 =? 32)) _bool = true)}) =>
       returnm (if sumbool_of_bool w__7 then true else false)
    | C_FLW (v__1186, rs1, rd) =>
       (and_boolMP
          ((returnm (build_ex
            (projT1
            (build_ex
            (Z.eqb 64 32)
             : {_bool : bool & ArithFact (Bool.eqb (64 =? 32) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
            32) _bool)}))
          (build_trivial_ex
          ((and_boolM ((haveRVC tt)  : M (bool)) ((haveFExt tt)  : M (bool)))
           : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         (64 =? 32)) _bool = true)})) >>= fun '(existT _ w__11 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         (64 =? 32)) _bool = true)}) =>
       returnm (if sumbool_of_bool w__11 then true else false)
    | C_FSW (v__1187, rs1, rs2) =>
       (and_boolMP
          ((returnm (build_ex
            (projT1
            (build_ex
            (Z.eqb 64 32)
             : {_bool : bool & ArithFact (Bool.eqb (64 =? 32) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
            32) _bool)}))
          (build_trivial_ex
          ((and_boolM ((haveRVC tt)  : M (bool)) ((haveFExt tt)  : M (bool)))
           : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         (64 =? 32)) _bool = true)})) >>= fun '(existT _ w__15 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         (64 =? 32)) _bool = true)}) =>
       returnm (if sumbool_of_bool w__15 then true else false)
    | C_FLDSP (v__1188, rd) =>
       (and_boolMP
          ((returnm (build_ex
            (projT1
            (build_ex
            (orb (Z.eqb 64 32) (Z.eqb 64 64))
             : {_bool : bool & ArithFact (Bool.eqb ((64 =? 32) || (64 =? 64)) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb ((64 =?
            32) ||
            (64 =? 64)) _bool)}))
          (build_trivial_ex
          ((and_boolM ((haveRVC tt)  : M (bool)) ((haveDExt tt)  : M (bool)))
           : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         ((64 =? 32) || (64 =? 64))) _bool = true)})) >>= fun '(existT _ w__19 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         ((64 =? 32) || (64 =? 64))) _bool = true)}) =>
       returnm (if sumbool_of_bool w__19 then true else false)
    | C_FSDSP (v__1189, rs2) =>
       (and_boolMP
          ((returnm (build_ex
            (projT1
            (build_ex
            (orb (Z.eqb 64 32) (Z.eqb 64 64))
             : {_bool : bool & ArithFact (Bool.eqb ((64 =? 32) || (64 =? 64)) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb ((64 =?
            32) ||
            (64 =? 64)) _bool)}))
          (build_trivial_ex
          ((and_boolM ((haveRVC tt)  : M (bool)) ((haveDExt tt)  : M (bool)))
           : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         ((64 =? 32) || (64 =? 64))) _bool = true)})) >>= fun '(existT _ w__23 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         ((64 =? 32) || (64 =? 64))) _bool = true)}) =>
       returnm (if sumbool_of_bool w__23 then true else false)
    | C_FLD (v__1190, rs1, rd) =>
       (and_boolMP
          ((returnm (build_ex
            (projT1
            (build_ex
            (orb (Z.eqb 64 32) (Z.eqb 64 64))
             : {_bool : bool & ArithFact (Bool.eqb ((64 =? 32) || (64 =? 64)) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb ((64 =?
            32) ||
            (64 =? 64)) _bool)}))
          (build_trivial_ex
          ((and_boolM ((haveRVC tt)  : M (bool)) ((haveDExt tt)  : M (bool)))
           : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         ((64 =? 32) || (64 =? 64))) _bool = true)})) >>= fun '(existT _ w__27 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         ((64 =? 32) || (64 =? 64))) _bool = true)}) =>
       returnm (if sumbool_of_bool w__27 then true else false)
    | C_FSD (v__1191, rs1, rs2) =>
       (and_boolMP
          ((returnm (build_ex
            (projT1
            (build_ex
            (orb (Z.eqb 64 32) (Z.eqb 64 64))
             : {_bool : bool & ArithFact (Bool.eqb ((64 =? 32) || (64 =? 64)) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb ((64 =?
            32) ||
            (64 =? 64)) _bool)}))
          (build_trivial_ex
          ((and_boolM ((haveRVC tt)  : M (bool)) ((haveDExt tt)  : M (bool)))
           : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         ((64 =? 32) || (64 =? 64))) _bool = true)})) >>= fun '(existT _ w__31 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
         ((64 =? 32) || (64 =? 64))) _bool = true)}) =>
       returnm (if sumbool_of_bool w__31 then true else false)
    | C_ILLEGAL s => returnm true
    | _ => returnm false
    end)
    : M (bool).

Definition encdec_compressed_backwards_matches (arg_ : mword 16) : M (bool) :=
   let v__1192 := arg_ in
   (if eq_vec v__1192 (Ox"0001"  : mword 16) then returnm true
    else if andb
              (let nz96 : bits 4 := subrange_vec_dec v__1192 10 7 in
              let nz54 : bits 2 := subrange_vec_dec v__1192 12 11 in
              let nz3 : bits 1 := subrange_vec_dec v__1192 5 5 in
              let nz2 : bits 1 := subrange_vec_dec v__1192 6 6 in
              neq_vec (concat_vec nz96 (concat_vec nz54 (concat_vec nz3 nz2)))
                (Ox"00"
                 : mword (4 + (2 + (1 + 1)))))
              (andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"000"  : mword (15 - 13 + 1)))
                 (eq_vec (subrange_vec_dec v__1192 1 0) ('b"00"  : mword (1 - 0 + 1)))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"010"  : mword (15 - 13 + 1)))
              (eq_vec (subrange_vec_dec v__1192 1 0) ('b"00"  : mword (1 - 0 + 1))) then
      returnm true
    else if sumbool_of_bool
      (andb (Z.eqb 64 64)
         (andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"011"  : mword (15 - 13 + 1)))
            (eq_vec (subrange_vec_dec v__1192 1 0) ('b"00"  : mword (1 - 0 + 1))))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"110"  : mword (15 - 13 + 1)))
              (eq_vec (subrange_vec_dec v__1192 1 0) ('b"00"  : mword (1 - 0 + 1))) then
      returnm true
    else if sumbool_of_bool
      (andb (Z.eqb 64 64)
         (andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"111"  : mword (15 - 13 + 1)))
            (eq_vec (subrange_vec_dec v__1192 1 0) ('b"00"  : mword (1 - 0 + 1))))) then
      returnm true
    else if andb
              (let rsd : regidx := subrange_vec_dec v__1192 11 7 in
              let nzi5 : bits 1 := subrange_vec_dec v__1192 12 12 in
              let nzi40 : bits 5 := subrange_vec_dec v__1192 6 2 in
              andb (neq_vec (concat_vec nzi5 nzi40) ('b"000000"  : mword (1 + 5)))
                (neq_vec rsd zreg))
              (andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"000"  : mword (15 - 13 + 1)))
                 (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1)))) then
      returnm true
    else if sumbool_of_bool
      (andb (Z.eqb 64 32)
         (andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"001"  : mword (15 - 13 + 1)))
            (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1))))) then
      returnm true
    else if sumbool_of_bool
      (andb
         (let rsd : regidx := subrange_vec_dec v__1192 11 7 in
         andb (neq_vec rsd zreg) (Z.eqb 64 64))
         (andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"001"  : mword (15 - 13 + 1)))
            (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1))))) then
      returnm true
    else if andb
              (let rd : regidx := subrange_vec_dec v__1192 11 7 in
              neq_vec rd zreg)
              (andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"010"  : mword (15 - 13 + 1)))
                 (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1)))) then
      returnm true
    else if andb
              (let nzi9 : bits 1 := subrange_vec_dec v__1192 12 12 in
              let nzi87 : bits 2 := subrange_vec_dec v__1192 4 3 in
              let nzi6 : bits 1 := subrange_vec_dec v__1192 5 5 in
              let nzi5 : bits 1 := subrange_vec_dec v__1192 2 2 in
              let nzi4 : bits 1 := subrange_vec_dec v__1192 6 6 in
              neq_vec (concat_vec nzi9 (concat_vec nzi87 (concat_vec nzi6 (concat_vec nzi5 nzi4))))
                ('b"000000"
                 : mword (1 + (2 + (1 + (1 + 1))))))
              (andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"011"  : mword (15 - 13 + 1)))
                 (andb (eq_vec (subrange_vec_dec v__1192 11 7) ('b"00010"  : mword (11 - 7 + 1)))
                    (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1))))) then
      returnm true
    else if andb
              (let rd : regidx := subrange_vec_dec v__1192 11 7 in
              let imm17 : bits 1 := subrange_vec_dec v__1192 12 12 in
              let imm1612 : bits 5 := subrange_vec_dec v__1192 6 2 in
              andb (neq_vec rd zreg)
                (andb (neq_vec rd sp)
                   (neq_vec (concat_vec imm17 imm1612) ('b"000000"  : mword (1 + 5)))))
              (andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"011"  : mword (15 - 13 + 1)))
                 (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1)))) then
      returnm true
    else if andb
              (let nzui5 : bits 1 := subrange_vec_dec v__1192 12 12 in
              let nzui40 : bits 5 := subrange_vec_dec v__1192 6 2 in
              neq_vec (concat_vec nzui5 nzui40) ('b"000000"  : mword (1 + 5)))
              (andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"100"  : mword (15 - 13 + 1)))
                 (andb (eq_vec (subrange_vec_dec v__1192 11 10) ('b"00"  : mword (11 - 10 + 1)))
                    (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1))))) then
      returnm true
    else if andb
              (let nzui5 : bits 1 := subrange_vec_dec v__1192 12 12 in
              let nzui40 : bits 5 := subrange_vec_dec v__1192 6 2 in
              neq_vec (concat_vec nzui5 nzui40) ('b"000000"  : mword (1 + 5)))
              (andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"100"  : mword (15 - 13 + 1)))
                 (andb (eq_vec (subrange_vec_dec v__1192 11 10) ('b"01"  : mword (11 - 10 + 1)))
                    (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1))))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"100"  : mword (15 - 13 + 1)))
              (andb (eq_vec (subrange_vec_dec v__1192 11 10) ('b"10"  : mword (11 - 10 + 1)))
                 (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1)))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__1192 15 10) ('b"100011"  : mword (15 - 10 + 1)))
              (andb (eq_vec (subrange_vec_dec v__1192 6 5) ('b"00"  : mword (6 - 5 + 1)))
                 (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1)))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__1192 15 10) ('b"100011"  : mword (15 - 10 + 1)))
              (andb (eq_vec (subrange_vec_dec v__1192 6 5) ('b"01"  : mword (6 - 5 + 1)))
                 (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1)))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__1192 15 10) ('b"100011"  : mword (15 - 10 + 1)))
              (andb (eq_vec (subrange_vec_dec v__1192 6 5) ('b"10"  : mword (6 - 5 + 1)))
                 (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1)))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__1192 15 10) ('b"100011"  : mword (15 - 10 + 1)))
              (andb (eq_vec (subrange_vec_dec v__1192 6 5) ('b"11"  : mword (6 - 5 + 1)))
                 (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1)))) then
      returnm true
    else if sumbool_of_bool
      (andb (Z.eqb 64 64)
         (andb (eq_vec (subrange_vec_dec v__1192 15 10) ('b"100111"  : mword (15 - 10 + 1)))
            (andb (eq_vec (subrange_vec_dec v__1192 6 5) ('b"00"  : mword (6 - 5 + 1)))
               (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1)))))) then
      returnm true
    else if sumbool_of_bool
      (andb (Z.eqb 64 64)
         (andb (eq_vec (subrange_vec_dec v__1192 15 10) ('b"100111"  : mword (15 - 10 + 1)))
            (andb (eq_vec (subrange_vec_dec v__1192 6 5) ('b"01"  : mword (6 - 5 + 1)))
               (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1)))))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"101"  : mword (15 - 13 + 1)))
              (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"110"  : mword (15 - 13 + 1)))
              (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"111"  : mword (15 - 13 + 1)))
              (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1))) then
      returnm true
    else if sumbool_of_bool
      (andb
         (let rsd : regidx := subrange_vec_dec v__1192 11 7 in
         let nzui5 : bits 1 := subrange_vec_dec v__1192 12 12 in
         let nzui40 : bits 5 := subrange_vec_dec v__1192 6 2 in
         andb (neq_vec (concat_vec nzui5 nzui40) ('b"000000"  : mword (1 + 5)))
           (andb (neq_vec rsd zreg) (orb (Z.eqb 64 64) (eq_vec nzui5 ('b"0"  : mword 1)))))
         (andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"000"  : mword (15 - 13 + 1)))
            (eq_vec (subrange_vec_dec v__1192 1 0) ('b"10"  : mword (1 - 0 + 1))))) then
      returnm true
    else if andb
              (let rd : regidx := subrange_vec_dec v__1192 11 7 in
              neq_vec rd zreg)
              (andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"010"  : mword (15 - 13 + 1)))
                 (eq_vec (subrange_vec_dec v__1192 1 0) ('b"10"  : mword (1 - 0 + 1)))) then
      returnm true
    else if sumbool_of_bool
      (andb
         (let rd : regidx := subrange_vec_dec v__1192 11 7 in
         andb (neq_vec rd zreg) (Z.eqb 64 64))
         (andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"011"  : mword (15 - 13 + 1)))
            (eq_vec (subrange_vec_dec v__1192 1 0) ('b"10"  : mword (1 - 0 + 1))))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"110"  : mword (15 - 13 + 1)))
              (eq_vec (subrange_vec_dec v__1192 1 0) ('b"10"  : mword (1 - 0 + 1))) then
      returnm true
    else if sumbool_of_bool
      (andb (Z.eqb 64 64)
         (andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"111"  : mword (15 - 13 + 1)))
            (eq_vec (subrange_vec_dec v__1192 1 0) ('b"10"  : mword (1 - 0 + 1))))) then
      returnm true
    else if andb
              (let rs1 : regidx := subrange_vec_dec v__1192 11 7 in
              neq_vec rs1 zreg)
              (andb (eq_vec (subrange_vec_dec v__1192 15 12) (Ox"8"  : mword (15 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__1192 6 0) ('b"0000010"  : mword (6 - 0 + 1)))) then
      returnm true
    else if andb
              (let rs1 : regidx := subrange_vec_dec v__1192 11 7 in
              neq_vec rs1 zreg)
              (andb (eq_vec (subrange_vec_dec v__1192 15 12) (Ox"9"  : mword (15 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__1192 6 0) ('b"0000010"  : mword (6 - 0 + 1)))) then
      returnm true
    else if andb
              (let rs2 : regidx := subrange_vec_dec v__1192 6 2 in
              let rd : regidx := subrange_vec_dec v__1192 11 7 in
              andb (neq_vec rd zreg) (neq_vec rs2 zreg))
              (andb (eq_vec (subrange_vec_dec v__1192 15 12) (Ox"8"  : mword (15 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__1192 1 0) ('b"10"  : mword (1 - 0 + 1)))) then
      returnm true
    else if eq_vec v__1192 (Ox"9002"  : mword 16) then returnm true
    else if andb
              (let rsd : regidx := subrange_vec_dec v__1192 11 7 in
              let rs2 : regidx := subrange_vec_dec v__1192 6 2 in
              andb (neq_vec rsd zreg) (neq_vec rs2 zreg))
              (andb (eq_vec (subrange_vec_dec v__1192 15 12) (Ox"9"  : mword (15 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__1192 1 0) ('b"10"  : mword (1 - 0 + 1)))) then
      returnm true
    else if andb
              (let im5 : bits 1 := subrange_vec_dec v__1192 12 12 in
              let im40 : bits 5 := subrange_vec_dec v__1192 6 2 in
              neq_vec (concat_vec im5 im40) ('b"000000"  : mword (1 + 5)))
              (andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"000"  : mword (15 - 13 + 1)))
                 (andb (eq_vec (subrange_vec_dec v__1192 11 7) ('b"00000"  : mword (11 - 7 + 1)))
                    (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1))))) then
      returnm true
    else if andb
              (let rsd : regidx := subrange_vec_dec v__1192 11 7 in
              neq_vec rsd zreg)
              (andb (eq_vec (subrange_vec_dec v__1192 15 12) (Ox"0"  : mword (15 - 12 + 1)))
                 (eq_vec (subrange_vec_dec v__1192 6 0) ('b"0000001"  : mword (6 - 0 + 1)))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"010"  : mword (15 - 13 + 1)))
              (andb (eq_vec (subrange_vec_dec v__1192 11 7) ('b"00000"  : mword (11 - 7 + 1)))
                 (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1)))) then
      returnm true
    else if andb
              (let imm17 : bits 1 := subrange_vec_dec v__1192 12 12 in
              let imm1612 : bits 5 := subrange_vec_dec v__1192 6 2 in
              neq_vec (concat_vec imm17 imm1612) ('b"000000"  : mword (1 + 5)))
              (andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"011"  : mword (15 - 13 + 1)))
                 (andb (eq_vec (subrange_vec_dec v__1192 11 7) ('b"00000"  : mword (11 - 7 + 1)))
                    (eq_vec (subrange_vec_dec v__1192 1 0) ('b"01"  : mword (1 - 0 + 1))))) then
      returnm true
    else if andb
              (let rs2 : regidx := subrange_vec_dec v__1192 6 2 in
              neq_vec rs2 zreg)
              (andb (eq_vec (subrange_vec_dec v__1192 15 7) ('b"100000000"  : mword (15 - 7 + 1)))
                 (eq_vec (subrange_vec_dec v__1192 1 0) ('b"10"  : mword (1 - 0 + 1)))) then
      returnm true
    else if andb
              (let rs2 : regidx := subrange_vec_dec v__1192 6 2 in
              neq_vec rs2 zreg)
              (andb (eq_vec (subrange_vec_dec v__1192 15 7) ('b"100100000"  : mword (15 - 7 + 1)))
                 (eq_vec (subrange_vec_dec v__1192 1 0) ('b"10"  : mword (1 - 0 + 1)))) then
      returnm true
    else if sumbool_of_bool
      (andb
         (let rsd : regidx := subrange_vec_dec v__1192 11 7 in
         let nzui5 : bits 1 := subrange_vec_dec v__1192 12 12 in
         let nzui40 : bits 5 := subrange_vec_dec v__1192 6 2 in
         andb
           (orb (eq_vec (concat_vec nzui5 nzui40) ('b"000000"  : mword (1 + 5))) (eq_vec rsd zreg))
           (orb (Z.eqb 64 64) (eq_vec nzui5 ('b"0"  : mword 1))))
         (andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"000"  : mword (15 - 13 + 1)))
            (eq_vec (subrange_vec_dec v__1192 1 0) ('b"10"  : mword (1 - 0 + 1))))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__1192 15 10) ('b"100000"  : mword (15 - 10 + 1)))
              (eq_vec (subrange_vec_dec v__1192 6 0) ('b"0000001"  : mword (6 - 0 + 1))) then
      returnm true
    else if andb (eq_vec (subrange_vec_dec v__1192 15 10) ('b"100001"  : mword (15 - 10 + 1)))
              (eq_vec (subrange_vec_dec v__1192 6 0) ('b"0000001"  : mword (6 - 0 + 1))) then
      returnm true
    else
      (and_boolMP
         (((and_boolMP
              ((returnm (build_ex
                (projT1
                (build_ex
                (Z.eqb 64 32)
                 : {_bool : bool & ArithFact (Bool.eqb (64 =? 32) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
                32) _bool)}))
              (build_trivial_ex
              ((and_boolM ((haveRVC tt)  : M (bool)) ((haveFExt tt)  : M (bool)))
               : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
           (64 =? 32)) _bool = true)}))
          : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 && (64 =? 32)) _bool = true)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
           (64 =? 32)) _bool = true)}))
         (build_trivial_ex
         (returnm ((andb (eq_vec (subrange_vec_dec v__1192 15 13) ('b"011"  : mword (15 - 13 + 1)))
                      (eq_vec (subrange_vec_dec v__1192 1 0) ('b"10"  : mword (1 - 0 + 1))))
           : bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 && (64 =? 32)) _bool = true)})) >>= fun '(existT _ w__4 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
        (64 =? 32)) _bool = true)}) =>
      (if sumbool_of_bool w__4 then returnm true
       else
         (and_boolMP
            (((and_boolMP
                 ((returnm (build_ex
                   (projT1
                   (build_ex
                   (Z.eqb 64 32)
                    : {_bool : bool & ArithFact (Bool.eqb (64 =? 32) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
                   32) _bool)}))
                 (build_trivial_ex
                 ((and_boolM ((haveRVC tt)  : M (bool)) ((haveFExt tt)  : M (bool)))
                  : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
              (64 =? 32)) _bool = true)}))
             : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 && (64 =? 32)) _bool = true)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
              (64 =? 32)) _bool = true)}))
            (build_trivial_ex
            (returnm ((andb
                         (eq_vec (subrange_vec_dec v__1192 15 13) ('b"111"  : mword (15 - 13 + 1)))
                         (eq_vec (subrange_vec_dec v__1192 1 0) ('b"10"  : mword (1 - 0 + 1))))
              : bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
           (64 =? 32)) _bool = true)})) >>= fun '(existT _ w__9 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
           (64 =? 32)) _bool = true)}) =>
         (if sumbool_of_bool w__9 then returnm true
          else
            (and_boolMP
               (((and_boolMP
                    ((returnm (build_ex
                      (projT1
                      (build_ex
                      (Z.eqb 64 32)
                       : {_bool : bool & ArithFact (Bool.eqb (64 =? 32) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
                      32) _bool)}))
                    (build_trivial_ex
                    ((and_boolM ((haveRVC tt)  : M (bool)) ((haveFExt tt)  : M (bool)))
                     : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                 (64 =? 32)) _bool = true)}))
                : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 && (64 =? 32)) _bool = true)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                 (64 =? 32)) _bool = true)}))
               (build_trivial_ex
               (returnm ((andb
                            (eq_vec (subrange_vec_dec v__1192 15 13)
                               ('b"011"
                                : mword (15 - 13 + 1)))
                            (eq_vec (subrange_vec_dec v__1192 1 0) ('b"00"  : mword (1 - 0 + 1))))
                 : bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
              (64 =? 32)) _bool = true)})) >>= fun '(existT _ w__14 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
              (64 =? 32)) _bool = true)}) =>
            (if sumbool_of_bool w__14 then returnm true
             else
               (and_boolMP
                  (((and_boolMP
                       ((returnm (build_ex
                         (projT1
                         (build_ex
                         (Z.eqb 64 32)
                          : {_bool : bool & ArithFact (Bool.eqb (64 =? 32) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb (64 =?
                         32) _bool)}))
                       (build_trivial_ex
                       ((and_boolM ((haveRVC tt)  : M (bool)) ((haveFExt tt)  : M (bool)))
                        : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                    (64 =? 32)) _bool = true)}))
                   : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 && (64 =? 32)) _bool = true)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                    (64 =? 32)) _bool = true)}))
                  (build_trivial_ex
                  (returnm ((andb
                               (eq_vec (subrange_vec_dec v__1192 15 13)
                                  ('b"111"
                                   : mword (15 - 13 + 1)))
                               (eq_vec (subrange_vec_dec v__1192 1 0) ('b"00"  : mword (1 - 0 + 1))))
                    : bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                 (64 =? 32)) _bool = true)})) >>= fun '(existT _ w__19 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                 (64 =? 32)) _bool = true)}) =>
               (if sumbool_of_bool w__19 then returnm true
                else
                  (and_boolMP
                     (((and_boolMP
                          ((returnm (build_ex
                            (projT1
                            (build_ex
                            (orb (Z.eqb 64 32) (Z.eqb 64 64))
                             : {_bool : bool & ArithFact (Bool.eqb ((64 =? 32) || (64 =? 64)) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb ((64 =?
                            32) ||
                            (64 =? 64)) _bool)}))
                          (build_trivial_ex
                          ((and_boolM ((haveRVC tt)  : M (bool)) ((haveDExt tt)  : M (bool)))
                           : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                       ((64 =? 32) || (64 =? 64))) _bool = true)}))
                      : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                       ((64 =? 32) || (64 =? 64))) _bool = true)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                       ((64 =? 32) || (64 =? 64))) _bool = true)}))
                     (build_trivial_ex
                     (returnm ((andb
                                  (eq_vec (subrange_vec_dec v__1192 15 13)
                                     ('b"001"
                                      : mword (15 - 13 + 1)))
                                  (eq_vec (subrange_vec_dec v__1192 1 0)
                                     ('b"10"
                                      : mword (1 - 0 + 1))))
                       : bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                    ((64 =? 32) || (64 =? 64))) _bool = true)})) >>= fun '(existT _ w__24 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                    ((64 =? 32) || (64 =? 64))) _bool = true)}) =>
                  (if sumbool_of_bool w__24 then returnm true
                   else
                     (and_boolMP
                        (((and_boolMP
                             ((returnm (build_ex
                               (projT1
                               (build_ex
                               (orb (Z.eqb 64 32) (Z.eqb 64 64))
                                : {_bool : bool & ArithFact (Bool.eqb ((64 =? 32) || (64 =? 64)) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb ((64 =?
                               32) ||
                               (64 =? 64)) _bool)}))
                             (build_trivial_ex
                             ((and_boolM ((haveRVC tt)  : M (bool)) ((haveDExt tt)  : M (bool)))
                              : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                          ((64 =? 32) || (64 =? 64))) _bool = true)}))
                         : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                          ((64 =? 32) || (64 =? 64))) _bool = true)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                          ((64 =? 32) || (64 =? 64))) _bool = true)}))
                        (build_trivial_ex
                        (returnm ((andb
                                     (eq_vec (subrange_vec_dec v__1192 15 13)
                                        ('b"101"
                                         : mword (15 - 13 + 1)))
                                     (eq_vec (subrange_vec_dec v__1192 1 0)
                                        ('b"10"
                                         : mword (1 - 0 + 1))))
                          : bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                       ((64 =? 32) || (64 =? 64))) _bool = true)})) >>= fun '(existT _ w__29 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                       ((64 =? 32) || (64 =? 64))) _bool = true)}) =>
                     (if sumbool_of_bool w__29 then returnm true
                      else
                        (and_boolMP
                           (((and_boolMP
                                ((returnm (build_ex
                                  (projT1
                                  (build_ex
                                  (orb (Z.eqb 64 32) (Z.eqb 64 64))
                                   : {_bool : bool & ArithFact (Bool.eqb ((64 =? 32) || (64 =? 64)) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb ((64 =?
                                  32) ||
                                  (64 =? 64)) _bool)}))
                                (build_trivial_ex
                                ((and_boolM ((haveRVC tt)  : M (bool)) ((haveDExt tt)  : M (bool)))
                                 : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                             ((64 =? 32) || (64 =? 64))) _bool = true)}))
                            : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                             ((64 =? 32) || (64 =? 64))) _bool = true)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                             ((64 =? 32) || (64 =? 64))) _bool = true)}))
                           (build_trivial_ex
                           (returnm ((andb
                                        (eq_vec (subrange_vec_dec v__1192 15 13)
                                           ('b"001"
                                            : mword (15 - 13 + 1)))
                                        (eq_vec (subrange_vec_dec v__1192 1 0)
                                           ('b"00"
                                            : mword (1 - 0 + 1))))
                             : bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                          ((64 =? 32) || (64 =? 64))) _bool = true)})) >>= fun '(existT _ w__34 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                          ((64 =? 32) || (64 =? 64))) _bool = true)}) =>
                        (if sumbool_of_bool w__34 then returnm true
                         else
                           (and_boolMP
                              (((and_boolMP
                                   ((returnm (build_ex
                                     (projT1
                                     (build_ex
                                     (orb (Z.eqb 64 32) (Z.eqb 64 64))
                                      : {_bool : bool & ArithFact (Bool.eqb ((64 =? 32) ||
                                       (64 =? 64)) _bool)})))) : M ({_bool : bool & ArithFact (Bool.eqb ((64 =?
                                     32) ||
                                     (64 =? 64)) _bool)}))
                                   (build_trivial_ex
                                   ((and_boolM ((haveRVC tt)  : M (bool))
                                       ((haveDExt tt)
                                        : M (bool)))
                                    : M (bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                                ((64 =? 32) || (64 =? 64))) _bool = true)}))
                               : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                                ((64 =? 32) || (64 =? 64))) _bool = true)})) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                                ((64 =? 32) || (64 =? 64))) _bool = true)}))
                              (build_trivial_ex
                              (returnm ((andb
                                           (eq_vec (subrange_vec_dec v__1192 15 13)
                                              ('b"101"
                                               : mword (15 - 13 + 1)))
                                           (eq_vec (subrange_vec_dec v__1192 1 0)
                                              ('b"00"
                                               : mword (1 - 0 + 1))))
                                : bool))) : M ({_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                             ((64 =? 32) || (64 =? 64))) _bool = true)})) >>= fun '(existT _ w__39 _ : {_bool : bool & ArithFactP (exists simp_0 , Bool.eqb (simp_0 &&
                             ((64 =? 32) || (64 =? 64))) _bool = true)}) =>
                           returnm (if sumbool_of_bool w__39 then true else true))
                         : M (bool))
                      : M (bool))
                   : M (bool))
                : M (bool))
             : M (bool))
          : M (bool))
       : M (bool))
    : M (bool).

Definition execute_WFI '(tt : unit) : M (Retired) :=
   read_reg cur_privilege_ref >>= fun w__0 : Privilege =>
   (match w__0 with
    | Machine => (platform_wfi tt) >> returnm RETIRE_SUCCESS
    | Supervisor =>
       read_reg mstatus_ref >>= fun w__1 : Mstatus =>
       (if eq_vec (_get_Mstatus_TW w__1) ('b"1"  : mword 1) then
          (handle_illegal tt) >> returnm RETIRE_FAIL
        else (platform_wfi tt) >> returnm RETIRE_SUCCESS)
        : M (Retired)
    | User => (handle_illegal tt) >> returnm RETIRE_FAIL
    end)
    : M (Retired).

Definition execute_UTYPE (imm : mword 20) (rd : mword 5) (op : uop) : M (Retired) :=
   let off : xlenbits := EXTS 64 (concat_vec imm (Ox"000"  : mword 12)) in
   (match op with
    | RISCV_LUI => returnm off
    | RISCV_AUIPC => (get_arch_pc tt) >>= fun w__0 : mword 64 => returnm (add_vec w__0 off)
    end) >>= fun ret : xlenbits =>
   (wX_bits rd ret) >> returnm RETIRE_SUCCESS.

Definition execute_URET '(tt : unit) : M (Retired) :=
   (or_boolM ((haveUsrMode tt) >>= fun w__0 : bool => returnm ((negb w__0)  : bool))
      (returnm ((negb (sys_enable_next tt))  : bool))) >>= fun w__1 : bool =>
   (if sumbool_of_bool w__1 then (handle_illegal tt)  : M (unit)
    else if negb (ext_check_xret_priv User) then returnm (ext_fail_xret_priv tt)
    else
      read_reg cur_privilege_ref >>= fun w__2 : Privilege =>
      ((read_reg PC_ref)  : M (mword 64)) >>= fun w__3 : mword 64 =>
      (exception_handler w__2 (CTL_URET tt) w__3) >>= fun w__4 : mword 64 =>
      (set_next_pc w__4)
       : M (unit)) >>
   returnm RETIRE_FAIL.

Definition execute_STORE_FP (imm : mword 12) (rs2 : mword 5) (rs1 : mword 5) (width : word_width)
: M (Retired) :=
   let offset : xlenbits := EXTS 64 imm in
   let '(aq, rl, con) := (false, false, false) in
   (ext_data_get_addr rs1 offset (Write Data) width) >>= fun w__0 : Ext_DataAddr_Check unit =>
   (match w__0 with
    | Ext_DataAddr_Error e =>
       let '_ := (ext_handle_data_check_error e)  : unit in
       returnm RETIRE_FAIL
    | Ext_DataAddr_OK vaddr =>
       (if check_misaligned vaddr width then
          (handle_mem_exception vaddr (E_SAMO_Addr_Align tt)) >> returnm RETIRE_FAIL
        else
          (translateAddr vaddr (Write Data)) >>= fun w__1 : TR_Result (mword 64) ExceptionType =>
          (match w__1 with
           | TR_Failure (e, _) => (handle_mem_exception vaddr e) >> returnm RETIRE_FAIL
           | TR_Address (addr, _) =>
              (match width with
               | BYTE => returnm (MemValue tt)
               | HALF => returnm (MemValue tt)
               | WORD => (mem_write_ea addr 4 aq rl false)  : M (MemoryOpResult unit)
               | DOUBLE => (mem_write_ea addr 8 aq rl false)  : M (MemoryOpResult unit)
               end) >>= fun eares : MemoryOpResult unit =>
              (match eares with
               | MemException e => (handle_mem_exception addr e) >> returnm RETIRE_FAIL
               | MemValue _ =>
                  (rF_bits rs2) >>= fun rs2_val =>
                  (match (width, 64) with
                   | (BYTE, g__332) => (handle_illegal tt) >> returnm RETIRE_FAIL
                   | (HALF, g__333) => (handle_illegal tt) >> returnm RETIRE_FAIL
                   | (WORD, g__334) =>
                      (mem_write_value addr 4 (subrange_vec_dec rs2_val 31 0) aq rl con) >>= fun w__4 : MemoryOpResult bool =>
                      (process_fstore vaddr w__4)
                       : M (Retired)
                   | (DOUBLE, l__9) =>
                      (if sumbool_of_bool (Z.eqb l__9 64) then
                         (mem_write_value addr 8 rs2_val aq rl con) >>= fun w__6 : MemoryOpResult bool =>
                         (process_fstore vaddr w__6)
                          : M (Retired)
                       else
                         assert_exp' false "Pattern match failure at model/riscv_insts_fext.sail 401:14 - 406:15" >>= fun _ =>
                         exit tt)
                       : M (Retired)
                   end)
                   : M (Retired)
               end)
               : M (Retired)
           end)
           : M (Retired))
        : M (Retired)
    end)
    : M (Retired).

Definition execute_STORECON
(aq : bool) (rl : bool) (rs2 : mword 5) (rs1 : mword 5) (width : word_width) (rd : mword 5)
: M (Retired) :=
   (speculate_conditional tt) >>= fun w__0 : bool =>
   (if Bool.eqb w__0 false then (wX_bits rd (EXTZ 64 ('b"1"  : mword 1))) >> returnm RETIRE_SUCCESS
    else
      (haveAtomics tt) >>= fun w__1 : bool =>
      (if sumbool_of_bool w__1 then
         (ext_data_get_addr rs1 (zeros_implicit 64) (Write Data) width) >>= fun w__2 : Ext_DataAddr_Check unit =>
         (match w__2 with
          | Ext_DataAddr_Error e =>
             let '_ := (ext_handle_data_check_error e)  : unit in
             returnm RETIRE_FAIL
          | Ext_DataAddr_OK vaddr =>
             let aligned : bool :=
               match width with
               | BYTE => true
               | HALF => eq_vec (subrange_vec_dec vaddr 0 0) ('b"0"  : mword (0 - 0 + 1))
               | WORD => eq_vec (subrange_vec_dec vaddr 1 0) ('b"00"  : mword (1 - 0 + 1))
               | DOUBLE => eq_vec (subrange_vec_dec vaddr 2 0) ('b"000"  : mword (2 - 0 + 1))
               end in
             (if sumbool_of_bool (negb aligned) then
                (handle_mem_exception vaddr (E_SAMO_Addr_Align tt)) >> returnm RETIRE_FAIL
              else if Bool.eqb (match_reservation vaddr) false then
                (wX_bits rd (EXTZ 64 ('b"1"  : mword 1))) >>
                let '_ := (cancel_reservation tt)  : unit in
                returnm RETIRE_SUCCESS
              else
                (translateAddr vaddr (Write Data)) >>= fun w__3 : TR_Result (mword 64) ExceptionType =>
                (match w__3 with
                 | TR_Failure (e, _) => (handle_mem_exception vaddr e) >> returnm RETIRE_FAIL
                 | TR_Address (addr, _) =>
                    (match (width, 64) with
                     | (BYTE, g__317) =>
                        (mem_write_ea addr 1 (andb aq rl) rl true)  : M (MemoryOpResult unit)
                     | (HALF, g__318) =>
                        (mem_write_ea addr 2 (andb aq rl) rl true)  : M (MemoryOpResult unit)
                     | (WORD, g__319) =>
                        (mem_write_ea addr 4 (andb aq rl) rl true)  : M (MemoryOpResult unit)
                     | (DOUBLE, l__4) =>
                        (if sumbool_of_bool (Z.eqb l__4 64) then
                           (mem_write_ea addr 8 (andb aq rl) rl true)
                            : M (MemoryOpResult unit)
                         else
                           (internal_error "STORECON expected word or double")
                            : M (MemoryOpResult unit))
                         : M (MemoryOpResult unit)
                     end) >>= fun eares : MemoryOpResult unit =>
                    (match eares with
                     | MemException e => (handle_mem_exception addr e) >> returnm RETIRE_FAIL
                     | MemValue _ =>
                        (rX_bits rs2) >>= fun rs2_val =>
                        (match (width, 64) with
                         | (BYTE, g__314) =>
                            (mem_write_value addr 1 (subrange_vec_dec rs2_val 7 0) (andb aq rl) rl
                               true)
                             : M (MemoryOpResult bool)
                         | (HALF, g__315) =>
                            (mem_write_value addr 2 (subrange_vec_dec rs2_val 15 0) (andb aq rl) rl
                               true)
                             : M (MemoryOpResult bool)
                         | (WORD, g__316) =>
                            (mem_write_value addr 4 (subrange_vec_dec rs2_val 31 0) (andb aq rl) rl
                               true)
                             : M (MemoryOpResult bool)
                         | (DOUBLE, l__3) =>
                            (if sumbool_of_bool (Z.eqb l__3 64) then
                               (mem_write_value addr 8 rs2_val (andb aq rl) rl true)
                                : M (MemoryOpResult bool)
                             else
                               (internal_error "STORECON expected word or double")
                                : M (MemoryOpResult bool))
                             : M (MemoryOpResult bool)
                         end) >>= fun res : MemoryOpResult bool =>
                        (match res with
                         | MemValue true =>
                            (wX_bits rd (EXTZ 64 ('b"0"  : mword 1))) >>
                            let '_ := (cancel_reservation tt)  : unit in
                            returnm RETIRE_SUCCESS
                         | MemValue false =>
                            (wX_bits rd (EXTZ 64 ('b"1"  : mword 1))) >>
                            let '_ := (cancel_reservation tt)  : unit in
                            returnm RETIRE_SUCCESS
                         | MemException e => (handle_mem_exception addr e) >> returnm RETIRE_FAIL
                         end)
                         : M (Retired)
                     end)
                     : M (Retired)
                 end)
                 : M (Retired))
              : M (Retired)
          end)
          : M (Retired)
       else (handle_illegal tt) >> returnm RETIRE_FAIL)
       : M (Retired))
    : M (Retired).

Definition execute_STORE
(imm : mword 12) (rs2 : mword 5) (rs1 : mword 5) (width : word_width) (aq : bool) (rl : bool)
: M (Retired) :=
   let offset : xlenbits := EXTS 64 imm in
   (ext_data_get_addr rs1 offset (Write Data) width) >>= fun w__0 : Ext_DataAddr_Check unit =>
   (match w__0 with
    | Ext_DataAddr_Error e =>
       let '_ := (ext_handle_data_check_error e)  : unit in
       returnm RETIRE_FAIL
    | Ext_DataAddr_OK vaddr =>
       (if check_misaligned vaddr width then
          (handle_mem_exception vaddr (E_SAMO_Addr_Align tt)) >> returnm RETIRE_FAIL
        else
          (translateAddr vaddr (Write Data)) >>= fun w__1 : TR_Result (mword 64) ExceptionType =>
          (match w__1 with
           | TR_Failure (e, _) => (handle_mem_exception vaddr e) >> returnm RETIRE_FAIL
           | TR_Address (paddr, _) =>
              (match width with
               | BYTE => (mem_write_ea paddr 1 aq rl false)  : M (MemoryOpResult unit)
               | HALF => (mem_write_ea paddr 2 aq rl false)  : M (MemoryOpResult unit)
               | WORD => (mem_write_ea paddr 4 aq rl false)  : M (MemoryOpResult unit)
               | DOUBLE => (mem_write_ea paddr 8 aq rl false)  : M (MemoryOpResult unit)
               end) >>= fun eares : MemoryOpResult unit =>
              (match eares with
               | MemException e => (handle_mem_exception vaddr e) >> returnm RETIRE_FAIL
               | MemValue _ =>
                  (rX_bits rs2) >>= fun rs2_val =>
                  (match (width, 64) with
                   | (BYTE, g__306) =>
                      (mem_write_value paddr 1 (subrange_vec_dec rs2_val 7 0) aq rl false)
                       : M (MemoryOpResult bool)
                   | (HALF, g__307) =>
                      (mem_write_value paddr 2 (subrange_vec_dec rs2_val 15 0) aq rl false)
                       : M (MemoryOpResult bool)
                   | (WORD, g__308) =>
                      (mem_write_value paddr 4 (subrange_vec_dec rs2_val 31 0) aq rl false)
                       : M (MemoryOpResult bool)
                   | (DOUBLE, l__1) =>
                      (if sumbool_of_bool (Z.eqb l__1 64) then
                         (mem_write_value paddr 8 rs2_val aq rl false)
                          : M (MemoryOpResult bool)
                       else
                         assert_exp' false "Pattern match failure at model/riscv_insts_base.sail 394:47 - 399:15" >>= fun _ =>
                         exit tt)
                       : M (MemoryOpResult bool)
                   end) >>= fun res : MemoryOpResult bool =>
                  (match res with
                   | MemValue true => returnm RETIRE_SUCCESS
                   | MemValue false =>
                      (internal_error "store got false from mem_write_value")  : M (Retired)
                   | MemException e => (handle_mem_exception vaddr e) >> returnm RETIRE_FAIL
                   end)
                   : M (Retired)
               end)
               : M (Retired)
           end)
           : M (Retired))
        : M (Retired)
    end)
    : M (Retired).

Definition execute_SRET '(tt : unit) : M (Retired) :=
   read_reg cur_privilege_ref >>= fun w__0 : Privilege =>
   (match w__0 with
    | User => returnm true
    | Supervisor =>
       (or_boolM ((haveSupMode tt) >>= fun w__1 : bool => returnm ((negb w__1)  : bool))
          (read_reg mstatus_ref >>= fun w__2 : Mstatus =>
           returnm ((eq_vec (_get_Mstatus_TSR w__2) ('b"1"  : mword 1))  : bool)))
        : M (bool)
    | Machine => (haveSupMode tt) >>= fun w__4 : bool => returnm (negb w__4)
    end) >>= fun sret_illegal : bool =>
   (if sumbool_of_bool sret_illegal then (handle_illegal tt) >> returnm RETIRE_FAIL
    else if negb (ext_check_xret_priv Supervisor) then
      let '_ := (ext_fail_xret_priv tt)  : unit in
      returnm RETIRE_FAIL
    else
      read_reg cur_privilege_ref >>= fun w__5 : Privilege =>
      ((read_reg PC_ref)  : M (mword 64)) >>= fun w__6 : mword 64 =>
      (exception_handler w__5 (CTL_SRET tt) w__6) >>= fun w__7 : mword 64 =>
      (set_next_pc w__7) >> returnm RETIRE_SUCCESS)
    : M (Retired).

Definition execute_SHIFTW (shamt : mword 5) (rs1 : mword 5) (rd : mword 5) (op : sop) : M (Retired) :=
   (rX_bits rs1) >>= fun w__0 : mword 64 =>
   let rs1_val := subrange_vec_dec w__0 31 0 in
   let result : bits 32 :=
     match op with
     | RISCV_SLLI => shift_bits_left rs1_val shamt
     | RISCV_SRLI => shift_bits_right rs1_val shamt
     | RISCV_SRAI => shift_right_arith32 rs1_val shamt
     end in
   (wX_bits rd (EXTS 64 result)) >> returnm RETIRE_SUCCESS.

Definition execute_SHIFTIWOP (shamt : mword 5) (rs1 : mword 5) (rd : mword 5) (op : sopw)
: M (Retired) :=
   (rX_bits rs1) >>= fun rs1_val =>
   let result : bits 32 :=
     match op with
     | RISCV_SLLIW => shift_bits_left (subrange_vec_dec rs1_val 31 0) shamt
     | RISCV_SRLIW => shift_bits_right (subrange_vec_dec rs1_val 31 0) shamt
     | RISCV_SRAIW => shift_right_arith32 (subrange_vec_dec rs1_val 31 0) shamt
     end in
   (wX_bits rd (EXTS 64 result)) >> returnm RETIRE_SUCCESS.

Definition execute_SHIFTIOP (shamt : mword 6) (rs1 : mword 5) (rd : mword 5) (op : sop)
: M (Retired) :=
   (rX_bits rs1) >>= fun rs1_val =>
   let result : xlenbits :=
     match op with
     | RISCV_SLLI => shift_bits_left rs1_val shamt
     | RISCV_SRLI => shift_bits_right rs1_val shamt
     | RISCV_SRAI => shift_right_arith64 rs1_val shamt
     end in
   (wX_bits rd result) >> returnm RETIRE_SUCCESS.

Definition execute_SFENCE_VMA (rs1 : mword 5) (rs2 : mword 5) : M (Retired) :=
   (if eq_vec rs1 ('b"00000"  : mword 5) then returnm None
    else (rX_bits rs1) >>= fun w__0 : mword 64 => returnm (Some w__0)) >>= fun addr : option xlenbits =>
   (if eq_vec rs2 ('b"00000"  : mword 5) then returnm None
    else (rX_bits rs2) >>= fun w__1 : mword 64 => returnm (Some w__1)) >>= fun asid : option xlenbits =>
   read_reg cur_privilege_ref >>= fun w__2 : Privilege =>
   (match w__2 with
    | User => (handle_illegal tt) >> returnm RETIRE_FAIL
    | Supervisor =>
       read_reg mstatus_ref >>= fun w__3 : Mstatus =>
       read_reg mstatus_ref >>= fun w__4 : Mstatus =>
       let p__310 := (architecture (get_mstatus_SXL w__3), _get_Mstatus_TVM w__4) in
       (match p__310 with
        | (Some g__309, b__0) =>
           (if eq_vec b__0 ('b"1"  : mword 1) then (handle_illegal tt) >> returnm RETIRE_FAIL
            else if eq_vec b__0 ('b"0"  : mword 1) then
              (flush_TLB asid addr) >> returnm RETIRE_SUCCESS
            else
              (match (Some g__309, b__0) with
               | (_, _) => (internal_error "unimplemented sfence architecture")  : M (Retired)
               end)
               : M (Retired))
            : M (Retired)
        | (_, _) => (internal_error "unimplemented sfence architecture")  : M (Retired)
        end)
        : M (Retired)
    | Machine => (flush_TLB asid addr) >> returnm RETIRE_SUCCESS
    end)
    : M (Retired).

Definition execute_RTYPEW (rs2 : mword 5) (rs1 : mword 5) (rd : mword 5) (op : ropw) : M (Retired) :=
   (rX_bits rs1) >>= fun w__0 : mword 64 =>
   let rs1_val := subrange_vec_dec w__0 31 0 in
   (rX_bits rs2) >>= fun w__1 : mword 64 =>
   let rs2_val := subrange_vec_dec w__1 31 0 in
   let result : bits 32 :=
     match op with
     | RISCV_ADDW => add_vec rs1_val rs2_val
     | RISCV_SUBW => sub_vec rs1_val rs2_val
     | RISCV_SLLW => shift_bits_left rs1_val (subrange_vec_dec rs2_val 4 0)
     | RISCV_SRLW => shift_bits_right rs1_val (subrange_vec_dec rs2_val 4 0)
     | RISCV_SRAW => shift_right_arith32 rs1_val (subrange_vec_dec rs2_val 4 0)
     end in
   (wX_bits rd (EXTS 64 result)) >> returnm RETIRE_SUCCESS.

Definition execute_RTYPE (rs2 : mword 5) (rs1 : mword 5) (rd : mword 5) (op : rop) : M (Retired) :=
   (rX_bits rs1) >>= fun rs1_val =>
   (rX_bits rs2) >>= fun rs2_val =>
   let result : xlenbits :=
     match op with
     | RISCV_ADD => add_vec rs1_val rs2_val
     | RISCV_SLT => EXTZ 64 (bool_to_bits (zopz0zI_s rs1_val rs2_val))
     | RISCV_SLTU => EXTZ 64 (bool_to_bits (zopz0zI_u rs1_val rs2_val))
     | RISCV_AND => and_vec rs1_val rs2_val
     | RISCV_OR => or_vec rs1_val rs2_val
     | RISCV_XOR => xor_vec rs1_val rs2_val
     | RISCV_SLL => shift_bits_left rs1_val (subrange_vec_dec rs2_val 5 0)
     | RISCV_SRL => shift_bits_right rs1_val (subrange_vec_dec rs2_val 5 0)
     | RISCV_SUB => sub_vec rs1_val rs2_val
     | RISCV_SRA => shift_right_arith64 rs1_val (subrange_vec_dec rs2_val 5 0)
     end in
   (wX_bits rd result) >> returnm RETIRE_SUCCESS.

Definition execute_RISCV_JALR (imm : mword 12) (rs1 : mword 5) (rd : mword 5) : M (Retired) :=
   (rX_bits rs1) >>= fun w__0 : mword 64 =>
   let t : xlenbits := add_vec w__0 (EXTS 64 imm) in
   (match (ext_control_check_addr t) with
    | Ext_ControlAddr_Error e =>
       let '_ := (ext_handle_control_check_error e)  : unit in
       returnm RETIRE_FAIL
    | Ext_ControlAddr_OK addr =>
       let target := update_vec_dec addr 0 B0 in
       (and_boolM ((bit_to_bool (access_vec_dec target 1))  : M (bool))
          ((haveRVC tt) >>= fun w__2 : bool => returnm ((negb w__2)  : bool))) >>= fun w__3 : bool =>
       (if sumbool_of_bool w__3 then
          (handle_mem_exception target (E_Fetch_Addr_Align tt)) >> returnm RETIRE_FAIL
        else
          (get_next_pc tt) >>= fun w__4 : mword 64 =>
          (wX_bits rd w__4) >> (set_next_pc target) >> returnm RETIRE_SUCCESS)
        : M (Retired)
    end)
    : M (Retired).

Definition execute_RISCV_JAL (imm : mword 21) (rd : mword 5) : M (Retired) :=
   ((read_reg PC_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   let t : xlenbits := add_vec w__0 (EXTS 64 imm) in
   (match (ext_control_check_pc t) with
    | Ext_ControlAddr_Error e =>
       let '_ := (ext_handle_control_check_error e)  : unit in
       returnm RETIRE_FAIL
    | Ext_ControlAddr_OK target =>
       (and_boolM ((bit_to_bool (access_vec_dec target 1))  : M (bool))
          ((haveRVC tt) >>= fun w__2 : bool => returnm ((negb w__2)  : bool))) >>= fun w__3 : bool =>
       (if sumbool_of_bool w__3 then
          (handle_mem_exception target (E_Fetch_Addr_Align tt)) >> returnm RETIRE_FAIL
        else
          (get_next_pc tt) >>= fun w__4 : mword 64 =>
          (wX_bits rd w__4) >> (set_next_pc target) >> returnm RETIRE_SUCCESS)
        : M (Retired)
    end)
    : M (Retired).

Definition execute_REMW (rs2 : mword 5) (rs1 : mword 5) (rd : mword 5) (s : bool) : M (Retired) :=
   (haveMulDiv tt) >>= fun w__0 : bool =>
   (if sumbool_of_bool w__0 then
      (rX_bits rs1) >>= fun w__1 : mword 64 =>
      let rs1_val := subrange_vec_dec w__1 31 0 in
      (rX_bits rs2) >>= fun w__2 : mword 64 =>
      let rs2_val := subrange_vec_dec w__2 31 0 in
      let rs1_int : Z := if sumbool_of_bool s then projT1 (sint rs1_val) else projT1 (uint rs1_val) in
      let rs2_int : Z := if sumbool_of_bool s then projT1 (sint rs2_val) else projT1 (uint rs2_val) in
      let r : Z := if sumbool_of_bool (Z.eqb rs2_int 0) then rs1_int else Z.rem rs1_int rs2_int in
      (wX_bits rd (EXTS 64 (to_bits 32 r))) >> returnm RETIRE_SUCCESS
    else (handle_illegal tt) >> returnm RETIRE_FAIL)
    : M (Retired).

Definition execute_REM (rs2 : mword 5) (rs1 : mword 5) (rd : mword 5) (s : bool) : M (Retired) :=
   (haveMulDiv tt) >>= fun w__0 : bool =>
   (if sumbool_of_bool w__0 then
      (rX_bits rs1) >>= fun rs1_val =>
      (rX_bits rs2) >>= fun rs2_val =>
      let rs1_int : Z := if sumbool_of_bool s then projT1 (sint rs1_val) else projT1 (uint rs1_val) in
      let rs2_int : Z := if sumbool_of_bool s then projT1 (sint rs2_val) else projT1 (uint rs2_val) in
      let r : Z := if sumbool_of_bool (Z.eqb rs2_int 0) then rs1_int else Z.rem rs1_int rs2_int in
      (wX_bits rd (to_bits 64 r)) >> returnm RETIRE_SUCCESS
    else (handle_illegal tt) >> returnm RETIRE_FAIL)
    : M (Retired).

Definition execute_MULW (rs2 : mword 5) (rs1 : mword 5) (rd : mword 5) : M (Retired) :=
   (haveMulDiv tt) >>= fun w__0 : bool =>
   (if sumbool_of_bool w__0 then
      (rX_bits rs1) >>= fun w__1 : mword 64 =>
      let rs1_val := subrange_vec_dec w__1 31 0 in
      (rX_bits rs2) >>= fun w__2 : mword 64 =>
      let rs2_val := subrange_vec_dec w__2 31 0 in
      let rs1_int : Z := projT1 (sint rs1_val) in
      let rs2_int : Z := projT1 (sint rs2_val) in
      let result32 := subrange_vec_dec (to_bits 64 (Z.mul rs1_int rs2_int)) 31 0 in
      let result : xlenbits := EXTS 64 result32 in
      (wX_bits rd result) >> returnm RETIRE_SUCCESS
    else (handle_illegal tt) >> returnm RETIRE_FAIL)
    : M (Retired).

Definition execute_MUL
(rs2 : mword 5) (rs1 : mword 5) (rd : mword 5) (high : bool) (signed1 : bool) (signed2 : bool)
: M (Retired) :=
   (haveMulDiv tt) >>= fun w__0 : bool =>
   (if sumbool_of_bool w__0 then
      (rX_bits rs1) >>= fun rs1_val =>
      (rX_bits rs2) >>= fun rs2_val =>
      let rs1_int : Z :=
        if sumbool_of_bool signed1 then projT1 (sint rs1_val)
        else projT1 (uint rs1_val) in
      let rs2_int : Z :=
        if sumbool_of_bool signed2 then projT1 (sint rs2_val)
        else projT1 (uint rs2_val) in
      let result_wide := to_bits (Z.mul 2 64) (Z.mul rs1_int rs2_int) in
      let result :=
        if sumbool_of_bool high then subrange_vec_dec result_wide (Z.sub (Z.mul 2 64) 1) 64
        else subrange_vec_dec result_wide (Z.sub 64 1) 0 in
      (wX_bits rd result) >> returnm RETIRE_SUCCESS
    else (handle_illegal tt) >> returnm RETIRE_FAIL)
    : M (Retired).

Definition execute_MRET '(tt : unit) : M (Retired) :=
   read_reg cur_privilege_ref >>= fun w__0 : Privilege =>
   (if generic_neq w__0 Machine then (handle_illegal tt) >> returnm RETIRE_FAIL
    else if negb (ext_check_xret_priv Machine) then
      let '_ := (ext_fail_xret_priv tt)  : unit in
      returnm RETIRE_FAIL
    else
      read_reg cur_privilege_ref >>= fun w__1 : Privilege =>
      ((read_reg PC_ref)  : M (mword 64)) >>= fun w__2 : mword 64 =>
      (exception_handler w__1 (CTL_MRET tt) w__2) >>= fun w__3 : mword 64 =>
      (set_next_pc w__3) >> returnm RETIRE_SUCCESS)
    : M (Retired).

Definition execute_LOAD_FP (imm : mword 12) (rs1 : mword 5) (rd : mword 5) (width : word_width)
: M (Retired) :=
   let offset : xlenbits := EXTS 64 imm in
   (ext_data_get_addr rs1 offset (Read Data) width) >>= fun w__0 : Ext_DataAddr_Check unit =>
   (match w__0 with
    | Ext_DataAddr_Error e =>
       let '_ := (ext_handle_data_check_error e)  : unit in
       returnm RETIRE_FAIL
    | Ext_DataAddr_OK vaddr =>
       (if check_misaligned vaddr width then
          (handle_mem_exception vaddr (E_Load_Addr_Align tt)) >> returnm RETIRE_FAIL
        else
          (translateAddr vaddr (Read Data)) >>= fun w__1 : TR_Result (mword 64) ExceptionType =>
          (match w__1 with
           | TR_Failure (e, _) => (handle_mem_exception vaddr e) >> returnm RETIRE_FAIL
           | TR_Address (addr, _) =>
              let '(aq, rl, res) := (false, false, false) in
              (match (width, 64) with
               | (BYTE, g__329) => (handle_illegal tt) >> returnm RETIRE_FAIL
               | (HALF, g__330) => (handle_illegal tt) >> returnm RETIRE_FAIL
               | (WORD, g__331) =>
                  (mem_read (Read Data) addr 4 aq rl res) >>= fun w__2 : MemoryOpResult (mword (8 * 4)) =>
                  (process_fload32 rd vaddr w__2)
                   : M (Retired)
               | (DOUBLE, l__8) =>
                  (if sumbool_of_bool (Z.eqb l__8 64) then
                     (mem_read (Read Data) addr 8 aq rl res) >>= fun w__4 : MemoryOpResult (mword (8 * 8)) =>
                     (process_fload64 rd vaddr w__4)
                      : M (Retired)
                   else
                     assert_exp' false "Pattern match failure at model/riscv_insts_fext.sail 331:10 - 338:11" >>= fun _ =>
                     exit tt)
                   : M (Retired)
               end)
               : M (Retired)
           end)
           : M (Retired))
        : M (Retired)
    end)
    : M (Retired).

Definition execute_LOADRES
(aq : bool) (rl : bool) (rs1 : mword 5) (width : word_width) (rd : mword 5)
: M (Retired) :=
   (haveAtomics tt) >>= fun w__0 : bool =>
   (if sumbool_of_bool w__0 then
      (ext_data_get_addr rs1 (zeros_implicit 64) (Read Data) width) >>= fun w__1 : Ext_DataAddr_Check unit =>
      (match w__1 with
       | Ext_DataAddr_Error e =>
          let '_ := (ext_handle_data_check_error e)  : unit in
          returnm RETIRE_FAIL
       | Ext_DataAddr_OK vaddr =>
          let aligned : bool :=
            match width with
            | BYTE => true
            | HALF => eq_vec (subrange_vec_dec vaddr 0 0) ('b"0"  : mword (0 - 0 + 1))
            | WORD => eq_vec (subrange_vec_dec vaddr 1 0) ('b"00"  : mword (1 - 0 + 1))
            | DOUBLE => eq_vec (subrange_vec_dec vaddr 2 0) ('b"000"  : mword (2 - 0 + 1))
            end in
          (if sumbool_of_bool (negb aligned) then
             (handle_mem_exception vaddr (E_Load_Addr_Align tt)) >> returnm RETIRE_FAIL
           else
             (translateAddr vaddr (Read Data)) >>= fun w__2 : TR_Result (mword 64) ExceptionType =>
             (match w__2 with
              | TR_Failure (e, _) => (handle_mem_exception vaddr e) >> returnm RETIRE_FAIL
              | TR_Address (addr, _) =>
                 (match (width, 64) with
                  | (BYTE, g__311) =>
                     (mem_read (Read Data) addr 1 aq (andb aq rl) true) >>= fun w__3 : MemoryOpResult (mword (8 * 1)) =>
                     (process_loadres rd vaddr w__3 false)
                      : M (Retired)
                  | (HALF, g__312) =>
                     (mem_read (Read Data) addr 2 aq (andb aq rl) true) >>= fun w__5 : MemoryOpResult (mword (8 * 2)) =>
                     (process_loadres rd vaddr w__5 false)
                      : M (Retired)
                  | (WORD, g__313) =>
                     (mem_read (Read Data) addr 4 aq (andb aq rl) true) >>= fun w__7 : MemoryOpResult (mword (8 * 4)) =>
                     (process_loadres rd vaddr w__7 false)
                      : M (Retired)
                  | (DOUBLE, l__2) =>
                     (if sumbool_of_bool (Z.eqb l__2 64) then
                        (mem_read (Read Data) addr 8 aq (andb aq rl) true) >>= fun w__9 : MemoryOpResult (mword (8 * 8)) =>
                        (process_loadres rd vaddr w__9 false)
                         : M (Retired)
                      else (internal_error "Unexpected AMO width")  : M (Retired))
                      : M (Retired)
                  end)
                  : M (Retired)
              end)
              : M (Retired))
           : M (Retired)
       end)
       : M (Retired)
    else (handle_illegal tt) >> returnm RETIRE_FAIL)
    : M (Retired).

Definition execute_LOAD
(imm : mword 12) (rs1 : mword 5) (rd : mword 5) (is_unsigned : bool) (width : word_width)
(aq : bool) (rl : bool)
: M (Retired) :=
   let offset : xlenbits := EXTS 64 imm in
   (ext_data_get_addr rs1 offset (Read Data) width) >>= fun w__0 : Ext_DataAddr_Check unit =>
   (match w__0 with
    | Ext_DataAddr_Error e =>
       let '_ := (ext_handle_data_check_error e)  : unit in
       returnm RETIRE_FAIL
    | Ext_DataAddr_OK vaddr =>
       (if check_misaligned vaddr width then
          (handle_mem_exception vaddr (E_Load_Addr_Align tt)) >> returnm RETIRE_FAIL
        else
          (translateAddr vaddr (Read Data)) >>= fun w__1 : TR_Result (mword 64) ExceptionType =>
          (match w__1 with
           | TR_Failure (e, _) => (handle_mem_exception vaddr e) >> returnm RETIRE_FAIL
           | TR_Address (paddr, _) =>
              (match (width, 64) with
               | (BYTE, g__303) =>
                  (mem_read (Read Data) paddr 1 aq rl false) >>= fun w__2 : MemoryOpResult (mword (8 * 1)) =>
                  (process_load rd vaddr w__2 is_unsigned)
                   : M (Retired)
               | (HALF, g__304) =>
                  (mem_read (Read Data) paddr 2 aq rl false) >>= fun w__4 : MemoryOpResult (mword (8 * 2)) =>
                  (process_load rd vaddr w__4 is_unsigned)
                   : M (Retired)
               | (WORD, g__305) =>
                  (mem_read (Read Data) paddr 4 aq rl false) >>= fun w__6 : MemoryOpResult (mword (8 * 4)) =>
                  (process_load rd vaddr w__6 is_unsigned)
                   : M (Retired)
               | (DOUBLE, l__0) =>
                  (if sumbool_of_bool (Z.eqb l__0 64) then
                     (mem_read (Read Data) paddr 8 aq rl false) >>= fun w__8 : MemoryOpResult (mword (8 * 8)) =>
                     (process_load rd vaddr w__8 is_unsigned)
                      : M (Retired)
                   else
                     assert_exp' false "Pattern match failure at model/riscv_insts_base.sail 329:10 - 338:11" >>= fun _ =>
                     exit tt)
                   : M (Retired)
               end)
               : M (Retired)
           end)
           : M (Retired))
        : M (Retired)
    end)
    : M (Retired).

Definition execute_ITYPE (imm : mword 12) (rs1 : mword 5) (rd : mword 5) (op : iop) : M (Retired) :=
   (rX_bits rs1) >>= fun rs1_val =>
   let immext : xlenbits := EXTS 64 imm in
   let result : xlenbits :=
     match op with
     | RISCV_ADDI => add_vec rs1_val immext
     | RISCV_SLTI => EXTZ 64 (bool_to_bits (zopz0zI_s rs1_val immext))
     | RISCV_SLTIU => EXTZ 64 (bool_to_bits (zopz0zI_u rs1_val immext))
     | RISCV_ANDI => and_vec rs1_val immext
     | RISCV_ORI => or_vec rs1_val immext
     | RISCV_XORI => xor_vec rs1_val immext
     end in
   (wX_bits rd result) >> returnm RETIRE_SUCCESS.

Definition execute_ILLEGAL (s : mword 32) : M (Retired) :=
   (handle_illegal tt) >> returnm RETIRE_FAIL.

Definition execute_F_UN_TYPE_S (arg0 : mword 5) (arg1 : mword 5) (arg2 : f_un_op_S) : M (Retired) :=
   let merge_var := (arg0, arg1, arg2) in
   (match merge_var with
    | (rs1, rd, FCLASS_S) =>
       (rF_bits rs1) >>= fun w__0 : mword 64 =>
       let rs1_val_S := nan_unbox w__0 in
       let rd_val_10b : bits 10 :=
         if f_is_neg_inf_S rs1_val_S then 'b"0000000001"  : mword 10
         else if f_is_neg_norm_S rs1_val_S then 'b"0000000010"  : mword 10
         else if f_is_neg_subnorm_S rs1_val_S then 'b"0000000100"  : mword 10
         else if f_is_neg_zero_S rs1_val_S then 'b"0000001000"  : mword 10
         else if f_is_pos_zero_S rs1_val_S then 'b"0000010000"  : mword 10
         else if f_is_pos_subnorm_S rs1_val_S then 'b"0000100000"  : mword 10
         else if f_is_pos_norm_S rs1_val_S then 'b"0001000000"  : mword 10
         else if f_is_pos_inf_S rs1_val_S then 'b"0010000000"  : mword 10
         else if f_is_SNaN_S rs1_val_S then 'b"0100000000"  : mword 10
         else if f_is_QNaN_S rs1_val_S then 'b"1000000000"  : mword 10
         else zeros_implicit 10 in
       (wX_bits rd (EXTZ 64 rd_val_10b)) >> returnm RETIRE_SUCCESS
    | (rs1, rd, FMV_X_W) =>
       (rF_bits rs1) >>= fun w__1 : mword 64 =>
       let rs1_val_S := subrange_vec_dec w__1 31 0 in
       let rd_val_X : xlenbits := EXTS 64 rs1_val_S in
       (wX_bits rd rd_val_X) >> returnm RETIRE_SUCCESS
    | (rs1, rd, FMV_W_X) =>
       (rX_bits rs1) >>= fun rs1_val_X =>
       let rd_val_S := subrange_vec_dec rs1_val_X 31 0 in
       (wF_bits rd (nan_box rd_val_S)) >> returnm RETIRE_SUCCESS
    end)
    : M (Retired).

Definition execute_F_UN_TYPE_D (arg0 : mword 5) (arg1 : mword 5) (arg2 : f_un_op_D) : M (Retired) :=
   let merge_var := (arg0, arg1, arg2) in
   (match merge_var with
    | (rs1, rd, FCLASS_D) =>
       (rF_bits rs1) >>= fun rs1_val_D =>
       let rd_val_10b : bits 10 :=
         if f_is_neg_inf_D rs1_val_D then 'b"0000000001"  : mword 10
         else if f_is_neg_norm_D rs1_val_D then 'b"0000000010"  : mword 10
         else if f_is_neg_subnorm_D rs1_val_D then 'b"0000000100"  : mword 10
         else if f_is_neg_zero_D rs1_val_D then 'b"0000001000"  : mword 10
         else if f_is_pos_zero_D rs1_val_D then 'b"0000010000"  : mword 10
         else if f_is_pos_subnorm_D rs1_val_D then 'b"0000100000"  : mword 10
         else if f_is_pos_norm_D rs1_val_D then 'b"0001000000"  : mword 10
         else if f_is_pos_inf_D rs1_val_D then 'b"0010000000"  : mword 10
         else if f_is_SNaN_D rs1_val_D then 'b"0100000000"  : mword 10
         else if f_is_QNaN_D rs1_val_D then 'b"1000000000"  : mword 10
         else zeros_implicit 10 in
       (wX_bits rd (EXTZ 64 rd_val_10b)) >> returnm RETIRE_SUCCESS
    | (rs1, rd, FMV_X_D) =>
       (rF_bits rs1) >>= fun rs1_val_D =>
       let rd_val_X := rs1_val_D in
       (wX_bits rd rd_val_X) >> returnm RETIRE_SUCCESS
    | (rs1, rd, FMV_D_X) =>
       (rX_bits rs1) >>= fun rs1_val_X =>
       let rd_val_D := rs1_val_X in
       (wF_bits rd rd_val_D) >> returnm RETIRE_SUCCESS
    end)
    : M (Retired).

Definition execute_F_UN_RM_TYPE_S
(arg0 : mword 5) (arg1 : rounding_mode) (arg2 : mword 5) (arg3 : f_un_rm_op_S)
: M (Retired) :=
   let merge_var := (arg0, arg1, arg2, arg3) in
   (match merge_var with
    | (rs1, rm, rd, FSQRT_S) =>
       (rF_bits rs1) >>= fun w__0 : mword 64 =>
       let rs1_val_S := nan_unbox w__0 in
       (select_instr_or_fcsr_rm rm) >>= fun w__1 : rounding_mode =>
       let rm_3b := encdec_rounding_mode_forwards w__1 in
       (riscv_f32Sqrt rm_3b rs1_val_S) >>= fun '(fflags, rd_val_S) =>
       (write_fflags fflags) >> (wF_bits rd (nan_box rd_val_S)) >> returnm RETIRE_SUCCESS
    | (rs1, rm, rd, FCVT_W_S) =>
       (rF_bits rs1) >>= fun w__2 : mword 64 =>
       let rs1_val_S := nan_unbox w__2 in
       (select_instr_or_fcsr_rm rm) >>= fun w__3 : rounding_mode =>
       let rm_3b := encdec_rounding_mode_forwards w__3 in
       (riscv_f32ToI32 rm_3b rs1_val_S) >>= fun '(fflags, rd_val_W) =>
       (write_fflags fflags) >> (wX_bits rd (EXTS 64 rd_val_W)) >> returnm RETIRE_SUCCESS
    | (rs1, rm, rd, FCVT_WU_S) =>
       (rF_bits rs1) >>= fun w__4 : mword 64 =>
       let rs1_val_S := nan_unbox w__4 in
       (select_instr_or_fcsr_rm rm) >>= fun w__5 : rounding_mode =>
       let rm_3b := encdec_rounding_mode_forwards w__5 in
       (riscv_f32ToUi32 rm_3b rs1_val_S) >>= fun '(fflags, rd_val_WU) =>
       (write_fflags fflags) >> (wX_bits rd (EXTS 64 rd_val_WU)) >> returnm RETIRE_SUCCESS
    | (rs1, rm, rd, FCVT_S_W) =>
       (rX_bits rs1) >>= fun w__6 : mword 64 =>
       let rs1_val_W := subrange_vec_dec w__6 31 0 in
       (select_instr_or_fcsr_rm rm) >>= fun w__7 : rounding_mode =>
       let rm_3b := encdec_rounding_mode_forwards w__7 in
       (riscv_i32ToF32 rm_3b rs1_val_W) >>= fun '(fflags, rd_val_S) =>
       (write_fflags fflags) >> (wF_bits rd (nan_box rd_val_S)) >> returnm RETIRE_SUCCESS
    | (rs1, rm, rd, FCVT_S_WU) =>
       (rX_bits rs1) >>= fun w__8 : mword 64 =>
       let rs1_val_WU := subrange_vec_dec w__8 31 0 in
       (select_instr_or_fcsr_rm rm) >>= fun w__9 : rounding_mode =>
       let rm_3b := encdec_rounding_mode_forwards w__9 in
       (riscv_ui32ToF32 rm_3b rs1_val_WU) >>= fun '(fflags, rd_val_S) =>
       (write_fflags fflags) >> (wF_bits rd (nan_box rd_val_S)) >> returnm RETIRE_SUCCESS
    | (rs1, rm, rd, FCVT_L_S) =>
       (rF_bits rs1) >>= fun w__10 : mword 64 =>
       let rs1_val_S := nan_unbox w__10 in
       (select_instr_or_fcsr_rm rm) >>= fun w__11 : rounding_mode =>
       let rm_3b := encdec_rounding_mode_forwards w__11 in
       (riscv_f32ToI64 rm_3b rs1_val_S) >>= fun '(fflags, rd_val_L) =>
       (write_fflags fflags) >> (wX_bits rd rd_val_L) >> returnm RETIRE_SUCCESS
    | (rs1, rm, rd, FCVT_LU_S) =>
       (rF_bits rs1) >>= fun w__12 : mword 64 =>
       let rs1_val_S := nan_unbox w__12 in
       (select_instr_or_fcsr_rm rm) >>= fun w__13 : rounding_mode =>
       let rm_3b := encdec_rounding_mode_forwards w__13 in
       (riscv_f32ToUi64 rm_3b rs1_val_S) >>= fun '(fflags, rd_val_LU) =>
       (write_fflags fflags) >> (wX_bits rd rd_val_LU) >> returnm RETIRE_SUCCESS
    | (rs1, rm, rd, FCVT_S_L) =>
       (rX_bits rs1) >>= fun rs1_val_L =>
       (select_instr_or_fcsr_rm rm) >>= fun w__14 : rounding_mode =>
       let rm_3b := encdec_rounding_mode_forwards w__14 in
       (riscv_i64ToF32 rm_3b rs1_val_L) >>= fun '(fflags, rd_val_S) =>
       (write_fflags fflags) >> (wF_bits rd (nan_box rd_val_S)) >> returnm RETIRE_SUCCESS
    | (rs1, rm, rd, FCVT_S_LU) =>
       (rX_bits rs1) >>= fun rs1_val_LU =>
       (select_instr_or_fcsr_rm rm) >>= fun w__15 : rounding_mode =>
       let rm_3b := encdec_rounding_mode_forwards w__15 in
       (riscv_ui64ToF32 rm_3b rs1_val_LU) >>= fun '(fflags, rd_val_S) =>
       (write_fflags fflags) >> (wF_bits rd (nan_box rd_val_S)) >> returnm RETIRE_SUCCESS
    end)
    : M (Retired).

Definition execute_F_UN_RM_TYPE_D
(arg0 : mword 5) (arg1 : rounding_mode) (arg2 : mword 5) (arg3 : f_un_rm_op_D)
: M (Retired) :=
   let merge_var := (arg0, arg1, arg2, arg3) in
   (match merge_var with
    | (rs1, rm, rd, FSQRT_D) =>
       (rF_bits rs1) >>= fun rs1_val_D =>
       (select_instr_or_fcsr_rm rm) >>= fun w__0 : rounding_mode =>
       let rm_3b := encdec_rounding_mode_forwards w__0 in
       (riscv_f64Sqrt rm_3b rs1_val_D) >>= fun '(fflags, rd_val_D) =>
       (write_fflags fflags) >> (wF_bits rd rd_val_D) >> returnm RETIRE_SUCCESS
    | (rs1, rm, rd, FCVT_W_D) =>
       (rF_bits rs1) >>= fun rs1_val_D =>
       (select_instr_or_fcsr_rm rm) >>= fun w__1 : rounding_mode =>
       let rm_3b := encdec_rounding_mode_forwards w__1 in
       (riscv_f64ToI32 rm_3b rs1_val_D) >>= fun '(fflags, rd_val_W) =>
       (write_fflags fflags) >> (wX_bits rd (EXTS 64 rd_val_W)) >> returnm RETIRE_SUCCESS
    | (rs1, rm, rd, FCVT_WU_D) =>
       (rF_bits rs1) >>= fun rs1_val_D =>
       (select_instr_or_fcsr_rm rm) >>= fun w__2 : rounding_mode =>
       let rm_3b := encdec_rounding_mode_forwards w__2 in
       (riscv_f64ToUi32 rm_3b rs1_val_D) >>= fun '(fflags, rd_val_WU) =>
       (write_fflags fflags) >> (wX_bits rd (EXTS 64 rd_val_WU)) >> returnm RETIRE_SUCCESS
    | (rs1, rm, rd, FCVT_D_W) =>
       (rX_bits rs1) >>= fun w__3 : mword 64 =>
       let rs1_val_W := subrange_vec_dec w__3 31 0 in
       (select_instr_or_fcsr_rm rm) >>= fun w__4 : rounding_mode =>
       let rm_3b := encdec_rounding_mode_forwards w__4 in
       (riscv_i32ToF64 rm_3b rs1_val_W) >>= fun '(fflags, rd_val_D) =>
       (write_fflags fflags) >> (wF_bits rd rd_val_D) >> returnm RETIRE_SUCCESS
    | (rs1, rm, rd, FCVT_D_WU) =>
       (rX_bits rs1) >>= fun w__5 : mword 64 =>
       let rs1_val_WU := subrange_vec_dec w__5 31 0 in
       (select_instr_or_fcsr_rm rm) >>= fun w__6 : rounding_mode =>
       let rm_3b := encdec_rounding_mode_forwards w__6 in
       (riscv_ui32ToF64 rm_3b rs1_val_WU) >>= fun '(fflags, rd_val_D) =>
       (write_fflags fflags) >> (wF_bits rd rd_val_D) >> returnm RETIRE_SUCCESS
    | (rs1, rm, rd, FCVT_S_D) =>
       (rF_bits rs1) >>= fun rs1_val_D =>
       (select_instr_or_fcsr_rm rm) >>= fun w__7 : rounding_mode =>
       let rm_3b := encdec_rounding_mode_forwards w__7 in
       (riscv_f64ToF32 rm_3b rs1_val_D) >>= fun '(fflags, rd_val_S) =>
       (write_fflags fflags) >> (wF_bits rd (nan_box rd_val_S)) >> returnm RETIRE_SUCCESS
    | (rs1, rm, rd, FCVT_D_S) =>
       (rF_bits rs1) >>= fun w__8 : mword 64 =>
       let rs1_val_S := nan_unbox w__8 in
       (select_instr_or_fcsr_rm rm) >>= fun w__9 : rounding_mode =>
       let rm_3b := encdec_rounding_mode_forwards w__9 in
       (riscv_f32ToF64 rm_3b rs1_val_S) >>= fun '(fflags, rd_val_D) =>
       (write_fflags fflags) >> (wF_bits rd rd_val_D) >> returnm RETIRE_SUCCESS
    | (rs1, rm, rd, FCVT_L_D) =>
       (rF_bits rs1) >>= fun rs1_val_D =>
       (select_instr_or_fcsr_rm rm) >>= fun w__10 : rounding_mode =>
       let rm_3b := encdec_rounding_mode_forwards w__10 in
       (riscv_f64ToI64 rm_3b rs1_val_D) >>= fun '(fflags, rd_val_L) =>
       (write_fflags fflags) >> (wX_bits rd rd_val_L) >> returnm RETIRE_SUCCESS
    | (rs1, rm, rd, FCVT_LU_D) =>
       (rF_bits rs1) >>= fun rs1_val_D =>
       (select_instr_or_fcsr_rm rm) >>= fun w__11 : rounding_mode =>
       let rm_3b := encdec_rounding_mode_forwards w__11 in
       (riscv_f64ToUi64 rm_3b rs1_val_D) >>= fun '(fflags, rd_val_LU) =>
       (write_fflags fflags) >> (wX_bits rd rd_val_LU) >> returnm RETIRE_SUCCESS
    | (rs1, rm, rd, FCVT_D_L) =>
       (rX_bits rs1) >>= fun rs1_val_L =>
       (select_instr_or_fcsr_rm rm) >>= fun w__12 : rounding_mode =>
       let rm_3b := encdec_rounding_mode_forwards w__12 in
       (riscv_i64ToF64 rm_3b rs1_val_L) >>= fun '(fflags, rd_val_D) =>
       (write_fflags fflags) >> (wF_bits rd rd_val_D) >> returnm RETIRE_SUCCESS
    | (rs1, rm, rd, FCVT_D_LU) =>
       (rX_bits rs1) >>= fun rs1_val_LU =>
       (select_instr_or_fcsr_rm rm) >>= fun w__13 : rounding_mode =>
       let rm_3b := encdec_rounding_mode_forwards w__13 in
       (riscv_ui64ToF64 rm_3b rs1_val_LU) >>= fun '(fflags, rd_val_D) =>
       (write_fflags fflags) >> (wF_bits rd rd_val_D) >> returnm RETIRE_SUCCESS
    end)
    : M (Retired).

Definition execute_F_MADD_TYPE_S
(rs3 : mword 5) (rs2 : mword 5) (rs1 : mword 5) (rm : rounding_mode) (rd : mword 5)
(op : f_madd_op_S)
: M (Retired) :=
   (rF_bits rs1) >>= fun w__0 : mword 64 =>
   let rs1_val_32b := nan_unbox w__0 in
   (rF_bits rs2) >>= fun w__1 : mword 64 =>
   let rs2_val_32b := nan_unbox w__1 in
   (rF_bits rs3) >>= fun w__2 : mword 64 =>
   let rs3_val_32b := nan_unbox w__2 in
   (select_instr_or_fcsr_rm rm) >>= fun w__3 : rounding_mode =>
   let rm_3b := encdec_rounding_mode_forwards w__3 in
   (match op with
    | FMADD_S =>
       (riscv_f32MulAdd rm_3b rs1_val_32b rs2_val_32b rs3_val_32b)  : M ((mword 5 * mword 32))
    | FMSUB_S =>
       (riscv_f32MulAdd rm_3b rs1_val_32b rs2_val_32b (negate_S rs3_val_32b))
        : M ((mword 5 * mword 32))
    | FNMSUB_S =>
       (riscv_f32MulAdd rm_3b (negate_S rs1_val_32b) rs2_val_32b rs3_val_32b)
        : M ((mword 5 * mword 32))
    | FNMADD_S =>
       (riscv_f32MulAdd rm_3b (negate_S rs1_val_32b) rs2_val_32b (negate_S rs3_val_32b))
        : M ((mword 5 * mword 32))
    end) >>= fun '((fflags, rd_val_32b)
   : (bits 5 * bits 32)) =>
   (write_fflags fflags) >> (wF_bits rd (nan_box rd_val_32b)) >> returnm RETIRE_SUCCESS.

Definition execute_F_MADD_TYPE_D
(rs3 : mword 5) (rs2 : mword 5) (rs1 : mword 5) (rm : rounding_mode) (rd : mword 5)
(op : f_madd_op_D)
: M (Retired) :=
   (rF_bits rs1) >>= fun rs1_val_64b =>
   (rF_bits rs2) >>= fun rs2_val_64b =>
   (rF_bits rs3) >>= fun rs3_val_64b =>
   (select_instr_or_fcsr_rm rm) >>= fun w__0 : rounding_mode =>
   let rm_3b := encdec_rounding_mode_forwards w__0 in
   (match op with
    | FMADD_D =>
       (riscv_f64MulAdd rm_3b rs1_val_64b rs2_val_64b rs3_val_64b)  : M ((mword 5 * mword 64))
    | FMSUB_D =>
       (riscv_f64MulAdd rm_3b rs1_val_64b rs2_val_64b (negate_D rs3_val_64b))
        : M ((mword 5 * mword 64))
    | FNMSUB_D =>
       (riscv_f64MulAdd rm_3b (negate_D rs1_val_64b) rs2_val_64b rs3_val_64b)
        : M ((mword 5 * mword 64))
    | FNMADD_D =>
       (riscv_f64MulAdd rm_3b (negate_D rs1_val_64b) rs2_val_64b (negate_D rs3_val_64b))
        : M ((mword 5 * mword 64))
    end) >>= fun '((fflags, rd_val_64b)
   : (bits 5 * bits 64)) =>
   (write_fflags fflags) >> (wF_bits rd rd_val_64b) >> returnm RETIRE_SUCCESS.

Definition execute_F_BIN_TYPE_S
(arg0 : mword 5) (arg1 : mword 5) (arg2 : mword 5) (arg3 : f_bin_op_S)
: M (Retired) :=
   let merge_var := (arg0, arg1, arg2, arg3) in
   (match merge_var with
    | (rs2, rs1, rd, FSGNJ_S) =>
       (rF_bits rs1) >>= fun w__0 : mword 64 =>
       let rs1_val_S := nan_unbox w__0 in
       (rF_bits rs2) >>= fun w__1 : mword 64 =>
       let rs2_val_S := nan_unbox w__1 in
       let '(s1, e1, m1) := fsplit_S rs1_val_S in
       let '(s2, e2, m2) := fsplit_S rs2_val_S in
       let rd_val_S := fmake_S s2 e1 m1 in
       (wF_bits rd (nan_box rd_val_S)) >> returnm RETIRE_SUCCESS
    | (rs2, rs1, rd, FSGNJN_S) =>
       (rF_bits rs1) >>= fun w__2 : mword 64 =>
       let rs1_val_S := nan_unbox w__2 in
       (rF_bits rs2) >>= fun w__3 : mword 64 =>
       let rs2_val_S := nan_unbox w__3 in
       let '(s1, e1, m1) := fsplit_S rs1_val_S in
       let '(s2, e2, m2) := fsplit_S rs2_val_S in
       let rd_val_S := fmake_S (xor_vec ('b"1"  : mword 1) s2) e1 m1 in
       (wF_bits rd (nan_box rd_val_S)) >> returnm RETIRE_SUCCESS
    | (rs2, rs1, rd, FSGNJX_S) =>
       (rF_bits rs1) >>= fun w__4 : mword 64 =>
       let rs1_val_S := nan_unbox w__4 in
       (rF_bits rs2) >>= fun w__5 : mword 64 =>
       let rs2_val_S := nan_unbox w__5 in
       let '(s1, e1, m1) := fsplit_S rs1_val_S in
       let '(s2, e2, m2) := fsplit_S rs2_val_S in
       let rd_val_S := fmake_S (xor_vec s1 s2) e1 m1 in
       (wF_bits rd (nan_box rd_val_S)) >> returnm RETIRE_SUCCESS
    | (rs2, rs1, rd, FMIN_S) =>
       (rF_bits rs1) >>= fun w__6 : mword 64 =>
       let rs1_val_S := nan_unbox w__6 in
       (rF_bits rs2) >>= fun w__7 : mword 64 =>
       let rs2_val_S := nan_unbox w__7 in
       let is_quiet := true in
       let '(rs1_lt_rs2, fflags) := fle_S rs1_val_S rs2_val_S is_quiet in
       let rd_val_S :=
         if andb (f_is_NaN_S rs1_val_S) (f_is_NaN_S rs2_val_S) then canonical_NaN_S tt
         else if f_is_NaN_S rs1_val_S then rs2_val_S
         else if f_is_NaN_S rs2_val_S then rs1_val_S
         else if andb (f_is_neg_zero_S rs1_val_S) (f_is_pos_zero_S rs2_val_S) then rs1_val_S
         else if andb (f_is_neg_zero_S rs2_val_S) (f_is_pos_zero_S rs1_val_S) then rs2_val_S
         else if sumbool_of_bool rs1_lt_rs2 then rs1_val_S
         else rs2_val_S in
       (accrue_fflags fflags) >> (wF_bits rd (nan_box rd_val_S)) >> returnm RETIRE_SUCCESS
    | (rs2, rs1, rd, FMAX_S) =>
       (rF_bits rs1) >>= fun w__8 : mword 64 =>
       let rs1_val_S := nan_unbox w__8 in
       (rF_bits rs2) >>= fun w__9 : mword 64 =>
       let rs2_val_S := nan_unbox w__9 in
       let is_quiet := true in
       let '(rs2_lt_rs1, fflags) := fle_S rs2_val_S rs1_val_S is_quiet in
       let rd_val_S :=
         if andb (f_is_NaN_S rs1_val_S) (f_is_NaN_S rs2_val_S) then canonical_NaN_S tt
         else if f_is_NaN_S rs1_val_S then rs2_val_S
         else if f_is_NaN_S rs2_val_S then rs1_val_S
         else if andb (f_is_neg_zero_S rs1_val_S) (f_is_pos_zero_S rs2_val_S) then rs2_val_S
         else if andb (f_is_neg_zero_S rs2_val_S) (f_is_pos_zero_S rs1_val_S) then rs1_val_S
         else if sumbool_of_bool rs2_lt_rs1 then rs1_val_S
         else rs2_val_S in
       (accrue_fflags fflags) >> (wF_bits rd (nan_box rd_val_S)) >> returnm RETIRE_SUCCESS
    | (rs2, rs1, rd, FEQ_S) =>
       (rF_bits rs1) >>= fun w__10 : mword 64 =>
       let rs1_val_S := nan_unbox w__10 in
       (rF_bits rs2) >>= fun w__11 : mword 64 =>
       let rs2_val_S := nan_unbox w__11 in
       (riscv_f32Eq rs1_val_S rs2_val_S) >>= fun '((fflags, rd_val)
       : (bits_fflags * bits_WU)) =>
       (write_fflags fflags) >> (wX_bits rd (EXTZ 64 rd_val)) >> returnm RETIRE_SUCCESS
    | (rs2, rs1, rd, FLT_S) =>
       (rF_bits rs1) >>= fun w__12 : mword 64 =>
       let rs1_val_S := nan_unbox w__12 in
       (rF_bits rs2) >>= fun w__13 : mword 64 =>
       let rs2_val_S := nan_unbox w__13 in
       (riscv_f32Lt rs1_val_S rs2_val_S) >>= fun '((fflags, rd_val)
       : (bits_fflags * bits_WU)) =>
       (write_fflags fflags) >> (wX_bits rd (EXTZ 64 rd_val)) >> returnm RETIRE_SUCCESS
    | (rs2, rs1, rd, FLE_S) =>
       (rF_bits rs1) >>= fun w__14 : mword 64 =>
       let rs1_val_S := nan_unbox w__14 in
       (rF_bits rs2) >>= fun w__15 : mword 64 =>
       let rs2_val_S := nan_unbox w__15 in
       (riscv_f32Le rs1_val_S rs2_val_S) >>= fun '((fflags, rd_val)
       : (bits_fflags * bits_WU)) =>
       (write_fflags fflags) >> (wX_bits rd (EXTZ 64 rd_val)) >> returnm RETIRE_SUCCESS
    end)
    : M (Retired).

Definition execute_F_BIN_TYPE_D
(arg0 : mword 5) (arg1 : mword 5) (arg2 : mword 5) (arg3 : f_bin_op_D)
: M (Retired) :=
   let merge_var := (arg0, arg1, arg2, arg3) in
   (match merge_var with
    | (rs2, rs1, rd, FSGNJ_D) =>
       (rF_bits rs1) >>= fun rs1_val_D =>
       (rF_bits rs2) >>= fun rs2_val_D =>
       let '(s1, e1, m1) := fsplit_D rs1_val_D in
       let '(s2, e2, m2) := fsplit_D rs2_val_D in
       let rd_val_D := fmake_D s2 e1 m1 in
       (wF_bits rd rd_val_D) >> returnm RETIRE_SUCCESS
    | (rs2, rs1, rd, FSGNJN_D) =>
       (rF_bits rs1) >>= fun rs1_val_D =>
       (rF_bits rs2) >>= fun rs2_val_D =>
       let '(s1, e1, m1) := fsplit_D rs1_val_D in
       let '(s2, e2, m2) := fsplit_D rs2_val_D in
       let rd_val_D := fmake_D (xor_vec ('b"1"  : mword 1) s2) e1 m1 in
       (wF_bits rd rd_val_D) >> returnm RETIRE_SUCCESS
    | (rs2, rs1, rd, FSGNJX_D) =>
       (rF_bits rs1) >>= fun rs1_val_D =>
       (rF_bits rs2) >>= fun rs2_val_D =>
       let '(s1, e1, m1) := fsplit_D rs1_val_D in
       let '(s2, e2, m2) := fsplit_D rs2_val_D in
       let rd_val_D := fmake_D (xor_vec s1 s2) e1 m1 in
       (wF_bits rd rd_val_D) >> returnm RETIRE_SUCCESS
    | (rs2, rs1, rd, FMIN_D) =>
       (rF_bits rs1) >>= fun rs1_val_D =>
       (rF_bits rs2) >>= fun rs2_val_D =>
       let is_quiet := true in
       let '(rs1_lt_rs2, fflags) := fle_D rs1_val_D rs2_val_D is_quiet in
       let rd_val_D :=
         if andb (f_is_NaN_D rs1_val_D) (f_is_NaN_D rs2_val_D) then canonical_NaN_D tt
         else if f_is_NaN_D rs1_val_D then rs2_val_D
         else if f_is_NaN_D rs2_val_D then rs1_val_D
         else if andb (f_is_neg_zero_D rs1_val_D) (f_is_pos_zero_D rs2_val_D) then rs1_val_D
         else if andb (f_is_neg_zero_D rs2_val_D) (f_is_pos_zero_D rs1_val_D) then rs2_val_D
         else if sumbool_of_bool rs1_lt_rs2 then rs1_val_D
         else rs2_val_D in
       (accrue_fflags fflags) >> (wF_bits rd rd_val_D) >> returnm RETIRE_SUCCESS
    | (rs2, rs1, rd, FMAX_D) =>
       (rF_bits rs1) >>= fun rs1_val_D =>
       (rF_bits rs2) >>= fun rs2_val_D =>
       let is_quiet := true in
       let '(rs2_lt_rs1, fflags) := fle_D rs2_val_D rs1_val_D is_quiet in
       let rd_val_D :=
         if andb (f_is_NaN_D rs1_val_D) (f_is_NaN_D rs2_val_D) then canonical_NaN_D tt
         else if f_is_NaN_D rs1_val_D then rs2_val_D
         else if f_is_NaN_D rs2_val_D then rs1_val_D
         else if andb (f_is_neg_zero_D rs1_val_D) (f_is_pos_zero_D rs2_val_D) then rs2_val_D
         else if andb (f_is_neg_zero_D rs2_val_D) (f_is_pos_zero_D rs1_val_D) then rs1_val_D
         else if sumbool_of_bool rs2_lt_rs1 then rs1_val_D
         else rs2_val_D in
       (accrue_fflags fflags) >> (wF_bits rd rd_val_D) >> returnm RETIRE_SUCCESS
    | (rs2, rs1, rd, FEQ_D) =>
       (rF_bits rs1) >>= fun rs1_val_D =>
       (rF_bits rs2) >>= fun rs2_val_D =>
       (riscv_f64Eq rs1_val_D rs2_val_D) >>= fun '((fflags, rd_val)
       : (bits_fflags * bits_LU)) =>
       (write_fflags fflags) >> (wX_bits rd rd_val) >> returnm RETIRE_SUCCESS
    | (rs2, rs1, rd, FLT_D) =>
       (rF_bits rs1) >>= fun rs1_val_D =>
       (rF_bits rs2) >>= fun rs2_val_D =>
       (riscv_f64Lt rs1_val_D rs2_val_D) >>= fun '((fflags, rd_val)
       : (bits_fflags * bits_LU)) =>
       (write_fflags fflags) >> (wX_bits rd rd_val) >> returnm RETIRE_SUCCESS
    | (rs2, rs1, rd, FLE_D) =>
       (rF_bits rs1) >>= fun rs1_val_D =>
       (rF_bits rs2) >>= fun rs2_val_D =>
       (riscv_f64Le rs1_val_D rs2_val_D) >>= fun '((fflags, rd_val)
       : (bits_fflags * bits_LU)) =>
       (write_fflags fflags) >> (wX_bits rd rd_val) >> returnm RETIRE_SUCCESS
    end)
    : M (Retired).

Definition execute_F_BIN_RM_TYPE_S
(rs2 : mword 5) (rs1 : mword 5) (rm : rounding_mode) (rd : mword 5) (op : f_bin_rm_op_S)
: M (Retired) :=
   (rF_bits rs1) >>= fun w__0 : mword 64 =>
   let rs1_val_32b := nan_unbox w__0 in
   (rF_bits rs2) >>= fun w__1 : mword 64 =>
   let rs2_val_32b := nan_unbox w__1 in
   (select_instr_or_fcsr_rm rm) >>= fun w__2 : rounding_mode =>
   let rm_3b := encdec_rounding_mode_forwards w__2 in
   (match op with
    | FADD_S => (riscv_f32Add rm_3b rs1_val_32b rs2_val_32b)  : M ((mword 5 * mword 32))
    | FSUB_S => (riscv_f32Sub rm_3b rs1_val_32b rs2_val_32b)  : M ((mword 5 * mword 32))
    | FMUL_S => (riscv_f32Mul rm_3b rs1_val_32b rs2_val_32b)  : M ((mword 5 * mword 32))
    | FDIV_S => (riscv_f32Div rm_3b rs1_val_32b rs2_val_32b)  : M ((mword 5 * mword 32))
    end) >>= fun '((fflags, rd_val_32b)
   : (bits 5 * bits 32)) =>
   (write_fflags fflags) >> (wF_bits rd (nan_box rd_val_32b)) >> returnm RETIRE_SUCCESS.

Definition execute_F_BIN_RM_TYPE_D
(rs2 : mword 5) (rs1 : mword 5) (rm : rounding_mode) (rd : mword 5) (op : f_bin_rm_op_D)
: M (Retired) :=
   (rF_bits rs1) >>= fun rs1_val_64b =>
   (rF_bits rs2) >>= fun rs2_val_64b =>
   (select_instr_or_fcsr_rm rm) >>= fun w__0 : rounding_mode =>
   let rm_3b := encdec_rounding_mode_forwards w__0 in
   (match op with
    | FADD_D => (riscv_f64Add rm_3b rs1_val_64b rs2_val_64b)  : M ((mword 5 * mword 64))
    | FSUB_D => (riscv_f64Sub rm_3b rs1_val_64b rs2_val_64b)  : M ((mword 5 * mword 64))
    | FMUL_D => (riscv_f64Mul rm_3b rs1_val_64b rs2_val_64b)  : M ((mword 5 * mword 64))
    | FDIV_D => (riscv_f64Div rm_3b rs1_val_64b rs2_val_64b)  : M ((mword 5 * mword 64))
    end) >>= fun '((fflags, rd_val_64b)
   : (bits 5 * bits 64)) =>
   (write_fflags fflags) >> (wF_bits rd rd_val_64b) >> returnm RETIRE_SUCCESS.

Definition execute_FENCE_TSO (pred : mword 4) (succ : mword 4) : M (Retired) :=
   (match (pred, succ) with
    | (v__1434, v__1435) =>
       (if andb (eq_vec (subrange_vec_dec v__1434 1 0) ('b"11"  : mword (1 - 0 + 1)))
             (eq_vec (subrange_vec_dec v__1435 1 0) ('b"11"  : mword (1 - 0 + 1))) then
          (barrier (Barrier_RISCV_tso tt))
           : M (unit)
        else
          returnm (if andb (eq_vec (subrange_vec_dec v__1434 1 0) ('b"00"  : mword (1 - 0 + 1)))
                        (eq_vec (subrange_vec_dec v__1435 1 0) ('b"00"  : mword (1 - 0 + 1))) then
                     tt
                   else
                     let '_ := (print_endline "FIXME: unsupported fence")  : unit in
                     tt))
        : M (unit)
    end) >>
   returnm RETIRE_SUCCESS.

Definition execute_FENCE_RESERVED
(fm : mword 4) (pred : mword 4) (succ : mword 4) (rs : mword 5) (rd : mword 5)
: Retired :=
   RETIRE_SUCCESS.

Definition execute_FENCEI_RESERVED (imm : mword 12) (rs : mword 5) (rd : mword 5) : Retired :=
   RETIRE_SUCCESS.

Definition execute_FENCEI '(tt : unit) : Retired := RETIRE_SUCCESS.

Definition execute_FENCE (pred : mword 4) (succ : mword 4) : M (Retired) :=
   (match (pred, succ) with
    | (v__1394, v__1395) =>
       (if andb (eq_vec (subrange_vec_dec v__1394 1 0) ('b"11"  : mword (1 - 0 + 1)))
             (eq_vec (subrange_vec_dec v__1395 1 0) ('b"11"  : mword (1 - 0 + 1))) then
          (barrier (Barrier_RISCV_rw_rw tt))
           : M (unit)
        else if andb (eq_vec (subrange_vec_dec v__1394 1 0) ('b"10"  : mword (1 - 0 + 1)))
                  (eq_vec (subrange_vec_dec v__1395 1 0) ('b"11"  : mword (1 - 0 + 1))) then
          (barrier (Barrier_RISCV_r_rw tt))
           : M (unit)
        else if andb (eq_vec (subrange_vec_dec v__1394 1 0) ('b"10"  : mword (1 - 0 + 1)))
                  (eq_vec (subrange_vec_dec v__1395 1 0) ('b"10"  : mword (1 - 0 + 1))) then
          (barrier (Barrier_RISCV_r_r tt))
           : M (unit)
        else if andb (eq_vec (subrange_vec_dec v__1394 1 0) ('b"11"  : mword (1 - 0 + 1)))
                  (eq_vec (subrange_vec_dec v__1395 1 0) ('b"01"  : mword (1 - 0 + 1))) then
          (barrier (Barrier_RISCV_rw_w tt))
           : M (unit)
        else if andb (eq_vec (subrange_vec_dec v__1394 1 0) ('b"01"  : mword (1 - 0 + 1)))
                  (eq_vec (subrange_vec_dec v__1395 1 0) ('b"01"  : mword (1 - 0 + 1))) then
          (barrier (Barrier_RISCV_w_w tt))
           : M (unit)
        else if andb (eq_vec (subrange_vec_dec v__1394 1 0) ('b"01"  : mword (1 - 0 + 1)))
                  (eq_vec (subrange_vec_dec v__1395 1 0) ('b"11"  : mword (1 - 0 + 1))) then
          (barrier (Barrier_RISCV_w_rw tt))
           : M (unit)
        else if andb (eq_vec (subrange_vec_dec v__1394 1 0) ('b"11"  : mword (1 - 0 + 1)))
                  (eq_vec (subrange_vec_dec v__1395 1 0) ('b"10"  : mword (1 - 0 + 1))) then
          (barrier (Barrier_RISCV_rw_r tt))
           : M (unit)
        else if andb (eq_vec (subrange_vec_dec v__1394 1 0) ('b"10"  : mword (1 - 0 + 1)))
                  (eq_vec (subrange_vec_dec v__1395 1 0) ('b"01"  : mword (1 - 0 + 1))) then
          (barrier (Barrier_RISCV_r_w tt))
           : M (unit)
        else if andb (eq_vec (subrange_vec_dec v__1394 1 0) ('b"01"  : mword (1 - 0 + 1)))
                  (eq_vec (subrange_vec_dec v__1395 1 0) ('b"10"  : mword (1 - 0 + 1))) then
          (barrier (Barrier_RISCV_w_r tt))
           : M (unit)
        else
          returnm (if eq_vec (subrange_vec_dec v__1395 1 0) ('b"00"  : mword (1 - 0 + 1)) then tt
                   else if eq_vec (subrange_vec_dec v__1394 1 0) ('b"00"  : mword (1 - 0 + 1)) then
                     tt
                   else
                     let '_ := (print_endline "FIXME: unsupported fence")  : unit in
                     tt))
        : M (unit)
    end) >>
   returnm RETIRE_SUCCESS.

Definition execute_ECALL '(tt : unit) : M (Retired) :=
   read_reg cur_privilege_ref >>= fun w__0 : Privilege =>
   let t : sync_exception :=
     {| sync_exception_trap :=
          (match w__0 with
           | User => E_U_EnvCall tt
           | Supervisor => E_S_EnvCall tt
           | Machine => E_M_EnvCall tt
           end); 
        sync_exception_excinfo := (None  : option xlenbits); 
        sync_exception_ext := None |} in
   read_reg cur_privilege_ref >>= fun w__1 : Privilege =>
   ((read_reg PC_ref)  : M (mword 64)) >>= fun w__2 : mword 64 =>
   (exception_handler w__1 (CTL_TRAP t) w__2) >>= fun w__3 : mword 64 =>
   (set_next_pc w__3) >> returnm RETIRE_FAIL.

Definition execute_EBREAK '(tt : unit) : M (Retired) :=
   ((read_reg PC_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   (handle_mem_exception w__0 (E_Breakpoint tt)) >> returnm RETIRE_FAIL.

Definition execute_DIVW (rs2 : mword 5) (rs1 : mword 5) (rd : mword 5) (s : bool) : M (Retired) :=
   (haveMulDiv tt) >>= fun w__0 : bool =>
   (if sumbool_of_bool w__0 then
      (rX_bits rs1) >>= fun w__1 : mword 64 =>
      let rs1_val := subrange_vec_dec w__1 31 0 in
      (rX_bits rs2) >>= fun w__2 : mword 64 =>
      let rs2_val := subrange_vec_dec w__2 31 0 in
      let rs1_int : Z := if sumbool_of_bool s then projT1 (sint rs1_val) else projT1 (uint rs1_val) in
      let rs2_int : Z := if sumbool_of_bool s then projT1 (sint rs2_val) else projT1 (uint rs2_val) in
      let q : Z := if sumbool_of_bool (Z.eqb rs2_int 0) then (-1) else Z.quot rs1_int rs2_int in
      let q' : Z :=
        if sumbool_of_bool (andb s (Z.gtb q (Z.sub (projT1 (pow2 31)) 1))) then Z.sub 0 (pow 2 31)
        else q in
      (wX_bits rd (EXTS 64 (to_bits 32 q'))) >> returnm RETIRE_SUCCESS
    else (handle_illegal tt) >> returnm RETIRE_FAIL)
    : M (Retired).

Definition execute_DIV (rs2 : mword 5) (rs1 : mword 5) (rd : mword 5) (s : bool) : M (Retired) :=
   (haveMulDiv tt) >>= fun w__0 : bool =>
   (if sumbool_of_bool w__0 then
      (rX_bits rs1) >>= fun rs1_val =>
      (rX_bits rs2) >>= fun rs2_val =>
      let rs1_int : Z := if sumbool_of_bool s then projT1 (sint rs1_val) else projT1 (uint rs1_val) in
      let rs2_int : Z := if sumbool_of_bool s then projT1 (sint rs2_val) else projT1 (uint rs2_val) in
      let q : Z := if sumbool_of_bool (Z.eqb rs2_int 0) then (-1) else Z.quot rs1_int rs2_int in
      let q' : Z :=
        if sumbool_of_bool (andb s (Z.gtb q xlen_max_signed)) then xlen_min_signed
        else q in
      (wX_bits rd (to_bits 64 q')) >> returnm RETIRE_SUCCESS
    else (handle_illegal tt) >> returnm RETIRE_FAIL)
    : M (Retired).

Definition execute_C_SRLI_HINT (rsd : mword 3) : Retired := RETIRE_SUCCESS.

Definition execute_C_SRAI_HINT (rsd : mword 3) : Retired := RETIRE_SUCCESS.

Definition execute_C_SLLI_HINT (shamt : mword 6) (rsd : mword 5) : Retired := RETIRE_SUCCESS.

Definition execute_C_NOP_HINT (imm : mword 6) : Retired := RETIRE_SUCCESS.

Definition execute_C_NOP '(tt : unit) : Retired := RETIRE_SUCCESS.

Definition execute_C_MV_HINT (rs2 : mword 5) : Retired := RETIRE_SUCCESS.

Definition execute_C_LUI_HINT (imm : mword 6) : Retired := RETIRE_SUCCESS.

Definition execute_C_LI_HINT (imm : mword 6) : Retired := RETIRE_SUCCESS.

Definition execute_C_ILLEGAL (s : mword 16) : M (Retired) :=
   (handle_illegal tt) >> returnm RETIRE_FAIL.

Definition execute_C_ADD_HINT (rs2 : mword 5) : Retired := RETIRE_SUCCESS.

Definition execute_C_ADDI_HINT (rsd : mword 5) : Retired := RETIRE_SUCCESS.

Definition execute_CSR (csr : mword 12) (rs1 : mword 5) (rd : mword 5) (is_imm : bool) (op : csrop)
: M (Retired) :=
   (if sumbool_of_bool is_imm then returnm (EXTZ 64 rs1)
    else (rX_bits rs1)  : M (mword 64)) >>= fun rs1_val : xlenbits =>
   let isWrite : bool :=
     match op with
     | CSRRW => true
     | _ =>
        if sumbool_of_bool is_imm then projT1 (neq_int (projT1 (uint rs1_val)) 0)
        else projT1 (neq_int (projT1 (uint rs1)) 0)
     end in
   read_reg cur_privilege_ref >>= fun w__1 : Privilege =>
   (check_CSR csr w__1 isWrite) >>= fun w__2 : bool =>
   (if sumbool_of_bool (negb w__2) then (handle_illegal tt) >> returnm RETIRE_FAIL
    else
      read_reg cur_privilege_ref >>= fun w__3 : Privilege =>
      (if negb (ext_check_CSR csr w__3 isWrite) then
         let '_ := (ext_check_CSR_fail tt)  : unit in
         returnm RETIRE_FAIL
       else
         (readCSR csr) >>= fun csr_val =>
         (if sumbool_of_bool isWrite then
            let new_val : xlenbits :=
              match op with
              | CSRRW => rs1_val
              | CSRRS => or_vec csr_val rs1_val
              | CSRRC => and_vec csr_val (not_vec rs1_val)
              end in
            (writeCSR csr new_val)
             : M (unit)
          else returnm tt) >>
         (wX_bits rd csr_val) >> returnm RETIRE_SUCCESS)
       : M (Retired))
    : M (Retired).

Definition execute_BTYPE (imm : mword 13) (rs2 : mword 5) (rs1 : mword 5) (op : bop) : M (Retired) :=
   (rX_bits rs1) >>= fun rs1_val =>
   (rX_bits rs2) >>= fun rs2_val =>
   let taken : bool :=
     match op with
     | RISCV_BEQ => eq_vec rs1_val rs2_val
     | RISCV_BNE => neq_vec rs1_val rs2_val
     | RISCV_BLT => zopz0zI_s rs1_val rs2_val
     | RISCV_BGE => zopz0zKzJ_s rs1_val rs2_val
     | RISCV_BLTU => zopz0zI_u rs1_val rs2_val
     | RISCV_BGEU => zopz0zKzJ_u rs1_val rs2_val
     end in
   ((read_reg PC_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
   let t : xlenbits := add_vec w__0 (EXTS 64 imm) in
   (if sumbool_of_bool taken then
      (match (ext_control_check_pc t) with
       | Ext_ControlAddr_Error e =>
          let '_ := (ext_handle_control_check_error e)  : unit in
          returnm RETIRE_FAIL
       | Ext_ControlAddr_OK target =>
          (and_boolM ((bit_to_bool (access_vec_dec target 1))  : M (bool))
             ((haveRVC tt) >>= fun w__2 : bool => returnm ((negb w__2)  : bool))) >>= fun w__3 : bool =>
          (if sumbool_of_bool w__3 then
             (handle_mem_exception target (E_Fetch_Addr_Align tt)) >> returnm RETIRE_FAIL
           else (set_next_pc target) >> returnm RETIRE_SUCCESS)
           : M (Retired)
       end)
       : M (Retired)
    else returnm RETIRE_SUCCESS)
    : M (Retired).

Definition execute_AMO
(op : amoop) (aq : bool) (rl : bool) (rs2 : mword 5) (rs1 : mword 5) (width : word_width)
(rd : mword 5)
: M (Retired) :=
   (haveAtomics tt) >>= fun w__0 : bool =>
   (if sumbool_of_bool w__0 then
      (ext_data_get_addr rs1 (zeros_implicit 64) (ReadWrite (Data, Data)) width) >>= fun w__1 : Ext_DataAddr_Check unit =>
      (match w__1 with
       | Ext_DataAddr_Error e =>
          let '_ := (ext_handle_data_check_error e)  : unit in
          returnm RETIRE_FAIL
       | Ext_DataAddr_OK vaddr =>
          (translateAddr vaddr (ReadWrite (Data, Data))) >>= fun w__2 : TR_Result (mword 64) ExceptionType =>
          (match w__2 with
           | TR_Failure (e, _) => (handle_mem_exception vaddr e) >> returnm RETIRE_FAIL
           | TR_Address (addr, _) =>
              (match (width, 64) with
               | (BYTE, g__326) =>
                  (mem_write_ea addr 1 (andb aq rl) rl true)  : M (MemoryOpResult unit)
               | (HALF, g__327) =>
                  (mem_write_ea addr 2 (andb aq rl) rl true)  : M (MemoryOpResult unit)
               | (WORD, g__328) =>
                  (mem_write_ea addr 4 (andb aq rl) rl true)  : M (MemoryOpResult unit)
               | (DOUBLE, l__7) =>
                  (if sumbool_of_bool (Z.eqb l__7 64) then
                     (mem_write_ea addr 8 (andb aq rl) rl true)
                      : M (MemoryOpResult unit)
                   else (internal_error "Unexpected AMO width")  : M (MemoryOpResult unit))
                   : M (MemoryOpResult unit)
               end) >>= fun eares : MemoryOpResult unit =>
              let is_unsigned : bool :=
                match op with | AMOMINU => true | AMOMAXU => true | _ => false end in
              (match width with
               | BYTE =>
                  (if sumbool_of_bool is_unsigned then
                     (rX_bits rs2) >>= fun w__9 : mword 64 =>
                     returnm (EXTZ 64 (subrange_vec_dec w__9 7 0))
                   else
                     (rX_bits rs2) >>= fun w__10 : mword 64 =>
                     returnm (EXTS 64 (subrange_vec_dec w__10 7 0)))
                   : M (mword 64)
               | HALF =>
                  (if sumbool_of_bool is_unsigned then
                     (rX_bits rs2) >>= fun w__12 : mword 64 =>
                     returnm (EXTZ 64 (subrange_vec_dec w__12 15 0))
                   else
                     (rX_bits rs2) >>= fun w__13 : mword 64 =>
                     returnm (EXTS 64 (subrange_vec_dec w__13 15 0)))
                   : M (mword 64)
               | WORD =>
                  (if sumbool_of_bool is_unsigned then
                     (rX_bits rs2) >>= fun w__15 : mword 64 =>
                     returnm (EXTZ 64 (subrange_vec_dec w__15 31 0))
                   else
                     (rX_bits rs2) >>= fun w__16 : mword 64 =>
                     returnm (EXTS 64 (subrange_vec_dec w__16 31 0)))
                   : M (mword 64)
               | DOUBLE => (rX_bits rs2)  : M (mword 64)
               end) >>= fun rs2_val : xlenbits =>
              (match eares with
               | MemException e => (handle_mem_exception addr e) >> returnm RETIRE_FAIL
               | MemValue _ =>
                  (match (width, 64) with
                   | (BYTE, g__323) =>
                      (mem_read (ReadWrite (Data, Data)) addr 1 aq (andb aq rl) true) >>= fun w__19 : MemoryOpResult (mword (8 * 1)) =>
                      returnm (extend_value is_unsigned w__19)
                   | (HALF, g__324) =>
                      (mem_read (ReadWrite (Data, Data)) addr 2 aq (andb aq rl) true) >>= fun w__20 : MemoryOpResult (mword (8 * 2)) =>
                      returnm (extend_value is_unsigned w__20)
                   | (WORD, g__325) =>
                      (mem_read (ReadWrite (Data, Data)) addr 4 aq (andb aq rl) true) >>= fun w__21 : MemoryOpResult (mword (8 * 4)) =>
                      returnm (extend_value is_unsigned w__21)
                   | (DOUBLE, l__6) =>
                      (if sumbool_of_bool (Z.eqb l__6 64) then
                         (mem_read (ReadWrite (Data, Data)) addr 8 aq (andb aq rl) true) >>= fun w__22 : MemoryOpResult (mword (8 * 8)) =>
                         returnm (extend_value is_unsigned w__22)
                       else (internal_error "Unexpected AMO width")  : M (MemoryOpResult (mword 64)))
                       : M (MemoryOpResult (mword 64))
                   end) >>= fun mval : MemoryOpResult xlenbits =>
                  (match mval with
                   | MemException e => (handle_mem_exception addr e) >> returnm RETIRE_FAIL
                   | MemValue loaded =>
                      let result : xlenbits :=
                        match op with
                        | AMOSWAP => rs2_val
                        | AMOADD => add_vec rs2_val loaded
                        | AMOXOR => xor_vec rs2_val loaded
                        | AMOAND => and_vec rs2_val loaded
                        | AMOOR => or_vec rs2_val loaded
                        | AMOMIN =>
                           to_bits 64
                             (projT1
                              (min_atom (projT1 (sint rs2_val)) (projT1 (sint loaded))))
                        | AMOMAX =>
                           to_bits 64
                             (projT1
                              (max_atom (projT1 (sint rs2_val)) (projT1 (sint loaded))))
                        | AMOMINU =>
                           to_bits 64
                             (projT1
                              (min_atom (projT1 (uint rs2_val)) (projT1 (uint loaded))))
                        | AMOMAXU =>
                           to_bits 64
                             (projT1
                              (max_atom (projT1 (uint rs2_val)) (projT1 (uint loaded))))
                        end in
                      let rval : xlenbits :=
                        match width with
                        | BYTE => EXTS 64 (subrange_vec_dec loaded 7 0)
                        | HALF => EXTS 64 (subrange_vec_dec loaded 15 0)
                        | WORD => EXTS 64 (subrange_vec_dec loaded 31 0)
                        | DOUBLE => loaded
                        end in
                      (match (width, 64) with
                       | (BYTE, g__320) =>
                          (mem_write_value addr 1 (subrange_vec_dec result 7 0) (andb aq rl) rl true)
                           : M (MemoryOpResult bool)
                       | (HALF, g__321) =>
                          (mem_write_value addr 2 (subrange_vec_dec result 15 0) (andb aq rl) rl
                             true)
                           : M (MemoryOpResult bool)
                       | (WORD, g__322) =>
                          (mem_write_value addr 4 (subrange_vec_dec result 31 0) (andb aq rl) rl
                             true)
                           : M (MemoryOpResult bool)
                       | (DOUBLE, l__5) =>
                          (if sumbool_of_bool (Z.eqb l__5 64) then
                             (mem_write_value addr 8 result (andb aq rl) rl true)
                              : M (MemoryOpResult bool)
                           else (internal_error "Unexpected AMO width")  : M (MemoryOpResult bool))
                           : M (MemoryOpResult bool)
                       end) >>= fun wval : MemoryOpResult bool =>
                      (match wval with
                       | MemValue true => (wX_bits rd rval) >> returnm RETIRE_SUCCESS
                       | MemValue false =>
                          (internal_error "AMO got false from mem_write_value")  : M (Retired)
                       | MemException e => (handle_mem_exception addr e) >> returnm RETIRE_FAIL
                       end)
                       : M (Retired)
                   end)
                   : M (Retired)
               end)
               : M (Retired)
           end)
           : M (Retired)
       end)
       : M (Retired)
    else (handle_illegal tt) >> returnm RETIRE_FAIL)
    : M (Retired).

Definition execute_ADDIW (imm : mword 12) (rs1 : mword 5) (rd : mword 5) : M (Retired) :=
   (rX_bits rs1) >>= fun w__0 : mword 64 =>
   let result : xlenbits := add_vec (EXTS 64 imm) w__0 in
   (wX_bits rd (EXTS 64 (subrange_vec_dec result 31 0))) >> returnm RETIRE_SUCCESS.

Definition compressed_measure (instr : ast) : Z :=
   match instr with
   | C_ADDI4SPN (rdc, nzimm) => 1
   | C_LW (uimm, rsc, rdc) => 1
   | C_LD (uimm, rsc, rdc) => 1
   | C_SW (uimm, rsc1, rsc2) => 1
   | C_SD (uimm, rsc1, rsc2) => 1
   | C_ADDI (nzi, rsd) => 1
   | C_JAL imm => 1
   | C_LI (imm, rd) => 1
   | C_ADDI16SP imm => 1
   | C_LUI (imm, rd) => 1
   | C_SRLI (shamt, rsd) => 1
   | C_SRAI (shamt, rsd) => 1
   | C_ANDI (imm, rsd) => 1
   | C_SUB (rsd, rs2) => 1
   | C_XOR (rsd, rs2) => 1
   | C_OR (rsd, rs2) => 1
   | C_AND (rsd, rs2) => 1
   | C_SUBW (rsd, rs2) => 1
   | C_ADDW (rsd, rs2) => 1
   | C_J imm => 1
   | C_BEQZ (imm, rs) => 1
   | C_BNEZ (imm, rs) => 1
   | C_SLLI (shamt, rsd) => 1
   | C_LWSP (uimm, rd) => 1
   | C_LDSP (uimm, rd) => 1
   | C_SWSP (uimm, rs2) => 1
   | C_SDSP (uimm, rs2) => 1
   | C_JR rs1 => 1
   | C_JALR rs1 => 1
   | C_MV (rd, rs2) => 1
   | C_EBREAK tt' => 1
   | C_ADD (rsd, rs2) => 1
   | _ => 0
   end.

Fixpoint _rec_execute (merge_var : ast) (_reclimit : Z) (_acc : Acc (Zwf 0) _reclimit)
{struct _acc} : M (Retired).
exact (
   assert_exp' (Z.geb _reclimit 0) "recursion limit reached" >>= fun _ =>
   (match merge_var with
    | C_ADDI4SPN (rdc, nzimm) =>
       let imm : bits 12 := concat_vec ('b"00"  : mword 2) (concat_vec nzimm ('b"00"  : mword 2)) in
       let rd := creg2reg_idx rdc in
       (_rec_execute (ITYPE (imm, sp, rd, RISCV_ADDI)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_LW (uimm, rsc, rdc) =>
       let imm : bits 12 := EXTZ 12 (concat_vec uimm ('b"00"  : mword 2)) in
       let rd := creg2reg_idx rdc in
       let rs := creg2reg_idx rsc in
       (_rec_execute (LOAD (imm, rs, rd, false, WORD, false, false)) (Z.sub _reclimit 1)
          (_limit_reduces _acc))
        : M (Retired)
    | C_LD (uimm, rsc, rdc) =>
       let imm : bits 12 := EXTZ 12 (concat_vec uimm ('b"000"  : mword 3)) in
       let rd := creg2reg_idx rdc in
       let rs := creg2reg_idx rsc in
       (_rec_execute (LOAD (imm, rs, rd, false, DOUBLE, false, false)) (Z.sub _reclimit 1)
          (_limit_reduces _acc))
        : M (Retired)
    | C_SW (uimm, rsc1, rsc2) =>
       let imm : bits 12 := EXTZ 12 (concat_vec uimm ('b"00"  : mword 2)) in
       let rs1 := creg2reg_idx rsc1 in
       let rs2 := creg2reg_idx rsc2 in
       (_rec_execute (STORE (imm, rs2, rs1, WORD, false, false)) (Z.sub _reclimit 1)
          (_limit_reduces _acc))
        : M (Retired)
    | C_SD (uimm, rsc1, rsc2) =>
       let imm : bits 12 := EXTZ 12 (concat_vec uimm ('b"000"  : mword 3)) in
       let rs1 := creg2reg_idx rsc1 in
       let rs2 := creg2reg_idx rsc2 in
       (_rec_execute (STORE (imm, rs2, rs1, DOUBLE, false, false)) (Z.sub _reclimit 1)
          (_limit_reduces _acc))
        : M (Retired)
    | C_ADDI (nzi, rsd) =>
       let imm : bits 12 := EXTS 12 nzi in
       (_rec_execute (ITYPE (imm, rsd, rsd, RISCV_ADDI)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_JAL imm =>
       (_rec_execute (RISCV_JAL (EXTS 21 (concat_vec imm ('b"0"  : mword 1)), ra))
          (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_ADDIW (imm, rsd) =>
       (_rec_execute (ADDIW (EXTS 12 imm, rsd, rsd)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_LI (imm, rd) =>
       let imm : bits 12 := EXTS 12 imm in
       (_rec_execute (ITYPE (imm, zreg, rd, RISCV_ADDI)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_ADDI16SP imm =>
       let imm : bits 12 := EXTS 12 (concat_vec imm (Ox"0"  : mword 4)) in
       (_rec_execute (ITYPE (imm, sp, sp, RISCV_ADDI)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_LUI (imm, rd) =>
       let res : bits 20 := EXTS 20 imm in
       (_rec_execute (UTYPE (res, rd, RISCV_LUI)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_SRLI (shamt, rsd) =>
       let rsd := creg2reg_idx rsd in
       (_rec_execute (SHIFTIOP (shamt, rsd, rsd, RISCV_SRLI)) (Z.sub _reclimit 1)
          (_limit_reduces _acc))
        : M (Retired)
    | C_SRAI (shamt, rsd) =>
       let rsd := creg2reg_idx rsd in
       (_rec_execute (SHIFTIOP (shamt, rsd, rsd, RISCV_SRAI)) (Z.sub _reclimit 1)
          (_limit_reduces _acc))
        : M (Retired)
    | C_ANDI (imm, rsd) =>
       let rsd := creg2reg_idx rsd in
       (_rec_execute (ITYPE (EXTS 12 imm, rsd, rsd, RISCV_ANDI)) (Z.sub _reclimit 1)
          (_limit_reduces _acc))
        : M (Retired)
    | C_SUB (rsd, rs2) =>
       let rsd := creg2reg_idx rsd in
       let rs2 := creg2reg_idx rs2 in
       (_rec_execute (RTYPE (rs2, rsd, rsd, RISCV_SUB)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_XOR (rsd, rs2) =>
       let rsd := creg2reg_idx rsd in
       let rs2 := creg2reg_idx rs2 in
       (_rec_execute (RTYPE (rs2, rsd, rsd, RISCV_XOR)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_OR (rsd, rs2) =>
       let rsd := creg2reg_idx rsd in
       let rs2 := creg2reg_idx rs2 in
       (_rec_execute (RTYPE (rs2, rsd, rsd, RISCV_OR)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_AND (rsd, rs2) =>
       let rsd := creg2reg_idx rsd in
       let rs2 := creg2reg_idx rs2 in
       (_rec_execute (RTYPE (rs2, rsd, rsd, RISCV_AND)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_SUBW (rsd, rs2) =>
       let rsd := creg2reg_idx rsd in
       let rs2 := creg2reg_idx rs2 in
       (_rec_execute (RTYPEW (rs2, rsd, rsd, RISCV_SUBW)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_ADDW (rsd, rs2) =>
       let rsd := creg2reg_idx rsd in
       let rs2 := creg2reg_idx rs2 in
       (_rec_execute (RTYPEW (rs2, rsd, rsd, RISCV_ADDW)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_J imm =>
       (_rec_execute (RISCV_JAL (EXTS 21 (concat_vec imm ('b"0"  : mword 1)), zreg))
          (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_BEQZ (imm, rs) =>
       (_rec_execute
          (BTYPE (EXTS 13 (concat_vec imm ('b"0"  : mword 1)), zreg, creg2reg_idx rs, RISCV_BEQ))
          (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_BNEZ (imm, rs) =>
       (_rec_execute
          (BTYPE (EXTS 13 (concat_vec imm ('b"0"  : mword 1)), zreg, creg2reg_idx rs, RISCV_BNE))
          (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_SLLI (shamt, rsd) =>
       (_rec_execute (SHIFTIOP (shamt, rsd, rsd, RISCV_SLLI)) (Z.sub _reclimit 1)
          (_limit_reduces _acc))
        : M (Retired)
    | C_LWSP (uimm, rd) =>
       let imm : bits 12 := EXTZ 12 (concat_vec uimm ('b"00"  : mword 2)) in
       (_rec_execute (LOAD (imm, sp, rd, false, WORD, false, false)) (Z.sub _reclimit 1)
          (_limit_reduces _acc))
        : M (Retired)
    | C_LDSP (uimm, rd) =>
       let imm : bits 12 := EXTZ 12 (concat_vec uimm ('b"000"  : mword 3)) in
       (_rec_execute (LOAD (imm, sp, rd, false, DOUBLE, false, false)) (Z.sub _reclimit 1)
          (_limit_reduces _acc))
        : M (Retired)
    | C_SWSP (uimm, rs2) =>
       let imm : bits 12 := EXTZ 12 (concat_vec uimm ('b"00"  : mword 2)) in
       (_rec_execute (STORE (imm, rs2, sp, WORD, false, false)) (Z.sub _reclimit 1)
          (_limit_reduces _acc))
        : M (Retired)
    | C_SDSP (uimm, rs2) =>
       let imm : bits 12 := EXTZ 12 (concat_vec uimm ('b"000"  : mword 3)) in
       (_rec_execute (STORE (imm, rs2, sp, DOUBLE, false, false)) (Z.sub _reclimit 1)
          (_limit_reduces _acc))
        : M (Retired)
    | C_JR rs1 =>
       (_rec_execute (RISCV_JALR (EXTZ 12 ('b"0"  : mword 1), rs1, zreg)) (Z.sub _reclimit 1)
          (_limit_reduces _acc))
        : M (Retired)
    | C_JALR rs1 =>
       (_rec_execute (RISCV_JALR (EXTZ 12 ('b"0"  : mword 1), rs1, ra)) (Z.sub _reclimit 1)
          (_limit_reduces _acc))
        : M (Retired)
    | C_MV (rd, rs2) =>
       (_rec_execute (RTYPE (rs2, zreg, rd, RISCV_ADD)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_EBREAK tt =>
       (_rec_execute (EBREAK tt) (Z.sub _reclimit 1) (_limit_reduces _acc))  : M (Retired)
    | C_ADD (rsd, rs2) =>
       (_rec_execute (RTYPE (rs2, rsd, rsd, RISCV_ADD)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_FLWSP (imm, rd) =>
       let imm : bits 12 := EXTZ 12 (concat_vec imm ('b"00"  : mword 2)) in
       (_rec_execute (LOAD_FP (imm, sp, rd, WORD)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_FSWSP (uimm, rs2) =>
       let imm : bits 12 := EXTZ 12 (concat_vec uimm ('b"00"  : mword 2)) in
       (_rec_execute (STORE_FP (imm, rs2, sp, WORD)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_FLW (uimm, rsc, rdc) =>
       let imm : bits 12 := EXTZ 12 (concat_vec uimm ('b"00"  : mword 2)) in
       let rd := creg2reg_idx rdc in
       let rs := creg2reg_idx rsc in
       (_rec_execute (LOAD_FP (imm, rs, rd, WORD)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_FSW (uimm, rsc1, rsc2) =>
       let imm : bits 12 := EXTZ 12 (concat_vec uimm ('b"00"  : mword 2)) in
       let rs1 := creg2reg_idx rsc1 in
       let rs2 := creg2reg_idx rsc2 in
       (_rec_execute (STORE_FP (imm, rs2, rs1, WORD)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_FLDSP (uimm, rd) =>
       let imm : bits 12 := EXTZ 12 (concat_vec uimm ('b"000"  : mword 3)) in
       (_rec_execute (LOAD_FP (imm, sp, rd, DOUBLE)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_FSDSP (uimm, rs2) =>
       let imm : bits 12 := EXTZ 12 (concat_vec uimm ('b"000"  : mword 3)) in
       (_rec_execute (STORE_FP (imm, rs2, sp, DOUBLE)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_FLD (uimm, rsc, rdc) =>
       let imm : bits 12 := EXTZ 12 (concat_vec uimm ('b"000"  : mword 3)) in
       let rd := creg2reg_idx rdc in
       let rs := creg2reg_idx rsc in
       (_rec_execute (LOAD_FP (imm, rs, rd, DOUBLE)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | C_FSD (uimm, rsc1, rsc2) =>
       let imm : bits 12 := EXTZ 12 (concat_vec uimm ('b"000"  : mword 3)) in
       let rs1 := creg2reg_idx rsc1 in
       let rs2 := creg2reg_idx rsc2 in
       (_rec_execute (STORE_FP (imm, rs2, rs1, DOUBLE)) (Z.sub _reclimit 1) (_limit_reduces _acc))
        : M (Retired)
    | UTYPE (imm, rd, op) => (execute_UTYPE imm rd op)  : M (Retired)
    | RISCV_JAL (imm, rd) => (execute_RISCV_JAL imm rd)  : M (Retired)
    | BTYPE (imm, rs2, rs1, op) => (execute_BTYPE imm rs2 rs1 op)  : M (Retired)
    | ITYPE (imm, rs1, rd, op) => (execute_ITYPE imm rs1 rd op)  : M (Retired)
    | SHIFTIOP (shamt, rs1, rd, op) => (execute_SHIFTIOP shamt rs1 rd op)  : M (Retired)
    | RTYPE (rs2, rs1, rd, op) => (execute_RTYPE rs2 rs1 rd op)  : M (Retired)
    | LOAD (imm, rs1, rd, is_unsigned, width, aq, rl) =>
       (execute_LOAD imm rs1 rd is_unsigned width aq rl)  : M (Retired)
    | STORE (imm, rs2, rs1, width, aq, rl) => (execute_STORE imm rs2 rs1 width aq rl)  : M (Retired)
    | ADDIW (imm, rs1, rd) => (execute_ADDIW imm rs1 rd)  : M (Retired)
    | SHIFTW (shamt, rs1, rd, op) => (execute_SHIFTW shamt rs1 rd op)  : M (Retired)
    | RTYPEW (rs2, rs1, rd, op) => (execute_RTYPEW rs2 rs1 rd op)  : M (Retired)
    | SHIFTIWOP (shamt, rs1, rd, op) => (execute_SHIFTIWOP shamt rs1 rd op)  : M (Retired)
    | FENCE (pred, succ) => (execute_FENCE pred succ)  : M (Retired)
    | FENCE_TSO (pred, succ) => (execute_FENCE_TSO pred succ)  : M (Retired)
    | FENCEI arg0 => returnm (execute_FENCEI arg0)
    | ECALL arg0 => (execute_ECALL arg0)  : M (Retired)
    | MRET arg0 => (execute_MRET arg0)  : M (Retired)
    | SRET arg0 => (execute_SRET arg0)  : M (Retired)
    | EBREAK arg0 => (execute_EBREAK arg0)  : M (Retired)
    | WFI arg0 => (execute_WFI arg0)  : M (Retired)
    | SFENCE_VMA (rs1, rs2) => (execute_SFENCE_VMA rs1 rs2)  : M (Retired)
    | LOADRES (aq, rl, rs1, width, rd) => (execute_LOADRES aq rl rs1 width rd)  : M (Retired)
    | STORECON (aq, rl, rs2, rs1, width, rd) =>
       (execute_STORECON aq rl rs2 rs1 width rd)  : M (Retired)
    | AMO (op, aq, rl, rs2, rs1, width, rd) =>
       (execute_AMO op aq rl rs2 rs1 width rd)  : M (Retired)
    | C_NOP arg0 => returnm (execute_C_NOP arg0)
    | MUL (rs2, rs1, rd, high, signed1, signed2) =>
       (execute_MUL rs2 rs1 rd high signed1 signed2)  : M (Retired)
    | DIV (rs2, rs1, rd, s) => (execute_DIV rs2 rs1 rd s)  : M (Retired)
    | REM (rs2, rs1, rd, s) => (execute_REM rs2 rs1 rd s)  : M (Retired)
    | MULW (rs2, rs1, rd) => (execute_MULW rs2 rs1 rd)  : M (Retired)
    | DIVW (rs2, rs1, rd, s) => (execute_DIVW rs2 rs1 rd s)  : M (Retired)
    | REMW (rs2, rs1, rd, s) => (execute_REMW rs2 rs1 rd s)  : M (Retired)
    | CSR (csr, rs1, rd, is_imm, op) => (execute_CSR csr rs1 rd is_imm op)  : M (Retired)
    | URET arg0 => (execute_URET arg0)  : M (Retired)
    | C_NOP_HINT imm => returnm (execute_C_NOP_HINT imm)
    | C_ADDI_HINT rsd => returnm (execute_C_ADDI_HINT rsd)
    | C_LI_HINT imm => returnm (execute_C_LI_HINT imm)
    | C_LUI_HINT imm => returnm (execute_C_LUI_HINT imm)
    | C_MV_HINT rs2 => returnm (execute_C_MV_HINT rs2)
    | C_ADD_HINT rs2 => returnm (execute_C_ADD_HINT rs2)
    | C_SLLI_HINT (shamt, rsd) => returnm (execute_C_SLLI_HINT shamt rsd)
    | C_SRLI_HINT rsd => returnm (execute_C_SRLI_HINT rsd)
    | C_SRAI_HINT rsd => returnm (execute_C_SRAI_HINT rsd)
    | FENCE_RESERVED (fm, pred, succ, rs, rd) => returnm (execute_FENCE_RESERVED fm pred succ rs rd)
    | FENCEI_RESERVED (imm, rs, rd) => returnm (execute_FENCEI_RESERVED imm rs rd)
    | LOAD_FP (imm, rs1, rd, width) => (execute_LOAD_FP imm rs1 rd width)  : M (Retired)
    | STORE_FP (imm, rs2, rs1, width) => (execute_STORE_FP imm rs2 rs1 width)  : M (Retired)
    | F_MADD_TYPE_S (rs3, rs2, rs1, rm, rd, op) =>
       (execute_F_MADD_TYPE_S rs3 rs2 rs1 rm rd op)  : M (Retired)
    | F_BIN_RM_TYPE_S (rs2, rs1, rm, rd, op) =>
       (execute_F_BIN_RM_TYPE_S rs2 rs1 rm rd op)  : M (Retired)
    | F_UN_RM_TYPE_S (rs1, rm, rd, arg3) => (execute_F_UN_RM_TYPE_S rs1 rm rd arg3)  : M (Retired)
    | F_BIN_TYPE_S (rs2, rs1, rd, arg3) => (execute_F_BIN_TYPE_S rs2 rs1 rd arg3)  : M (Retired)
    | F_UN_TYPE_S (rs1, rd, arg2) => (execute_F_UN_TYPE_S rs1 rd arg2)  : M (Retired)
    | F_MADD_TYPE_D (rs3, rs2, rs1, rm, rd, op) =>
       (execute_F_MADD_TYPE_D rs3 rs2 rs1 rm rd op)  : M (Retired)
    | F_BIN_RM_TYPE_D (rs2, rs1, rm, rd, op) =>
       (execute_F_BIN_RM_TYPE_D rs2 rs1 rm rd op)  : M (Retired)
    | F_UN_RM_TYPE_D (rs1, rm, rd, arg3) => (execute_F_UN_RM_TYPE_D rs1 rm rd arg3)  : M (Retired)
    | F_BIN_TYPE_D (rs2, rs1, rd, arg3) => (execute_F_BIN_TYPE_D rs2 rs1 rd arg3)  : M (Retired)
    | F_UN_TYPE_D (rs1, rd, arg2) => (execute_F_UN_TYPE_D rs1 rd arg2)  : M (Retired)
    | RISCV_JALR (imm, rs1, rd) => (execute_RISCV_JALR imm rs1 rd)  : M (Retired)
    | ILLEGAL s => (execute_ILLEGAL s)  : M (Retired)
    | C_ILLEGAL s => (execute_C_ILLEGAL s)  : M (Retired)
    end)
    : M (Retired)
).
Defined.


Definition execute (i : ast) : M (Retired) :=
   (_rec_execute i ((compressed_measure i)  : Z) (Zwf_guarded _))  : M (Retired).

Definition assembly_forwards (arg_ : ast) : M (string) :=
   (match arg_ with
    | UTYPE (imm, rd, op) =>
       (reg_name_forwards rd) >>= fun w__0 : string =>
       returnm (string_append (utype_mnemonic_forwards op)
                  (string_append (spc_forwards tt)
                     (string_append w__0
                        (string_append (sep_forwards tt)
                           (string_append (decimal_string_of_bits imm) "")))))
    | RISCV_JAL (imm, rd) =>
       (reg_name_forwards rd) >>= fun w__1 : string =>
       returnm (string_append "jal"
                  (string_append (spc_forwards tt)
                     (string_append w__1
                        (string_append (sep_forwards tt)
                           (string_append (decimal_string_of_bits imm) "")))))
    | RISCV_JALR (imm, rs1, rd) =>
       (reg_name_forwards rd) >>= fun w__2 : string =>
       (reg_name_forwards rs1) >>= fun w__3 : string =>
       returnm (string_append "jalr"
                  (string_append (spc_forwards tt)
                     (string_append w__2
                        (string_append (sep_forwards tt)
                           (string_append w__3
                              (string_append (sep_forwards tt)
                                 (string_append (decimal_string_of_bits imm) "")))))))
    | BTYPE (imm, rs2, rs1, op) =>
       (reg_name_forwards rs1) >>= fun w__4 : string =>
       (reg_name_forwards rs2) >>= fun w__5 : string =>
       returnm (string_append (btype_mnemonic_forwards op)
                  (string_append (spc_forwards tt)
                     (string_append w__4
                        (string_append (sep_forwards tt)
                           (string_append w__5
                              (string_append (sep_forwards tt)
                                 (string_append (decimal_string_of_bits imm) "")))))))
    | ITYPE (imm, rs1, rd, op) =>
       (reg_name_forwards rd) >>= fun w__6 : string =>
       (reg_name_forwards rs1) >>= fun w__7 : string =>
       returnm (string_append (itype_mnemonic_forwards op)
                  (string_append (spc_forwards tt)
                     (string_append w__6
                        (string_append (sep_forwards tt)
                           (string_append w__7
                              (string_append (sep_forwards tt)
                                 (string_append (decimal_string_of_bits imm) "")))))))
    | SHIFTIOP (shamt, rs1, rd, op) =>
       (reg_name_forwards rd) >>= fun w__8 : string =>
       (reg_name_forwards rs1) >>= fun w__9 : string =>
       returnm (string_append (shiftiop_mnemonic_forwards op)
                  (string_append (spc_forwards tt)
                     (string_append w__8
                        (string_append (sep_forwards tt)
                           (string_append w__9
                              (string_append (sep_forwards tt)
                                 (string_append (decimal_string_of_bits shamt) "")))))))
    | RTYPE (rs2, rs1, rd, op) =>
       (reg_name_forwards rd) >>= fun w__10 : string =>
       (reg_name_forwards rs1) >>= fun w__11 : string =>
       (reg_name_forwards rs2) >>= fun w__12 : string =>
       returnm (string_append (rtype_mnemonic_forwards op)
                  (string_append (spc_forwards tt)
                     (string_append w__10
                        (string_append (sep_forwards tt)
                           (string_append w__11
                              (string_append (sep_forwards tt) (string_append w__12 "")))))))
    | LOAD (imm, rs1, rd, is_unsigned, size, aq, rl) =>
       (reg_name_forwards rd) >>= fun w__13 : string =>
       (reg_name_forwards rs1) >>= fun w__14 : string =>
       returnm (string_append "l"
                  (string_append (size_mnemonic_forwards size)
                     (string_append (maybe_u_forwards is_unsigned)
                        (string_append (maybe_aq_forwards aq)
                           (string_append (maybe_rl_forwards rl)
                              (string_append (spc_forwards tt)
                                 (string_append w__13
                                    (string_append (sep_forwards tt)
                                       (string_append (decimal_string_of_bits imm)
                                          (string_append (opt_spc_forwards tt)
                                             (string_append "("
                                                (string_append (opt_spc_forwards tt)
                                                   (string_append w__14
                                                      (string_append (opt_spc_forwards tt)
                                                         (string_append ")" "")))))))))))))))
    | STORE (imm, rs2, rs1, size, aq, rl) =>
       (reg_name_forwards rs2) >>= fun w__15 : string =>
       (reg_name_forwards rs1) >>= fun w__16 : string =>
       returnm (string_append "s"
                  (string_append (size_mnemonic_forwards size)
                     (string_append (maybe_aq_forwards aq)
                        (string_append (maybe_rl_forwards rl)
                           (string_append (spc_forwards tt)
                              (string_append w__15
                                 (string_append (sep_forwards tt)
                                    (string_append (decimal_string_of_bits imm)
                                       (string_append (opt_spc_forwards tt)
                                          (string_append "("
                                             (string_append (opt_spc_forwards tt)
                                                (string_append w__16
                                                   (string_append (opt_spc_forwards tt)
                                                      (string_append ")" ""))))))))))))))
    | ADDIW (imm, rs1, rd) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          (reg_name_forwards rd) >>= fun w__17 : string =>
          (reg_name_forwards rs1) >>= fun w__18 : string =>
          returnm (string_append "addiw"
                     (string_append (spc_forwards tt)
                        (string_append w__17
                           (string_append (sep_forwards tt)
                              (string_append w__18
                                 (string_append (sep_forwards tt)
                                    (string_append (decimal_string_of_bits imm) "")))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | SHIFTW (shamt, rs1, rd, op) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          (reg_name_forwards rd) >>= fun w__21 : string =>
          (reg_name_forwards rs1) >>= fun w__22 : string =>
          returnm (string_append (shiftw_mnemonic_forwards op)
                     (string_append (spc_forwards tt)
                        (string_append w__21
                           (string_append (sep_forwards tt)
                              (string_append w__22
                                 (string_append (sep_forwards tt)
                                    (string_append (decimal_string_of_bits shamt) "")))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | RTYPEW (rs2, rs1, rd, op) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          (reg_name_forwards rd) >>= fun w__25 : string =>
          (reg_name_forwards rs1) >>= fun w__26 : string =>
          (reg_name_forwards rs2) >>= fun w__27 : string =>
          returnm (string_append (rtypew_mnemonic_forwards op)
                     (string_append (spc_forwards tt)
                        (string_append w__25
                           (string_append (sep_forwards tt)
                              (string_append w__26
                                 (string_append (sep_forwards tt) (string_append w__27 "")))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | SHIFTIWOP (shamt, rs1, rd, op) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          (reg_name_forwards rd) >>= fun w__30 : string =>
          (reg_name_forwards rs1) >>= fun w__31 : string =>
          returnm (string_append (shiftiwop_mnemonic_forwards op)
                     (string_append (spc_forwards tt)
                        (string_append w__30
                           (string_append (sep_forwards tt)
                              (string_append w__31
                                 (string_append (sep_forwards tt)
                                    (string_append (decimal_string_of_bits shamt) "")))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | FENCE (pred, succ) =>
       (fence_bits_forwards pred) >>= fun w__34 : string =>
       (fence_bits_forwards succ) >>= fun w__35 : string =>
       returnm (string_append "fence"
                  (string_append (spc_forwards tt)
                     (string_append w__34 (string_append (sep_forwards tt) (string_append w__35 "")))))
    | FENCE_TSO (pred, succ) =>
       (fence_bits_forwards pred) >>= fun w__36 : string =>
       (fence_bits_forwards succ) >>= fun w__37 : string =>
       returnm (string_append "fence.tso"
                  (string_append (spc_forwards tt)
                     (string_append w__36 (string_append (sep_forwards tt) (string_append w__37 "")))))
    | FENCEI tt => returnm "fence.i"
    | ECALL tt => returnm "ecall"
    | MRET tt => returnm "mret"
    | SRET tt => returnm "sret"
    | EBREAK tt => returnm "ebreak"
    | WFI tt => returnm "wfi"
    | SFENCE_VMA (rs1, rs2) =>
       (reg_name_forwards rs1) >>= fun w__38 : string =>
       (reg_name_forwards rs2) >>= fun w__39 : string =>
       returnm (string_append "sfence.vma"
                  (string_append (spc_forwards tt)
                     (string_append w__38 (string_append (sep_forwards tt) (string_append w__39 "")))))
    | LOADRES (aq, rl, rs1, size, rd) =>
       (reg_name_forwards rd) >>= fun w__40 : string =>
       (reg_name_forwards rs1) >>= fun w__41 : string =>
       returnm (string_append "lr."
                  (string_append (size_mnemonic_forwards size)
                     (string_append (maybe_aq_forwards aq)
                        (string_append (maybe_rl_forwards rl)
                           (string_append (spc_forwards tt)
                              (string_append w__40
                                 (string_append (sep_forwards tt) (string_append w__41 ""))))))))
    | STORECON (aq, rl, rs2, rs1, size, rd) =>
       (reg_name_forwards rd) >>= fun w__42 : string =>
       (reg_name_forwards rs1) >>= fun w__43 : string =>
       (reg_name_forwards rs2) >>= fun w__44 : string =>
       returnm (string_append "sc."
                  (string_append (size_mnemonic_forwards size)
                     (string_append (maybe_aq_forwards aq)
                        (string_append (maybe_rl_forwards rl)
                           (string_append (spc_forwards tt)
                              (string_append w__42
                                 (string_append (sep_forwards tt)
                                    (string_append w__43
                                       (string_append (sep_forwards tt) (string_append w__44 ""))))))))))
    | AMO (op, aq, rl, rs2, rs1, width, rd) =>
       (reg_name_forwards rd) >>= fun w__45 : string =>
       (reg_name_forwards rs2) >>= fun w__46 : string =>
       (reg_name_forwards rs1) >>= fun w__47 : string =>
       returnm (string_append (amo_mnemonic_forwards op)
                  (string_append "."
                     (string_append (size_mnemonic_forwards width)
                        (string_append (maybe_aq_forwards aq)
                           (string_append (maybe_rl_forwards rl)
                              (string_append (spc_forwards tt)
                                 (string_append w__45
                                    (string_append (sep_forwards tt)
                                       (string_append w__46
                                          (string_append (sep_forwards tt)
                                             (string_append "("
                                                (string_append w__47 (string_append ")" "")))))))))))))
    | C_NOP tt => returnm "c.nop"
    | C_ADDI4SPN (rdc, nzimm) =>
       (if neq_vec nzimm (Ox"00"  : mword 8) then
          (creg_name_forwards rdc) >>= fun w__48 : string =>
          returnm (string_append "c.addi4spn"
                     (string_append (spc_forwards tt)
                        (string_append w__48
                           (string_append (sep_forwards tt)
                              (string_append
                                 (decimal_string_of_bits
                                    (concat_vec (nzimm  : mword 8) ('b"00"  : mword 2))) "")))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_LW (uimm, rsc, rdc) =>
       (creg_name_forwards rdc) >>= fun w__51 : string =>
       (creg_name_forwards rsc) >>= fun w__52 : string =>
       returnm (string_append "c.lw"
                  (string_append (spc_forwards tt)
                     (string_append w__51
                        (string_append (sep_forwards tt)
                           (string_append w__52
                              (string_append (sep_forwards tt)
                                 (string_append
                                    (decimal_string_of_bits
                                       (concat_vec (uimm  : mword 5) ('b"00"  : mword 2))) "")))))))
    | C_LD (uimm, rsc, rdc) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          (creg_name_forwards rdc) >>= fun w__53 : string =>
          (creg_name_forwards rsc) >>= fun w__54 : string =>
          returnm (string_append "c.ld"
                     (string_append (spc_forwards tt)
                        (string_append w__53
                           (string_append (sep_forwards tt)
                              (string_append w__54
                                 (string_append (sep_forwards tt)
                                    (string_append
                                       (decimal_string_of_bits
                                          (concat_vec (uimm  : mword 5) ('b"000"  : mword 3))) "")))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_SW (uimm, rsc1, rsc2) =>
       (creg_name_forwards rsc1) >>= fun w__57 : string =>
       (creg_name_forwards rsc2) >>= fun w__58 : string =>
       returnm (string_append "c.sw"
                  (string_append (spc_forwards tt)
                     (string_append w__57
                        (string_append (sep_forwards tt)
                           (string_append w__58
                              (string_append (sep_forwards tt)
                                 (string_append
                                    (decimal_string_of_bits
                                       (concat_vec (uimm  : mword 5) ('b"00"  : mword 2))) "")))))))
    | C_SD (uimm, rsc1, rsc2) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          (creg_name_forwards rsc1) >>= fun w__59 : string =>
          (creg_name_forwards rsc2) >>= fun w__60 : string =>
          returnm (string_append "c.sd"
                     (string_append (spc_forwards tt)
                        (string_append w__59
                           (string_append (sep_forwards tt)
                              (string_append w__60
                                 (string_append (sep_forwards tt)
                                    (string_append
                                       (decimal_string_of_bits
                                          (concat_vec (uimm  : mword 5) ('b"000"  : mword 3))) "")))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_ADDI (nzi, rsd) =>
       (if andb (neq_vec nzi ('b"000000"  : mword 6)) (neq_vec rsd zreg) then
          (reg_name_forwards rsd) >>= fun w__63 : string =>
          returnm (string_append "c.addi"
                     (string_append (spc_forwards tt)
                        (string_append w__63
                           (string_append (sep_forwards tt)
                              (string_append (decimal_string_of_bits nzi) "")))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_JAL imm =>
       (if sumbool_of_bool (Z.eqb 64 32) then
          returnm (string_append "c.jal"
                     (string_append (spc_forwards tt)
                        (string_append
                           (decimal_string_of_bits (concat_vec (imm  : mword 11) ('b"0"  : mword 1)))
                           "")))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_ADDIW (imm, rsd) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          (reg_name_forwards rsd) >>= fun w__68 : string =>
          returnm (string_append "c.addiw"
                     (string_append (spc_forwards tt)
                        (string_append w__68
                           (string_append (sep_forwards tt)
                              (string_append (decimal_string_of_bits imm) "")))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_LI (imm, rd) =>
       (if neq_vec rd zreg then
          (reg_name_forwards rd) >>= fun w__71 : string =>
          returnm (string_append "c.li"
                     (string_append (spc_forwards tt)
                        (string_append w__71
                           (string_append (sep_forwards tt)
                              (string_append (decimal_string_of_bits imm) "")))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_ADDI16SP imm =>
       (if neq_vec imm ('b"000000"  : mword 6) then
          returnm (string_append "c.addi16sp"
                     (string_append (spc_forwards tt)
                        (string_append (decimal_string_of_bits imm) "")))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_LUI (imm, rd) =>
       (if andb (neq_vec rd zreg) (andb (neq_vec rd sp) (neq_vec imm ('b"000000"  : mword 6))) then
          (reg_name_forwards rd) >>= fun w__76 : string =>
          returnm (string_append "c.lui"
                     (string_append (spc_forwards tt)
                        (string_append w__76
                           (string_append (sep_forwards tt)
                              (string_append (decimal_string_of_bits imm) "")))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_SRLI (shamt, rsd) =>
       (if neq_vec shamt ('b"000000"  : mword 6) then
          (creg_name_forwards rsd) >>= fun w__79 : string =>
          returnm (string_append "c.srli"
                     (string_append (spc_forwards tt)
                        (string_append w__79
                           (string_append (sep_forwards tt)
                              (string_append (decimal_string_of_bits shamt) "")))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_SRAI (shamt, rsd) =>
       (if neq_vec shamt ('b"000000"  : mword 6) then
          (creg_name_forwards rsd) >>= fun w__82 : string =>
          returnm (string_append "c.srai"
                     (string_append (spc_forwards tt)
                        (string_append w__82
                           (string_append (sep_forwards tt)
                              (string_append (decimal_string_of_bits shamt) "")))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_ANDI (imm, rsd) =>
       (creg_name_forwards rsd) >>= fun w__85 : string =>
       returnm (string_append "c.andi"
                  (string_append (spc_forwards tt)
                     (string_append w__85
                        (string_append (sep_forwards tt)
                           (string_append (decimal_string_of_bits imm) "")))))
    | C_SUB (rsd, rs2) =>
       (creg_name_forwards rsd) >>= fun w__86 : string =>
       (creg_name_forwards rs2) >>= fun w__87 : string =>
       returnm (string_append "c.sub"
                  (string_append (spc_forwards tt)
                     (string_append w__86 (string_append (sep_forwards tt) (string_append w__87 "")))))
    | C_XOR (rsd, rs2) =>
       (creg_name_forwards rsd) >>= fun w__88 : string =>
       (creg_name_forwards rs2) >>= fun w__89 : string =>
       returnm (string_append "c.xor"
                  (string_append (spc_forwards tt)
                     (string_append w__88 (string_append (sep_forwards tt) (string_append w__89 "")))))
    | C_OR (rsd, rs2) =>
       (creg_name_forwards rsd) >>= fun w__90 : string =>
       (creg_name_forwards rs2) >>= fun w__91 : string =>
       returnm (string_append "c.or"
                  (string_append (spc_forwards tt)
                     (string_append w__90 (string_append (sep_forwards tt) (string_append w__91 "")))))
    | C_AND (rsd, rs2) =>
       (creg_name_forwards rsd) >>= fun w__92 : string =>
       (creg_name_forwards rs2) >>= fun w__93 : string =>
       returnm (string_append "c.and"
                  (string_append (spc_forwards tt)
                     (string_append w__92 (string_append (sep_forwards tt) (string_append w__93 "")))))
    | C_SUBW (rsd, rs2) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          (creg_name_forwards rsd) >>= fun w__94 : string =>
          (creg_name_forwards rs2) >>= fun w__95 : string =>
          returnm (string_append "c.subw"
                     (string_append (spc_forwards tt)
                        (string_append w__94
                           (string_append (sep_forwards tt) (string_append w__95 "")))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_ADDW (rsd, rs2) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          (creg_name_forwards rsd) >>= fun w__98 : string =>
          (creg_name_forwards rs2) >>= fun w__99 : string =>
          returnm (string_append "c.addw"
                     (string_append (spc_forwards tt)
                        (string_append w__98
                           (string_append (sep_forwards tt) (string_append w__99 "")))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_J imm =>
       returnm (string_append "c.j"
                  (string_append (spc_forwards tt) (string_append (decimal_string_of_bits imm) "")))
    | C_BEQZ (imm, rs) =>
       (creg_name_forwards rs) >>= fun w__102 : string =>
       returnm (string_append "c.beqz"
                  (string_append (spc_forwards tt)
                     (string_append w__102
                        (string_append (sep_forwards tt)
                           (string_append (decimal_string_of_bits imm) "")))))
    | C_BNEZ (imm, rs) =>
       (creg_name_forwards rs) >>= fun w__103 : string =>
       returnm (string_append "c.bnez"
                  (string_append (spc_forwards tt)
                     (string_append w__103
                        (string_append (sep_forwards tt)
                           (string_append (decimal_string_of_bits imm) "")))))
    | C_SLLI (shamt, rsd) =>
       (if andb (neq_vec shamt ('b"000000"  : mword 6)) (neq_vec rsd zreg) then
          (reg_name_forwards rsd) >>= fun w__104 : string =>
          returnm (string_append "c.slli"
                     (string_append (spc_forwards tt)
                        (string_append w__104
                           (string_append (sep_forwards tt)
                              (string_append (decimal_string_of_bits shamt) "")))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_LWSP (uimm, rd) =>
       (if neq_vec rd zreg then
          (reg_name_forwards rd) >>= fun w__107 : string =>
          returnm (string_append "c.lwsp"
                     (string_append (spc_forwards tt)
                        (string_append w__107
                           (string_append (sep_forwards tt)
                              (string_append (decimal_string_of_bits uimm) "")))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_LDSP (uimm, rd) =>
       (if sumbool_of_bool (andb (neq_vec rd zreg) (Z.eqb 64 64)) then
          (reg_name_forwards rd) >>= fun w__110 : string =>
          returnm (string_append "c.ldsp"
                     (string_append (spc_forwards tt)
                        (string_append w__110
                           (string_append (sep_forwards tt)
                              (string_append (decimal_string_of_bits uimm) "")))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_SWSP (uimm, rd) =>
       (reg_name_forwards rd) >>= fun w__113 : string =>
       returnm (string_append "c.swsp"
                  (string_append (spc_forwards tt)
                     (string_append w__113
                        (string_append (sep_forwards tt)
                           (string_append (decimal_string_of_bits uimm) "")))))
    | C_SDSP (uimm, rs2) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          (reg_name_forwards rs2) >>= fun w__114 : string =>
          returnm (string_append "c.sdsp"
                     (string_append (spc_forwards tt)
                        (string_append w__114
                           (string_append (sep_forwards tt)
                              (string_append (decimal_string_of_bits uimm) "")))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_JR rs1 =>
       (if neq_vec rs1 zreg then
          (reg_name_forwards rs1) >>= fun w__117 : string =>
          returnm (string_append "c.jr" (string_append (spc_forwards tt) (string_append w__117 "")))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_JALR rs1 =>
       (if neq_vec rs1 zreg then
          (reg_name_forwards rs1) >>= fun w__120 : string =>
          returnm (string_append "c.jalr"
                     (string_append (spc_forwards tt) (string_append w__120 "")))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_MV (rd, rs2) =>
       (if andb (neq_vec rd zreg) (neq_vec rs2 zreg) then
          (reg_name_forwards rd) >>= fun w__123 : string =>
          (reg_name_forwards rs2) >>= fun w__124 : string =>
          returnm (string_append "c.mv"
                     (string_append (spc_forwards tt)
                        (string_append w__123
                           (string_append (sep_forwards tt) (string_append w__124 "")))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_EBREAK tt => returnm "c.ebreak"
    | C_ADD (rsd, rs2) =>
       (if andb (neq_vec rsd zreg) (neq_vec rs2 zreg) then
          (reg_name_forwards rsd) >>= fun w__127 : string =>
          (reg_name_forwards rs2) >>= fun w__128 : string =>
          returnm (string_append "c.add"
                     (string_append (spc_forwards tt)
                        (string_append w__127
                           (string_append (sep_forwards tt) (string_append w__128 "")))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | MUL (rs2, rs1, rd, high, signed1, signed2) =>
       (mul_mnemonic_forwards (high, signed1, signed2)) >>= fun w__131 : string =>
       (reg_name_forwards rd) >>= fun w__132 : string =>
       (reg_name_forwards rs1) >>= fun w__133 : string =>
       (reg_name_forwards rs2) >>= fun w__134 : string =>
       returnm (string_append w__131
                  (string_append (spc_forwards tt)
                     (string_append w__132
                        (string_append (sep_forwards tt)
                           (string_append w__133
                              (string_append (sep_forwards tt) (string_append w__134 "")))))))
    | DIV (rs2, rs1, rd, s) =>
       (reg_name_forwards rd) >>= fun w__135 : string =>
       (reg_name_forwards rs1) >>= fun w__136 : string =>
       (reg_name_forwards rs2) >>= fun w__137 : string =>
       returnm (string_append "div"
                  (string_append (maybe_not_u_forwards s)
                     (string_append (spc_forwards tt)
                        (string_append w__135
                           (string_append (sep_forwards tt)
                              (string_append w__136
                                 (string_append (sep_forwards tt) (string_append w__137 ""))))))))
    | REM (rs2, rs1, rd, s) =>
       (reg_name_forwards rd) >>= fun w__138 : string =>
       (reg_name_forwards rs1) >>= fun w__139 : string =>
       (reg_name_forwards rs2) >>= fun w__140 : string =>
       returnm (string_append "rem"
                  (string_append (maybe_not_u_forwards s)
                     (string_append (spc_forwards tt)
                        (string_append w__138
                           (string_append (sep_forwards tt)
                              (string_append w__139
                                 (string_append (sep_forwards tt) (string_append w__140 ""))))))))
    | MULW (rs2, rs1, rd) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          (reg_name_forwards rd) >>= fun w__141 : string =>
          (reg_name_forwards rs1) >>= fun w__142 : string =>
          (reg_name_forwards rs2) >>= fun w__143 : string =>
          returnm (string_append "mulw"
                     (string_append (spc_forwards tt)
                        (string_append w__141
                           (string_append (sep_forwards tt)
                              (string_append w__142
                                 (string_append (sep_forwards tt) (string_append w__143 "")))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | DIVW (rs2, rs1, rd, s) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          (reg_name_forwards rd) >>= fun w__146 : string =>
          (reg_name_forwards rs1) >>= fun w__147 : string =>
          (reg_name_forwards rs2) >>= fun w__148 : string =>
          returnm (string_append "div"
                     (string_append (maybe_not_u_forwards s)
                        (string_append "w"
                           (string_append (spc_forwards tt)
                              (string_append w__146
                                 (string_append (sep_forwards tt)
                                    (string_append w__147
                                       (string_append (sep_forwards tt) (string_append w__148 "")))))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | REMW (rs2, rs1, rd, s) =>
       (if sumbool_of_bool (Z.eqb 64 64) then
          (reg_name_forwards rd) >>= fun w__151 : string =>
          (reg_name_forwards rs1) >>= fun w__152 : string =>
          (reg_name_forwards rs2) >>= fun w__153 : string =>
          returnm (string_append "rem"
                     (string_append (maybe_not_u_forwards s)
                        (string_append "w"
                           (string_append (spc_forwards tt)
                              (string_append w__151
                                 (string_append (sep_forwards tt)
                                    (string_append w__152
                                       (string_append (sep_forwards tt) (string_append w__153 "")))))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | CSR (csr, rs1, rd, true, op) =>
       (reg_name_forwards rd) >>= fun w__156 : string =>
       returnm (string_append (csr_mnemonic_forwards op)
                  (string_append "i"
                     (string_append (spc_forwards tt)
                        (string_append w__156
                           (string_append (sep_forwards tt)
                              (string_append (csr_name_map_forwards csr)
                                 (string_append (sep_forwards tt)
                                    (string_append (decimal_string_of_bits rs1) ""))))))))
    | CSR (csr, rs1, rd, false, op) =>
       (reg_name_forwards rd) >>= fun w__157 : string =>
       (reg_name_forwards rs1) >>= fun w__158 : string =>
       returnm (string_append (csr_mnemonic_forwards op)
                  (string_append (spc_forwards tt)
                     (string_append w__157
                        (string_append (sep_forwards tt)
                           (string_append (csr_name_map_forwards csr)
                              (string_append (sep_forwards tt) (string_append w__158 "")))))))
    | URET tt => returnm "uret"
    | C_NOP_HINT imm =>
       returnm (string_append "c.nop.hint." (string_append (decimal_string_of_bits imm) ""))
    | C_ADDI_HINT rsd =>
       (if neq_vec rsd zreg then
          (reg_name_forwards rsd) >>= fun w__159 : string =>
          returnm (string_append "c.addi.hint." (string_append w__159 ""))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_LI_HINT imm =>
       returnm (string_append "c.li.hint." (string_append (decimal_string_of_bits imm) ""))
    | C_LUI_HINT imm =>
       (if neq_vec imm ('b"000000"  : mword 6) then
          returnm (string_append "c.lui.hint." (string_append (decimal_string_of_bits imm) ""))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_MV_HINT rs2 =>
       (if neq_vec rs2 zreg then
          (reg_name_forwards rs2) >>= fun w__164 : string =>
          returnm (string_append "c.mv.hint." (string_append w__164 ""))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_ADD_HINT rs2 =>
       (if neq_vec rs2 zreg then
          (reg_name_forwards rs2) >>= fun w__167 : string =>
          returnm (string_append "c.add.hint." (string_append w__167 ""))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_SLLI_HINT (shamt, rsd) =>
       (if orb (eq_vec shamt ('b"000000"  : mword 6)) (eq_vec rsd zreg) then
          (reg_name_forwards rsd) >>= fun w__170 : string =>
          returnm (string_append "c.slli.hint."
                     (string_append w__170
                        (string_append "." (string_append (decimal_string_of_bits shamt) ""))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_SRLI_HINT rsd =>
       (creg_name_forwards rsd) >>= fun w__173 : string =>
       returnm (string_append "c.srli.hint." (string_append w__173 ""))
    | C_SRAI_HINT rsd =>
       (creg_name_forwards rsd) >>= fun w__174 : string =>
       returnm (string_append "c.srai.hint." (string_append w__174 ""))
    | FENCE_RESERVED (fm, pred, succ, rs, rd) =>
       (if orb (andb (neq_vec fm (Ox"0"  : mword 4)) (neq_vec fm (Ox"8"  : mword 4)))
             (orb (neq_vec rs ('b"00000"  : mword 5)) (neq_vec rd ('b"00000"  : mword 5))) then
          (fence_bits_forwards pred) >>= fun w__175 : string =>
          (fence_bits_forwards succ) >>= fun w__176 : string =>
          (reg_name_forwards rs) >>= fun w__177 : string =>
          (reg_name_forwards rd) >>= fun w__178 : string =>
          returnm (string_append "fence.reserved."
                     (string_append w__175
                        (string_append "."
                           (string_append w__176
                              (string_append "."
                                 (string_append w__177
                                    (string_append "."
                                       (string_append w__178
                                          (string_append "."
                                             (string_append (decimal_string_of_bits fm) ""))))))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | FENCEI_RESERVED (imm, rs, rd) =>
       (if orb (neq_vec imm (Ox"000"  : mword 12)) (orb (neq_vec rs zreg) (neq_vec rd zreg)) then
          (reg_name_forwards rd) >>= fun w__181 : string =>
          (reg_name_forwards rs) >>= fun w__182 : string =>
          returnm (string_append "fence.i.reserved."
                     (string_append w__181
                        (string_append "."
                           (string_append w__182
                              (string_append "." (string_append (decimal_string_of_bits imm) ""))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | LOAD_FP (imm, rs1, rd, width) =>
       (freg_name_forwards rd) >>= fun w__185 : string =>
       (reg_name_forwards rs1) >>= fun w__186 : string =>
       returnm (string_append "fl"
                  (string_append (size_mnemonic_forwards width)
                     (string_append (spc_forwards tt)
                        (string_append w__185
                           (string_append (sep_forwards tt)
                              (string_append (decimal_string_of_bits imm)
                                 (string_append (opt_spc_forwards tt)
                                    (string_append "("
                                       (string_append (opt_spc_forwards tt)
                                          (string_append w__186
                                             (string_append (opt_spc_forwards tt)
                                                (string_append ")" ""))))))))))))
    | STORE_FP (imm, rs2, rs1, width) =>
       (freg_name_forwards rs2) >>= fun w__187 : string =>
       (reg_name_forwards rs1) >>= fun w__188 : string =>
       returnm (string_append "fs"
                  (string_append (size_mnemonic_forwards width)
                     (string_append (spc_forwards tt)
                        (string_append w__187
                           (string_append (sep_forwards tt)
                              (string_append (decimal_string_of_bits imm)
                                 (string_append (opt_spc_forwards tt)
                                    (string_append "("
                                       (string_append (opt_spc_forwards tt)
                                          (string_append w__188
                                             (string_append (opt_spc_forwards tt)
                                                (string_append ")" ""))))))))))))
    | F_MADD_TYPE_S (rs3, rs2, rs1, rm, rd, op) =>
       (freg_name_forwards rd) >>= fun w__189 : string =>
       (freg_name_forwards rs1) >>= fun w__190 : string =>
       (freg_name_forwards rs2) >>= fun w__191 : string =>
       (freg_name_forwards rs3) >>= fun w__192 : string =>
       returnm (string_append (f_madd_type_mnemonic_S_forwards op)
                  (string_append (spc_forwards tt)
                     (string_append w__189
                        (string_append (sep_forwards tt)
                           (string_append w__190
                              (string_append (sep_forwards tt)
                                 (string_append w__191
                                    (string_append (sep_forwards tt)
                                       (string_append w__192
                                          (string_append (sep_forwards tt)
                                             (string_append (frm_mnemonic_forwards rm) "")))))))))))
    | F_BIN_RM_TYPE_S (rs2, rs1, rm, rd, op) =>
       (freg_name_forwards rd) >>= fun w__193 : string =>
       (freg_name_forwards rs1) >>= fun w__194 : string =>
       (freg_name_forwards rs2) >>= fun w__195 : string =>
       returnm (string_append (f_bin_rm_type_mnemonic_S_forwards op)
                  (string_append (spc_forwards tt)
                     (string_append w__193
                        (string_append (sep_forwards tt)
                           (string_append w__194
                              (string_append (sep_forwards tt)
                                 (string_append w__195
                                    (string_append (sep_forwards tt)
                                       (string_append (frm_mnemonic_forwards rm) "")))))))))
    | F_UN_RM_TYPE_S (rs1, rm, rd, FSQRT_S) =>
       (freg_name_forwards rd) >>= fun w__196 : string =>
       (freg_name_forwards rs1) >>= fun w__197 : string =>
       returnm (string_append (f_un_rm_type_mnemonic_S_forwards FSQRT_S)
                  (string_append (spc_forwards tt)
                     (string_append w__196
                        (string_append (sep_forwards tt)
                           (string_append w__197
                              (string_append (sep_forwards tt)
                                 (string_append (frm_mnemonic_forwards rm) "")))))))
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_W_S) =>
       (reg_name_forwards rd) >>= fun w__198 : string =>
       (freg_name_forwards rs1) >>= fun w__199 : string =>
       returnm (string_append (f_un_rm_type_mnemonic_S_forwards FCVT_W_S)
                  (string_append (spc_forwards tt)
                     (string_append w__198
                        (string_append (sep_forwards tt)
                           (string_append w__199
                              (string_append (sep_forwards tt)
                                 (string_append (frm_mnemonic_forwards rm) "")))))))
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_WU_S) =>
       (reg_name_forwards rd) >>= fun w__200 : string =>
       (freg_name_forwards rs1) >>= fun w__201 : string =>
       returnm (string_append (f_un_rm_type_mnemonic_S_forwards FCVT_WU_S)
                  (string_append (spc_forwards tt)
                     (string_append w__200
                        (string_append (sep_forwards tt)
                           (string_append w__201
                              (string_append (sep_forwards tt)
                                 (string_append (frm_mnemonic_forwards rm) "")))))))
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_W) =>
       (freg_name_forwards rd) >>= fun w__202 : string =>
       (reg_name_forwards rs1) >>= fun w__203 : string =>
       returnm (string_append (f_un_rm_type_mnemonic_S_forwards FCVT_S_W)
                  (string_append (spc_forwards tt)
                     (string_append w__202
                        (string_append (sep_forwards tt)
                           (string_append w__203
                              (string_append (sep_forwards tt)
                                 (string_append (frm_mnemonic_forwards rm) "")))))))
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_WU) =>
       (freg_name_forwards rd) >>= fun w__204 : string =>
       (reg_name_forwards rs1) >>= fun w__205 : string =>
       returnm (string_append (f_un_rm_type_mnemonic_S_forwards FCVT_S_WU)
                  (string_append (spc_forwards tt)
                     (string_append w__204
                        (string_append (sep_forwards tt)
                           (string_append w__205
                              (string_append (sep_forwards tt)
                                 (string_append (frm_mnemonic_forwards rm) "")))))))
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_L_S) =>
       (reg_name_forwards rd) >>= fun w__206 : string =>
       (freg_name_forwards rs1) >>= fun w__207 : string =>
       returnm (string_append (f_un_rm_type_mnemonic_S_forwards FCVT_L_S)
                  (string_append (spc_forwards tt)
                     (string_append w__206
                        (string_append (sep_forwards tt)
                           (string_append w__207
                              (string_append (sep_forwards tt)
                                 (string_append (frm_mnemonic_forwards rm) "")))))))
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_LU_S) =>
       (reg_name_forwards rd) >>= fun w__208 : string =>
       (freg_name_forwards rs1) >>= fun w__209 : string =>
       returnm (string_append (f_un_rm_type_mnemonic_S_forwards FCVT_LU_S)
                  (string_append (spc_forwards tt)
                     (string_append w__208
                        (string_append (sep_forwards tt)
                           (string_append w__209
                              (string_append (sep_forwards tt)
                                 (string_append (frm_mnemonic_forwards rm) "")))))))
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_L) =>
       (freg_name_forwards rd) >>= fun w__210 : string =>
       (reg_name_forwards rs1) >>= fun w__211 : string =>
       returnm (string_append (f_un_rm_type_mnemonic_S_forwards FCVT_S_L)
                  (string_append (spc_forwards tt)
                     (string_append w__210
                        (string_append (sep_forwards tt)
                           (string_append w__211
                              (string_append (sep_forwards tt)
                                 (string_append (frm_mnemonic_forwards rm) "")))))))
    | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_LU) =>
       (freg_name_forwards rd) >>= fun w__212 : string =>
       (reg_name_forwards rs1) >>= fun w__213 : string =>
       returnm (string_append (f_un_rm_type_mnemonic_S_forwards FCVT_S_LU)
                  (string_append (spc_forwards tt)
                     (string_append w__212
                        (string_append (sep_forwards tt)
                           (string_append w__213
                              (string_append (sep_forwards tt)
                                 (string_append (frm_mnemonic_forwards rm) "")))))))
    | F_BIN_TYPE_S (rs2, rs1, rd, FSGNJ_S) =>
       (freg_name_forwards rd) >>= fun w__214 : string =>
       (freg_name_forwards rs1) >>= fun w__215 : string =>
       (freg_name_forwards rs2) >>= fun w__216 : string =>
       returnm (string_append (f_bin_type_mnemonic_S_forwards FSGNJ_S)
                  (string_append (spc_forwards tt)
                     (string_append w__214
                        (string_append (sep_forwards tt)
                           (string_append w__215
                              (string_append (sep_forwards tt) (string_append w__216 "")))))))
    | F_BIN_TYPE_S (rs2, rs1, rd, FSGNJN_S) =>
       (freg_name_forwards rd) >>= fun w__217 : string =>
       (freg_name_forwards rs1) >>= fun w__218 : string =>
       (freg_name_forwards rs2) >>= fun w__219 : string =>
       returnm (string_append (f_bin_type_mnemonic_S_forwards FSGNJN_S)
                  (string_append (spc_forwards tt)
                     (string_append w__217
                        (string_append (sep_forwards tt)
                           (string_append w__218
                              (string_append (sep_forwards tt) (string_append w__219 "")))))))
    | F_BIN_TYPE_S (rs2, rs1, rd, FSGNJX_S) =>
       (freg_name_forwards rd) >>= fun w__220 : string =>
       (freg_name_forwards rs1) >>= fun w__221 : string =>
       (freg_name_forwards rs2) >>= fun w__222 : string =>
       returnm (string_append (f_bin_type_mnemonic_S_forwards FSGNJX_S)
                  (string_append (spc_forwards tt)
                     (string_append w__220
                        (string_append (sep_forwards tt)
                           (string_append w__221
                              (string_append (sep_forwards tt) (string_append w__222 "")))))))
    | F_BIN_TYPE_S (rs2, rs1, rd, FMIN_S) =>
       (freg_name_forwards rd) >>= fun w__223 : string =>
       (freg_name_forwards rs1) >>= fun w__224 : string =>
       (freg_name_forwards rs2) >>= fun w__225 : string =>
       returnm (string_append (f_bin_type_mnemonic_S_forwards FMIN_S)
                  (string_append (spc_forwards tt)
                     (string_append w__223
                        (string_append (sep_forwards tt)
                           (string_append w__224
                              (string_append (sep_forwards tt) (string_append w__225 "")))))))
    | F_BIN_TYPE_S (rs2, rs1, rd, FMAX_S) =>
       (freg_name_forwards rd) >>= fun w__226 : string =>
       (freg_name_forwards rs1) >>= fun w__227 : string =>
       (freg_name_forwards rs2) >>= fun w__228 : string =>
       returnm (string_append (f_bin_type_mnemonic_S_forwards FMAX_S)
                  (string_append (spc_forwards tt)
                     (string_append w__226
                        (string_append (sep_forwards tt)
                           (string_append w__227
                              (string_append (sep_forwards tt) (string_append w__228 "")))))))
    | F_BIN_TYPE_S (rs2, rs1, rd, FEQ_S) =>
       (reg_name_forwards rd) >>= fun w__229 : string =>
       (freg_name_forwards rs1) >>= fun w__230 : string =>
       (freg_name_forwards rs2) >>= fun w__231 : string =>
       returnm (string_append (f_bin_type_mnemonic_S_forwards FEQ_S)
                  (string_append (spc_forwards tt)
                     (string_append w__229
                        (string_append (sep_forwards tt)
                           (string_append w__230
                              (string_append (sep_forwards tt) (string_append w__231 "")))))))
    | F_BIN_TYPE_S (rs2, rs1, rd, FLT_S) =>
       (reg_name_forwards rd) >>= fun w__232 : string =>
       (freg_name_forwards rs1) >>= fun w__233 : string =>
       (freg_name_forwards rs2) >>= fun w__234 : string =>
       returnm (string_append (f_bin_type_mnemonic_S_forwards FLT_S)
                  (string_append (spc_forwards tt)
                     (string_append w__232
                        (string_append (sep_forwards tt)
                           (string_append w__233
                              (string_append (sep_forwards tt) (string_append w__234 "")))))))
    | F_BIN_TYPE_S (rs2, rs1, rd, FLE_S) =>
       (reg_name_forwards rd) >>= fun w__235 : string =>
       (freg_name_forwards rs1) >>= fun w__236 : string =>
       (freg_name_forwards rs2) >>= fun w__237 : string =>
       returnm (string_append (f_bin_type_mnemonic_S_forwards FLE_S)
                  (string_append (spc_forwards tt)
                     (string_append w__235
                        (string_append (sep_forwards tt)
                           (string_append w__236
                              (string_append (sep_forwards tt) (string_append w__237 "")))))))
    | F_UN_TYPE_S (rs1, rd, FMV_X_W) =>
       (reg_name_forwards rd) >>= fun w__238 : string =>
       (freg_name_forwards rs1) >>= fun w__239 : string =>
       returnm (string_append (f_un_type_mnemonic_S_forwards FMV_X_W)
                  (string_append (spc_forwards tt)
                     (string_append w__238
                        (string_append (sep_forwards tt) (string_append w__239 "")))))
    | F_UN_TYPE_S (rs1, rd, FMV_W_X) =>
       (freg_name_forwards rd) >>= fun w__240 : string =>
       (reg_name_forwards rs1) >>= fun w__241 : string =>
       returnm (string_append (f_un_type_mnemonic_S_forwards FMV_W_X)
                  (string_append (spc_forwards tt)
                     (string_append w__240
                        (string_append (sep_forwards tt) (string_append w__241 "")))))
    | F_UN_TYPE_S (rs1, rd, FCLASS_S) =>
       (reg_name_forwards rd) >>= fun w__242 : string =>
       (freg_name_forwards rs1) >>= fun w__243 : string =>
       returnm (string_append (f_un_type_mnemonic_S_forwards FCLASS_S)
                  (string_append (spc_forwards tt)
                     (string_append w__242
                        (string_append (sep_forwards tt) (string_append w__243 "")))))
    | C_FLWSP (imm, rd) =>
       (if sumbool_of_bool (Z.eqb 64 32) then
          (reg_name_forwards rd) >>= fun w__244 : string =>
          returnm (string_append "c.flwsp"
                     (string_append (spc_forwards tt)
                        (string_append w__244
                           (string_append (sep_forwards tt)
                              (string_append (decimal_string_of_bits imm) "")))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_FSWSP (uimm, rd) =>
       (if sumbool_of_bool (Z.eqb 64 32) then
          (reg_name_forwards rd) >>= fun w__247 : string =>
          returnm (string_append "c.fswsp"
                     (string_append (spc_forwards tt)
                        (string_append w__247
                           (string_append (sep_forwards tt)
                              (string_append (decimal_string_of_bits uimm) "")))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_FLW (uimm, rsc, rdc) =>
       (if sumbool_of_bool (Z.eqb 64 32) then
          (creg_name_forwards rdc) >>= fun w__250 : string =>
          (creg_name_forwards rsc) >>= fun w__251 : string =>
          returnm (string_append "c.flw"
                     (string_append (spc_forwards tt)
                        (string_append w__250
                           (string_append (sep_forwards tt)
                              (string_append w__251
                                 (string_append (sep_forwards tt)
                                    (string_append
                                       (decimal_string_of_bits
                                          (concat_vec (uimm  : mword 5) ('b"00"  : mword 2))) "")))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_FSW (uimm, rsc1, rsc2) =>
       (if sumbool_of_bool (Z.eqb 64 32) then
          (creg_name_forwards rsc1) >>= fun w__254 : string =>
          (creg_name_forwards rsc2) >>= fun w__255 : string =>
          returnm (string_append "c.fsw"
                     (string_append (spc_forwards tt)
                        (string_append w__254
                           (string_append (sep_forwards tt)
                              (string_append w__255
                                 (string_append (sep_forwards tt)
                                    (string_append
                                       (decimal_string_of_bits
                                          (concat_vec (uimm  : mword 5) ('b"00"  : mword 2))) "")))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | F_MADD_TYPE_D (rs3, rs2, rs1, rm, rd, op) =>
       (freg_name_forwards rd) >>= fun w__258 : string =>
       (freg_name_forwards rs1) >>= fun w__259 : string =>
       (freg_name_forwards rs2) >>= fun w__260 : string =>
       (freg_name_forwards rs3) >>= fun w__261 : string =>
       returnm (string_append (f_madd_type_mnemonic_D_forwards op)
                  (string_append (spc_forwards tt)
                     (string_append w__258
                        (string_append (sep_forwards tt)
                           (string_append w__259
                              (string_append (sep_forwards tt)
                                 (string_append w__260
                                    (string_append (sep_forwards tt)
                                       (string_append w__261
                                          (string_append (sep_forwards tt)
                                             (string_append (frm_mnemonic_forwards rm) "")))))))))))
    | F_BIN_RM_TYPE_D (rs2, rs1, rm, rd, op) =>
       (freg_name_forwards rd) >>= fun w__262 : string =>
       (freg_name_forwards rs1) >>= fun w__263 : string =>
       (freg_name_forwards rs2) >>= fun w__264 : string =>
       returnm (string_append (f_bin_rm_type_mnemonic_D_forwards op)
                  (string_append (spc_forwards tt)
                     (string_append w__262
                        (string_append (sep_forwards tt)
                           (string_append w__263
                              (string_append (sep_forwards tt)
                                 (string_append w__264
                                    (string_append (sep_forwards tt)
                                       (string_append (frm_mnemonic_forwards rm) "")))))))))
    | F_UN_RM_TYPE_D (rs1, rm, rd, FSQRT_D) =>
       (freg_name_forwards rd) >>= fun w__265 : string =>
       (freg_name_forwards rs1) >>= fun w__266 : string =>
       returnm (string_append (f_un_rm_type_mnemonic_D_forwards FSQRT_D)
                  (string_append (spc_forwards tt)
                     (string_append w__265
                        (string_append (sep_forwards tt)
                           (string_append w__266
                              (string_append (sep_forwards tt)
                                 (string_append (frm_mnemonic_forwards rm) "")))))))
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_W_D) =>
       (reg_name_forwards rd) >>= fun w__267 : string =>
       (freg_name_forwards rs1) >>= fun w__268 : string =>
       returnm (string_append (f_un_rm_type_mnemonic_D_forwards FCVT_W_D)
                  (string_append (spc_forwards tt)
                     (string_append w__267
                        (string_append (sep_forwards tt)
                           (string_append w__268
                              (string_append (sep_forwards tt)
                                 (string_append (frm_mnemonic_forwards rm) "")))))))
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_WU_D) =>
       (reg_name_forwards rd) >>= fun w__269 : string =>
       (freg_name_forwards rs1) >>= fun w__270 : string =>
       returnm (string_append (f_un_rm_type_mnemonic_D_forwards FCVT_WU_D)
                  (string_append (spc_forwards tt)
                     (string_append w__269
                        (string_append (sep_forwards tt)
                           (string_append w__270
                              (string_append (sep_forwards tt)
                                 (string_append (frm_mnemonic_forwards rm) "")))))))
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_W) =>
       (freg_name_forwards rd) >>= fun w__271 : string =>
       (reg_name_forwards rs1) >>= fun w__272 : string =>
       returnm (string_append (f_un_rm_type_mnemonic_D_forwards FCVT_D_W)
                  (string_append (spc_forwards tt)
                     (string_append w__271
                        (string_append (sep_forwards tt)
                           (string_append w__272
                              (string_append (sep_forwards tt)
                                 (string_append (frm_mnemonic_forwards rm) "")))))))
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_WU) =>
       (freg_name_forwards rd) >>= fun w__273 : string =>
       (reg_name_forwards rs1) >>= fun w__274 : string =>
       returnm (string_append (f_un_rm_type_mnemonic_D_forwards FCVT_D_WU)
                  (string_append (spc_forwards tt)
                     (string_append w__273
                        (string_append (sep_forwards tt)
                           (string_append w__274
                              (string_append (sep_forwards tt)
                                 (string_append (frm_mnemonic_forwards rm) "")))))))
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_L_D) =>
       (reg_name_forwards rd) >>= fun w__275 : string =>
       (freg_name_forwards rs1) >>= fun w__276 : string =>
       returnm (string_append (f_un_rm_type_mnemonic_D_forwards FCVT_L_D)
                  (string_append (spc_forwards tt)
                     (string_append w__275
                        (string_append (sep_forwards tt)
                           (string_append w__276
                              (string_append (sep_forwards tt)
                                 (string_append (frm_mnemonic_forwards rm) "")))))))
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_LU_D) =>
       (reg_name_forwards rd) >>= fun w__277 : string =>
       (freg_name_forwards rs1) >>= fun w__278 : string =>
       returnm (string_append (f_un_rm_type_mnemonic_D_forwards FCVT_LU_D)
                  (string_append (spc_forwards tt)
                     (string_append w__277
                        (string_append (sep_forwards tt)
                           (string_append w__278
                              (string_append (sep_forwards tt)
                                 (string_append (frm_mnemonic_forwards rm) "")))))))
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_L) =>
       (freg_name_forwards rd) >>= fun w__279 : string =>
       (reg_name_forwards rs1) >>= fun w__280 : string =>
       returnm (string_append (f_un_rm_type_mnemonic_D_forwards FCVT_D_L)
                  (string_append (spc_forwards tt)
                     (string_append w__279
                        (string_append (sep_forwards tt)
                           (string_append w__280
                              (string_append (sep_forwards tt)
                                 (string_append (frm_mnemonic_forwards rm) "")))))))
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_LU) =>
       (freg_name_forwards rd) >>= fun w__281 : string =>
       (reg_name_forwards rs1) >>= fun w__282 : string =>
       returnm (string_append (f_un_rm_type_mnemonic_D_forwards FCVT_D_LU)
                  (string_append (spc_forwards tt)
                     (string_append w__281
                        (string_append (sep_forwards tt)
                           (string_append w__282
                              (string_append (sep_forwards tt)
                                 (string_append (frm_mnemonic_forwards rm) "")))))))
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_S_D) =>
       (freg_name_forwards rd) >>= fun w__283 : string =>
       (freg_name_forwards rs1) >>= fun w__284 : string =>
       returnm (string_append (f_un_rm_type_mnemonic_D_forwards FCVT_S_D)
                  (string_append (spc_forwards tt)
                     (string_append w__283
                        (string_append (sep_forwards tt)
                           (string_append w__284
                              (string_append (sep_forwards tt)
                                 (string_append (frm_mnemonic_forwards rm) "")))))))
    | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_S) =>
       (freg_name_forwards rd) >>= fun w__285 : string =>
       (freg_name_forwards rs1) >>= fun w__286 : string =>
       returnm (string_append (f_un_rm_type_mnemonic_D_forwards FCVT_D_S)
                  (string_append (spc_forwards tt)
                     (string_append w__285
                        (string_append (sep_forwards tt)
                           (string_append w__286
                              (string_append (sep_forwards tt)
                                 (string_append (frm_mnemonic_forwards rm) "")))))))
    | F_BIN_TYPE_D (rs2, rs1, rd, FSGNJ_D) =>
       (freg_name_forwards rd) >>= fun w__287 : string =>
       (freg_name_forwards rs1) >>= fun w__288 : string =>
       (freg_name_forwards rs2) >>= fun w__289 : string =>
       returnm (string_append (f_bin_type_mnemonic_D_forwards FSGNJ_D)
                  (string_append (spc_forwards tt)
                     (string_append w__287
                        (string_append (sep_forwards tt)
                           (string_append w__288
                              (string_append (sep_forwards tt) (string_append w__289 "")))))))
    | F_BIN_TYPE_D (rs2, rs1, rd, FSGNJN_D) =>
       (freg_name_forwards rd) >>= fun w__290 : string =>
       (freg_name_forwards rs1) >>= fun w__291 : string =>
       (freg_name_forwards rs2) >>= fun w__292 : string =>
       returnm (string_append (f_bin_type_mnemonic_D_forwards FSGNJN_D)
                  (string_append (spc_forwards tt)
                     (string_append w__290
                        (string_append (sep_forwards tt)
                           (string_append w__291
                              (string_append (sep_forwards tt) (string_append w__292 "")))))))
    | F_BIN_TYPE_D (rs2, rs1, rd, FSGNJX_D) =>
       (freg_name_forwards rd) >>= fun w__293 : string =>
       (freg_name_forwards rs1) >>= fun w__294 : string =>
       (freg_name_forwards rs2) >>= fun w__295 : string =>
       returnm (string_append (f_bin_type_mnemonic_D_forwards FSGNJX_D)
                  (string_append (spc_forwards tt)
                     (string_append w__293
                        (string_append (sep_forwards tt)
                           (string_append w__294
                              (string_append (sep_forwards tt) (string_append w__295 "")))))))
    | F_BIN_TYPE_D (rs2, rs1, rd, FMIN_D) =>
       (freg_name_forwards rd) >>= fun w__296 : string =>
       (freg_name_forwards rs1) >>= fun w__297 : string =>
       (freg_name_forwards rs2) >>= fun w__298 : string =>
       returnm (string_append (f_bin_type_mnemonic_D_forwards FMIN_D)
                  (string_append (spc_forwards tt)
                     (string_append w__296
                        (string_append (sep_forwards tt)
                           (string_append w__297
                              (string_append (sep_forwards tt) (string_append w__298 "")))))))
    | F_BIN_TYPE_D (rs2, rs1, rd, FMAX_D) =>
       (freg_name_forwards rd) >>= fun w__299 : string =>
       (freg_name_forwards rs1) >>= fun w__300 : string =>
       (freg_name_forwards rs2) >>= fun w__301 : string =>
       returnm (string_append (f_bin_type_mnemonic_D_forwards FMAX_D)
                  (string_append (spc_forwards tt)
                     (string_append w__299
                        (string_append (sep_forwards tt)
                           (string_append w__300
                              (string_append (sep_forwards tt) (string_append w__301 "")))))))
    | F_BIN_TYPE_D (rs2, rs1, rd, FEQ_D) =>
       (reg_name_forwards rd) >>= fun w__302 : string =>
       (freg_name_forwards rs1) >>= fun w__303 : string =>
       (freg_name_forwards rs2) >>= fun w__304 : string =>
       returnm (string_append (f_bin_type_mnemonic_D_forwards FEQ_D)
                  (string_append (spc_forwards tt)
                     (string_append w__302
                        (string_append (sep_forwards tt)
                           (string_append w__303
                              (string_append (sep_forwards tt) (string_append w__304 "")))))))
    | F_BIN_TYPE_D (rs2, rs1, rd, FLT_D) =>
       (reg_name_forwards rd) >>= fun w__305 : string =>
       (freg_name_forwards rs1) >>= fun w__306 : string =>
       (freg_name_forwards rs2) >>= fun w__307 : string =>
       returnm (string_append (f_bin_type_mnemonic_D_forwards FLT_D)
                  (string_append (spc_forwards tt)
                     (string_append w__305
                        (string_append (sep_forwards tt)
                           (string_append w__306
                              (string_append (sep_forwards tt) (string_append w__307 "")))))))
    | F_BIN_TYPE_D (rs2, rs1, rd, FLE_D) =>
       (reg_name_forwards rd) >>= fun w__308 : string =>
       (freg_name_forwards rs1) >>= fun w__309 : string =>
       (freg_name_forwards rs2) >>= fun w__310 : string =>
       returnm (string_append (f_bin_type_mnemonic_D_forwards FLE_D)
                  (string_append (spc_forwards tt)
                     (string_append w__308
                        (string_append (sep_forwards tt)
                           (string_append w__309
                              (string_append (sep_forwards tt) (string_append w__310 "")))))))
    | F_UN_TYPE_D (rs1, rd, FMV_X_D) =>
       (reg_name_forwards rd) >>= fun w__311 : string =>
       (freg_name_forwards rs1) >>= fun w__312 : string =>
       returnm (string_append (f_un_type_mnemonic_D_forwards FMV_X_D)
                  (string_append (spc_forwards tt)
                     (string_append w__311
                        (string_append (sep_forwards tt) (string_append w__312 "")))))
    | F_UN_TYPE_D (rs1, rd, FMV_D_X) =>
       (freg_name_forwards rd) >>= fun w__313 : string =>
       (reg_name_forwards rs1) >>= fun w__314 : string =>
       returnm (string_append (f_un_type_mnemonic_D_forwards FMV_D_X)
                  (string_append (spc_forwards tt)
                     (string_append w__313
                        (string_append (sep_forwards tt) (string_append w__314 "")))))
    | F_UN_TYPE_D (rs1, rd, FCLASS_D) =>
       (reg_name_forwards rd) >>= fun w__315 : string =>
       (freg_name_forwards rs1) >>= fun w__316 : string =>
       returnm (string_append (f_un_type_mnemonic_D_forwards FCLASS_D)
                  (string_append (spc_forwards tt)
                     (string_append w__315
                        (string_append (sep_forwards tt) (string_append w__316 "")))))
    | C_FLDSP (uimm, rd) =>
       (if sumbool_of_bool (orb (Z.eqb 64 32) (Z.eqb 64 64)) then
          (reg_name_forwards rd) >>= fun w__317 : string =>
          returnm (string_append "c.fldsp"
                     (string_append (spc_forwards tt)
                        (string_append w__317
                           (string_append (sep_forwards tt)
                              (string_append (decimal_string_of_bits uimm) "")))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_FSDSP (uimm, rs2) =>
       (if sumbool_of_bool (orb (Z.eqb 64 32) (Z.eqb 64 64)) then
          (reg_name_forwards rs2) >>= fun w__320 : string =>
          returnm (string_append "c.fsdsp"
                     (string_append (spc_forwards tt)
                        (string_append w__320
                           (string_append (sep_forwards tt)
                              (string_append (decimal_string_of_bits uimm) "")))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_FLD (uimm, rsc, rdc) =>
       (if sumbool_of_bool (orb (Z.eqb 64 32) (Z.eqb 64 64)) then
          (creg_name_forwards rdc) >>= fun w__323 : string =>
          (creg_name_forwards rsc) >>= fun w__324 : string =>
          returnm (string_append "c.fld"
                     (string_append (spc_forwards tt)
                        (string_append w__323
                           (string_append (sep_forwards tt)
                              (string_append w__324
                                 (string_append (sep_forwards tt)
                                    (string_append
                                       (decimal_string_of_bits
                                          (concat_vec (uimm  : mword 5) ('b"000"  : mword 3))) "")))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | C_FSD (uimm, rsc1, rsc2) =>
       (if sumbool_of_bool (orb (Z.eqb 64 32) (Z.eqb 64 64)) then
          (creg_name_forwards rsc1) >>= fun w__327 : string =>
          (creg_name_forwards rsc2) >>= fun w__328 : string =>
          returnm (string_append "c.fsd"
                     (string_append (spc_forwards tt)
                        (string_append w__327
                           (string_append (sep_forwards tt)
                              (string_append w__328
                                 (string_append (sep_forwards tt)
                                    (string_append
                                       (decimal_string_of_bits
                                          (concat_vec (uimm  : mword 5) ('b"000"  : mword 3))) "")))))))
        else assert_exp' false "Pattern match failure at unknown location" >>= fun _ => exit tt)
        : M (string)
    | ILLEGAL s =>
       returnm (string_append "illegal"
                  (string_append (spc_forwards tt) (string_append (decimal_string_of_bits s) "")))
    | C_ILLEGAL s =>
       returnm (string_append "c.illegal"
                  (string_append (spc_forwards tt) (string_append (decimal_string_of_bits s) "")))
    end)
    : M (string).

Definition _s3229_ (_s3230_ : string) : M (option (mword 16)) :=
   let _s3231_ := _s3230_ in
   (if string_startswith _s3231_ "c.illegal" then
      (match (string_drop _s3231_ (projT1 (string_length "c.illegal"))) with
       | _s3232_ =>
          (spc_matches_prefix _s3232_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          returnm (match w__0 with
                   | Some (tt, existT _ _s3233_ _) =>
                      match (string_drop _s3232_ _s3233_) with
                      | _s3234_ =>
                         match (hex_bits_16_matches_prefix _s3234_) with
                         | Some (s, existT _ _s3235_ _) =>
                            let p0_ := string_drop _s3234_ _s3235_ in
                            if generic_eq p0_ "" then Some s
                            else None
                         | _ => None
                         end
                      end
                   | _ => None
                   end)
       end)
       : M (option (mword 16))
    else returnm None)
    : M (option (mword 16)).

Definition _s3221_ (_s3222_ : string) : M (option (mword 32)) :=
   let _s3223_ := _s3222_ in
   (if string_startswith _s3223_ "illegal" then
      (match (string_drop _s3223_ (projT1 (string_length "illegal"))) with
       | _s3224_ =>
          (spc_matches_prefix _s3224_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          returnm (match w__0 with
                   | Some (tt, existT _ _s3225_ _) =>
                      match (string_drop _s3224_ _s3225_) with
                      | _s3226_ =>
                         match (hex_bits_32_matches_prefix _s3226_) with
                         | Some (s, existT _ _s3227_ _) =>
                            let p0_ := string_drop _s3226_ _s3227_ in
                            if generic_eq p0_ "" then Some s
                            else None
                         | _ => None
                         end
                      end
                   | _ => None
                   end)
       end)
       : M (option (mword 32))
    else returnm None)
    : M (option (mword 32)).

Definition _s3205_ (_s3206_ : string) : M (option ((mword 3 * mword 3 * mword 5))) :=
   let _s3207_ := _s3206_ in
   (if string_startswith _s3207_ "c.fsd" then
      (match (string_drop _s3207_ (projT1 (string_length "c.fsd"))) with
       | _s3208_ =>
          (spc_matches_prefix _s3208_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3209_ _) =>
              (match (string_drop _s3208_ _s3209_) with
               | _s3210_ =>
                  (creg_name_matches_prefix _s3210_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsc1, existT _ _s3211_ _) =>
                      (match (string_drop _s3210_ _s3211_) with
                       | _s3212_ =>
                          (sep_matches_prefix _s3212_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s3213_ _) =>
                              (match (string_drop _s3212_ _s3213_) with
                               | _s3214_ =>
                                  (creg_name_matches_prefix _s3214_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc2, existT _ _s3215_ _) =>
                                      (match (string_drop _s3214_ _s3215_) with
                                       | _s3216_ =>
                                          (sep_matches_prefix _s3216_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s3217_ _) =>
                                                      match (string_drop _s3216_ _s3217_) with
                                                      | _s3218_ =>
                                                         match (hex_bits_8_matches_prefix _s3218_) with
                                                         | Some (v__1442, existT _ _s3219_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1442 2 0)
                                                                 ('b"000"
                                                                  : mword (2 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1442 7 3 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1442 7 3 in
                                                              let p0_ := string_drop _s3218_ _s3219_ in
                                                              if generic_eq p0_ "" then
                                                                Some (rsc1, rsc2, uimm)
                                                              else None
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5))).

Definition _s3189_ (_s3190_ : string) : M (option ((mword 3 * mword 3 * mword 5))) :=
   let _s3191_ := _s3190_ in
   (if string_startswith _s3191_ "c.fld" then
      (match (string_drop _s3191_ (projT1 (string_length "c.fld"))) with
       | _s3192_ =>
          (spc_matches_prefix _s3192_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3193_ _) =>
              (match (string_drop _s3192_ _s3193_) with
               | _s3194_ =>
                  (creg_name_matches_prefix _s3194_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rdc, existT _ _s3195_ _) =>
                      (match (string_drop _s3194_ _s3195_) with
                       | _s3196_ =>
                          (sep_matches_prefix _s3196_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s3197_ _) =>
                              (match (string_drop _s3196_ _s3197_) with
                               | _s3198_ =>
                                  (creg_name_matches_prefix _s3198_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc, existT _ _s3199_ _) =>
                                      (match (string_drop _s3198_ _s3199_) with
                                       | _s3200_ =>
                                          (sep_matches_prefix _s3200_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s3201_ _) =>
                                                      match (string_drop _s3200_ _s3201_) with
                                                      | _s3202_ =>
                                                         match (hex_bits_8_matches_prefix _s3202_) with
                                                         | Some (v__1444, existT _ _s3203_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1444 2 0)
                                                                 ('b"000"
                                                                  : mword (2 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1444 7 3 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1444 7 3 in
                                                              let p0_ := string_drop _s3202_ _s3203_ in
                                                              if generic_eq p0_ "" then
                                                                Some (rdc, rsc, uimm)
                                                              else None
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5))).

Definition _s3177_ (_s3178_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s3179_ := _s3178_ in
   (if string_startswith _s3179_ "c.fsdsp" then
      (match (string_drop _s3179_ (projT1 (string_length "c.fsdsp"))) with
       | _s3180_ =>
          (spc_matches_prefix _s3180_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3181_ _) =>
              (match (string_drop _s3180_ _s3181_) with
               | _s3182_ =>
                  (reg_name_matches_prefix _s3182_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rs2, existT _ _s3183_ _) =>
                      (match (string_drop _s3182_ _s3183_) with
                       | _s3184_ =>
                          (sep_matches_prefix _s3184_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s3185_ _) =>
                                      match (string_drop _s3184_ _s3185_) with
                                      | _s3186_ =>
                                         match (hex_bits_6_matches_prefix _s3186_) with
                                         | Some (uimm, existT _ _s3187_ _) =>
                                            let p0_ := string_drop _s3186_ _s3187_ in
                                            if generic_eq p0_ "" then Some (rs2, uimm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s3165_ (_s3166_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s3167_ := _s3166_ in
   (if string_startswith _s3167_ "c.fldsp" then
      (match (string_drop _s3167_ (projT1 (string_length "c.fldsp"))) with
       | _s3168_ =>
          (spc_matches_prefix _s3168_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3169_ _) =>
              (match (string_drop _s3168_ _s3169_) with
               | _s3170_ =>
                  (reg_name_matches_prefix _s3170_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s3171_ _) =>
                      (match (string_drop _s3170_ _s3171_) with
                       | _s3172_ =>
                          (sep_matches_prefix _s3172_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s3173_ _) =>
                                      match (string_drop _s3172_ _s3173_) with
                                      | _s3174_ =>
                                         match (hex_bits_6_matches_prefix _s3174_) with
                                         | Some (uimm, existT _ _s3175_ _) =>
                                            let p0_ := string_drop _s3174_ _s3175_ in
                                            if generic_eq p0_ "" then Some (rd, uimm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s3152_ (_s3153_ : string) : M (option ((f_un_op_D * mword 5 * mword 5))) :=
   (match _s3153_ with
    | _s3154_ =>
       (f_un_type_mnemonic_D_matches_prefix _s3154_) >>= fun w__0 : option ((f_un_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCLASS_D, existT _ _s3155_ _) =>
           (match (string_drop _s3154_ _s3155_) with
            | _s3156_ =>
               (spc_matches_prefix _s3156_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s3157_ _) =>
                   (match (string_drop _s3156_ _s3157_) with
                    | _s3158_ =>
                       (reg_name_matches_prefix _s3158_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s3159_ _) =>
                           (match (string_drop _s3158_ _s3159_) with
                            | _s3160_ =>
                               (sep_matches_prefix _s3160_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s3161_ _) =>
                                   (match (string_drop _s3160_ _s3161_) with
                                    | _s3162_ =>
                                       (freg_name_matches_prefix _s3162_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       returnm (match w__4 with
                                                | Some (rs1, existT _ _s3163_ _) =>
                                                   let p0_ := string_drop _s3162_ _s3163_ in
                                                   if generic_eq p0_ "" then
                                                     Some (FCLASS_D, rd, rs1)
                                                   else None
                                                | _ => None
                                                end)
                                    end)
                                    : M (option ((f_un_op_D * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_op_D * mword 5 * mword 5)))
                            end)
                            : M (option ((f_un_op_D * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_op_D * mword 5 * mword 5)))
                    end)
                    : M (option ((f_un_op_D * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_un_op_D * mword 5 * mword 5)))
            end)
            : M (option ((f_un_op_D * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_un_op_D * mword 5 * mword 5)))
    end)
    : M (option ((f_un_op_D * mword 5 * mword 5))).

Definition _s3139_ (_s3140_ : string) : M (option ((f_un_op_D * mword 5 * mword 5))) :=
   (match _s3140_ with
    | _s3141_ =>
       (f_un_type_mnemonic_D_matches_prefix _s3141_) >>= fun w__0 : option ((f_un_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMV_D_X, existT _ _s3142_ _) =>
           (match (string_drop _s3141_ _s3142_) with
            | _s3143_ =>
               (spc_matches_prefix _s3143_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s3144_ _) =>
                   (match (string_drop _s3143_ _s3144_) with
                    | _s3145_ =>
                       (freg_name_matches_prefix _s3145_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s3146_ _) =>
                           (match (string_drop _s3145_ _s3146_) with
                            | _s3147_ =>
                               (sep_matches_prefix _s3147_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s3148_ _) =>
                                   (match (string_drop _s3147_ _s3148_) with
                                    | _s3149_ =>
                                       (reg_name_matches_prefix _s3149_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       returnm (match w__4 with
                                                | Some (rs1, existT _ _s3150_ _) =>
                                                   let p0_ := string_drop _s3149_ _s3150_ in
                                                   if generic_eq p0_ "" then Some (FMV_D_X, rd, rs1)
                                                   else None
                                                | _ => None
                                                end)
                                    end)
                                    : M (option ((f_un_op_D * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_op_D * mword 5 * mword 5)))
                            end)
                            : M (option ((f_un_op_D * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_op_D * mword 5 * mword 5)))
                    end)
                    : M (option ((f_un_op_D * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_un_op_D * mword 5 * mword 5)))
            end)
            : M (option ((f_un_op_D * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_un_op_D * mword 5 * mword 5)))
    end)
    : M (option ((f_un_op_D * mword 5 * mword 5))).

Definition _s3126_ (_s3127_ : string) : M (option ((f_un_op_D * mword 5 * mword 5))) :=
   (match _s3127_ with
    | _s3128_ =>
       (f_un_type_mnemonic_D_matches_prefix _s3128_) >>= fun w__0 : option ((f_un_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMV_X_D, existT _ _s3129_ _) =>
           (match (string_drop _s3128_ _s3129_) with
            | _s3130_ =>
               (spc_matches_prefix _s3130_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s3131_ _) =>
                   (match (string_drop _s3130_ _s3131_) with
                    | _s3132_ =>
                       (reg_name_matches_prefix _s3132_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s3133_ _) =>
                           (match (string_drop _s3132_ _s3133_) with
                            | _s3134_ =>
                               (sep_matches_prefix _s3134_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s3135_ _) =>
                                   (match (string_drop _s3134_ _s3135_) with
                                    | _s3136_ =>
                                       (freg_name_matches_prefix _s3136_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       returnm (match w__4 with
                                                | Some (rs1, existT _ _s3137_ _) =>
                                                   let p0_ := string_drop _s3136_ _s3137_ in
                                                   if generic_eq p0_ "" then Some (FMV_X_D, rd, rs1)
                                                   else None
                                                | _ => None
                                                end)
                                    end)
                                    : M (option ((f_un_op_D * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_op_D * mword 5 * mword 5)))
                            end)
                            : M (option ((f_un_op_D * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_op_D * mword 5 * mword 5)))
                    end)
                    : M (option ((f_un_op_D * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_un_op_D * mword 5 * mword 5)))
            end)
            : M (option ((f_un_op_D * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_un_op_D * mword 5 * mword 5)))
    end)
    : M (option ((f_un_op_D * mword 5 * mword 5))).

Definition _s3109_ (_s3110_ : string) : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))) :=
   (match _s3110_ with
    | _s3111_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s3111_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FLE_D, existT _ _s3112_ _) =>
           (match (string_drop _s3111_ _s3112_) with
            | _s3113_ =>
               (spc_matches_prefix _s3113_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s3114_ _) =>
                   (match (string_drop _s3113_ _s3114_) with
                    | _s3115_ =>
                       (reg_name_matches_prefix _s3115_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s3116_ _) =>
                           (match (string_drop _s3115_ _s3116_) with
                            | _s3117_ =>
                               (sep_matches_prefix _s3117_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s3118_ _) =>
                                   (match (string_drop _s3117_ _s3118_) with
                                    | _s3119_ =>
                                       (freg_name_matches_prefix _s3119_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s3120_ _) =>
                                           (match (string_drop _s3119_ _s3120_) with
                                            | _s3121_ =>
                                               (sep_matches_prefix _s3121_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s3122_ _) =>
                                                   (match (string_drop _s3121_ _s3122_) with
                                                    | _s3123_ =>
                                                       (freg_name_matches_prefix _s3123_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s3124_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s3123_ _s3124_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FLE_D, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))).

Definition _s3092_ (_s3093_ : string) : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))) :=
   (match _s3093_ with
    | _s3094_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s3094_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FLT_D, existT _ _s3095_ _) =>
           (match (string_drop _s3094_ _s3095_) with
            | _s3096_ =>
               (spc_matches_prefix _s3096_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s3097_ _) =>
                   (match (string_drop _s3096_ _s3097_) with
                    | _s3098_ =>
                       (reg_name_matches_prefix _s3098_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s3099_ _) =>
                           (match (string_drop _s3098_ _s3099_) with
                            | _s3100_ =>
                               (sep_matches_prefix _s3100_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s3101_ _) =>
                                   (match (string_drop _s3100_ _s3101_) with
                                    | _s3102_ =>
                                       (freg_name_matches_prefix _s3102_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s3103_ _) =>
                                           (match (string_drop _s3102_ _s3103_) with
                                            | _s3104_ =>
                                               (sep_matches_prefix _s3104_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s3105_ _) =>
                                                   (match (string_drop _s3104_ _s3105_) with
                                                    | _s3106_ =>
                                                       (freg_name_matches_prefix _s3106_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s3107_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s3106_ _s3107_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FLT_D, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))).

Definition _s3075_ (_s3076_ : string) : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))) :=
   (match _s3076_ with
    | _s3077_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s3077_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FEQ_D, existT _ _s3078_ _) =>
           (match (string_drop _s3077_ _s3078_) with
            | _s3079_ =>
               (spc_matches_prefix _s3079_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s3080_ _) =>
                   (match (string_drop _s3079_ _s3080_) with
                    | _s3081_ =>
                       (reg_name_matches_prefix _s3081_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s3082_ _) =>
                           (match (string_drop _s3081_ _s3082_) with
                            | _s3083_ =>
                               (sep_matches_prefix _s3083_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s3084_ _) =>
                                   (match (string_drop _s3083_ _s3084_) with
                                    | _s3085_ =>
                                       (freg_name_matches_prefix _s3085_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s3086_ _) =>
                                           (match (string_drop _s3085_ _s3086_) with
                                            | _s3087_ =>
                                               (sep_matches_prefix _s3087_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s3088_ _) =>
                                                   (match (string_drop _s3087_ _s3088_) with
                                                    | _s3089_ =>
                                                       (freg_name_matches_prefix _s3089_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s3090_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s3089_ _s3090_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FEQ_D, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))).

Definition _s3058_ (_s3059_ : string) : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))) :=
   (match _s3059_ with
    | _s3060_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s3060_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMAX_D, existT _ _s3061_ _) =>
           (match (string_drop _s3060_ _s3061_) with
            | _s3062_ =>
               (spc_matches_prefix _s3062_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s3063_ _) =>
                   (match (string_drop _s3062_ _s3063_) with
                    | _s3064_ =>
                       (freg_name_matches_prefix _s3064_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s3065_ _) =>
                           (match (string_drop _s3064_ _s3065_) with
                            | _s3066_ =>
                               (sep_matches_prefix _s3066_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s3067_ _) =>
                                   (match (string_drop _s3066_ _s3067_) with
                                    | _s3068_ =>
                                       (freg_name_matches_prefix _s3068_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s3069_ _) =>
                                           (match (string_drop _s3068_ _s3069_) with
                                            | _s3070_ =>
                                               (sep_matches_prefix _s3070_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s3071_ _) =>
                                                   (match (string_drop _s3070_ _s3071_) with
                                                    | _s3072_ =>
                                                       (freg_name_matches_prefix _s3072_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s3073_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s3072_ _s3073_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FMAX_D, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))).

Definition _s3041_ (_s3042_ : string) : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))) :=
   (match _s3042_ with
    | _s3043_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s3043_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMIN_D, existT _ _s3044_ _) =>
           (match (string_drop _s3043_ _s3044_) with
            | _s3045_ =>
               (spc_matches_prefix _s3045_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s3046_ _) =>
                   (match (string_drop _s3045_ _s3046_) with
                    | _s3047_ =>
                       (freg_name_matches_prefix _s3047_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s3048_ _) =>
                           (match (string_drop _s3047_ _s3048_) with
                            | _s3049_ =>
                               (sep_matches_prefix _s3049_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s3050_ _) =>
                                   (match (string_drop _s3049_ _s3050_) with
                                    | _s3051_ =>
                                       (freg_name_matches_prefix _s3051_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s3052_ _) =>
                                           (match (string_drop _s3051_ _s3052_) with
                                            | _s3053_ =>
                                               (sep_matches_prefix _s3053_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s3054_ _) =>
                                                   (match (string_drop _s3053_ _s3054_) with
                                                    | _s3055_ =>
                                                       (freg_name_matches_prefix _s3055_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s3056_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s3055_ _s3056_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FMIN_D, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))).

Definition _s3024_ (_s3025_ : string) : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))) :=
   (match _s3025_ with
    | _s3026_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s3026_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSGNJX_D, existT _ _s3027_ _) =>
           (match (string_drop _s3026_ _s3027_) with
            | _s3028_ =>
               (spc_matches_prefix _s3028_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s3029_ _) =>
                   (match (string_drop _s3028_ _s3029_) with
                    | _s3030_ =>
                       (freg_name_matches_prefix _s3030_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s3031_ _) =>
                           (match (string_drop _s3030_ _s3031_) with
                            | _s3032_ =>
                               (sep_matches_prefix _s3032_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s3033_ _) =>
                                   (match (string_drop _s3032_ _s3033_) with
                                    | _s3034_ =>
                                       (freg_name_matches_prefix _s3034_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s3035_ _) =>
                                           (match (string_drop _s3034_ _s3035_) with
                                            | _s3036_ =>
                                               (sep_matches_prefix _s3036_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s3037_ _) =>
                                                   (match (string_drop _s3036_ _s3037_) with
                                                    | _s3038_ =>
                                                       (freg_name_matches_prefix _s3038_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s3039_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s3038_ _s3039_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FSGNJX_D, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))).

Definition _s3007_ (_s3008_ : string) : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))) :=
   (match _s3008_ with
    | _s3009_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s3009_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSGNJN_D, existT _ _s3010_ _) =>
           (match (string_drop _s3009_ _s3010_) with
            | _s3011_ =>
               (spc_matches_prefix _s3011_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s3012_ _) =>
                   (match (string_drop _s3011_ _s3012_) with
                    | _s3013_ =>
                       (freg_name_matches_prefix _s3013_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s3014_ _) =>
                           (match (string_drop _s3013_ _s3014_) with
                            | _s3015_ =>
                               (sep_matches_prefix _s3015_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s3016_ _) =>
                                   (match (string_drop _s3015_ _s3016_) with
                                    | _s3017_ =>
                                       (freg_name_matches_prefix _s3017_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s3018_ _) =>
                                           (match (string_drop _s3017_ _s3018_) with
                                            | _s3019_ =>
                                               (sep_matches_prefix _s3019_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s3020_ _) =>
                                                   (match (string_drop _s3019_ _s3020_) with
                                                    | _s3021_ =>
                                                       (freg_name_matches_prefix _s3021_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s3022_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s3021_ _s3022_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FSGNJN_D, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))).

Definition _s2990_ (_s2991_ : string) : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))) :=
   (match _s2991_ with
    | _s2992_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s2992_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSGNJ_D, existT _ _s2993_ _) =>
           (match (string_drop _s2992_ _s2993_) with
            | _s2994_ =>
               (spc_matches_prefix _s2994_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2995_ _) =>
                   (match (string_drop _s2994_ _s2995_) with
                    | _s2996_ =>
                       (freg_name_matches_prefix _s2996_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2997_ _) =>
                           (match (string_drop _s2996_ _s2997_) with
                            | _s2998_ =>
                               (sep_matches_prefix _s2998_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2999_ _) =>
                                   (match (string_drop _s2998_ _s2999_) with
                                    | _s3000_ =>
                                       (freg_name_matches_prefix _s3000_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s3001_ _) =>
                                           (match (string_drop _s3000_ _s3001_) with
                                            | _s3002_ =>
                                               (sep_matches_prefix _s3002_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s3003_ _) =>
                                                   (match (string_drop _s3002_ _s3003_) with
                                                    | _s3004_ =>
                                                       (freg_name_matches_prefix _s3004_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s3005_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s3004_ _s3005_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FSGNJ_D, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))).

Definition _s2973_ (_s2974_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2974_ with
    | _s2975_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s2975_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_D_S, existT _ _s2976_ _) =>
           (match (string_drop _s2975_ _s2976_) with
            | _s2977_ =>
               (spc_matches_prefix _s2977_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2978_ _) =>
                   (match (string_drop _s2977_ _s2978_) with
                    | _s2979_ =>
                       (freg_name_matches_prefix _s2979_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2980_ _) =>
                           (match (string_drop _s2979_ _s2980_) with
                            | _s2981_ =>
                               (sep_matches_prefix _s2981_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2982_ _) =>
                                   (match (string_drop _s2981_ _s2982_) with
                                    | _s2983_ =>
                                       (freg_name_matches_prefix _s2983_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2984_ _) =>
                                           (match (string_drop _s2983_ _s2984_) with
                                            | _s2985_ =>
                                               (sep_matches_prefix _s2985_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2986_ _) =>
                                                   (match (string_drop _s2985_ _s2986_) with
                                                    | _s2987_ =>
                                                       (frm_mnemonic_matches_prefix _s2987_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s2988_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2987_ _s2988_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_D_S, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s2956_ (_s2957_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2957_ with
    | _s2958_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s2958_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_S_D, existT _ _s2959_ _) =>
           (match (string_drop _s2958_ _s2959_) with
            | _s2960_ =>
               (spc_matches_prefix _s2960_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2961_ _) =>
                   (match (string_drop _s2960_ _s2961_) with
                    | _s2962_ =>
                       (freg_name_matches_prefix _s2962_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2963_ _) =>
                           (match (string_drop _s2962_ _s2963_) with
                            | _s2964_ =>
                               (sep_matches_prefix _s2964_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2965_ _) =>
                                   (match (string_drop _s2964_ _s2965_) with
                                    | _s2966_ =>
                                       (freg_name_matches_prefix _s2966_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2967_ _) =>
                                           (match (string_drop _s2966_ _s2967_) with
                                            | _s2968_ =>
                                               (sep_matches_prefix _s2968_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2969_ _) =>
                                                   (match (string_drop _s2968_ _s2969_) with
                                                    | _s2970_ =>
                                                       (frm_mnemonic_matches_prefix _s2970_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s2971_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2970_ _s2971_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_S_D, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s2939_ (_s2940_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2940_ with
    | _s2941_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s2941_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_D_LU, existT _ _s2942_ _) =>
           (match (string_drop _s2941_ _s2942_) with
            | _s2943_ =>
               (spc_matches_prefix _s2943_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2944_ _) =>
                   (match (string_drop _s2943_ _s2944_) with
                    | _s2945_ =>
                       (freg_name_matches_prefix _s2945_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2946_ _) =>
                           (match (string_drop _s2945_ _s2946_) with
                            | _s2947_ =>
                               (sep_matches_prefix _s2947_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2948_ _) =>
                                   (match (string_drop _s2947_ _s2948_) with
                                    | _s2949_ =>
                                       (reg_name_matches_prefix _s2949_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2950_ _) =>
                                           (match (string_drop _s2949_ _s2950_) with
                                            | _s2951_ =>
                                               (sep_matches_prefix _s2951_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2952_ _) =>
                                                   (match (string_drop _s2951_ _s2952_) with
                                                    | _s2953_ =>
                                                       (frm_mnemonic_matches_prefix _s2953_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s2954_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2953_ _s2954_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_D_LU, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s2922_ (_s2923_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2923_ with
    | _s2924_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s2924_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_D_L, existT _ _s2925_ _) =>
           (match (string_drop _s2924_ _s2925_) with
            | _s2926_ =>
               (spc_matches_prefix _s2926_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2927_ _) =>
                   (match (string_drop _s2926_ _s2927_) with
                    | _s2928_ =>
                       (freg_name_matches_prefix _s2928_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2929_ _) =>
                           (match (string_drop _s2928_ _s2929_) with
                            | _s2930_ =>
                               (sep_matches_prefix _s2930_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2931_ _) =>
                                   (match (string_drop _s2930_ _s2931_) with
                                    | _s2932_ =>
                                       (reg_name_matches_prefix _s2932_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2933_ _) =>
                                           (match (string_drop _s2932_ _s2933_) with
                                            | _s2934_ =>
                                               (sep_matches_prefix _s2934_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2935_ _) =>
                                                   (match (string_drop _s2934_ _s2935_) with
                                                    | _s2936_ =>
                                                       (frm_mnemonic_matches_prefix _s2936_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s2937_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2936_ _s2937_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_D_L, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s2905_ (_s2906_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2906_ with
    | _s2907_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s2907_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_LU_D, existT _ _s2908_ _) =>
           (match (string_drop _s2907_ _s2908_) with
            | _s2909_ =>
               (spc_matches_prefix _s2909_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2910_ _) =>
                   (match (string_drop _s2909_ _s2910_) with
                    | _s2911_ =>
                       (reg_name_matches_prefix _s2911_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2912_ _) =>
                           (match (string_drop _s2911_ _s2912_) with
                            | _s2913_ =>
                               (sep_matches_prefix _s2913_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2914_ _) =>
                                   (match (string_drop _s2913_ _s2914_) with
                                    | _s2915_ =>
                                       (freg_name_matches_prefix _s2915_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2916_ _) =>
                                           (match (string_drop _s2915_ _s2916_) with
                                            | _s2917_ =>
                                               (sep_matches_prefix _s2917_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2918_ _) =>
                                                   (match (string_drop _s2917_ _s2918_) with
                                                    | _s2919_ =>
                                                       (frm_mnemonic_matches_prefix _s2919_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s2920_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2919_ _s2920_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_LU_D, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s2888_ (_s2889_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2889_ with
    | _s2890_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s2890_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_L_D, existT _ _s2891_ _) =>
           (match (string_drop _s2890_ _s2891_) with
            | _s2892_ =>
               (spc_matches_prefix _s2892_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2893_ _) =>
                   (match (string_drop _s2892_ _s2893_) with
                    | _s2894_ =>
                       (reg_name_matches_prefix _s2894_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2895_ _) =>
                           (match (string_drop _s2894_ _s2895_) with
                            | _s2896_ =>
                               (sep_matches_prefix _s2896_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2897_ _) =>
                                   (match (string_drop _s2896_ _s2897_) with
                                    | _s2898_ =>
                                       (freg_name_matches_prefix _s2898_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2899_ _) =>
                                           (match (string_drop _s2898_ _s2899_) with
                                            | _s2900_ =>
                                               (sep_matches_prefix _s2900_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2901_ _) =>
                                                   (match (string_drop _s2900_ _s2901_) with
                                                    | _s2902_ =>
                                                       (frm_mnemonic_matches_prefix _s2902_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s2903_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2902_ _s2903_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_L_D, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s2871_ (_s2872_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2872_ with
    | _s2873_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s2873_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_D_WU, existT _ _s2874_ _) =>
           (match (string_drop _s2873_ _s2874_) with
            | _s2875_ =>
               (spc_matches_prefix _s2875_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2876_ _) =>
                   (match (string_drop _s2875_ _s2876_) with
                    | _s2877_ =>
                       (freg_name_matches_prefix _s2877_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2878_ _) =>
                           (match (string_drop _s2877_ _s2878_) with
                            | _s2879_ =>
                               (sep_matches_prefix _s2879_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2880_ _) =>
                                   (match (string_drop _s2879_ _s2880_) with
                                    | _s2881_ =>
                                       (reg_name_matches_prefix _s2881_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2882_ _) =>
                                           (match (string_drop _s2881_ _s2882_) with
                                            | _s2883_ =>
                                               (sep_matches_prefix _s2883_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2884_ _) =>
                                                   (match (string_drop _s2883_ _s2884_) with
                                                    | _s2885_ =>
                                                       (frm_mnemonic_matches_prefix _s2885_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s2886_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2885_ _s2886_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_D_WU, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s2854_ (_s2855_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2855_ with
    | _s2856_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s2856_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_D_W, existT _ _s2857_ _) =>
           (match (string_drop _s2856_ _s2857_) with
            | _s2858_ =>
               (spc_matches_prefix _s2858_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2859_ _) =>
                   (match (string_drop _s2858_ _s2859_) with
                    | _s2860_ =>
                       (freg_name_matches_prefix _s2860_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2861_ _) =>
                           (match (string_drop _s2860_ _s2861_) with
                            | _s2862_ =>
                               (sep_matches_prefix _s2862_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2863_ _) =>
                                   (match (string_drop _s2862_ _s2863_) with
                                    | _s2864_ =>
                                       (reg_name_matches_prefix _s2864_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2865_ _) =>
                                           (match (string_drop _s2864_ _s2865_) with
                                            | _s2866_ =>
                                               (sep_matches_prefix _s2866_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2867_ _) =>
                                                   (match (string_drop _s2866_ _s2867_) with
                                                    | _s2868_ =>
                                                       (frm_mnemonic_matches_prefix _s2868_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s2869_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2868_ _s2869_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_D_W, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s2837_ (_s2838_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2838_ with
    | _s2839_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s2839_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_WU_D, existT _ _s2840_ _) =>
           (match (string_drop _s2839_ _s2840_) with
            | _s2841_ =>
               (spc_matches_prefix _s2841_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2842_ _) =>
                   (match (string_drop _s2841_ _s2842_) with
                    | _s2843_ =>
                       (reg_name_matches_prefix _s2843_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2844_ _) =>
                           (match (string_drop _s2843_ _s2844_) with
                            | _s2845_ =>
                               (sep_matches_prefix _s2845_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2846_ _) =>
                                   (match (string_drop _s2845_ _s2846_) with
                                    | _s2847_ =>
                                       (freg_name_matches_prefix _s2847_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2848_ _) =>
                                           (match (string_drop _s2847_ _s2848_) with
                                            | _s2849_ =>
                                               (sep_matches_prefix _s2849_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2850_ _) =>
                                                   (match (string_drop _s2849_ _s2850_) with
                                                    | _s2851_ =>
                                                       (frm_mnemonic_matches_prefix _s2851_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s2852_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2851_ _s2852_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_WU_D, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s2820_ (_s2821_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2821_ with
    | _s2822_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s2822_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_W_D, existT _ _s2823_ _) =>
           (match (string_drop _s2822_ _s2823_) with
            | _s2824_ =>
               (spc_matches_prefix _s2824_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2825_ _) =>
                   (match (string_drop _s2824_ _s2825_) with
                    | _s2826_ =>
                       (reg_name_matches_prefix _s2826_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2827_ _) =>
                           (match (string_drop _s2826_ _s2827_) with
                            | _s2828_ =>
                               (sep_matches_prefix _s2828_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2829_ _) =>
                                   (match (string_drop _s2828_ _s2829_) with
                                    | _s2830_ =>
                                       (freg_name_matches_prefix _s2830_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2831_ _) =>
                                           (match (string_drop _s2830_ _s2831_) with
                                            | _s2832_ =>
                                               (sep_matches_prefix _s2832_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2833_ _) =>
                                                   (match (string_drop _s2832_ _s2833_) with
                                                    | _s2834_ =>
                                                       (frm_mnemonic_matches_prefix _s2834_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s2835_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2834_ _s2835_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_W_D, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s2803_ (_s2804_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2804_ with
    | _s2805_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s2805_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSQRT_D, existT _ _s2806_ _) =>
           (match (string_drop _s2805_ _s2806_) with
            | _s2807_ =>
               (spc_matches_prefix _s2807_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2808_ _) =>
                   (match (string_drop _s2807_ _s2808_) with
                    | _s2809_ =>
                       (freg_name_matches_prefix _s2809_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2810_ _) =>
                           (match (string_drop _s2809_ _s2810_) with
                            | _s2811_ =>
                               (sep_matches_prefix _s2811_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2812_ _) =>
                                   (match (string_drop _s2811_ _s2812_) with
                                    | _s2813_ =>
                                       (freg_name_matches_prefix _s2813_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2814_ _) =>
                                           (match (string_drop _s2813_ _s2814_) with
                                            | _s2815_ =>
                                               (sep_matches_prefix _s2815_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2816_ _) =>
                                                   (match (string_drop _s2815_ _s2816_) with
                                                    | _s2817_ =>
                                                       (frm_mnemonic_matches_prefix _s2817_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s2818_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2817_ _s2818_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FSQRT_D, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s2782_ (_s2783_ : string)
: M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2783_ with
    | _s2784_ =>
       (f_bin_rm_type_mnemonic_D_matches_prefix _s2784_) >>= fun w__0 : option ((f_bin_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s2785_ _) =>
           (match (string_drop _s2784_ _s2785_) with
            | _s2786_ =>
               (spc_matches_prefix _s2786_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2787_ _) =>
                   (match (string_drop _s2786_ _s2787_) with
                    | _s2788_ =>
                       (freg_name_matches_prefix _s2788_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2789_ _) =>
                           (match (string_drop _s2788_ _s2789_) with
                            | _s2790_ =>
                               (sep_matches_prefix _s2790_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2791_ _) =>
                                   (match (string_drop _s2790_ _s2791_) with
                                    | _s2792_ =>
                                       (freg_name_matches_prefix _s2792_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2793_ _) =>
                                           (match (string_drop _s2792_ _s2793_) with
                                            | _s2794_ =>
                                               (sep_matches_prefix _s2794_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2795_ _) =>
                                                   (match (string_drop _s2794_ _s2795_) with
                                                    | _s2796_ =>
                                                       (freg_name_matches_prefix _s2796_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       (match w__6 with
                                                        | Some (rs2, existT _ _s2797_ _) =>
                                                           (match (string_drop _s2796_ _s2797_) with
                                                            | _s2798_ =>
                                                               (sep_matches_prefix _s2798_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                 0)})) =>
                                                               (match w__7 with
                                                                | Some (tt, existT _ _s2799_ _) =>
                                                                   (match (string_drop _s2798_
                                                                             _s2799_) with
                                                                    | _s2800_ =>
                                                                       (frm_mnemonic_matches_prefix
                                                                          _s2800_) >>= fun w__8 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                                         0)})) =>
                                                                       returnm (match w__8 with
                                                                                | Some
                                                                                  (rm, existT _ _s2801_ _) =>
                                                                                   let p0_ :=
                                                                                     string_drop
                                                                                       _s2800_
                                                                                       _s2801_ in
                                                                                   if generic_eq p0_
                                                                                        "" then
                                                                                     Some
                                                                                       (op, rd, rs1, rs2, rm)
                                                                                   else None
                                                                                | _ => None
                                                                                end)
                                                                    end)
                                                                    : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                | _ => returnm None
                                                                end)
                                                                : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                            end)
                                                            : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                        | _ => returnm None
                                                        end)
                                                        : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                    end)
                                                    : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode))).

Definition _s2757_ (_s2758_ : string)
: M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2758_ with
    | _s2759_ =>
       (f_madd_type_mnemonic_D_matches_prefix _s2759_) >>= fun w__0 : option ((f_madd_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s2760_ _) =>
           (match (string_drop _s2759_ _s2760_) with
            | _s2761_ =>
               (spc_matches_prefix _s2761_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2762_ _) =>
                   (match (string_drop _s2761_ _s2762_) with
                    | _s2763_ =>
                       (freg_name_matches_prefix _s2763_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2764_ _) =>
                           (match (string_drop _s2763_ _s2764_) with
                            | _s2765_ =>
                               (sep_matches_prefix _s2765_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2766_ _) =>
                                   (match (string_drop _s2765_ _s2766_) with
                                    | _s2767_ =>
                                       (freg_name_matches_prefix _s2767_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2768_ _) =>
                                           (match (string_drop _s2767_ _s2768_) with
                                            | _s2769_ =>
                                               (sep_matches_prefix _s2769_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2770_ _) =>
                                                   (match (string_drop _s2769_ _s2770_) with
                                                    | _s2771_ =>
                                                       (freg_name_matches_prefix _s2771_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       (match w__6 with
                                                        | Some (rs2, existT _ _s2772_ _) =>
                                                           (match (string_drop _s2771_ _s2772_) with
                                                            | _s2773_ =>
                                                               (sep_matches_prefix _s2773_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                 0)})) =>
                                                               (match w__7 with
                                                                | Some (tt, existT _ _s2774_ _) =>
                                                                   (match (string_drop _s2773_
                                                                             _s2774_) with
                                                                    | _s2775_ =>
                                                                       (freg_name_matches_prefix
                                                                          _s2775_) >>= fun w__8 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                         0)})) =>
                                                                       (match w__8 with
                                                                        | Some
                                                                          (rs3, existT _ _s2776_ _) =>
                                                                           (match (string_drop
                                                                                     _s2775_ _s2776_) with
                                                                            | _s2777_ =>
                                                                               (sep_matches_prefix
                                                                                  _s2777_) >>= fun w__9 : option ((unit * {n : Z & ArithFact (n >=?
                                                                                 0)})) =>
                                                                               (match w__9 with
                                                                                | Some
                                                                                  (tt, existT _ _s2778_ _) =>
                                                                                   (match (string_drop
                                                                                             _s2777_
                                                                                             _s2778_) with
                                                                                    | _s2779_ =>
                                                                                       (frm_mnemonic_matches_prefix
                                                                                          _s2779_) >>= fun w__10 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                                                         0)})) =>
                                                                                       returnm (match w__10 with
                                                                                                | Some
                                                                                                  (rm, existT _ _s2780_ _) =>
                                                                                                   let p0_ :=
                                                                                                     string_drop
                                                                                                       _s2779_
                                                                                                       _s2780_ in
                                                                                                   if
                                                                                                     generic_eq
                                                                                                       p0_
                                                                                                       ""
                                                                                                   then
                                                                                                     Some
                                                                                                       (op, rd, rs1, rs2, rs3, rm)
                                                                                                   else
                                                                                                     None
                                                                                                | _ =>
                                                                                                   None
                                                                                                end)
                                                                                    end)
                                                                                    : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                                | _ => returnm None
                                                                                end)
                                                                                : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                            end)
                                                                            : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                        | _ => returnm None
                                                                        end)
                                                                        : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                    end)
                                                                    : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                | _ => returnm None
                                                                end)
                                                                : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                            end)
                                                            : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                        | _ => returnm None
                                                        end)
                                                        : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                    end)
                                                    : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode))).

Definition _s2741_ (_s2742_ : string) : M (option ((mword 3 * mword 3 * mword 5))) :=
   let _s2743_ := _s2742_ in
   (if string_startswith _s2743_ "c.fsw" then
      (match (string_drop _s2743_ (projT1 (string_length "c.fsw"))) with
       | _s2744_ =>
          (spc_matches_prefix _s2744_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s2745_ _) =>
              (match (string_drop _s2744_ _s2745_) with
               | _s2746_ =>
                  (creg_name_matches_prefix _s2746_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsc1, existT _ _s2747_ _) =>
                      (match (string_drop _s2746_ _s2747_) with
                       | _s2748_ =>
                          (sep_matches_prefix _s2748_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s2749_ _) =>
                              (match (string_drop _s2748_ _s2749_) with
                               | _s2750_ =>
                                  (creg_name_matches_prefix _s2750_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc2, existT _ _s2751_ _) =>
                                      (match (string_drop _s2750_ _s2751_) with
                                       | _s2752_ =>
                                          (sep_matches_prefix _s2752_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s2753_ _) =>
                                                      match (string_drop _s2752_ _s2753_) with
                                                      | _s2754_ =>
                                                         match (hex_bits_7_matches_prefix _s2754_) with
                                                         | Some (v__1446, existT _ _s2755_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1446 1 0)
                                                                 ('b"00"
                                                                  : mword (1 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1446 6 2 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1446 6 2 in
                                                              let p0_ := string_drop _s2754_ _s2755_ in
                                                              if generic_eq p0_ "" then
                                                                Some (rsc1, rsc2, uimm)
                                                              else None
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5))).

Definition _s2725_ (_s2726_ : string) : M (option ((mword 3 * mword 3 * mword 5))) :=
   let _s2727_ := _s2726_ in
   (if string_startswith _s2727_ "c.flw" then
      (match (string_drop _s2727_ (projT1 (string_length "c.flw"))) with
       | _s2728_ =>
          (spc_matches_prefix _s2728_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s2729_ _) =>
              (match (string_drop _s2728_ _s2729_) with
               | _s2730_ =>
                  (creg_name_matches_prefix _s2730_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rdc, existT _ _s2731_ _) =>
                      (match (string_drop _s2730_ _s2731_) with
                       | _s2732_ =>
                          (sep_matches_prefix _s2732_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s2733_ _) =>
                              (match (string_drop _s2732_ _s2733_) with
                               | _s2734_ =>
                                  (creg_name_matches_prefix _s2734_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc, existT _ _s2735_ _) =>
                                      (match (string_drop _s2734_ _s2735_) with
                                       | _s2736_ =>
                                          (sep_matches_prefix _s2736_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s2737_ _) =>
                                                      match (string_drop _s2736_ _s2737_) with
                                                      | _s2738_ =>
                                                         match (hex_bits_7_matches_prefix _s2738_) with
                                                         | Some (v__1448, existT _ _s2739_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1448 1 0)
                                                                 ('b"00"
                                                                  : mword (1 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1448 6 2 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1448 6 2 in
                                                              let p0_ := string_drop _s2738_ _s2739_ in
                                                              if generic_eq p0_ "" then
                                                                Some (rdc, rsc, uimm)
                                                              else None
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5))).

Definition _s2713_ (_s2714_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s2715_ := _s2714_ in
   (if string_startswith _s2715_ "c.fswsp" then
      (match (string_drop _s2715_ (projT1 (string_length "c.fswsp"))) with
       | _s2716_ =>
          (spc_matches_prefix _s2716_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s2717_ _) =>
              (match (string_drop _s2716_ _s2717_) with
               | _s2718_ =>
                  (reg_name_matches_prefix _s2718_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s2719_ _) =>
                      (match (string_drop _s2718_ _s2719_) with
                       | _s2720_ =>
                          (sep_matches_prefix _s2720_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s2721_ _) =>
                                      match (string_drop _s2720_ _s2721_) with
                                      | _s2722_ =>
                                         match (hex_bits_6_matches_prefix _s2722_) with
                                         | Some (uimm, existT _ _s2723_ _) =>
                                            let p0_ := string_drop _s2722_ _s2723_ in
                                            if generic_eq p0_ "" then Some (rd, uimm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s2701_ (_s2702_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s2703_ := _s2702_ in
   (if string_startswith _s2703_ "c.flwsp" then
      (match (string_drop _s2703_ (projT1 (string_length "c.flwsp"))) with
       | _s2704_ =>
          (spc_matches_prefix _s2704_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s2705_ _) =>
              (match (string_drop _s2704_ _s2705_) with
               | _s2706_ =>
                  (reg_name_matches_prefix _s2706_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s2707_ _) =>
                      (match (string_drop _s2706_ _s2707_) with
                       | _s2708_ =>
                          (sep_matches_prefix _s2708_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s2709_ _) =>
                                      match (string_drop _s2708_ _s2709_) with
                                      | _s2710_ =>
                                         match (hex_bits_6_matches_prefix _s2710_) with
                                         | Some (imm, existT _ _s2711_ _) =>
                                            let p0_ := string_drop _s2710_ _s2711_ in
                                            if generic_eq p0_ "" then Some (rd, imm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s2688_ (_s2689_ : string) : M (option ((f_un_op_S * mword 5 * mword 5))) :=
   (match _s2689_ with
    | _s2690_ =>
       (f_un_type_mnemonic_S_matches_prefix _s2690_) >>= fun w__0 : option ((f_un_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCLASS_S, existT _ _s2691_ _) =>
           (match (string_drop _s2690_ _s2691_) with
            | _s2692_ =>
               (spc_matches_prefix _s2692_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2693_ _) =>
                   (match (string_drop _s2692_ _s2693_) with
                    | _s2694_ =>
                       (reg_name_matches_prefix _s2694_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2695_ _) =>
                           (match (string_drop _s2694_ _s2695_) with
                            | _s2696_ =>
                               (sep_matches_prefix _s2696_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2697_ _) =>
                                   (match (string_drop _s2696_ _s2697_) with
                                    | _s2698_ =>
                                       (freg_name_matches_prefix _s2698_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       returnm (match w__4 with
                                                | Some (rs1, existT _ _s2699_ _) =>
                                                   let p0_ := string_drop _s2698_ _s2699_ in
                                                   if generic_eq p0_ "" then
                                                     Some (FCLASS_S, rd, rs1)
                                                   else None
                                                | _ => None
                                                end)
                                    end)
                                    : M (option ((f_un_op_S * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_op_S * mword 5 * mword 5)))
                            end)
                            : M (option ((f_un_op_S * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_op_S * mword 5 * mword 5)))
                    end)
                    : M (option ((f_un_op_S * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_un_op_S * mword 5 * mword 5)))
            end)
            : M (option ((f_un_op_S * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_un_op_S * mword 5 * mword 5)))
    end)
    : M (option ((f_un_op_S * mword 5 * mword 5))).

Definition _s2675_ (_s2676_ : string) : M (option ((f_un_op_S * mword 5 * mword 5))) :=
   (match _s2676_ with
    | _s2677_ =>
       (f_un_type_mnemonic_S_matches_prefix _s2677_) >>= fun w__0 : option ((f_un_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMV_W_X, existT _ _s2678_ _) =>
           (match (string_drop _s2677_ _s2678_) with
            | _s2679_ =>
               (spc_matches_prefix _s2679_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2680_ _) =>
                   (match (string_drop _s2679_ _s2680_) with
                    | _s2681_ =>
                       (freg_name_matches_prefix _s2681_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2682_ _) =>
                           (match (string_drop _s2681_ _s2682_) with
                            | _s2683_ =>
                               (sep_matches_prefix _s2683_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2684_ _) =>
                                   (match (string_drop _s2683_ _s2684_) with
                                    | _s2685_ =>
                                       (reg_name_matches_prefix _s2685_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       returnm (match w__4 with
                                                | Some (rs1, existT _ _s2686_ _) =>
                                                   let p0_ := string_drop _s2685_ _s2686_ in
                                                   if generic_eq p0_ "" then Some (FMV_W_X, rd, rs1)
                                                   else None
                                                | _ => None
                                                end)
                                    end)
                                    : M (option ((f_un_op_S * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_op_S * mword 5 * mword 5)))
                            end)
                            : M (option ((f_un_op_S * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_op_S * mword 5 * mword 5)))
                    end)
                    : M (option ((f_un_op_S * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_un_op_S * mword 5 * mword 5)))
            end)
            : M (option ((f_un_op_S * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_un_op_S * mword 5 * mword 5)))
    end)
    : M (option ((f_un_op_S * mword 5 * mword 5))).

Definition _s2662_ (_s2663_ : string) : M (option ((f_un_op_S * mword 5 * mword 5))) :=
   (match _s2663_ with
    | _s2664_ =>
       (f_un_type_mnemonic_S_matches_prefix _s2664_) >>= fun w__0 : option ((f_un_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMV_X_W, existT _ _s2665_ _) =>
           (match (string_drop _s2664_ _s2665_) with
            | _s2666_ =>
               (spc_matches_prefix _s2666_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2667_ _) =>
                   (match (string_drop _s2666_ _s2667_) with
                    | _s2668_ =>
                       (reg_name_matches_prefix _s2668_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2669_ _) =>
                           (match (string_drop _s2668_ _s2669_) with
                            | _s2670_ =>
                               (sep_matches_prefix _s2670_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2671_ _) =>
                                   (match (string_drop _s2670_ _s2671_) with
                                    | _s2672_ =>
                                       (freg_name_matches_prefix _s2672_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       returnm (match w__4 with
                                                | Some (rs1, existT _ _s2673_ _) =>
                                                   let p0_ := string_drop _s2672_ _s2673_ in
                                                   if generic_eq p0_ "" then Some (FMV_X_W, rd, rs1)
                                                   else None
                                                | _ => None
                                                end)
                                    end)
                                    : M (option ((f_un_op_S * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_op_S * mword 5 * mword 5)))
                            end)
                            : M (option ((f_un_op_S * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_op_S * mword 5 * mword 5)))
                    end)
                    : M (option ((f_un_op_S * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_un_op_S * mword 5 * mword 5)))
            end)
            : M (option ((f_un_op_S * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_un_op_S * mword 5 * mword 5)))
    end)
    : M (option ((f_un_op_S * mword 5 * mword 5))).

Definition _s2645_ (_s2646_ : string) : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))) :=
   (match _s2646_ with
    | _s2647_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s2647_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FLE_S, existT _ _s2648_ _) =>
           (match (string_drop _s2647_ _s2648_) with
            | _s2649_ =>
               (spc_matches_prefix _s2649_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2650_ _) =>
                   (match (string_drop _s2649_ _s2650_) with
                    | _s2651_ =>
                       (reg_name_matches_prefix _s2651_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2652_ _) =>
                           (match (string_drop _s2651_ _s2652_) with
                            | _s2653_ =>
                               (sep_matches_prefix _s2653_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2654_ _) =>
                                   (match (string_drop _s2653_ _s2654_) with
                                    | _s2655_ =>
                                       (freg_name_matches_prefix _s2655_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2656_ _) =>
                                           (match (string_drop _s2655_ _s2656_) with
                                            | _s2657_ =>
                                               (sep_matches_prefix _s2657_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2658_ _) =>
                                                   (match (string_drop _s2657_ _s2658_) with
                                                    | _s2659_ =>
                                                       (freg_name_matches_prefix _s2659_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s2660_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2659_ _s2660_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FLE_S, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))).

Definition _s2628_ (_s2629_ : string) : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))) :=
   (match _s2629_ with
    | _s2630_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s2630_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FLT_S, existT _ _s2631_ _) =>
           (match (string_drop _s2630_ _s2631_) with
            | _s2632_ =>
               (spc_matches_prefix _s2632_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2633_ _) =>
                   (match (string_drop _s2632_ _s2633_) with
                    | _s2634_ =>
                       (reg_name_matches_prefix _s2634_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2635_ _) =>
                           (match (string_drop _s2634_ _s2635_) with
                            | _s2636_ =>
                               (sep_matches_prefix _s2636_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2637_ _) =>
                                   (match (string_drop _s2636_ _s2637_) with
                                    | _s2638_ =>
                                       (freg_name_matches_prefix _s2638_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2639_ _) =>
                                           (match (string_drop _s2638_ _s2639_) with
                                            | _s2640_ =>
                                               (sep_matches_prefix _s2640_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2641_ _) =>
                                                   (match (string_drop _s2640_ _s2641_) with
                                                    | _s2642_ =>
                                                       (freg_name_matches_prefix _s2642_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s2643_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2642_ _s2643_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FLT_S, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))).

Definition _s2611_ (_s2612_ : string) : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))) :=
   (match _s2612_ with
    | _s2613_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s2613_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FEQ_S, existT _ _s2614_ _) =>
           (match (string_drop _s2613_ _s2614_) with
            | _s2615_ =>
               (spc_matches_prefix _s2615_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2616_ _) =>
                   (match (string_drop _s2615_ _s2616_) with
                    | _s2617_ =>
                       (reg_name_matches_prefix _s2617_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2618_ _) =>
                           (match (string_drop _s2617_ _s2618_) with
                            | _s2619_ =>
                               (sep_matches_prefix _s2619_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2620_ _) =>
                                   (match (string_drop _s2619_ _s2620_) with
                                    | _s2621_ =>
                                       (freg_name_matches_prefix _s2621_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2622_ _) =>
                                           (match (string_drop _s2621_ _s2622_) with
                                            | _s2623_ =>
                                               (sep_matches_prefix _s2623_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2624_ _) =>
                                                   (match (string_drop _s2623_ _s2624_) with
                                                    | _s2625_ =>
                                                       (freg_name_matches_prefix _s2625_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s2626_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2625_ _s2626_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FEQ_S, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))).

Definition _s2594_ (_s2595_ : string) : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))) :=
   (match _s2595_ with
    | _s2596_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s2596_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMAX_S, existT _ _s2597_ _) =>
           (match (string_drop _s2596_ _s2597_) with
            | _s2598_ =>
               (spc_matches_prefix _s2598_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2599_ _) =>
                   (match (string_drop _s2598_ _s2599_) with
                    | _s2600_ =>
                       (freg_name_matches_prefix _s2600_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2601_ _) =>
                           (match (string_drop _s2600_ _s2601_) with
                            | _s2602_ =>
                               (sep_matches_prefix _s2602_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2603_ _) =>
                                   (match (string_drop _s2602_ _s2603_) with
                                    | _s2604_ =>
                                       (freg_name_matches_prefix _s2604_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2605_ _) =>
                                           (match (string_drop _s2604_ _s2605_) with
                                            | _s2606_ =>
                                               (sep_matches_prefix _s2606_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2607_ _) =>
                                                   (match (string_drop _s2606_ _s2607_) with
                                                    | _s2608_ =>
                                                       (freg_name_matches_prefix _s2608_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s2609_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2608_ _s2609_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FMAX_S, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))).

Definition _s2577_ (_s2578_ : string) : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))) :=
   (match _s2578_ with
    | _s2579_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s2579_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMIN_S, existT _ _s2580_ _) =>
           (match (string_drop _s2579_ _s2580_) with
            | _s2581_ =>
               (spc_matches_prefix _s2581_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2582_ _) =>
                   (match (string_drop _s2581_ _s2582_) with
                    | _s2583_ =>
                       (freg_name_matches_prefix _s2583_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2584_ _) =>
                           (match (string_drop _s2583_ _s2584_) with
                            | _s2585_ =>
                               (sep_matches_prefix _s2585_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2586_ _) =>
                                   (match (string_drop _s2585_ _s2586_) with
                                    | _s2587_ =>
                                       (freg_name_matches_prefix _s2587_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2588_ _) =>
                                           (match (string_drop _s2587_ _s2588_) with
                                            | _s2589_ =>
                                               (sep_matches_prefix _s2589_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2590_ _) =>
                                                   (match (string_drop _s2589_ _s2590_) with
                                                    | _s2591_ =>
                                                       (freg_name_matches_prefix _s2591_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s2592_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2591_ _s2592_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FMIN_S, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))).

Definition _s2560_ (_s2561_ : string) : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))) :=
   (match _s2561_ with
    | _s2562_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s2562_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSGNJX_S, existT _ _s2563_ _) =>
           (match (string_drop _s2562_ _s2563_) with
            | _s2564_ =>
               (spc_matches_prefix _s2564_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2565_ _) =>
                   (match (string_drop _s2564_ _s2565_) with
                    | _s2566_ =>
                       (freg_name_matches_prefix _s2566_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2567_ _) =>
                           (match (string_drop _s2566_ _s2567_) with
                            | _s2568_ =>
                               (sep_matches_prefix _s2568_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2569_ _) =>
                                   (match (string_drop _s2568_ _s2569_) with
                                    | _s2570_ =>
                                       (freg_name_matches_prefix _s2570_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2571_ _) =>
                                           (match (string_drop _s2570_ _s2571_) with
                                            | _s2572_ =>
                                               (sep_matches_prefix _s2572_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2573_ _) =>
                                                   (match (string_drop _s2572_ _s2573_) with
                                                    | _s2574_ =>
                                                       (freg_name_matches_prefix _s2574_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s2575_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2574_ _s2575_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FSGNJX_S, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))).

Definition _s2543_ (_s2544_ : string) : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))) :=
   (match _s2544_ with
    | _s2545_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s2545_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSGNJN_S, existT _ _s2546_ _) =>
           (match (string_drop _s2545_ _s2546_) with
            | _s2547_ =>
               (spc_matches_prefix _s2547_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2548_ _) =>
                   (match (string_drop _s2547_ _s2548_) with
                    | _s2549_ =>
                       (freg_name_matches_prefix _s2549_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2550_ _) =>
                           (match (string_drop _s2549_ _s2550_) with
                            | _s2551_ =>
                               (sep_matches_prefix _s2551_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2552_ _) =>
                                   (match (string_drop _s2551_ _s2552_) with
                                    | _s2553_ =>
                                       (freg_name_matches_prefix _s2553_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2554_ _) =>
                                           (match (string_drop _s2553_ _s2554_) with
                                            | _s2555_ =>
                                               (sep_matches_prefix _s2555_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2556_ _) =>
                                                   (match (string_drop _s2555_ _s2556_) with
                                                    | _s2557_ =>
                                                       (freg_name_matches_prefix _s2557_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s2558_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2557_ _s2558_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FSGNJN_S, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))).

Definition _s2526_ (_s2527_ : string) : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))) :=
   (match _s2527_ with
    | _s2528_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s2528_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSGNJ_S, existT _ _s2529_ _) =>
           (match (string_drop _s2528_ _s2529_) with
            | _s2530_ =>
               (spc_matches_prefix _s2530_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2531_ _) =>
                   (match (string_drop _s2530_ _s2531_) with
                    | _s2532_ =>
                       (freg_name_matches_prefix _s2532_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2533_ _) =>
                           (match (string_drop _s2532_ _s2533_) with
                            | _s2534_ =>
                               (sep_matches_prefix _s2534_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2535_ _) =>
                                   (match (string_drop _s2534_ _s2535_) with
                                    | _s2536_ =>
                                       (freg_name_matches_prefix _s2536_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2537_ _) =>
                                           (match (string_drop _s2536_ _s2537_) with
                                            | _s2538_ =>
                                               (sep_matches_prefix _s2538_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2539_ _) =>
                                                   (match (string_drop _s2538_ _s2539_) with
                                                    | _s2540_ =>
                                                       (freg_name_matches_prefix _s2540_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s2541_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2540_ _s2541_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FSGNJ_S, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))).

Definition _s2509_ (_s2510_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2510_ with
    | _s2511_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s2511_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_S_LU, existT _ _s2512_ _) =>
           (match (string_drop _s2511_ _s2512_) with
            | _s2513_ =>
               (spc_matches_prefix _s2513_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2514_ _) =>
                   (match (string_drop _s2513_ _s2514_) with
                    | _s2515_ =>
                       (freg_name_matches_prefix _s2515_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2516_ _) =>
                           (match (string_drop _s2515_ _s2516_) with
                            | _s2517_ =>
                               (sep_matches_prefix _s2517_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2518_ _) =>
                                   (match (string_drop _s2517_ _s2518_) with
                                    | _s2519_ =>
                                       (reg_name_matches_prefix _s2519_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2520_ _) =>
                                           (match (string_drop _s2519_ _s2520_) with
                                            | _s2521_ =>
                                               (sep_matches_prefix _s2521_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2522_ _) =>
                                                   (match (string_drop _s2521_ _s2522_) with
                                                    | _s2523_ =>
                                                       (frm_mnemonic_matches_prefix _s2523_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s2524_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2523_ _s2524_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_S_LU, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))).

Definition _s2492_ (_s2493_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2493_ with
    | _s2494_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s2494_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_S_L, existT _ _s2495_ _) =>
           (match (string_drop _s2494_ _s2495_) with
            | _s2496_ =>
               (spc_matches_prefix _s2496_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2497_ _) =>
                   (match (string_drop _s2496_ _s2497_) with
                    | _s2498_ =>
                       (freg_name_matches_prefix _s2498_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2499_ _) =>
                           (match (string_drop _s2498_ _s2499_) with
                            | _s2500_ =>
                               (sep_matches_prefix _s2500_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2501_ _) =>
                                   (match (string_drop _s2500_ _s2501_) with
                                    | _s2502_ =>
                                       (reg_name_matches_prefix _s2502_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2503_ _) =>
                                           (match (string_drop _s2502_ _s2503_) with
                                            | _s2504_ =>
                                               (sep_matches_prefix _s2504_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2505_ _) =>
                                                   (match (string_drop _s2504_ _s2505_) with
                                                    | _s2506_ =>
                                                       (frm_mnemonic_matches_prefix _s2506_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s2507_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2506_ _s2507_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_S_L, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))).

Definition _s2475_ (_s2476_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2476_ with
    | _s2477_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s2477_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_LU_S, existT _ _s2478_ _) =>
           (match (string_drop _s2477_ _s2478_) with
            | _s2479_ =>
               (spc_matches_prefix _s2479_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2480_ _) =>
                   (match (string_drop _s2479_ _s2480_) with
                    | _s2481_ =>
                       (reg_name_matches_prefix _s2481_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2482_ _) =>
                           (match (string_drop _s2481_ _s2482_) with
                            | _s2483_ =>
                               (sep_matches_prefix _s2483_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2484_ _) =>
                                   (match (string_drop _s2483_ _s2484_) with
                                    | _s2485_ =>
                                       (freg_name_matches_prefix _s2485_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2486_ _) =>
                                           (match (string_drop _s2485_ _s2486_) with
                                            | _s2487_ =>
                                               (sep_matches_prefix _s2487_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2488_ _) =>
                                                   (match (string_drop _s2487_ _s2488_) with
                                                    | _s2489_ =>
                                                       (frm_mnemonic_matches_prefix _s2489_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s2490_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2489_ _s2490_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_LU_S, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))).

Definition _s2458_ (_s2459_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2459_ with
    | _s2460_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s2460_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_L_S, existT _ _s2461_ _) =>
           (match (string_drop _s2460_ _s2461_) with
            | _s2462_ =>
               (spc_matches_prefix _s2462_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2463_ _) =>
                   (match (string_drop _s2462_ _s2463_) with
                    | _s2464_ =>
                       (reg_name_matches_prefix _s2464_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2465_ _) =>
                           (match (string_drop _s2464_ _s2465_) with
                            | _s2466_ =>
                               (sep_matches_prefix _s2466_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2467_ _) =>
                                   (match (string_drop _s2466_ _s2467_) with
                                    | _s2468_ =>
                                       (freg_name_matches_prefix _s2468_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2469_ _) =>
                                           (match (string_drop _s2468_ _s2469_) with
                                            | _s2470_ =>
                                               (sep_matches_prefix _s2470_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2471_ _) =>
                                                   (match (string_drop _s2470_ _s2471_) with
                                                    | _s2472_ =>
                                                       (frm_mnemonic_matches_prefix _s2472_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s2473_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2472_ _s2473_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_L_S, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))).

Definition _s2441_ (_s2442_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2442_ with
    | _s2443_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s2443_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_S_WU, existT _ _s2444_ _) =>
           (match (string_drop _s2443_ _s2444_) with
            | _s2445_ =>
               (spc_matches_prefix _s2445_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2446_ _) =>
                   (match (string_drop _s2445_ _s2446_) with
                    | _s2447_ =>
                       (freg_name_matches_prefix _s2447_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2448_ _) =>
                           (match (string_drop _s2447_ _s2448_) with
                            | _s2449_ =>
                               (sep_matches_prefix _s2449_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2450_ _) =>
                                   (match (string_drop _s2449_ _s2450_) with
                                    | _s2451_ =>
                                       (reg_name_matches_prefix _s2451_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2452_ _) =>
                                           (match (string_drop _s2451_ _s2452_) with
                                            | _s2453_ =>
                                               (sep_matches_prefix _s2453_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2454_ _) =>
                                                   (match (string_drop _s2453_ _s2454_) with
                                                    | _s2455_ =>
                                                       (frm_mnemonic_matches_prefix _s2455_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s2456_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2455_ _s2456_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_S_WU, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))).

Definition _s2424_ (_s2425_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2425_ with
    | _s2426_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s2426_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_S_W, existT _ _s2427_ _) =>
           (match (string_drop _s2426_ _s2427_) with
            | _s2428_ =>
               (spc_matches_prefix _s2428_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2429_ _) =>
                   (match (string_drop _s2428_ _s2429_) with
                    | _s2430_ =>
                       (freg_name_matches_prefix _s2430_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2431_ _) =>
                           (match (string_drop _s2430_ _s2431_) with
                            | _s2432_ =>
                               (sep_matches_prefix _s2432_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2433_ _) =>
                                   (match (string_drop _s2432_ _s2433_) with
                                    | _s2434_ =>
                                       (reg_name_matches_prefix _s2434_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2435_ _) =>
                                           (match (string_drop _s2434_ _s2435_) with
                                            | _s2436_ =>
                                               (sep_matches_prefix _s2436_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2437_ _) =>
                                                   (match (string_drop _s2436_ _s2437_) with
                                                    | _s2438_ =>
                                                       (frm_mnemonic_matches_prefix _s2438_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s2439_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2438_ _s2439_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_S_W, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))).

Definition _s2407_ (_s2408_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2408_ with
    | _s2409_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s2409_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_WU_S, existT _ _s2410_ _) =>
           (match (string_drop _s2409_ _s2410_) with
            | _s2411_ =>
               (spc_matches_prefix _s2411_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2412_ _) =>
                   (match (string_drop _s2411_ _s2412_) with
                    | _s2413_ =>
                       (reg_name_matches_prefix _s2413_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2414_ _) =>
                           (match (string_drop _s2413_ _s2414_) with
                            | _s2415_ =>
                               (sep_matches_prefix _s2415_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2416_ _) =>
                                   (match (string_drop _s2415_ _s2416_) with
                                    | _s2417_ =>
                                       (freg_name_matches_prefix _s2417_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2418_ _) =>
                                           (match (string_drop _s2417_ _s2418_) with
                                            | _s2419_ =>
                                               (sep_matches_prefix _s2419_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2420_ _) =>
                                                   (match (string_drop _s2419_ _s2420_) with
                                                    | _s2421_ =>
                                                       (frm_mnemonic_matches_prefix _s2421_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s2422_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2421_ _s2422_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_WU_S, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))).

Definition _s2390_ (_s2391_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2391_ with
    | _s2392_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s2392_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_W_S, existT _ _s2393_ _) =>
           (match (string_drop _s2392_ _s2393_) with
            | _s2394_ =>
               (spc_matches_prefix _s2394_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2395_ _) =>
                   (match (string_drop _s2394_ _s2395_) with
                    | _s2396_ =>
                       (reg_name_matches_prefix _s2396_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2397_ _) =>
                           (match (string_drop _s2396_ _s2397_) with
                            | _s2398_ =>
                               (sep_matches_prefix _s2398_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2399_ _) =>
                                   (match (string_drop _s2398_ _s2399_) with
                                    | _s2400_ =>
                                       (freg_name_matches_prefix _s2400_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2401_ _) =>
                                           (match (string_drop _s2400_ _s2401_) with
                                            | _s2402_ =>
                                               (sep_matches_prefix _s2402_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2403_ _) =>
                                                   (match (string_drop _s2402_ _s2403_) with
                                                    | _s2404_ =>
                                                       (frm_mnemonic_matches_prefix _s2404_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s2405_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2404_ _s2405_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_W_S, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))).

Definition _s2373_ (_s2374_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2374_ with
    | _s2375_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s2375_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSQRT_S, existT _ _s2376_ _) =>
           (match (string_drop _s2375_ _s2376_) with
            | _s2377_ =>
               (spc_matches_prefix _s2377_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2378_ _) =>
                   (match (string_drop _s2377_ _s2378_) with
                    | _s2379_ =>
                       (freg_name_matches_prefix _s2379_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2380_ _) =>
                           (match (string_drop _s2379_ _s2380_) with
                            | _s2381_ =>
                               (sep_matches_prefix _s2381_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2382_ _) =>
                                   (match (string_drop _s2381_ _s2382_) with
                                    | _s2383_ =>
                                       (freg_name_matches_prefix _s2383_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2384_ _) =>
                                           (match (string_drop _s2383_ _s2384_) with
                                            | _s2385_ =>
                                               (sep_matches_prefix _s2385_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2386_ _) =>
                                                   (match (string_drop _s2385_ _s2386_) with
                                                    | _s2387_ =>
                                                       (frm_mnemonic_matches_prefix _s2387_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s2388_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2387_ _s2388_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FSQRT_S, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))).

Definition _s2352_ (_s2353_ : string)
: M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2353_ with
    | _s2354_ =>
       (f_bin_rm_type_mnemonic_S_matches_prefix _s2354_) >>= fun w__0 : option ((f_bin_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s2355_ _) =>
           (match (string_drop _s2354_ _s2355_) with
            | _s2356_ =>
               (spc_matches_prefix _s2356_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2357_ _) =>
                   (match (string_drop _s2356_ _s2357_) with
                    | _s2358_ =>
                       (freg_name_matches_prefix _s2358_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2359_ _) =>
                           (match (string_drop _s2358_ _s2359_) with
                            | _s2360_ =>
                               (sep_matches_prefix _s2360_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2361_ _) =>
                                   (match (string_drop _s2360_ _s2361_) with
                                    | _s2362_ =>
                                       (freg_name_matches_prefix _s2362_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2363_ _) =>
                                           (match (string_drop _s2362_ _s2363_) with
                                            | _s2364_ =>
                                               (sep_matches_prefix _s2364_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2365_ _) =>
                                                   (match (string_drop _s2364_ _s2365_) with
                                                    | _s2366_ =>
                                                       (freg_name_matches_prefix _s2366_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       (match w__6 with
                                                        | Some (rs2, existT _ _s2367_ _) =>
                                                           (match (string_drop _s2366_ _s2367_) with
                                                            | _s2368_ =>
                                                               (sep_matches_prefix _s2368_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                 0)})) =>
                                                               (match w__7 with
                                                                | Some (tt, existT _ _s2369_ _) =>
                                                                   (match (string_drop _s2368_
                                                                             _s2369_) with
                                                                    | _s2370_ =>
                                                                       (frm_mnemonic_matches_prefix
                                                                          _s2370_) >>= fun w__8 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                                         0)})) =>
                                                                       returnm (match w__8 with
                                                                                | Some
                                                                                  (rm, existT _ _s2371_ _) =>
                                                                                   let p0_ :=
                                                                                     string_drop
                                                                                       _s2370_
                                                                                       _s2371_ in
                                                                                   if generic_eq p0_
                                                                                        "" then
                                                                                     Some
                                                                                       (op, rd, rs1, rs2, rm)
                                                                                   else None
                                                                                | _ => None
                                                                                end)
                                                                    end)
                                                                    : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                | _ => returnm None
                                                                end)
                                                                : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                            end)
                                                            : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                        | _ => returnm None
                                                        end)
                                                        : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                    end)
                                                    : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode))).

Definition _s2327_ (_s2328_ : string)
: M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode))) :=
   (match _s2328_ with
    | _s2329_ =>
       (f_madd_type_mnemonic_S_matches_prefix _s2329_) >>= fun w__0 : option ((f_madd_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s2330_ _) =>
           (match (string_drop _s2329_ _s2330_) with
            | _s2331_ =>
               (spc_matches_prefix _s2331_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2332_ _) =>
                   (match (string_drop _s2331_ _s2332_) with
                    | _s2333_ =>
                       (freg_name_matches_prefix _s2333_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2334_ _) =>
                           (match (string_drop _s2333_ _s2334_) with
                            | _s2335_ =>
                               (sep_matches_prefix _s2335_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2336_ _) =>
                                   (match (string_drop _s2335_ _s2336_) with
                                    | _s2337_ =>
                                       (freg_name_matches_prefix _s2337_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2338_ _) =>
                                           (match (string_drop _s2337_ _s2338_) with
                                            | _s2339_ =>
                                               (sep_matches_prefix _s2339_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2340_ _) =>
                                                   (match (string_drop _s2339_ _s2340_) with
                                                    | _s2341_ =>
                                                       (freg_name_matches_prefix _s2341_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       (match w__6 with
                                                        | Some (rs2, existT _ _s2342_ _) =>
                                                           (match (string_drop _s2341_ _s2342_) with
                                                            | _s2343_ =>
                                                               (sep_matches_prefix _s2343_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                 0)})) =>
                                                               (match w__7 with
                                                                | Some (tt, existT _ _s2344_ _) =>
                                                                   (match (string_drop _s2343_
                                                                             _s2344_) with
                                                                    | _s2345_ =>
                                                                       (freg_name_matches_prefix
                                                                          _s2345_) >>= fun w__8 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                         0)})) =>
                                                                       (match w__8 with
                                                                        | Some
                                                                          (rs3, existT _ _s2346_ _) =>
                                                                           (match (string_drop
                                                                                     _s2345_ _s2346_) with
                                                                            | _s2347_ =>
                                                                               (sep_matches_prefix
                                                                                  _s2347_) >>= fun w__9 : option ((unit * {n : Z & ArithFact (n >=?
                                                                                 0)})) =>
                                                                               (match w__9 with
                                                                                | Some
                                                                                  (tt, existT _ _s2348_ _) =>
                                                                                   (match (string_drop
                                                                                             _s2347_
                                                                                             _s2348_) with
                                                                                    | _s2349_ =>
                                                                                       (frm_mnemonic_matches_prefix
                                                                                          _s2349_) >>= fun w__10 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                                                         0)})) =>
                                                                                       returnm (match w__10 with
                                                                                                | Some
                                                                                                  (rm, existT _ _s2350_ _) =>
                                                                                                   let p0_ :=
                                                                                                     string_drop
                                                                                                       _s2349_
                                                                                                       _s2350_ in
                                                                                                   if
                                                                                                     generic_eq
                                                                                                       p0_
                                                                                                       ""
                                                                                                   then
                                                                                                     Some
                                                                                                       (op, rd, rs1, rs2, rs3, rm)
                                                                                                   else
                                                                                                     None
                                                                                                | _ =>
                                                                                                   None
                                                                                                end)
                                                                                    end)
                                                                                    : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                                | _ => returnm None
                                                                                end)
                                                                                : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                            end)
                                                                            : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                        | _ => returnm None
                                                                        end)
                                                                        : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                    end)
                                                                    : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                | _ => returnm None
                                                                end)
                                                                : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                            end)
                                                            : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                        | _ => returnm None
                                                        end)
                                                        : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                    end)
                                                    : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode))).

Definition _s2303_ (_s2304_ : string) : M (option ((word_width * mword 5 * mword 12 * mword 5))) :=
   let _s2305_ := _s2304_ in
   (if string_startswith _s2305_ "fs" then
      (match (string_drop _s2305_ (projT1 (string_length "fs"))) with
       | _s2306_ =>
          (size_mnemonic_matches_prefix _s2306_) >>= fun w__0 : option ((word_width * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (width, existT _ _s2307_ _) =>
              (match (string_drop _s2306_ _s2307_) with
               | _s2308_ =>
                  (spc_matches_prefix _s2308_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (tt, existT _ _s2309_ _) =>
                      (match (string_drop _s2308_ _s2309_) with
                       | _s2310_ =>
                          (freg_name_matches_prefix _s2310_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rs2, existT _ _s2311_ _) =>
                              (match (string_drop _s2310_ _s2311_) with
                               | _s2312_ =>
                                  (sep_matches_prefix _s2312_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s2313_ _) =>
                                      (match (string_drop _s2312_ _s2313_) with
                                       | _s2314_ =>
                                          (match (hex_bits_12_matches_prefix _s2314_) with
                                           | Some (imm, existT _ _s2315_ _) =>
                                              (match (string_drop _s2314_ _s2315_) with
                                               | _s2316_ =>
                                                  (opt_spc_matches_prefix _s2316_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__4 with
                                                   | Some (tt, existT _ _s2317_ _) =>
                                                      let _s2318_ := string_drop _s2316_ _s2317_ in
                                                      (if string_startswith _s2318_ "(" then
                                                         (match (string_drop _s2318_
                                                                   (projT1
                                                                    (string_length "("))) with
                                                          | _s2319_ =>
                                                             (opt_spc_matches_prefix _s2319_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                               0)})) =>
                                                             (match w__5 with
                                                              | Some (tt, existT _ _s2320_ _) =>
                                                                 (match (string_drop _s2319_ _s2320_) with
                                                                  | _s2321_ =>
                                                                     (reg_name_matches_prefix
                                                                        _s2321_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                       0)})) =>
                                                                     (match w__6 with
                                                                      | Some
                                                                        (rs1, existT _ _s2322_ _) =>
                                                                         (match (string_drop _s2321_
                                                                                   _s2322_) with
                                                                          | _s2323_ =>
                                                                             (opt_spc_matches_prefix
                                                                                _s2323_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                               0)})) =>
                                                                             returnm (match w__7 with
                                                                                      | Some
                                                                                        (tt, existT _ _s2324_ _) =>
                                                                                         let _s2325_ :=
                                                                                           string_drop
                                                                                             _s2323_
                                                                                             _s2324_ in
                                                                                         if string_startswith
                                                                                              _s2325_
                                                                                              ")"
                                                                                         then
                                                                                           let p0_ :=
                                                                                             string_drop
                                                                                               _s2325_
                                                                                               (projT1
                                                                                                (string_length
                                                                                                   ")")) in
                                                                                           if generic_eq
                                                                                                p0_
                                                                                                ""
                                                                                           then
                                                                                             Some
                                                                                               (width, rs2, imm, rs1)
                                                                                           else None
                                                                                         else None
                                                                                      | _ => None
                                                                                      end)
                                                                          end)
                                                                          : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                                      | _ => returnm None
                                                                      end)
                                                                      : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                                  end)
                                                                  : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                              | _ => returnm None
                                                              end)
                                                              : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                          end)
                                                          : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                       else returnm None)
                                                       : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                               end)
                                               : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                       end)
                                       : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                               end)
                               : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                       end)
                       : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((word_width * mword 5 * mword 12 * mword 5)))
               end)
               : M (option ((word_width * mword 5 * mword 12 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((word_width * mword 5 * mword 12 * mword 5)))
       end)
       : M (option ((word_width * mword 5 * mword 12 * mword 5)))
    else returnm None)
    : M (option ((word_width * mword 5 * mword 12 * mword 5))).

Definition _s2279_ (_s2280_ : string) : M (option ((word_width * mword 5 * mword 12 * mword 5))) :=
   let _s2281_ := _s2280_ in
   (if string_startswith _s2281_ "fl" then
      (match (string_drop _s2281_ (projT1 (string_length "fl"))) with
       | _s2282_ =>
          (size_mnemonic_matches_prefix _s2282_) >>= fun w__0 : option ((word_width * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (width, existT _ _s2283_ _) =>
              (match (string_drop _s2282_ _s2283_) with
               | _s2284_ =>
                  (spc_matches_prefix _s2284_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (tt, existT _ _s2285_ _) =>
                      (match (string_drop _s2284_ _s2285_) with
                       | _s2286_ =>
                          (freg_name_matches_prefix _s2286_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rd, existT _ _s2287_ _) =>
                              (match (string_drop _s2286_ _s2287_) with
                               | _s2288_ =>
                                  (sep_matches_prefix _s2288_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s2289_ _) =>
                                      (match (string_drop _s2288_ _s2289_) with
                                       | _s2290_ =>
                                          (match (hex_bits_12_matches_prefix _s2290_) with
                                           | Some (imm, existT _ _s2291_ _) =>
                                              (match (string_drop _s2290_ _s2291_) with
                                               | _s2292_ =>
                                                  (opt_spc_matches_prefix _s2292_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__4 with
                                                   | Some (tt, existT _ _s2293_ _) =>
                                                      let _s2294_ := string_drop _s2292_ _s2293_ in
                                                      (if string_startswith _s2294_ "(" then
                                                         (match (string_drop _s2294_
                                                                   (projT1
                                                                    (string_length "("))) with
                                                          | _s2295_ =>
                                                             (opt_spc_matches_prefix _s2295_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                               0)})) =>
                                                             (match w__5 with
                                                              | Some (tt, existT _ _s2296_ _) =>
                                                                 (match (string_drop _s2295_ _s2296_) with
                                                                  | _s2297_ =>
                                                                     (reg_name_matches_prefix
                                                                        _s2297_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                       0)})) =>
                                                                     (match w__6 with
                                                                      | Some
                                                                        (rs1, existT _ _s2298_ _) =>
                                                                         (match (string_drop _s2297_
                                                                                   _s2298_) with
                                                                          | _s2299_ =>
                                                                             (opt_spc_matches_prefix
                                                                                _s2299_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                               0)})) =>
                                                                             returnm (match w__7 with
                                                                                      | Some
                                                                                        (tt, existT _ _s2300_ _) =>
                                                                                         let _s2301_ :=
                                                                                           string_drop
                                                                                             _s2299_
                                                                                             _s2300_ in
                                                                                         if string_startswith
                                                                                              _s2301_
                                                                                              ")"
                                                                                         then
                                                                                           let p0_ :=
                                                                                             string_drop
                                                                                               _s2301_
                                                                                               (projT1
                                                                                                (string_length
                                                                                                   ")")) in
                                                                                           if generic_eq
                                                                                                p0_
                                                                                                ""
                                                                                           then
                                                                                             Some
                                                                                               (width, rd, imm, rs1)
                                                                                           else None
                                                                                         else None
                                                                                      | _ => None
                                                                                      end)
                                                                          end)
                                                                          : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                                      | _ => returnm None
                                                                      end)
                                                                      : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                                  end)
                                                                  : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                              | _ => returnm None
                                                              end)
                                                              : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                          end)
                                                          : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                       else returnm None)
                                                       : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                               end)
                                               : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                       end)
                                       : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                               end)
                               : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                       end)
                       : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((word_width * mword 5 * mword 12 * mword 5)))
               end)
               : M (option ((word_width * mword 5 * mword 12 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((word_width * mword 5 * mword 12 * mword 5)))
       end)
       : M (option ((word_width * mword 5 * mword 12 * mword 5)))
    else returnm None)
    : M (option ((word_width * mword 5 * mword 12 * mword 5))).

Definition _s2267_ (_s2268_ : string) : M (option ((mword 5 * mword 5 * mword 12))) :=
   let _s2269_ := _s2268_ in
   (if string_startswith _s2269_ "fence.i.reserved." then
      (match (string_drop _s2269_ (projT1 (string_length "fence.i.reserved."))) with
       | _s2270_ =>
          (reg_name_matches_prefix _s2270_) >>= fun w__0 : option ((mword 5 * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (rd, existT _ _s2271_ _) =>
              let _s2272_ := string_drop _s2270_ _s2271_ in
              (if string_startswith _s2272_ "." then
                 (match (string_drop _s2272_ (projT1 (string_length "."))) with
                  | _s2273_ =>
                     (reg_name_matches_prefix _s2273_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                       0)})) =>
                     returnm (match w__1 with
                              | Some (rs, existT _ _s2274_ _) =>
                                 let _s2275_ := string_drop _s2273_ _s2274_ in
                                 if string_startswith _s2275_ "." then
                                   match (string_drop _s2275_ (projT1 (string_length "."))) with
                                   | _s2276_ =>
                                      match (hex_bits_12_matches_prefix _s2276_) with
                                      | Some (imm, existT _ _s2277_ _) =>
                                         let p0_ := string_drop _s2276_ _s2277_ in
                                         if generic_eq p0_ "" then Some (rd, rs, imm)
                                         else None
                                      | _ => None
                                      end
                                   end
                                 else None
                              | _ => None
                              end)
                  end)
                  : M (option ((mword 5 * mword 5 * mword 12)))
               else returnm None)
               : M (option ((mword 5 * mword 5 * mword 12)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5 * mword 12)))
       end)
       : M (option ((mword 5 * mword 5 * mword 12)))
    else returnm None)
    : M (option ((mword 5 * mword 5 * mword 12))).

Definition _s2249_ (_s2250_ : string)
: M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4))) :=
   let _s2251_ := _s2250_ in
   (if string_startswith _s2251_ "fence.reserved." then
      (match (string_drop _s2251_ (projT1 (string_length "fence.reserved."))) with
       | _s2252_ =>
          (fence_bits_matches_prefix _s2252_) >>= fun w__0 : option ((mword 4 * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (pred, existT _ _s2253_ _) =>
              let _s2254_ := string_drop _s2252_ _s2253_ in
              (if string_startswith _s2254_ "." then
                 (match (string_drop _s2254_ (projT1 (string_length "."))) with
                  | _s2255_ =>
                     (fence_bits_matches_prefix _s2255_) >>= fun w__1 : option ((mword 4 * {n : Z & ArithFact (n >=?
                       0)})) =>
                     (match w__1 with
                      | Some (succ, existT _ _s2256_ _) =>
                         let _s2257_ := string_drop _s2255_ _s2256_ in
                         (if string_startswith _s2257_ "." then
                            (match (string_drop _s2257_ (projT1 (string_length "."))) with
                             | _s2258_ =>
                                (reg_name_matches_prefix _s2258_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                  0)})) =>
                                (match w__2 with
                                 | Some (rs, existT _ _s2259_ _) =>
                                    let _s2260_ := string_drop _s2258_ _s2259_ in
                                    (if string_startswith _s2260_ "." then
                                       (match (string_drop _s2260_ (projT1 (string_length "."))) with
                                        | _s2261_ =>
                                           (reg_name_matches_prefix _s2261_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                             0)})) =>
                                           returnm (match w__3 with
                                                    | Some (rd, existT _ _s2262_ _) =>
                                                       let _s2263_ := string_drop _s2261_ _s2262_ in
                                                       if string_startswith _s2263_ "." then
                                                         match (string_drop _s2263_
                                                                  (projT1
                                                                   (string_length "."))) with
                                                         | _s2264_ =>
                                                            match (hex_bits_4_matches_prefix _s2264_) with
                                                            | Some (fm, existT _ _s2265_ _) =>
                                                               let p0_ :=
                                                                 string_drop _s2264_ _s2265_ in
                                                               if generic_eq p0_ "" then
                                                                 Some (pred, succ, rs, rd, fm)
                                                               else None
                                                            | _ => None
                                                            end
                                                         end
                                                       else None
                                                    | _ => None
                                                    end)
                                        end)
                                        : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)))
                                     else returnm None)
                                     : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)))
                                 | _ => returnm None
                                 end)
                                 : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)))
                             end)
                             : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)))
                          else returnm None)
                          : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)))
                      | _ => returnm None
                      end)
                      : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)))
                  end)
                  : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)))
               else returnm None)
               : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)))
           | _ => returnm None
           end)
           : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)))
       end)
       : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)))
    else returnm None)
    : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4))).

Definition _s2243_ (_s2244_ : string) : M (option (mword 3)) :=
   let _s2245_ := _s2244_ in
   (if string_startswith _s2245_ "c.srai.hint." then
      (match (string_drop _s2245_ (projT1 (string_length "c.srai.hint."))) with
       | _s2246_ =>
          (creg_name_matches_prefix _s2246_) >>= fun w__0 : option ((mword 3 * {n : Z & ArithFact (n >=?
            0)})) =>
          returnm (match w__0 with
                   | Some (rsd, existT _ _s2247_ _) =>
                      let p0_ := string_drop _s2246_ _s2247_ in
                      if generic_eq p0_ "" then Some rsd
                      else None
                   | _ => None
                   end)
       end)
       : M (option (mword 3))
    else returnm None)
    : M (option (mword 3)).

Definition _s2237_ (_s2238_ : string) : M (option (mword 3)) :=
   let _s2239_ := _s2238_ in
   (if string_startswith _s2239_ "c.srli.hint." then
      (match (string_drop _s2239_ (projT1 (string_length "c.srli.hint."))) with
       | _s2240_ =>
          (creg_name_matches_prefix _s2240_) >>= fun w__0 : option ((mword 3 * {n : Z & ArithFact (n >=?
            0)})) =>
          returnm (match w__0 with
                   | Some (rsd, existT _ _s2241_ _) =>
                      let p0_ := string_drop _s2240_ _s2241_ in
                      if generic_eq p0_ "" then Some rsd
                      else None
                   | _ => None
                   end)
       end)
       : M (option (mword 3))
    else returnm None)
    : M (option (mword 3)).

Definition _s2228_ (_s2229_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s2230_ := _s2229_ in
   (if string_startswith _s2230_ "c.slli.hint." then
      (match (string_drop _s2230_ (projT1 (string_length "c.slli.hint."))) with
       | _s2231_ =>
          (reg_name_matches_prefix _s2231_) >>= fun w__0 : option ((mword 5 * {n : Z & ArithFact (n >=?
            0)})) =>
          returnm (match w__0 with
                   | Some (rsd, existT _ _s2232_ _) =>
                      let _s2233_ := string_drop _s2231_ _s2232_ in
                      if string_startswith _s2233_ "." then
                        match (string_drop _s2233_ (projT1 (string_length "."))) with
                        | _s2234_ =>
                           match (hex_bits_6_matches_prefix _s2234_) with
                           | Some (shamt, existT _ _s2235_ _) =>
                              let p0_ := string_drop _s2234_ _s2235_ in
                              if generic_eq p0_ "" then Some (rsd, shamt)
                              else None
                           | _ => None
                           end
                        end
                      else None
                   | _ => None
                   end)
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s2222_ (_s2223_ : string) : M (option (mword 5)) :=
   let _s2224_ := _s2223_ in
   (if string_startswith _s2224_ "c.add.hint." then
      (match (string_drop _s2224_ (projT1 (string_length "c.add.hint."))) with
       | _s2225_ =>
          (reg_name_matches_prefix _s2225_) >>= fun w__0 : option ((mword 5 * {n : Z & ArithFact (n >=?
            0)})) =>
          returnm (match w__0 with
                   | Some (rs2, existT _ _s2226_ _) =>
                      let p0_ := string_drop _s2225_ _s2226_ in
                      if generic_eq p0_ "" then Some rs2
                      else None
                   | _ => None
                   end)
       end)
       : M (option (mword 5))
    else returnm None)
    : M (option (mword 5)).

Definition _s2216_ (_s2217_ : string) : M (option (mword 5)) :=
   let _s2218_ := _s2217_ in
   (if string_startswith _s2218_ "c.mv.hint." then
      (match (string_drop _s2218_ (projT1 (string_length "c.mv.hint."))) with
       | _s2219_ =>
          (reg_name_matches_prefix _s2219_) >>= fun w__0 : option ((mword 5 * {n : Z & ArithFact (n >=?
            0)})) =>
          returnm (match w__0 with
                   | Some (rs2, existT _ _s2220_ _) =>
                      let p0_ := string_drop _s2219_ _s2220_ in
                      if generic_eq p0_ "" then Some rs2
                      else None
                   | _ => None
                   end)
       end)
       : M (option (mword 5))
    else returnm None)
    : M (option (mword 5)).

Definition _s2210_ (_s2211_ : string) : option (mword 6) :=
   let _s2212_ := _s2211_ in
   if string_startswith _s2212_ "c.lui.hint." then
     match (string_drop _s2212_ (projT1 (string_length "c.lui.hint."))) with
     | _s2213_ =>
        match (hex_bits_6_matches_prefix _s2213_) with
        | Some (imm, existT _ _s2214_ _) =>
           let p0_ := string_drop _s2213_ _s2214_ in
           if generic_eq p0_ "" then Some imm
           else None
        | _ => None
        end
     end
   else None.

Definition _s2204_ (_s2205_ : string) : option (mword 6) :=
   let _s2206_ := _s2205_ in
   if string_startswith _s2206_ "c.li.hint." then
     match (string_drop _s2206_ (projT1 (string_length "c.li.hint."))) with
     | _s2207_ =>
        match (hex_bits_6_matches_prefix _s2207_) with
        | Some (imm, existT _ _s2208_ _) =>
           let p0_ := string_drop _s2207_ _s2208_ in
           if generic_eq p0_ "" then Some imm
           else None
        | _ => None
        end
     end
   else None.

Definition _s2198_ (_s2199_ : string) : M (option (mword 5)) :=
   let _s2200_ := _s2199_ in
   (if string_startswith _s2200_ "c.addi.hint." then
      (match (string_drop _s2200_ (projT1 (string_length "c.addi.hint."))) with
       | _s2201_ =>
          (reg_name_matches_prefix _s2201_) >>= fun w__0 : option ((mword 5 * {n : Z & ArithFact (n >=?
            0)})) =>
          returnm (match w__0 with
                   | Some (rsd, existT _ _s2202_ _) =>
                      let p0_ := string_drop _s2201_ _s2202_ in
                      if generic_eq p0_ "" then Some rsd
                      else None
                   | _ => None
                   end)
       end)
       : M (option (mword 5))
    else returnm None)
    : M (option (mword 5)).

Definition _s2192_ (_s2193_ : string) : option (mword 6) :=
   let _s2194_ := _s2193_ in
   if string_startswith _s2194_ "c.nop.hint." then
     match (string_drop _s2194_ (projT1 (string_length "c.nop.hint."))) with
     | _s2195_ =>
        match (hex_bits_6_matches_prefix _s2195_) with
        | Some (imm, existT _ _s2196_ _) =>
           let p0_ := string_drop _s2195_ _s2196_ in
           if generic_eq p0_ "" then Some imm
           else None
        | _ => None
        end
     end
   else None.

Definition _s2175_ (_s2176_ : string) : M (option ((csrop * mword 5 * mword 12 * mword 5))) :=
   (match _s2176_ with
    | _s2177_ =>
       (csr_mnemonic_matches_prefix _s2177_) >>= fun w__0 : option ((csrop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s2178_ _) =>
           (match (string_drop _s2177_ _s2178_) with
            | _s2179_ =>
               (spc_matches_prefix _s2179_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2180_ _) =>
                   (match (string_drop _s2179_ _s2180_) with
                    | _s2181_ =>
                       (reg_name_matches_prefix _s2181_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2182_ _) =>
                           (match (string_drop _s2181_ _s2182_) with
                            | _s2183_ =>
                               (sep_matches_prefix _s2183_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2184_ _) =>
                                   (match (string_drop _s2183_ _s2184_) with
                                    | _s2185_ =>
                                       (csr_name_map_matches_prefix _s2185_) >>= fun w__4 : option ((mword 12 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (csr, existT _ _s2186_ _) =>
                                           (match (string_drop _s2185_ _s2186_) with
                                            | _s2187_ =>
                                               (sep_matches_prefix _s2187_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2188_ _) =>
                                                   (match (string_drop _s2187_ _s2188_) with
                                                    | _s2189_ =>
                                                       (reg_name_matches_prefix _s2189_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs1, existT _ _s2190_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2189_ _s2190_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (op, rd, csr, rs1)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                                            end)
                                            : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                                    end)
                                    : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                            end)
                            : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                    end)
                    : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((csrop * mword 5 * mword 12 * mword 5)))
            end)
            : M (option ((csrop * mword 5 * mword 12 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((csrop * mword 5 * mword 12 * mword 5)))
    end)
    : M (option ((csrop * mword 5 * mword 12 * mword 5))).

Definition _s2157_ (_s2158_ : string) : M (option ((csrop * mword 5 * mword 12 * mword 5))) :=
   (match _s2158_ with
    | _s2159_ =>
       (csr_mnemonic_matches_prefix _s2159_) >>= fun w__0 : option ((csrop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s2160_ _) =>
           let _s2161_ := string_drop _s2159_ _s2160_ in
           (if string_startswith _s2161_ "i" then
              (match (string_drop _s2161_ (projT1 (string_length "i"))) with
               | _s2162_ =>
                  (spc_matches_prefix _s2162_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (tt, existT _ _s2163_ _) =>
                      (match (string_drop _s2162_ _s2163_) with
                       | _s2164_ =>
                          (reg_name_matches_prefix _s2164_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rd, existT _ _s2165_ _) =>
                              (match (string_drop _s2164_ _s2165_) with
                               | _s2166_ =>
                                  (sep_matches_prefix _s2166_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s2167_ _) =>
                                      (match (string_drop _s2166_ _s2167_) with
                                       | _s2168_ =>
                                          (csr_name_map_matches_prefix _s2168_) >>= fun w__4 : option ((mword 12 * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (csr, existT _ _s2169_ _) =>
                                              (match (string_drop _s2168_ _s2169_) with
                                               | _s2170_ =>
                                                  (sep_matches_prefix _s2170_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  returnm (match w__5 with
                                                           | Some (tt, existT _ _s2171_ _) =>
                                                              match (string_drop _s2170_ _s2171_) with
                                                              | _s2172_ =>
                                                                 match (hex_bits_5_matches_prefix
                                                                          _s2172_) with
                                                                 | Some (rs1, existT _ _s2173_ _) =>
                                                                    let p0_ :=
                                                                      string_drop _s2172_ _s2173_ in
                                                                    if generic_eq p0_ "" then
                                                                      Some (op, rd, csr, rs1)
                                                                    else None
                                                                 | _ => None
                                                                 end
                                                              end
                                                           | _ => None
                                                           end)
                                               end)
                                               : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                                       end)
                                       : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                               end)
                               : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                       end)
                       : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((csrop * mword 5 * mword 12 * mword 5)))
               end)
               : M (option ((csrop * mword 5 * mword 12 * mword 5)))
            else returnm None)
            : M (option ((csrop * mword 5 * mword 12 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((csrop * mword 5 * mword 12 * mword 5)))
    end)
    : M (option ((csrop * mword 5 * mword 12 * mword 5))).

Definition _s2138_ (_s2139_ : string) : M (option ((bool * mword 5 * mword 5 * mword 5))) :=
   let _s2140_ := _s2139_ in
   (if string_startswith _s2140_ "rem" then
      (match (string_drop _s2140_ (projT1 (string_length "rem"))) with
       | _s2141_ =>
          (maybe_not_u_matches_prefix _s2141_) >>= fun w__0 : option ((bool * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (s, existT _ _s2142_ _) =>
              let _s2143_ := string_drop _s2141_ _s2142_ in
              (if string_startswith _s2143_ "w" then
                 (match (string_drop _s2143_ (projT1 (string_length "w"))) with
                  | _s2144_ =>
                     (spc_matches_prefix _s2144_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                       0)})) =>
                     (match w__1 with
                      | Some (tt, existT _ _s2145_ _) =>
                         (match (string_drop _s2144_ _s2145_) with
                          | _s2146_ =>
                             (reg_name_matches_prefix _s2146_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                               0)})) =>
                             (match w__2 with
                              | Some (rd, existT _ _s2147_ _) =>
                                 (match (string_drop _s2146_ _s2147_) with
                                  | _s2148_ =>
                                     (sep_matches_prefix _s2148_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                       0)})) =>
                                     (match w__3 with
                                      | Some (tt, existT _ _s2149_ _) =>
                                         (match (string_drop _s2148_ _s2149_) with
                                          | _s2150_ =>
                                             (reg_name_matches_prefix _s2150_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                               0)})) =>
                                             (match w__4 with
                                              | Some (rs1, existT _ _s2151_ _) =>
                                                 (match (string_drop _s2150_ _s2151_) with
                                                  | _s2152_ =>
                                                     (sep_matches_prefix _s2152_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                       0)})) =>
                                                     (match w__5 with
                                                      | Some (tt, existT _ _s2153_ _) =>
                                                         (match (string_drop _s2152_ _s2153_) with
                                                          | _s2154_ =>
                                                             (reg_name_matches_prefix _s2154_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                               0)})) =>
                                                             returnm (match w__6 with
                                                                      | Some
                                                                        (rs2, existT _ _s2155_ _) =>
                                                                         let p0_ :=
                                                                           string_drop _s2154_
                                                                             _s2155_ in
                                                                         if generic_eq p0_ "" then
                                                                           Some (s, rd, rs1, rs2)
                                                                         else None
                                                                      | _ => None
                                                                      end)
                                                          end)
                                                          : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                                      | _ => returnm None
                                                      end)
                                                      : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                                  end)
                                                  : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                              | _ => returnm None
                                              end)
                                              : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                          end)
                                          : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                      | _ => returnm None
                                      end)
                                      : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                  end)
                                  : M (option ((bool * mword 5 * mword 5 * mword 5)))
                              | _ => returnm None
                              end)
                              : M (option ((bool * mword 5 * mword 5 * mword 5)))
                          end)
                          : M (option ((bool * mword 5 * mword 5 * mword 5)))
                      | _ => returnm None
                      end)
                      : M (option ((bool * mword 5 * mword 5 * mword 5)))
                  end)
                  : M (option ((bool * mword 5 * mword 5 * mword 5)))
               else returnm None)
               : M (option ((bool * mword 5 * mword 5 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((bool * mword 5 * mword 5 * mword 5)))
       end)
       : M (option ((bool * mword 5 * mword 5 * mword 5)))
    else returnm None)
    : M (option ((bool * mword 5 * mword 5 * mword 5))).

Definition _s2119_ (_s2120_ : string) : M (option ((bool * mword 5 * mword 5 * mword 5))) :=
   let _s2121_ := _s2120_ in
   (if string_startswith _s2121_ "div" then
      (match (string_drop _s2121_ (projT1 (string_length "div"))) with
       | _s2122_ =>
          (maybe_not_u_matches_prefix _s2122_) >>= fun w__0 : option ((bool * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (s, existT _ _s2123_ _) =>
              let _s2124_ := string_drop _s2122_ _s2123_ in
              (if string_startswith _s2124_ "w" then
                 (match (string_drop _s2124_ (projT1 (string_length "w"))) with
                  | _s2125_ =>
                     (spc_matches_prefix _s2125_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                       0)})) =>
                     (match w__1 with
                      | Some (tt, existT _ _s2126_ _) =>
                         (match (string_drop _s2125_ _s2126_) with
                          | _s2127_ =>
                             (reg_name_matches_prefix _s2127_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                               0)})) =>
                             (match w__2 with
                              | Some (rd, existT _ _s2128_ _) =>
                                 (match (string_drop _s2127_ _s2128_) with
                                  | _s2129_ =>
                                     (sep_matches_prefix _s2129_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                       0)})) =>
                                     (match w__3 with
                                      | Some (tt, existT _ _s2130_ _) =>
                                         (match (string_drop _s2129_ _s2130_) with
                                          | _s2131_ =>
                                             (reg_name_matches_prefix _s2131_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                               0)})) =>
                                             (match w__4 with
                                              | Some (rs1, existT _ _s2132_ _) =>
                                                 (match (string_drop _s2131_ _s2132_) with
                                                  | _s2133_ =>
                                                     (sep_matches_prefix _s2133_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                       0)})) =>
                                                     (match w__5 with
                                                      | Some (tt, existT _ _s2134_ _) =>
                                                         (match (string_drop _s2133_ _s2134_) with
                                                          | _s2135_ =>
                                                             (reg_name_matches_prefix _s2135_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                               0)})) =>
                                                             returnm (match w__6 with
                                                                      | Some
                                                                        (rs2, existT _ _s2136_ _) =>
                                                                         let p0_ :=
                                                                           string_drop _s2135_
                                                                             _s2136_ in
                                                                         if generic_eq p0_ "" then
                                                                           Some (s, rd, rs1, rs2)
                                                                         else None
                                                                      | _ => None
                                                                      end)
                                                          end)
                                                          : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                                      | _ => returnm None
                                                      end)
                                                      : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                                  end)
                                                  : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                              | _ => returnm None
                                              end)
                                              : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                          end)
                                          : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                      | _ => returnm None
                                      end)
                                      : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                  end)
                                  : M (option ((bool * mword 5 * mword 5 * mword 5)))
                              | _ => returnm None
                              end)
                              : M (option ((bool * mword 5 * mword 5 * mword 5)))
                          end)
                          : M (option ((bool * mword 5 * mword 5 * mword 5)))
                      | _ => returnm None
                      end)
                      : M (option ((bool * mword 5 * mword 5 * mword 5)))
                  end)
                  : M (option ((bool * mword 5 * mword 5 * mword 5)))
               else returnm None)
               : M (option ((bool * mword 5 * mword 5 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((bool * mword 5 * mword 5 * mword 5)))
       end)
       : M (option ((bool * mword 5 * mword 5 * mword 5)))
    else returnm None)
    : M (option ((bool * mword 5 * mword 5 * mword 5))).

Definition _s2103_ (_s2104_ : string) : M (option ((mword 5 * mword 5 * mword 5))) :=
   let _s2105_ := _s2104_ in
   (if string_startswith _s2105_ "mulw" then
      (match (string_drop _s2105_ (projT1 (string_length "mulw"))) with
       | _s2106_ =>
          (spc_matches_prefix _s2106_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s2107_ _) =>
              (match (string_drop _s2106_ _s2107_) with
               | _s2108_ =>
                  (reg_name_matches_prefix _s2108_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s2109_ _) =>
                      (match (string_drop _s2108_ _s2109_) with
                       | _s2110_ =>
                          (sep_matches_prefix _s2110_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s2111_ _) =>
                              (match (string_drop _s2110_ _s2111_) with
                               | _s2112_ =>
                                  (reg_name_matches_prefix _s2112_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rs1, existT _ _s2113_ _) =>
                                      (match (string_drop _s2112_ _s2113_) with
                                       | _s2114_ =>
                                          (sep_matches_prefix _s2114_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (tt, existT _ _s2115_ _) =>
                                              (match (string_drop _s2114_ _s2115_) with
                                               | _s2116_ =>
                                                  (reg_name_matches_prefix _s2116_) >>= fun w__5 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  returnm (match w__5 with
                                                           | Some (rs2, existT _ _s2117_ _) =>
                                                              let p0_ := string_drop _s2116_ _s2117_ in
                                                              if generic_eq p0_ "" then
                                                                Some (rd, rs1, rs2)
                                                              else None
                                                           | _ => None
                                                           end)
                                               end)
                                               : M (option ((mword 5 * mword 5 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((mword 5 * mword 5 * mword 5)))
                                       end)
                                       : M (option ((mword 5 * mword 5 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 5 * mword 5 * mword 5)))
                               end)
                               : M (option ((mword 5 * mword 5 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 5 * mword 5 * mword 5)))
                       end)
                       : M (option ((mword 5 * mword 5 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 5 * mword 5)))
               end)
               : M (option ((mword 5 * mword 5 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5 * mword 5)))
       end)
       : M (option ((mword 5 * mword 5 * mword 5)))
    else returnm None)
    : M (option ((mword 5 * mword 5 * mword 5))).

Definition _s2085_ (_s2086_ : string) : M (option ((bool * mword 5 * mword 5 * mword 5))) :=
   let _s2087_ := _s2086_ in
   (if string_startswith _s2087_ "rem" then
      (match (string_drop _s2087_ (projT1 (string_length "rem"))) with
       | _s2088_ =>
          (maybe_not_u_matches_prefix _s2088_) >>= fun w__0 : option ((bool * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (s, existT _ _s2089_ _) =>
              (match (string_drop _s2088_ _s2089_) with
               | _s2090_ =>
                  (spc_matches_prefix _s2090_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (tt, existT _ _s2091_ _) =>
                      (match (string_drop _s2090_ _s2091_) with
                       | _s2092_ =>
                          (reg_name_matches_prefix _s2092_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rd, existT _ _s2093_ _) =>
                              (match (string_drop _s2092_ _s2093_) with
                               | _s2094_ =>
                                  (sep_matches_prefix _s2094_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s2095_ _) =>
                                      (match (string_drop _s2094_ _s2095_) with
                                       | _s2096_ =>
                                          (reg_name_matches_prefix _s2096_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (rs1, existT _ _s2097_ _) =>
                                              (match (string_drop _s2096_ _s2097_) with
                                               | _s2098_ =>
                                                  (sep_matches_prefix _s2098_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (tt, existT _ _s2099_ _) =>
                                                      (match (string_drop _s2098_ _s2099_) with
                                                       | _s2100_ =>
                                                          (reg_name_matches_prefix _s2100_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                            0)})) =>
                                                          returnm (match w__6 with
                                                                   | Some (rs2, existT _ _s2101_ _) =>
                                                                      let p0_ :=
                                                                        string_drop _s2100_ _s2101_ in
                                                                      if generic_eq p0_ "" then
                                                                        Some (s, rd, rs1, rs2)
                                                                      else None
                                                                   | _ => None
                                                                   end)
                                                       end)
                                                       : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                               end)
                                               : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                       end)
                                       : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((bool * mword 5 * mword 5 * mword 5)))
                               end)
                               : M (option ((bool * mword 5 * mword 5 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((bool * mword 5 * mword 5 * mword 5)))
                       end)
                       : M (option ((bool * mword 5 * mword 5 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((bool * mword 5 * mword 5 * mword 5)))
               end)
               : M (option ((bool * mword 5 * mword 5 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((bool * mword 5 * mword 5 * mword 5)))
       end)
       : M (option ((bool * mword 5 * mword 5 * mword 5)))
    else returnm None)
    : M (option ((bool * mword 5 * mword 5 * mword 5))).

Definition _s2067_ (_s2068_ : string) : M (option ((bool * mword 5 * mword 5 * mword 5))) :=
   let _s2069_ := _s2068_ in
   (if string_startswith _s2069_ "div" then
      (match (string_drop _s2069_ (projT1 (string_length "div"))) with
       | _s2070_ =>
          (maybe_not_u_matches_prefix _s2070_) >>= fun w__0 : option ((bool * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (s, existT _ _s2071_ _) =>
              (match (string_drop _s2070_ _s2071_) with
               | _s2072_ =>
                  (spc_matches_prefix _s2072_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (tt, existT _ _s2073_ _) =>
                      (match (string_drop _s2072_ _s2073_) with
                       | _s2074_ =>
                          (reg_name_matches_prefix _s2074_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rd, existT _ _s2075_ _) =>
                              (match (string_drop _s2074_ _s2075_) with
                               | _s2076_ =>
                                  (sep_matches_prefix _s2076_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s2077_ _) =>
                                      (match (string_drop _s2076_ _s2077_) with
                                       | _s2078_ =>
                                          (reg_name_matches_prefix _s2078_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (rs1, existT _ _s2079_ _) =>
                                              (match (string_drop _s2078_ _s2079_) with
                                               | _s2080_ =>
                                                  (sep_matches_prefix _s2080_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (tt, existT _ _s2081_ _) =>
                                                      (match (string_drop _s2080_ _s2081_) with
                                                       | _s2082_ =>
                                                          (reg_name_matches_prefix _s2082_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                            0)})) =>
                                                          returnm (match w__6 with
                                                                   | Some (rs2, existT _ _s2083_ _) =>
                                                                      let p0_ :=
                                                                        string_drop _s2082_ _s2083_ in
                                                                      if generic_eq p0_ "" then
                                                                        Some (s, rd, rs1, rs2)
                                                                      else None
                                                                   | _ => None
                                                                   end)
                                                       end)
                                                       : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                               end)
                                               : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                       end)
                                       : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((bool * mword 5 * mword 5 * mword 5)))
                               end)
                               : M (option ((bool * mword 5 * mword 5 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((bool * mword 5 * mword 5 * mword 5)))
                       end)
                       : M (option ((bool * mword 5 * mword 5 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((bool * mword 5 * mword 5 * mword 5)))
               end)
               : M (option ((bool * mword 5 * mword 5 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((bool * mword 5 * mword 5 * mword 5)))
       end)
       : M (option ((bool * mword 5 * mword 5 * mword 5)))
    else returnm None)
    : M (option ((bool * mword 5 * mword 5 * mword 5))).

Definition _s2050_ (_s2051_ : string)
: M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5))) :=
   (match _s2051_ with
    | _s2052_ =>
       (mul_mnemonic_matches_prefix _s2052_) >>= fun w__0 : option (((bool * bool * bool) * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some ((high, signed1, signed2), existT _ _s2053_ _) =>
           (match (string_drop _s2052_ _s2053_) with
            | _s2054_ =>
               (spc_matches_prefix _s2054_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s2055_ _) =>
                   (match (string_drop _s2054_ _s2055_) with
                    | _s2056_ =>
                       (reg_name_matches_prefix _s2056_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s2057_ _) =>
                           (match (string_drop _s2056_ _s2057_) with
                            | _s2058_ =>
                               (sep_matches_prefix _s2058_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s2059_ _) =>
                                   (match (string_drop _s2058_ _s2059_) with
                                    | _s2060_ =>
                                       (reg_name_matches_prefix _s2060_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s2061_ _) =>
                                           (match (string_drop _s2060_ _s2061_) with
                                            | _s2062_ =>
                                               (sep_matches_prefix _s2062_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s2063_ _) =>
                                                   (match (string_drop _s2062_ _s2063_) with
                                                    | _s2064_ =>
                                                       (reg_name_matches_prefix _s2064_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s2065_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s2064_ _s2065_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some
                                                                       (high, signed1, signed2, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5))).

Definition _s2038_ (_s2039_ : string) : M (option ((mword 5 * mword 5))) :=
   let _s2040_ := _s2039_ in
   (if string_startswith _s2040_ "c.add" then
      (match (string_drop _s2040_ (projT1 (string_length "c.add"))) with
       | _s2041_ =>
          (spc_matches_prefix _s2041_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s2042_ _) =>
              (match (string_drop _s2041_ _s2042_) with
               | _s2043_ =>
                  (reg_name_matches_prefix _s2043_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s2044_ _) =>
                      (match (string_drop _s2043_ _s2044_) with
                       | _s2045_ =>
                          (sep_matches_prefix _s2045_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s2046_ _) =>
                              (match (string_drop _s2045_ _s2046_) with
                               | _s2047_ =>
                                  (reg_name_matches_prefix _s2047_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s2048_ _) =>
                                              let p0_ := string_drop _s2047_ _s2048_ in
                                              if generic_eq p0_ "" then Some (rsd, rs2)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 5 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 5 * mword 5)))
                       end)
                       : M (option ((mword 5 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 5)))
               end)
               : M (option ((mword 5 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5)))
       end)
       : M (option ((mword 5 * mword 5)))
    else returnm None)
    : M (option ((mword 5 * mword 5))).

Definition _s2026_ (_s2027_ : string) : M (option ((mword 5 * mword 5))) :=
   let _s2028_ := _s2027_ in
   (if string_startswith _s2028_ "c.mv" then
      (match (string_drop _s2028_ (projT1 (string_length "c.mv"))) with
       | _s2029_ =>
          (spc_matches_prefix _s2029_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s2030_ _) =>
              (match (string_drop _s2029_ _s2030_) with
               | _s2031_ =>
                  (reg_name_matches_prefix _s2031_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s2032_ _) =>
                      (match (string_drop _s2031_ _s2032_) with
                       | _s2033_ =>
                          (sep_matches_prefix _s2033_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s2034_ _) =>
                              (match (string_drop _s2033_ _s2034_) with
                               | _s2035_ =>
                                  (reg_name_matches_prefix _s2035_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s2036_ _) =>
                                              let p0_ := string_drop _s2035_ _s2036_ in
                                              if generic_eq p0_ "" then Some (rd, rs2)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 5 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 5 * mword 5)))
                       end)
                       : M (option ((mword 5 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 5)))
               end)
               : M (option ((mword 5 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5)))
       end)
       : M (option ((mword 5 * mword 5)))
    else returnm None)
    : M (option ((mword 5 * mword 5))).

Definition _s2018_ (_s2019_ : string) : M (option (mword 5)) :=
   let _s2020_ := _s2019_ in
   (if string_startswith _s2020_ "c.jalr" then
      (match (string_drop _s2020_ (projT1 (string_length "c.jalr"))) with
       | _s2021_ =>
          (spc_matches_prefix _s2021_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s2022_ _) =>
              (match (string_drop _s2021_ _s2022_) with
               | _s2023_ =>
                  (reg_name_matches_prefix _s2023_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  returnm (match w__1 with
                           | Some (rs1, existT _ _s2024_ _) =>
                              let p0_ := string_drop _s2023_ _s2024_ in
                              if generic_eq p0_ "" then Some rs1
                              else None
                           | _ => None
                           end)
               end)
               : M (option (mword 5))
           | _ => returnm None
           end)
           : M (option (mword 5))
       end)
       : M (option (mword 5))
    else returnm None)
    : M (option (mword 5)).

Definition _s2010_ (_s2011_ : string) : M (option (mword 5)) :=
   let _s2012_ := _s2011_ in
   (if string_startswith _s2012_ "c.jr" then
      (match (string_drop _s2012_ (projT1 (string_length "c.jr"))) with
       | _s2013_ =>
          (spc_matches_prefix _s2013_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s2014_ _) =>
              (match (string_drop _s2013_ _s2014_) with
               | _s2015_ =>
                  (reg_name_matches_prefix _s2015_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  returnm (match w__1 with
                           | Some (rs1, existT _ _s2016_ _) =>
                              let p0_ := string_drop _s2015_ _s2016_ in
                              if generic_eq p0_ "" then Some rs1
                              else None
                           | _ => None
                           end)
               end)
               : M (option (mword 5))
           | _ => returnm None
           end)
           : M (option (mword 5))
       end)
       : M (option (mword 5))
    else returnm None)
    : M (option (mword 5)).

Definition _s1998_ (_s1999_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s2000_ := _s1999_ in
   (if string_startswith _s2000_ "c.sdsp" then
      (match (string_drop _s2000_ (projT1 (string_length "c.sdsp"))) with
       | _s2001_ =>
          (spc_matches_prefix _s2001_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s2002_ _) =>
              (match (string_drop _s2001_ _s2002_) with
               | _s2003_ =>
                  (reg_name_matches_prefix _s2003_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rs2, existT _ _s2004_ _) =>
                      (match (string_drop _s2003_ _s2004_) with
                       | _s2005_ =>
                          (sep_matches_prefix _s2005_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s2006_ _) =>
                                      match (string_drop _s2005_ _s2006_) with
                                      | _s2007_ =>
                                         match (hex_bits_6_matches_prefix _s2007_) with
                                         | Some (uimm, existT _ _s2008_ _) =>
                                            let p0_ := string_drop _s2007_ _s2008_ in
                                            if generic_eq p0_ "" then Some (rs2, uimm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s1986_ (_s1987_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s1988_ := _s1987_ in
   (if string_startswith _s1988_ "c.swsp" then
      (match (string_drop _s1988_ (projT1 (string_length "c.swsp"))) with
       | _s1989_ =>
          (spc_matches_prefix _s1989_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1990_ _) =>
              (match (string_drop _s1989_ _s1990_) with
               | _s1991_ =>
                  (reg_name_matches_prefix _s1991_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s1992_ _) =>
                      (match (string_drop _s1991_ _s1992_) with
                       | _s1993_ =>
                          (sep_matches_prefix _s1993_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s1994_ _) =>
                                      match (string_drop _s1993_ _s1994_) with
                                      | _s1995_ =>
                                         match (hex_bits_6_matches_prefix _s1995_) with
                                         | Some (uimm, existT _ _s1996_ _) =>
                                            let p0_ := string_drop _s1995_ _s1996_ in
                                            if generic_eq p0_ "" then Some (rd, uimm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s1974_ (_s1975_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s1976_ := _s1975_ in
   (if string_startswith _s1976_ "c.ldsp" then
      (match (string_drop _s1976_ (projT1 (string_length "c.ldsp"))) with
       | _s1977_ =>
          (spc_matches_prefix _s1977_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1978_ _) =>
              (match (string_drop _s1977_ _s1978_) with
               | _s1979_ =>
                  (reg_name_matches_prefix _s1979_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s1980_ _) =>
                      (match (string_drop _s1979_ _s1980_) with
                       | _s1981_ =>
                          (sep_matches_prefix _s1981_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s1982_ _) =>
                                      match (string_drop _s1981_ _s1982_) with
                                      | _s1983_ =>
                                         match (hex_bits_6_matches_prefix _s1983_) with
                                         | Some (uimm, existT _ _s1984_ _) =>
                                            let p0_ := string_drop _s1983_ _s1984_ in
                                            if generic_eq p0_ "" then Some (rd, uimm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s1962_ (_s1963_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s1964_ := _s1963_ in
   (if string_startswith _s1964_ "c.lwsp" then
      (match (string_drop _s1964_ (projT1 (string_length "c.lwsp"))) with
       | _s1965_ =>
          (spc_matches_prefix _s1965_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1966_ _) =>
              (match (string_drop _s1965_ _s1966_) with
               | _s1967_ =>
                  (reg_name_matches_prefix _s1967_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s1968_ _) =>
                      (match (string_drop _s1967_ _s1968_) with
                       | _s1969_ =>
                          (sep_matches_prefix _s1969_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s1970_ _) =>
                                      match (string_drop _s1969_ _s1970_) with
                                      | _s1971_ =>
                                         match (hex_bits_6_matches_prefix _s1971_) with
                                         | Some (uimm, existT _ _s1972_ _) =>
                                            let p0_ := string_drop _s1971_ _s1972_ in
                                            if generic_eq p0_ "" then Some (rd, uimm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s1950_ (_s1951_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s1952_ := _s1951_ in
   (if string_startswith _s1952_ "c.slli" then
      (match (string_drop _s1952_ (projT1 (string_length "c.slli"))) with
       | _s1953_ =>
          (spc_matches_prefix _s1953_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1954_ _) =>
              (match (string_drop _s1953_ _s1954_) with
               | _s1955_ =>
                  (reg_name_matches_prefix _s1955_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s1956_ _) =>
                      (match (string_drop _s1955_ _s1956_) with
                       | _s1957_ =>
                          (sep_matches_prefix _s1957_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s1958_ _) =>
                                      match (string_drop _s1957_ _s1958_) with
                                      | _s1959_ =>
                                         match (hex_bits_6_matches_prefix _s1959_) with
                                         | Some (shamt, existT _ _s1960_ _) =>
                                            let p0_ := string_drop _s1959_ _s1960_ in
                                            if generic_eq p0_ "" then Some (rsd, shamt)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s1938_ (_s1939_ : string) : M (option ((mword 3 * mword 8))) :=
   let _s1940_ := _s1939_ in
   (if string_startswith _s1940_ "c.bnez" then
      (match (string_drop _s1940_ (projT1 (string_length "c.bnez"))) with
       | _s1941_ =>
          (spc_matches_prefix _s1941_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1942_ _) =>
              (match (string_drop _s1941_ _s1942_) with
               | _s1943_ =>
                  (creg_name_matches_prefix _s1943_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rs, existT _ _s1944_ _) =>
                      (match (string_drop _s1943_ _s1944_) with
                       | _s1945_ =>
                          (sep_matches_prefix _s1945_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s1946_ _) =>
                                      match (string_drop _s1945_ _s1946_) with
                                      | _s1947_ =>
                                         match (hex_bits_8_matches_prefix _s1947_) with
                                         | Some (imm, existT _ _s1948_ _) =>
                                            let p0_ := string_drop _s1947_ _s1948_ in
                                            if generic_eq p0_ "" then Some (rs, imm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 3 * mword 8)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 8)))
               end)
               : M (option ((mword 3 * mword 8)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 8)))
       end)
       : M (option ((mword 3 * mword 8)))
    else returnm None)
    : M (option ((mword 3 * mword 8))).

Definition _s1926_ (_s1927_ : string) : M (option ((mword 3 * mword 8))) :=
   let _s1928_ := _s1927_ in
   (if string_startswith _s1928_ "c.beqz" then
      (match (string_drop _s1928_ (projT1 (string_length "c.beqz"))) with
       | _s1929_ =>
          (spc_matches_prefix _s1929_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1930_ _) =>
              (match (string_drop _s1929_ _s1930_) with
               | _s1931_ =>
                  (creg_name_matches_prefix _s1931_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rs, existT _ _s1932_ _) =>
                      (match (string_drop _s1931_ _s1932_) with
                       | _s1933_ =>
                          (sep_matches_prefix _s1933_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s1934_ _) =>
                                      match (string_drop _s1933_ _s1934_) with
                                      | _s1935_ =>
                                         match (hex_bits_8_matches_prefix _s1935_) with
                                         | Some (imm, existT _ _s1936_ _) =>
                                            let p0_ := string_drop _s1935_ _s1936_ in
                                            if generic_eq p0_ "" then Some (rs, imm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 3 * mword 8)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 8)))
               end)
               : M (option ((mword 3 * mword 8)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 8)))
       end)
       : M (option ((mword 3 * mword 8)))
    else returnm None)
    : M (option ((mword 3 * mword 8))).

Definition _s1918_ (_s1919_ : string) : M (option (mword 11)) :=
   let _s1920_ := _s1919_ in
   (if string_startswith _s1920_ "c.j" then
      (match (string_drop _s1920_ (projT1 (string_length "c.j"))) with
       | _s1921_ =>
          (spc_matches_prefix _s1921_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          returnm (match w__0 with
                   | Some (tt, existT _ _s1922_ _) =>
                      match (string_drop _s1921_ _s1922_) with
                      | _s1923_ =>
                         match (hex_bits_11_matches_prefix _s1923_) with
                         | Some (imm, existT _ _s1924_ _) =>
                            let p0_ := string_drop _s1923_ _s1924_ in
                            if generic_eq p0_ "" then Some imm
                            else None
                         | _ => None
                         end
                      end
                   | _ => None
                   end)
       end)
       : M (option (mword 11))
    else returnm None)
    : M (option (mword 11)).

Definition _s1906_ (_s1907_ : string) : M (option ((mword 3 * mword 3))) :=
   let _s1908_ := _s1907_ in
   (if string_startswith _s1908_ "c.addw" then
      (match (string_drop _s1908_ (projT1 (string_length "c.addw"))) with
       | _s1909_ =>
          (spc_matches_prefix _s1909_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1910_ _) =>
              (match (string_drop _s1909_ _s1910_) with
               | _s1911_ =>
                  (creg_name_matches_prefix _s1911_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s1912_ _) =>
                      (match (string_drop _s1911_ _s1912_) with
                       | _s1913_ =>
                          (sep_matches_prefix _s1913_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s1914_ _) =>
                              (match (string_drop _s1913_ _s1914_) with
                               | _s1915_ =>
                                  (creg_name_matches_prefix _s1915_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s1916_ _) =>
                                              let p0_ := string_drop _s1915_ _s1916_ in
                                              if generic_eq p0_ "" then Some (rsd, rs2)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 3 * mword 3)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3)))
                       end)
                       : M (option ((mword 3 * mword 3)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3)))
               end)
               : M (option ((mword 3 * mword 3)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3)))
       end)
       : M (option ((mword 3 * mword 3)))
    else returnm None)
    : M (option ((mword 3 * mword 3))).

Definition _s1894_ (_s1895_ : string) : M (option ((mword 3 * mword 3))) :=
   let _s1896_ := _s1895_ in
   (if string_startswith _s1896_ "c.subw" then
      (match (string_drop _s1896_ (projT1 (string_length "c.subw"))) with
       | _s1897_ =>
          (spc_matches_prefix _s1897_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1898_ _) =>
              (match (string_drop _s1897_ _s1898_) with
               | _s1899_ =>
                  (creg_name_matches_prefix _s1899_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s1900_ _) =>
                      (match (string_drop _s1899_ _s1900_) with
                       | _s1901_ =>
                          (sep_matches_prefix _s1901_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s1902_ _) =>
                              (match (string_drop _s1901_ _s1902_) with
                               | _s1903_ =>
                                  (creg_name_matches_prefix _s1903_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s1904_ _) =>
                                              let p0_ := string_drop _s1903_ _s1904_ in
                                              if generic_eq p0_ "" then Some (rsd, rs2)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 3 * mword 3)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3)))
                       end)
                       : M (option ((mword 3 * mword 3)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3)))
               end)
               : M (option ((mword 3 * mword 3)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3)))
       end)
       : M (option ((mword 3 * mword 3)))
    else returnm None)
    : M (option ((mword 3 * mword 3))).

Definition _s1882_ (_s1883_ : string) : M (option ((mword 3 * mword 3))) :=
   let _s1884_ := _s1883_ in
   (if string_startswith _s1884_ "c.and" then
      (match (string_drop _s1884_ (projT1 (string_length "c.and"))) with
       | _s1885_ =>
          (spc_matches_prefix _s1885_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1886_ _) =>
              (match (string_drop _s1885_ _s1886_) with
               | _s1887_ =>
                  (creg_name_matches_prefix _s1887_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s1888_ _) =>
                      (match (string_drop _s1887_ _s1888_) with
                       | _s1889_ =>
                          (sep_matches_prefix _s1889_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s1890_ _) =>
                              (match (string_drop _s1889_ _s1890_) with
                               | _s1891_ =>
                                  (creg_name_matches_prefix _s1891_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s1892_ _) =>
                                              let p0_ := string_drop _s1891_ _s1892_ in
                                              if generic_eq p0_ "" then Some (rsd, rs2)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 3 * mword 3)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3)))
                       end)
                       : M (option ((mword 3 * mword 3)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3)))
               end)
               : M (option ((mword 3 * mword 3)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3)))
       end)
       : M (option ((mword 3 * mword 3)))
    else returnm None)
    : M (option ((mword 3 * mword 3))).

Definition _s1870_ (_s1871_ : string) : M (option ((mword 3 * mword 3))) :=
   let _s1872_ := _s1871_ in
   (if string_startswith _s1872_ "c.or" then
      (match (string_drop _s1872_ (projT1 (string_length "c.or"))) with
       | _s1873_ =>
          (spc_matches_prefix _s1873_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1874_ _) =>
              (match (string_drop _s1873_ _s1874_) with
               | _s1875_ =>
                  (creg_name_matches_prefix _s1875_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s1876_ _) =>
                      (match (string_drop _s1875_ _s1876_) with
                       | _s1877_ =>
                          (sep_matches_prefix _s1877_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s1878_ _) =>
                              (match (string_drop _s1877_ _s1878_) with
                               | _s1879_ =>
                                  (creg_name_matches_prefix _s1879_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s1880_ _) =>
                                              let p0_ := string_drop _s1879_ _s1880_ in
                                              if generic_eq p0_ "" then Some (rsd, rs2)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 3 * mword 3)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3)))
                       end)
                       : M (option ((mword 3 * mword 3)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3)))
               end)
               : M (option ((mword 3 * mword 3)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3)))
       end)
       : M (option ((mword 3 * mword 3)))
    else returnm None)
    : M (option ((mword 3 * mword 3))).

Definition _s1858_ (_s1859_ : string) : M (option ((mword 3 * mword 3))) :=
   let _s1860_ := _s1859_ in
   (if string_startswith _s1860_ "c.xor" then
      (match (string_drop _s1860_ (projT1 (string_length "c.xor"))) with
       | _s1861_ =>
          (spc_matches_prefix _s1861_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1862_ _) =>
              (match (string_drop _s1861_ _s1862_) with
               | _s1863_ =>
                  (creg_name_matches_prefix _s1863_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s1864_ _) =>
                      (match (string_drop _s1863_ _s1864_) with
                       | _s1865_ =>
                          (sep_matches_prefix _s1865_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s1866_ _) =>
                              (match (string_drop _s1865_ _s1866_) with
                               | _s1867_ =>
                                  (creg_name_matches_prefix _s1867_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s1868_ _) =>
                                              let p0_ := string_drop _s1867_ _s1868_ in
                                              if generic_eq p0_ "" then Some (rsd, rs2)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 3 * mword 3)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3)))
                       end)
                       : M (option ((mword 3 * mword 3)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3)))
               end)
               : M (option ((mword 3 * mword 3)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3)))
       end)
       : M (option ((mword 3 * mword 3)))
    else returnm None)
    : M (option ((mword 3 * mword 3))).

Definition _s1846_ (_s1847_ : string) : M (option ((mword 3 * mword 3))) :=
   let _s1848_ := _s1847_ in
   (if string_startswith _s1848_ "c.sub" then
      (match (string_drop _s1848_ (projT1 (string_length "c.sub"))) with
       | _s1849_ =>
          (spc_matches_prefix _s1849_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1850_ _) =>
              (match (string_drop _s1849_ _s1850_) with
               | _s1851_ =>
                  (creg_name_matches_prefix _s1851_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s1852_ _) =>
                      (match (string_drop _s1851_ _s1852_) with
                       | _s1853_ =>
                          (sep_matches_prefix _s1853_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s1854_ _) =>
                              (match (string_drop _s1853_ _s1854_) with
                               | _s1855_ =>
                                  (creg_name_matches_prefix _s1855_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s1856_ _) =>
                                              let p0_ := string_drop _s1855_ _s1856_ in
                                              if generic_eq p0_ "" then Some (rsd, rs2)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 3 * mword 3)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3)))
                       end)
                       : M (option ((mword 3 * mword 3)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3)))
               end)
               : M (option ((mword 3 * mword 3)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3)))
       end)
       : M (option ((mword 3 * mword 3)))
    else returnm None)
    : M (option ((mword 3 * mword 3))).

Definition _s1834_ (_s1835_ : string) : M (option ((mword 3 * mword 6))) :=
   let _s1836_ := _s1835_ in
   (if string_startswith _s1836_ "c.andi" then
      (match (string_drop _s1836_ (projT1 (string_length "c.andi"))) with
       | _s1837_ =>
          (spc_matches_prefix _s1837_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1838_ _) =>
              (match (string_drop _s1837_ _s1838_) with
               | _s1839_ =>
                  (creg_name_matches_prefix _s1839_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s1840_ _) =>
                      (match (string_drop _s1839_ _s1840_) with
                       | _s1841_ =>
                          (sep_matches_prefix _s1841_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s1842_ _) =>
                                      match (string_drop _s1841_ _s1842_) with
                                      | _s1843_ =>
                                         match (hex_bits_6_matches_prefix _s1843_) with
                                         | Some (imm, existT _ _s1844_ _) =>
                                            let p0_ := string_drop _s1843_ _s1844_ in
                                            if generic_eq p0_ "" then Some (rsd, imm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 3 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 6)))
               end)
               : M (option ((mword 3 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 6)))
       end)
       : M (option ((mword 3 * mword 6)))
    else returnm None)
    : M (option ((mword 3 * mword 6))).

Definition _s1822_ (_s1823_ : string) : M (option ((mword 3 * mword 6))) :=
   let _s1824_ := _s1823_ in
   (if string_startswith _s1824_ "c.srai" then
      (match (string_drop _s1824_ (projT1 (string_length "c.srai"))) with
       | _s1825_ =>
          (spc_matches_prefix _s1825_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1826_ _) =>
              (match (string_drop _s1825_ _s1826_) with
               | _s1827_ =>
                  (creg_name_matches_prefix _s1827_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s1828_ _) =>
                      (match (string_drop _s1827_ _s1828_) with
                       | _s1829_ =>
                          (sep_matches_prefix _s1829_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s1830_ _) =>
                                      match (string_drop _s1829_ _s1830_) with
                                      | _s1831_ =>
                                         match (hex_bits_6_matches_prefix _s1831_) with
                                         | Some (shamt, existT _ _s1832_ _) =>
                                            let p0_ := string_drop _s1831_ _s1832_ in
                                            if generic_eq p0_ "" then Some (rsd, shamt)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 3 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 6)))
               end)
               : M (option ((mword 3 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 6)))
       end)
       : M (option ((mword 3 * mword 6)))
    else returnm None)
    : M (option ((mword 3 * mword 6))).

Definition _s1810_ (_s1811_ : string) : M (option ((mword 3 * mword 6))) :=
   let _s1812_ := _s1811_ in
   (if string_startswith _s1812_ "c.srli" then
      (match (string_drop _s1812_ (projT1 (string_length "c.srli"))) with
       | _s1813_ =>
          (spc_matches_prefix _s1813_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1814_ _) =>
              (match (string_drop _s1813_ _s1814_) with
               | _s1815_ =>
                  (creg_name_matches_prefix _s1815_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s1816_ _) =>
                      (match (string_drop _s1815_ _s1816_) with
                       | _s1817_ =>
                          (sep_matches_prefix _s1817_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s1818_ _) =>
                                      match (string_drop _s1817_ _s1818_) with
                                      | _s1819_ =>
                                         match (hex_bits_6_matches_prefix _s1819_) with
                                         | Some (shamt, existT _ _s1820_ _) =>
                                            let p0_ := string_drop _s1819_ _s1820_ in
                                            if generic_eq p0_ "" then Some (rsd, shamt)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 3 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 6)))
               end)
               : M (option ((mword 3 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 6)))
       end)
       : M (option ((mword 3 * mword 6)))
    else returnm None)
    : M (option ((mword 3 * mword 6))).

Definition _s1798_ (_s1799_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s1800_ := _s1799_ in
   (if string_startswith _s1800_ "c.lui" then
      (match (string_drop _s1800_ (projT1 (string_length "c.lui"))) with
       | _s1801_ =>
          (spc_matches_prefix _s1801_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1802_ _) =>
              (match (string_drop _s1801_ _s1802_) with
               | _s1803_ =>
                  (reg_name_matches_prefix _s1803_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s1804_ _) =>
                      (match (string_drop _s1803_ _s1804_) with
                       | _s1805_ =>
                          (sep_matches_prefix _s1805_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s1806_ _) =>
                                      match (string_drop _s1805_ _s1806_) with
                                      | _s1807_ =>
                                         match (hex_bits_6_matches_prefix _s1807_) with
                                         | Some (imm, existT _ _s1808_ _) =>
                                            let p0_ := string_drop _s1807_ _s1808_ in
                                            if generic_eq p0_ "" then Some (rd, imm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s1790_ (_s1791_ : string) : M (option (mword 6)) :=
   let _s1792_ := _s1791_ in
   (if string_startswith _s1792_ "c.addi16sp" then
      (match (string_drop _s1792_ (projT1 (string_length "c.addi16sp"))) with
       | _s1793_ =>
          (spc_matches_prefix _s1793_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          returnm (match w__0 with
                   | Some (tt, existT _ _s1794_ _) =>
                      match (string_drop _s1793_ _s1794_) with
                      | _s1795_ =>
                         match (hex_bits_6_matches_prefix _s1795_) with
                         | Some (imm, existT _ _s1796_ _) =>
                            let p0_ := string_drop _s1795_ _s1796_ in
                            if generic_eq p0_ "" then Some imm
                            else None
                         | _ => None
                         end
                      end
                   | _ => None
                   end)
       end)
       : M (option (mword 6))
    else returnm None)
    : M (option (mword 6)).

Definition _s1778_ (_s1779_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s1780_ := _s1779_ in
   (if string_startswith _s1780_ "c.li" then
      (match (string_drop _s1780_ (projT1 (string_length "c.li"))) with
       | _s1781_ =>
          (spc_matches_prefix _s1781_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1782_ _) =>
              (match (string_drop _s1781_ _s1782_) with
               | _s1783_ =>
                  (reg_name_matches_prefix _s1783_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s1784_ _) =>
                      (match (string_drop _s1783_ _s1784_) with
                       | _s1785_ =>
                          (sep_matches_prefix _s1785_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s1786_ _) =>
                                      match (string_drop _s1785_ _s1786_) with
                                      | _s1787_ =>
                                         match (hex_bits_6_matches_prefix _s1787_) with
                                         | Some (imm, existT _ _s1788_ _) =>
                                            let p0_ := string_drop _s1787_ _s1788_ in
                                            if generic_eq p0_ "" then Some (rd, imm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s1766_ (_s1767_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s1768_ := _s1767_ in
   (if string_startswith _s1768_ "c.addiw" then
      (match (string_drop _s1768_ (projT1 (string_length "c.addiw"))) with
       | _s1769_ =>
          (spc_matches_prefix _s1769_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1770_ _) =>
              (match (string_drop _s1769_ _s1770_) with
               | _s1771_ =>
                  (reg_name_matches_prefix _s1771_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s1772_ _) =>
                      (match (string_drop _s1771_ _s1772_) with
                       | _s1773_ =>
                          (sep_matches_prefix _s1773_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s1774_ _) =>
                                      match (string_drop _s1773_ _s1774_) with
                                      | _s1775_ =>
                                         match (hex_bits_6_matches_prefix _s1775_) with
                                         | Some (imm, existT _ _s1776_ _) =>
                                            let p0_ := string_drop _s1775_ _s1776_ in
                                            if generic_eq p0_ "" then Some (rsd, imm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s1758_ (_s1759_ : string) : M (option (mword 11)) :=
   let _s1760_ := _s1759_ in
   (if string_startswith _s1760_ "c.jal" then
      (match (string_drop _s1760_ (projT1 (string_length "c.jal"))) with
       | _s1761_ =>
          (spc_matches_prefix _s1761_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          returnm (match w__0 with
                   | Some (tt, existT _ _s1762_ _) =>
                      match (string_drop _s1761_ _s1762_) with
                      | _s1763_ =>
                         match (hex_bits_12_matches_prefix _s1763_) with
                         | Some (v__1450, existT _ _s1764_ _) =>
                            if eq_vec (subrange_vec_dec v__1450 0 0) ('b"0"  : mword (0 - 0 + 1))
                            then
                              let imm : mword 11 := subrange_vec_dec v__1450 11 1 in
                              let imm : mword 11 := subrange_vec_dec v__1450 11 1 in
                              let p0_ := string_drop _s1763_ _s1764_ in
                              if generic_eq p0_ "" then Some imm
                              else None
                            else None
                         | _ => None
                         end
                      end
                   | _ => None
                   end)
       end)
       : M (option (mword 11))
    else returnm None)
    : M (option (mword 11)).

Definition _s1746_ (_s1747_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s1748_ := _s1747_ in
   (if string_startswith _s1748_ "c.addi" then
      (match (string_drop _s1748_ (projT1 (string_length "c.addi"))) with
       | _s1749_ =>
          (spc_matches_prefix _s1749_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1750_ _) =>
              (match (string_drop _s1749_ _s1750_) with
               | _s1751_ =>
                  (reg_name_matches_prefix _s1751_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s1752_ _) =>
                      (match (string_drop _s1751_ _s1752_) with
                       | _s1753_ =>
                          (sep_matches_prefix _s1753_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s1754_ _) =>
                                      match (string_drop _s1753_ _s1754_) with
                                      | _s1755_ =>
                                         match (hex_bits_6_matches_prefix _s1755_) with
                                         | Some (nzi, existT _ _s1756_ _) =>
                                            let p0_ := string_drop _s1755_ _s1756_ in
                                            if generic_eq p0_ "" then Some (rsd, nzi)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s1730_ (_s1731_ : string) : M (option ((mword 3 * mword 3 * mword 5))) :=
   let _s1732_ := _s1731_ in
   (if string_startswith _s1732_ "c.sd" then
      (match (string_drop _s1732_ (projT1 (string_length "c.sd"))) with
       | _s1733_ =>
          (spc_matches_prefix _s1733_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1734_ _) =>
              (match (string_drop _s1733_ _s1734_) with
               | _s1735_ =>
                  (creg_name_matches_prefix _s1735_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsc1, existT _ _s1736_ _) =>
                      (match (string_drop _s1735_ _s1736_) with
                       | _s1737_ =>
                          (sep_matches_prefix _s1737_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s1738_ _) =>
                              (match (string_drop _s1737_ _s1738_) with
                               | _s1739_ =>
                                  (creg_name_matches_prefix _s1739_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc2, existT _ _s1740_ _) =>
                                      (match (string_drop _s1739_ _s1740_) with
                                       | _s1741_ =>
                                          (sep_matches_prefix _s1741_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s1742_ _) =>
                                                      match (string_drop _s1741_ _s1742_) with
                                                      | _s1743_ =>
                                                         match (hex_bits_8_matches_prefix _s1743_) with
                                                         | Some (v__1452, existT _ _s1744_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1452 2 0)
                                                                 ('b"000"
                                                                  : mword (2 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1452 7 3 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1452 7 3 in
                                                              let p0_ := string_drop _s1743_ _s1744_ in
                                                              if generic_eq p0_ "" then
                                                                Some (rsc1, rsc2, uimm)
                                                              else None
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5))).

Definition _s1714_ (_s1715_ : string) : M (option ((mword 3 * mword 3 * mword 5))) :=
   let _s1716_ := _s1715_ in
   (if string_startswith _s1716_ "c.sw" then
      (match (string_drop _s1716_ (projT1 (string_length "c.sw"))) with
       | _s1717_ =>
          (spc_matches_prefix _s1717_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1718_ _) =>
              (match (string_drop _s1717_ _s1718_) with
               | _s1719_ =>
                  (creg_name_matches_prefix _s1719_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsc1, existT _ _s1720_ _) =>
                      (match (string_drop _s1719_ _s1720_) with
                       | _s1721_ =>
                          (sep_matches_prefix _s1721_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s1722_ _) =>
                              (match (string_drop _s1721_ _s1722_) with
                               | _s1723_ =>
                                  (creg_name_matches_prefix _s1723_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc2, existT _ _s1724_ _) =>
                                      (match (string_drop _s1723_ _s1724_) with
                                       | _s1725_ =>
                                          (sep_matches_prefix _s1725_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s1726_ _) =>
                                                      match (string_drop _s1725_ _s1726_) with
                                                      | _s1727_ =>
                                                         match (hex_bits_7_matches_prefix _s1727_) with
                                                         | Some (v__1454, existT _ _s1728_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1454 1 0)
                                                                 ('b"00"
                                                                  : mword (1 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1454 6 2 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1454 6 2 in
                                                              let p0_ := string_drop _s1727_ _s1728_ in
                                                              if generic_eq p0_ "" then
                                                                Some (rsc1, rsc2, uimm)
                                                              else None
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5))).

Definition _s1698_ (_s1699_ : string) : M (option ((mword 3 * mword 3 * mword 5))) :=
   let _s1700_ := _s1699_ in
   (if string_startswith _s1700_ "c.ld" then
      (match (string_drop _s1700_ (projT1 (string_length "c.ld"))) with
       | _s1701_ =>
          (spc_matches_prefix _s1701_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1702_ _) =>
              (match (string_drop _s1701_ _s1702_) with
               | _s1703_ =>
                  (creg_name_matches_prefix _s1703_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rdc, existT _ _s1704_ _) =>
                      (match (string_drop _s1703_ _s1704_) with
                       | _s1705_ =>
                          (sep_matches_prefix _s1705_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s1706_ _) =>
                              (match (string_drop _s1705_ _s1706_) with
                               | _s1707_ =>
                                  (creg_name_matches_prefix _s1707_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc, existT _ _s1708_ _) =>
                                      (match (string_drop _s1707_ _s1708_) with
                                       | _s1709_ =>
                                          (sep_matches_prefix _s1709_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s1710_ _) =>
                                                      match (string_drop _s1709_ _s1710_) with
                                                      | _s1711_ =>
                                                         match (hex_bits_8_matches_prefix _s1711_) with
                                                         | Some (v__1456, existT _ _s1712_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1456 2 0)
                                                                 ('b"000"
                                                                  : mword (2 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1456 7 3 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1456 7 3 in
                                                              let p0_ := string_drop _s1711_ _s1712_ in
                                                              if generic_eq p0_ "" then
                                                                Some (rdc, rsc, uimm)
                                                              else None
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5))).

Definition _s1682_ (_s1683_ : string) : M (option ((mword 3 * mword 3 * mword 5))) :=
   let _s1684_ := _s1683_ in
   (if string_startswith _s1684_ "c.lw" then
      (match (string_drop _s1684_ (projT1 (string_length "c.lw"))) with
       | _s1685_ =>
          (spc_matches_prefix _s1685_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1686_ _) =>
              (match (string_drop _s1685_ _s1686_) with
               | _s1687_ =>
                  (creg_name_matches_prefix _s1687_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rdc, existT _ _s1688_ _) =>
                      (match (string_drop _s1687_ _s1688_) with
                       | _s1689_ =>
                          (sep_matches_prefix _s1689_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s1690_ _) =>
                              (match (string_drop _s1689_ _s1690_) with
                               | _s1691_ =>
                                  (creg_name_matches_prefix _s1691_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc, existT _ _s1692_ _) =>
                                      (match (string_drop _s1691_ _s1692_) with
                                       | _s1693_ =>
                                          (sep_matches_prefix _s1693_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s1694_ _) =>
                                                      match (string_drop _s1693_ _s1694_) with
                                                      | _s1695_ =>
                                                         match (hex_bits_7_matches_prefix _s1695_) with
                                                         | Some (v__1458, existT _ _s1696_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1458 1 0)
                                                                 ('b"00"
                                                                  : mword (1 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1458 6 2 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1458 6 2 in
                                                              let p0_ := string_drop _s1695_ _s1696_ in
                                                              if generic_eq p0_ "" then
                                                                Some (rdc, rsc, uimm)
                                                              else None
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5))).

Definition _s1670_ (_s1671_ : string) : M (option ((mword 3 * mword 8))) :=
   let _s1672_ := _s1671_ in
   (if string_startswith _s1672_ "c.addi4spn" then
      (match (string_drop _s1672_ (projT1 (string_length "c.addi4spn"))) with
       | _s1673_ =>
          (spc_matches_prefix _s1673_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1674_ _) =>
              (match (string_drop _s1673_ _s1674_) with
               | _s1675_ =>
                  (creg_name_matches_prefix _s1675_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rdc, existT _ _s1676_ _) =>
                      (match (string_drop _s1675_ _s1676_) with
                       | _s1677_ =>
                          (sep_matches_prefix _s1677_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s1678_ _) =>
                                      match (string_drop _s1677_ _s1678_) with
                                      | _s1679_ =>
                                         match (hex_bits_10_matches_prefix _s1679_) with
                                         | Some (v__1460, existT _ _s1680_ _) =>
                                            if eq_vec (subrange_vec_dec v__1460 1 0)
                                                 ('b"00"
                                                  : mword (1 - 0 + 1)) then
                                              let nzimm : mword 8 := subrange_vec_dec v__1460 9 2 in
                                              let nzimm : mword 8 := subrange_vec_dec v__1460 9 2 in
                                              let p0_ := string_drop _s1679_ _s1680_ in
                                              if generic_eq p0_ "" then Some (rdc, nzimm)
                                              else None
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 3 * mword 8)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 8)))
               end)
               : M (option ((mword 3 * mword 8)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 8)))
       end)
       : M (option ((mword 3 * mword 8)))
    else returnm None)
    : M (option ((mword 3 * mword 8))).

Definition _s1644_ (_s1645_ : string)
: M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5))) :=
   (match _s1645_ with
    | _s1646_ =>
       (amo_mnemonic_matches_prefix _s1646_) >>= fun w__0 : option ((amoop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s1647_ _) =>
           let _s1648_ := string_drop _s1646_ _s1647_ in
           (if string_startswith _s1648_ "." then
              (match (string_drop _s1648_ (projT1 (string_length "."))) with
               | _s1649_ =>
                  (size_mnemonic_matches_prefix _s1649_) >>= fun w__1 : option ((word_width * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (width, existT _ _s1650_ _) =>
                      (match (string_drop _s1649_ _s1650_) with
                       | _s1651_ =>
                          (maybe_aq_matches_prefix _s1651_) >>= fun w__2 : option ((bool * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (aq, existT _ _s1652_ _) =>
                              (match (string_drop _s1651_ _s1652_) with
                               | _s1653_ =>
                                  (maybe_rl_matches_prefix _s1653_) >>= fun w__3 : option ((bool * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rl, existT _ _s1654_ _) =>
                                      (match (string_drop _s1653_ _s1654_) with
                                       | _s1655_ =>
                                          (spc_matches_prefix _s1655_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (tt, existT _ _s1656_ _) =>
                                              (match (string_drop _s1655_ _s1656_) with
                                               | _s1657_ =>
                                                  (reg_name_matches_prefix _s1657_) >>= fun w__5 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (rd, existT _ _s1658_ _) =>
                                                      (match (string_drop _s1657_ _s1658_) with
                                                       | _s1659_ =>
                                                          (sep_matches_prefix _s1659_) >>= fun w__6 : option ((unit * {n : Z & ArithFact (n >=?
                                                            0)})) =>
                                                          (match w__6 with
                                                           | Some (tt, existT _ _s1660_ _) =>
                                                              (match (string_drop _s1659_ _s1660_) with
                                                               | _s1661_ =>
                                                                  (reg_name_matches_prefix _s1661_) >>= fun w__7 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                    0)})) =>
                                                                  (match w__7 with
                                                                   | Some (rs2, existT _ _s1662_ _) =>
                                                                      (match (string_drop _s1661_
                                                                                _s1662_) with
                                                                       | _s1663_ =>
                                                                          (sep_matches_prefix
                                                                             _s1663_) >>= fun w__8 : option ((unit * {n : Z & ArithFact (n >=?
                                                                            0)})) =>
                                                                          (match w__8 with
                                                                           | Some
                                                                             (tt, existT _ _s1664_ _) =>
                                                                              let _s1665_ :=
                                                                                string_drop _s1663_
                                                                                  _s1664_ in
                                                                              (if string_startswith
                                                                                    _s1665_ "(" then
                                                                                 (match (string_drop
                                                                                           _s1665_
                                                                                           (projT1
                                                                                            (string_length
                                                                                               "("))) with
                                                                                  | _s1666_ =>
                                                                                     (reg_name_matches_prefix
                                                                                        _s1666_) >>= fun w__9 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                                       0)})) =>
                                                                                     returnm (match w__9 with
                                                                                              | Some
                                                                                                (rs1, existT _ _s1667_ _) =>
                                                                                                 let _s1668_ :=
                                                                                                   string_drop
                                                                                                     _s1666_
                                                                                                     _s1667_ in
                                                                                                 if string_startswith
                                                                                                      _s1668_
                                                                                                      ")"
                                                                                                 then
                                                                                                   let p0_ :=
                                                                                                     string_drop
                                                                                                       _s1668_
                                                                                                       (projT1
                                                                                                        (string_length
                                                                                                           ")")) in
                                                                                                   if
                                                                                                     generic_eq
                                                                                                       p0_
                                                                                                       ""
                                                                                                   then
                                                                                                     Some
                                                                                                       (op, width, aq, rl, rd, rs2, rs1)
                                                                                                   else
                                                                                                     None
                                                                                                 else
                                                                                                   None
                                                                                              | _ =>
                                                                                                 None
                                                                                              end)
                                                                                  end)
                                                                                  : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                                               else returnm None)
                                                                               : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                                           | _ => returnm None
                                                                           end)
                                                                           : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                                       end)
                                                                       : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                                   | _ => returnm None
                                                                   end)
                                                                   : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                               end)
                                                               : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                           | _ => returnm None
                                                           end)
                                                           : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                       end)
                                                       : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                               end)
                                               : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                       end)
                                       : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                               end)
                               : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                       end)
                       : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
               end)
               : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
            else returnm None)
            : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5))).

Definition _s1622_ (_s1623_ : string)
: M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5))) :=
   let _s1624_ := _s1623_ in
   (if string_startswith _s1624_ "sc." then
      (match (string_drop _s1624_ (projT1 (string_length "sc."))) with
       | _s1625_ =>
          (size_mnemonic_matches_prefix _s1625_) >>= fun w__0 : option ((word_width * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (size, existT _ _s1626_ _) =>
              (match (string_drop _s1625_ _s1626_) with
               | _s1627_ =>
                  (maybe_aq_matches_prefix _s1627_) >>= fun w__1 : option ((bool * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (aq, existT _ _s1628_ _) =>
                      (match (string_drop _s1627_ _s1628_) with
                       | _s1629_ =>
                          (maybe_rl_matches_prefix _s1629_) >>= fun w__2 : option ((bool * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rl, existT _ _s1630_ _) =>
                              (match (string_drop _s1629_ _s1630_) with
                               | _s1631_ =>
                                  (spc_matches_prefix _s1631_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s1632_ _) =>
                                      (match (string_drop _s1631_ _s1632_) with
                                       | _s1633_ =>
                                          (reg_name_matches_prefix _s1633_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (rd, existT _ _s1634_ _) =>
                                              (match (string_drop _s1633_ _s1634_) with
                                               | _s1635_ =>
                                                  (sep_matches_prefix _s1635_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (tt, existT _ _s1636_ _) =>
                                                      (match (string_drop _s1635_ _s1636_) with
                                                       | _s1637_ =>
                                                          (reg_name_matches_prefix _s1637_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                            0)})) =>
                                                          (match w__6 with
                                                           | Some (rs1, existT _ _s1638_ _) =>
                                                              (match (string_drop _s1637_ _s1638_) with
                                                               | _s1639_ =>
                                                                  (sep_matches_prefix _s1639_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                    0)})) =>
                                                                  (match w__7 with
                                                                   | Some (tt, existT _ _s1640_ _) =>
                                                                      (match (string_drop _s1639_
                                                                                _s1640_) with
                                                                       | _s1641_ =>
                                                                          (reg_name_matches_prefix
                                                                             _s1641_) >>= fun w__8 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                            0)})) =>
                                                                          returnm (match w__8 with
                                                                                   | Some
                                                                                     (rs2, existT _ _s1642_ _) =>
                                                                                      let p0_ :=
                                                                                        string_drop
                                                                                          _s1641_
                                                                                          _s1642_ in
                                                                                      if generic_eq
                                                                                           p0_ ""
                                                                                      then
                                                                                        Some
                                                                                          (size, aq, rl, rd, rs1, rs2)
                                                                                      else None
                                                                                   | _ => None
                                                                                   end)
                                                                       end)
                                                                       : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                                   | _ => returnm None
                                                                   end)
                                                                   : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                               end)
                                                               : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                           | _ => returnm None
                                                           end)
                                                           : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                       end)
                                                       : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                               end)
                                               : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                       end)
                                       : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                               end)
                               : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                       end)
                       : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
               end)
               : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
       end)
       : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
    else returnm None)
    : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5))).

Definition _s1604_ (_s1605_ : string) : M (option ((word_width * bool * bool * mword 5 * mword 5))) :=
   let _s1606_ := _s1605_ in
   (if string_startswith _s1606_ "lr." then
      (match (string_drop _s1606_ (projT1 (string_length "lr."))) with
       | _s1607_ =>
          (size_mnemonic_matches_prefix _s1607_) >>= fun w__0 : option ((word_width * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (size, existT _ _s1608_ _) =>
              (match (string_drop _s1607_ _s1608_) with
               | _s1609_ =>
                  (maybe_aq_matches_prefix _s1609_) >>= fun w__1 : option ((bool * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (aq, existT _ _s1610_ _) =>
                      (match (string_drop _s1609_ _s1610_) with
                       | _s1611_ =>
                          (maybe_rl_matches_prefix _s1611_) >>= fun w__2 : option ((bool * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rl, existT _ _s1612_ _) =>
                              (match (string_drop _s1611_ _s1612_) with
                               | _s1613_ =>
                                  (spc_matches_prefix _s1613_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s1614_ _) =>
                                      (match (string_drop _s1613_ _s1614_) with
                                       | _s1615_ =>
                                          (reg_name_matches_prefix _s1615_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (rd, existT _ _s1616_ _) =>
                                              (match (string_drop _s1615_ _s1616_) with
                                               | _s1617_ =>
                                                  (sep_matches_prefix _s1617_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (tt, existT _ _s1618_ _) =>
                                                      (match (string_drop _s1617_ _s1618_) with
                                                       | _s1619_ =>
                                                          (reg_name_matches_prefix _s1619_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                            0)})) =>
                                                          returnm (match w__6 with
                                                                   | Some (rs1, existT _ _s1620_ _) =>
                                                                      let p0_ :=
                                                                        string_drop _s1619_ _s1620_ in
                                                                      if generic_eq p0_ "" then
                                                                        Some (size, aq, rl, rd, rs1)
                                                                      else None
                                                                   | _ => None
                                                                   end)
                                                       end)
                                                       : M (option ((word_width * bool * bool * mword 5 * mword 5)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((word_width * bool * bool * mword 5 * mword 5)))
                                               end)
                                               : M (option ((word_width * bool * bool * mword 5 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((word_width * bool * bool * mword 5 * mword 5)))
                                       end)
                                       : M (option ((word_width * bool * bool * mword 5 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((word_width * bool * bool * mword 5 * mword 5)))
                               end)
                               : M (option ((word_width * bool * bool * mword 5 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((word_width * bool * bool * mword 5 * mword 5)))
                       end)
                       : M (option ((word_width * bool * bool * mword 5 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((word_width * bool * bool * mword 5 * mword 5)))
               end)
               : M (option ((word_width * bool * bool * mword 5 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((word_width * bool * bool * mword 5 * mword 5)))
       end)
       : M (option ((word_width * bool * bool * mword 5 * mword 5)))
    else returnm None)
    : M (option ((word_width * bool * bool * mword 5 * mword 5))).

Definition _s1592_ (_s1593_ : string) : M (option ((mword 5 * mword 5))) :=
   let _s1594_ := _s1593_ in
   (if string_startswith _s1594_ "sfence.vma" then
      (match (string_drop _s1594_ (projT1 (string_length "sfence.vma"))) with
       | _s1595_ =>
          (spc_matches_prefix _s1595_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1596_ _) =>
              (match (string_drop _s1595_ _s1596_) with
               | _s1597_ =>
                  (reg_name_matches_prefix _s1597_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rs1, existT _ _s1598_ _) =>
                      (match (string_drop _s1597_ _s1598_) with
                       | _s1599_ =>
                          (sep_matches_prefix _s1599_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s1600_ _) =>
                              (match (string_drop _s1599_ _s1600_) with
                               | _s1601_ =>
                                  (reg_name_matches_prefix _s1601_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s1602_ _) =>
                                              let p0_ := string_drop _s1601_ _s1602_ in
                                              if generic_eq p0_ "" then Some (rs1, rs2)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 5 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 5 * mword 5)))
                       end)
                       : M (option ((mword 5 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 5)))
               end)
               : M (option ((mword 5 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5)))
       end)
       : M (option ((mword 5 * mword 5)))
    else returnm None)
    : M (option ((mword 5 * mword 5))).

Definition _s1580_ (_s1581_ : string) : M (option ((mword 4 * mword 4))) :=
   let _s1582_ := _s1581_ in
   (if string_startswith _s1582_ "fence.tso" then
      (match (string_drop _s1582_ (projT1 (string_length "fence.tso"))) with
       | _s1583_ =>
          (spc_matches_prefix _s1583_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1584_ _) =>
              (match (string_drop _s1583_ _s1584_) with
               | _s1585_ =>
                  (fence_bits_matches_prefix _s1585_) >>= fun w__1 : option ((mword 4 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (pred, existT _ _s1586_ _) =>
                      (match (string_drop _s1585_ _s1586_) with
                       | _s1587_ =>
                          (sep_matches_prefix _s1587_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s1588_ _) =>
                              (match (string_drop _s1587_ _s1588_) with
                               | _s1589_ =>
                                  (fence_bits_matches_prefix _s1589_) >>= fun w__3 : option ((mword 4 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (succ, existT _ _s1590_ _) =>
                                              let p0_ := string_drop _s1589_ _s1590_ in
                                              if generic_eq p0_ "" then Some (pred, succ)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 4 * mword 4)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 4 * mword 4)))
                       end)
                       : M (option ((mword 4 * mword 4)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 4 * mword 4)))
               end)
               : M (option ((mword 4 * mword 4)))
           | _ => returnm None
           end)
           : M (option ((mword 4 * mword 4)))
       end)
       : M (option ((mword 4 * mword 4)))
    else returnm None)
    : M (option ((mword 4 * mword 4))).

Definition _s1568_ (_s1569_ : string) : M (option ((mword 4 * mword 4))) :=
   let _s1570_ := _s1569_ in
   (if string_startswith _s1570_ "fence" then
      (match (string_drop _s1570_ (projT1 (string_length "fence"))) with
       | _s1571_ =>
          (spc_matches_prefix _s1571_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1572_ _) =>
              (match (string_drop _s1571_ _s1572_) with
               | _s1573_ =>
                  (fence_bits_matches_prefix _s1573_) >>= fun w__1 : option ((mword 4 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (pred, existT _ _s1574_ _) =>
                      (match (string_drop _s1573_ _s1574_) with
                       | _s1575_ =>
                          (sep_matches_prefix _s1575_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s1576_ _) =>
                              (match (string_drop _s1575_ _s1576_) with
                               | _s1577_ =>
                                  (fence_bits_matches_prefix _s1577_) >>= fun w__3 : option ((mword 4 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (succ, existT _ _s1578_ _) =>
                                              let p0_ := string_drop _s1577_ _s1578_ in
                                              if generic_eq p0_ "" then Some (pred, succ)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 4 * mword 4)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 4 * mword 4)))
                       end)
                       : M (option ((mword 4 * mword 4)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 4 * mword 4)))
               end)
               : M (option ((mword 4 * mword 4)))
           | _ => returnm None
           end)
           : M (option ((mword 4 * mword 4)))
       end)
       : M (option ((mword 4 * mword 4)))
    else returnm None)
    : M (option ((mword 4 * mword 4))).

Definition _s1551_ (_s1552_ : string) : M (option ((sopw * mword 5 * mword 5 * mword 5))) :=
   (match _s1552_ with
    | _s1553_ =>
       (shiftiwop_mnemonic_matches_prefix _s1553_) >>= fun w__0 : option ((sopw * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s1554_ _) =>
           (match (string_drop _s1553_ _s1554_) with
            | _s1555_ =>
               (spc_matches_prefix _s1555_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s1556_ _) =>
                   (match (string_drop _s1555_ _s1556_) with
                    | _s1557_ =>
                       (reg_name_matches_prefix _s1557_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s1558_ _) =>
                           (match (string_drop _s1557_ _s1558_) with
                            | _s1559_ =>
                               (sep_matches_prefix _s1559_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s1560_ _) =>
                                   (match (string_drop _s1559_ _s1560_) with
                                    | _s1561_ =>
                                       (reg_name_matches_prefix _s1561_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s1562_ _) =>
                                           (match (string_drop _s1561_ _s1562_) with
                                            | _s1563_ =>
                                               (sep_matches_prefix _s1563_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               returnm (match w__5 with
                                                        | Some (tt, existT _ _s1564_ _) =>
                                                           match (string_drop _s1563_ _s1564_) with
                                                           | _s1565_ =>
                                                              match (hex_bits_5_matches_prefix
                                                                       _s1565_) with
                                                              | Some (shamt, existT _ _s1566_ _) =>
                                                                 let p0_ :=
                                                                   string_drop _s1565_ _s1566_ in
                                                                 if generic_eq p0_ "" then
                                                                   Some (op, rd, rs1, shamt)
                                                                 else None
                                                              | _ => None
                                                              end
                                                           end
                                                        | _ => None
                                                        end)
                                            end)
                                            : M (option ((sopw * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((sopw * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((sopw * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((sopw * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((sopw * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((sopw * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((sopw * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((sopw * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((sopw * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((sopw * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((sopw * mword 5 * mword 5 * mword 5))).

Definition _s1534_ (_s1535_ : string) : M (option ((ropw * mword 5 * mword 5 * mword 5))) :=
   (match _s1535_ with
    | _s1536_ =>
       (rtypew_mnemonic_matches_prefix _s1536_) >>= fun w__0 : option ((ropw * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s1537_ _) =>
           (match (string_drop _s1536_ _s1537_) with
            | _s1538_ =>
               (spc_matches_prefix _s1538_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s1539_ _) =>
                   (match (string_drop _s1538_ _s1539_) with
                    | _s1540_ =>
                       (reg_name_matches_prefix _s1540_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s1541_ _) =>
                           (match (string_drop _s1540_ _s1541_) with
                            | _s1542_ =>
                               (sep_matches_prefix _s1542_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s1543_ _) =>
                                   (match (string_drop _s1542_ _s1543_) with
                                    | _s1544_ =>
                                       (reg_name_matches_prefix _s1544_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s1545_ _) =>
                                           (match (string_drop _s1544_ _s1545_) with
                                            | _s1546_ =>
                                               (sep_matches_prefix _s1546_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s1547_ _) =>
                                                   (match (string_drop _s1546_ _s1547_) with
                                                    | _s1548_ =>
                                                       (reg_name_matches_prefix _s1548_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s1549_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s1548_ _s1549_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (op, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((ropw * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((ropw * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((ropw * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((ropw * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((ropw * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((ropw * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((ropw * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((ropw * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((ropw * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((ropw * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((ropw * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((ropw * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((ropw * mword 5 * mword 5 * mword 5))).

Definition _s1517_ (_s1518_ : string) : M (option ((sop * mword 5 * mword 5 * mword 5))) :=
   (match _s1518_ with
    | _s1519_ =>
       (shiftw_mnemonic_matches_prefix _s1519_) >>= fun w__0 : option ((sop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s1520_ _) =>
           (match (string_drop _s1519_ _s1520_) with
            | _s1521_ =>
               (spc_matches_prefix _s1521_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s1522_ _) =>
                   (match (string_drop _s1521_ _s1522_) with
                    | _s1523_ =>
                       (reg_name_matches_prefix _s1523_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s1524_ _) =>
                           (match (string_drop _s1523_ _s1524_) with
                            | _s1525_ =>
                               (sep_matches_prefix _s1525_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s1526_ _) =>
                                   (match (string_drop _s1525_ _s1526_) with
                                    | _s1527_ =>
                                       (reg_name_matches_prefix _s1527_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s1528_ _) =>
                                           (match (string_drop _s1527_ _s1528_) with
                                            | _s1529_ =>
                                               (sep_matches_prefix _s1529_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               returnm (match w__5 with
                                                        | Some (tt, existT _ _s1530_ _) =>
                                                           match (string_drop _s1529_ _s1530_) with
                                                           | _s1531_ =>
                                                              match (hex_bits_5_matches_prefix
                                                                       _s1531_) with
                                                              | Some (shamt, existT _ _s1532_ _) =>
                                                                 let p0_ :=
                                                                   string_drop _s1531_ _s1532_ in
                                                                 if generic_eq p0_ "" then
                                                                   Some (op, rd, rs1, shamt)
                                                                 else None
                                                              | _ => None
                                                              end
                                                           end
                                                        | _ => None
                                                        end)
                                            end)
                                            : M (option ((sop * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((sop * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((sop * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((sop * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((sop * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((sop * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((sop * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((sop * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((sop * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((sop * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((sop * mword 5 * mword 5 * mword 5))).

Definition _s1501_ (_s1502_ : string) : M (option ((mword 5 * mword 5 * mword 12))) :=
   let _s1503_ := _s1502_ in
   (if string_startswith _s1503_ "addiw" then
      (match (string_drop _s1503_ (projT1 (string_length "addiw"))) with
       | _s1504_ =>
          (spc_matches_prefix _s1504_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1505_ _) =>
              (match (string_drop _s1504_ _s1505_) with
               | _s1506_ =>
                  (reg_name_matches_prefix _s1506_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s1507_ _) =>
                      (match (string_drop _s1506_ _s1507_) with
                       | _s1508_ =>
                          (sep_matches_prefix _s1508_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s1509_ _) =>
                              (match (string_drop _s1508_ _s1509_) with
                               | _s1510_ =>
                                  (reg_name_matches_prefix _s1510_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rs1, existT _ _s1511_ _) =>
                                      (match (string_drop _s1510_ _s1511_) with
                                       | _s1512_ =>
                                          (sep_matches_prefix _s1512_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s1513_ _) =>
                                                      match (string_drop _s1512_ _s1513_) with
                                                      | _s1514_ =>
                                                         match (hex_bits_12_matches_prefix _s1514_) with
                                                         | Some (imm, existT _ _s1515_ _) =>
                                                            let p0_ := string_drop _s1514_ _s1515_ in
                                                            if generic_eq p0_ "" then
                                                              Some (rd, rs1, imm)
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 5 * mword 5 * mword 12)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 5 * mword 5 * mword 12)))
                               end)
                               : M (option ((mword 5 * mword 5 * mword 12)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 5 * mword 5 * mword 12)))
                       end)
                       : M (option ((mword 5 * mword 5 * mword 12)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 5 * mword 12)))
               end)
               : M (option ((mword 5 * mword 5 * mword 12)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5 * mword 12)))
       end)
       : M (option ((mword 5 * mword 5 * mword 12)))
    else returnm None)
    : M (option ((mword 5 * mword 5 * mword 12))).

Definition _s1473_ (_s1474_ : string)
: M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5))) :=
   let _s1475_ := _s1474_ in
   (if string_startswith _s1475_ "s" then
      (match (string_drop _s1475_ (projT1 (string_length "s"))) with
       | _s1476_ =>
          (size_mnemonic_matches_prefix _s1476_) >>= fun w__0 : option ((word_width * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (size, existT _ _s1477_ _) =>
              (match (string_drop _s1476_ _s1477_) with
               | _s1478_ =>
                  (maybe_aq_matches_prefix _s1478_) >>= fun w__1 : option ((bool * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (aq, existT _ _s1479_ _) =>
                      (match (string_drop _s1478_ _s1479_) with
                       | _s1480_ =>
                          (maybe_rl_matches_prefix _s1480_) >>= fun w__2 : option ((bool * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rl, existT _ _s1481_ _) =>
                              (match (string_drop _s1480_ _s1481_) with
                               | _s1482_ =>
                                  (spc_matches_prefix _s1482_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s1483_ _) =>
                                      (match (string_drop _s1482_ _s1483_) with
                                       | _s1484_ =>
                                          (reg_name_matches_prefix _s1484_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (rs2, existT _ _s1485_ _) =>
                                              (match (string_drop _s1484_ _s1485_) with
                                               | _s1486_ =>
                                                  (sep_matches_prefix _s1486_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (tt, existT _ _s1487_ _) =>
                                                      (match (string_drop _s1486_ _s1487_) with
                                                       | _s1488_ =>
                                                          (match (hex_bits_12_matches_prefix _s1488_) with
                                                           | Some (imm, existT _ _s1489_ _) =>
                                                              (match (string_drop _s1488_ _s1489_) with
                                                               | _s1490_ =>
                                                                  (opt_spc_matches_prefix _s1490_) >>= fun w__6 : option ((unit * {n : Z & ArithFact (n >=?
                                                                    0)})) =>
                                                                  (match w__6 with
                                                                   | Some (tt, existT _ _s1491_ _) =>
                                                                      let _s1492_ :=
                                                                        string_drop _s1490_ _s1491_ in
                                                                      (if string_startswith _s1492_
                                                                            "(" then
                                                                         (match (string_drop _s1492_
                                                                                   (projT1
                                                                                    (string_length
                                                                                       "("))) with
                                                                          | _s1493_ =>
                                                                             (opt_spc_matches_prefix
                                                                                _s1493_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                               0)})) =>
                                                                             (match w__7 with
                                                                              | Some
                                                                                (tt, existT _ _s1494_ _) =>
                                                                                 (match (string_drop
                                                                                           _s1493_
                                                                                           _s1494_) with
                                                                                  | _s1495_ =>
                                                                                     (reg_name_matches_prefix
                                                                                        _s1495_) >>= fun w__8 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                                       0)})) =>
                                                                                     (match w__8 with
                                                                                      | Some
                                                                                        (rs1, existT _ _s1496_ _) =>
                                                                                         (match (string_drop
                                                                                                   _s1495_
                                                                                                   _s1496_) with
                                                                                          | _s1497_ =>
                                                                                             (opt_spc_matches_prefix
                                                                                                _s1497_) >>= fun w__9 : option ((unit * {n : Z & ArithFact (n >=?
                                                                                               0)})) =>
                                                                                             returnm (match w__9 with
                                                                                                      | Some
                                                                                                        (tt, existT _ _s1498_ _) =>
                                                                                                         let _s1499_ :=
                                                                                                           string_drop
                                                                                                             _s1497_
                                                                                                             _s1498_ in
                                                                                                         if
                                                                                                           string_startswith
                                                                                                             _s1499_
                                                                                                             ")"
                                                                                                         then
                                                                                                           let p0_ :=
                                                                                                             string_drop
                                                                                                               _s1499_
                                                                                                               (projT1
                                                                                                                (string_length
                                                                                                                   ")")) in
                                                                                                           if
                                                                                                             generic_eq
                                                                                                               p0_
                                                                                                               ""
                                                                                                           then
                                                                                                             Some
                                                                                                               (size, aq, rl, rs2, imm, rs1)
                                                                                                           else
                                                                                                             None
                                                                                                         else
                                                                                                           None
                                                                                                      | _ =>
                                                                                                         None
                                                                                                      end)
                                                                                          end)
                                                                                          : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                                      | _ =>
                                                                                         returnm None
                                                                                      end)
                                                                                      : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                                  end)
                                                                                  : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                              | _ => returnm None
                                                                              end)
                                                                              : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                          end)
                                                                          : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                       else returnm None)
                                                                       : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                   | _ => returnm None
                                                                   end)
                                                                   : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                                               end)
                                                               : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                                           | _ => returnm None
                                                           end)
                                                           : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                                       end)
                                                       : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                               end)
                                               : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                       end)
                                       : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                               end)
                               : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                       end)
                       : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
               end)
               : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
       end)
       : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
    else returnm None)
    : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5))).

Definition _s1443_ (_s1444_ : string)
: M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5))) :=
   let _s1445_ := _s1444_ in
   (if string_startswith _s1445_ "l" then
      (match (string_drop _s1445_ (projT1 (string_length "l"))) with
       | _s1446_ =>
          (size_mnemonic_matches_prefix _s1446_) >>= fun w__0 : option ((word_width * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (size, existT _ _s1447_ _) =>
              (match (string_drop _s1446_ _s1447_) with
               | _s1448_ =>
                  (maybe_u_matches_prefix _s1448_) >>= fun w__1 : option ((bool * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (is_unsigned, existT _ _s1449_ _) =>
                      (match (string_drop _s1448_ _s1449_) with
                       | _s1450_ =>
                          (maybe_aq_matches_prefix _s1450_) >>= fun w__2 : option ((bool * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (aq, existT _ _s1451_ _) =>
                              (match (string_drop _s1450_ _s1451_) with
                               | _s1452_ =>
                                  (maybe_rl_matches_prefix _s1452_) >>= fun w__3 : option ((bool * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rl, existT _ _s1453_ _) =>
                                      (match (string_drop _s1452_ _s1453_) with
                                       | _s1454_ =>
                                          (spc_matches_prefix _s1454_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (tt, existT _ _s1455_ _) =>
                                              (match (string_drop _s1454_ _s1455_) with
                                               | _s1456_ =>
                                                  (reg_name_matches_prefix _s1456_) >>= fun w__5 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (rd, existT _ _s1457_ _) =>
                                                      (match (string_drop _s1456_ _s1457_) with
                                                       | _s1458_ =>
                                                          (sep_matches_prefix _s1458_) >>= fun w__6 : option ((unit * {n : Z & ArithFact (n >=?
                                                            0)})) =>
                                                          (match w__6 with
                                                           | Some (tt, existT _ _s1459_ _) =>
                                                              (match (string_drop _s1458_ _s1459_) with
                                                               | _s1460_ =>
                                                                  (match (hex_bits_12_matches_prefix
                                                                            _s1460_) with
                                                                   | Some (imm, existT _ _s1461_ _) =>
                                                                      (match (string_drop _s1460_
                                                                                _s1461_) with
                                                                       | _s1462_ =>
                                                                          (opt_spc_matches_prefix
                                                                             _s1462_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                            0)})) =>
                                                                          (match w__7 with
                                                                           | Some
                                                                             (tt, existT _ _s1463_ _) =>
                                                                              let _s1464_ :=
                                                                                string_drop _s1462_
                                                                                  _s1463_ in
                                                                              (if string_startswith
                                                                                    _s1464_ "(" then
                                                                                 (match (string_drop
                                                                                           _s1464_
                                                                                           (projT1
                                                                                            (string_length
                                                                                               "("))) with
                                                                                  | _s1465_ =>
                                                                                     (opt_spc_matches_prefix
                                                                                        _s1465_) >>= fun w__8 : option ((unit * {n : Z & ArithFact (n >=?
                                                                                       0)})) =>
                                                                                     (match w__8 with
                                                                                      | Some
                                                                                        (tt, existT _ _s1466_ _) =>
                                                                                         (match (string_drop
                                                                                                   _s1465_
                                                                                                   _s1466_) with
                                                                                          | _s1467_ =>
                                                                                             (reg_name_matches_prefix
                                                                                                _s1467_) >>= fun w__9 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                                               0)})) =>
                                                                                             (match w__9 with
                                                                                              | Some
                                                                                                (rs1, existT _ _s1468_ _) =>
                                                                                                 (match (string_drop
                                                                                                           _s1467_
                                                                                                           _s1468_) with
                                                                                                  | _s1469_ =>
                                                                                                     (opt_spc_matches_prefix
                                                                                                        _s1469_) >>= fun w__10 : option ((unit * {n : Z & ArithFact (n >=?
                                                                                                       0)})) =>
                                                                                                     returnm (match w__10 with
                                                                                                              | Some
                                                                                                                (tt, existT _ _s1470_ _) =>
                                                                                                                 let _s1471_ :=
                                                                                                                   string_drop
                                                                                                                     _s1469_
                                                                                                                     _s1470_ in
                                                                                                                 if
                                                                                                                   string_startswith
                                                                                                                     _s1471_
                                                                                                                     ")"
                                                                                                                 then
                                                                                                                   let p0_ :=
                                                                                                                     string_drop
                                                                                                                       _s1471_
                                                                                                                       (projT1
                                                                                                                        (string_length
                                                                                                                           ")")) in
                                                                                                                   if
                                                                                                                     generic_eq
                                                                                                                       p0_
                                                                                                                       ""
                                                                                                                   then
                                                                                                                     Some
                                                                                                                       (size, is_unsigned, aq, rl, rd, imm, rs1)
                                                                                                                   else
                                                                                                                     None
                                                                                                                 else
                                                                                                                   None
                                                                                                              | _ =>
                                                                                                                 None
                                                                                                              end)
                                                                                                  end)
                                                                                                  : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                                              | _ =>
                                                                                                 returnm None
                                                                                              end)
                                                                                              : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                                          end)
                                                                                          : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                                      | _ =>
                                                                                         returnm None
                                                                                      end)
                                                                                      : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                                  end)
                                                                                  : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                               else returnm None)
                                                                               : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                           | _ => returnm None
                                                                           end)
                                                                           : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                       end)
                                                                       : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                   | _ => returnm None
                                                                   end)
                                                                   : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                               end)
                                                               : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                           | _ => returnm None
                                                           end)
                                                           : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                       end)
                                                       : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                               end)
                                               : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                       end)
                                       : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                               end)
                               : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                       end)
                       : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
               end)
               : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
       end)
       : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
    else returnm None)
    : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5))).

Definition _s1426_ (_s1427_ : string) : M (option ((rop * mword 5 * mword 5 * mword 5))) :=
   (match _s1427_ with
    | _s1428_ =>
       (rtype_mnemonic_matches_prefix _s1428_) >>= fun w__0 : option ((rop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s1429_ _) =>
           (match (string_drop _s1428_ _s1429_) with
            | _s1430_ =>
               (spc_matches_prefix _s1430_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s1431_ _) =>
                   (match (string_drop _s1430_ _s1431_) with
                    | _s1432_ =>
                       (reg_name_matches_prefix _s1432_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s1433_ _) =>
                           (match (string_drop _s1432_ _s1433_) with
                            | _s1434_ =>
                               (sep_matches_prefix _s1434_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s1435_ _) =>
                                   (match (string_drop _s1434_ _s1435_) with
                                    | _s1436_ =>
                                       (reg_name_matches_prefix _s1436_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s1437_ _) =>
                                           (match (string_drop _s1436_ _s1437_) with
                                            | _s1438_ =>
                                               (sep_matches_prefix _s1438_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s1439_ _) =>
                                                   (match (string_drop _s1438_ _s1439_) with
                                                    | _s1440_ =>
                                                       (reg_name_matches_prefix _s1440_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s1441_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s1440_ _s1441_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (op, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((rop * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((rop * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((rop * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((rop * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((rop * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((rop * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((rop * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((rop * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((rop * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((rop * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((rop * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((rop * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((rop * mword 5 * mword 5 * mword 5))).

Definition _s1409_ (_s1410_ : string) : M (option ((sop * mword 5 * mword 5 * mword 6))) :=
   (match _s1410_ with
    | _s1411_ =>
       (shiftiop_mnemonic_matches_prefix _s1411_) >>= fun w__0 : option ((sop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s1412_ _) =>
           (match (string_drop _s1411_ _s1412_) with
            | _s1413_ =>
               (spc_matches_prefix _s1413_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s1414_ _) =>
                   (match (string_drop _s1413_ _s1414_) with
                    | _s1415_ =>
                       (reg_name_matches_prefix _s1415_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s1416_ _) =>
                           (match (string_drop _s1415_ _s1416_) with
                            | _s1417_ =>
                               (sep_matches_prefix _s1417_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s1418_ _) =>
                                   (match (string_drop _s1417_ _s1418_) with
                                    | _s1419_ =>
                                       (reg_name_matches_prefix _s1419_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s1420_ _) =>
                                           (match (string_drop _s1419_ _s1420_) with
                                            | _s1421_ =>
                                               (sep_matches_prefix _s1421_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               returnm (match w__5 with
                                                        | Some (tt, existT _ _s1422_ _) =>
                                                           match (string_drop _s1421_ _s1422_) with
                                                           | _s1423_ =>
                                                              match (hex_bits_6_matches_prefix
                                                                       _s1423_) with
                                                              | Some (shamt, existT _ _s1424_ _) =>
                                                                 let p0_ :=
                                                                   string_drop _s1423_ _s1424_ in
                                                                 if generic_eq p0_ "" then
                                                                   Some (op, rd, rs1, shamt)
                                                                 else None
                                                              | _ => None
                                                              end
                                                           end
                                                        | _ => None
                                                        end)
                                            end)
                                            : M (option ((sop * mword 5 * mword 5 * mword 6)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((sop * mword 5 * mword 5 * mword 6)))
                                    end)
                                    : M (option ((sop * mword 5 * mword 5 * mword 6)))
                                | _ => returnm None
                                end)
                                : M (option ((sop * mword 5 * mword 5 * mword 6)))
                            end)
                            : M (option ((sop * mword 5 * mword 5 * mword 6)))
                        | _ => returnm None
                        end)
                        : M (option ((sop * mword 5 * mword 5 * mword 6)))
                    end)
                    : M (option ((sop * mword 5 * mword 5 * mword 6)))
                | _ => returnm None
                end)
                : M (option ((sop * mword 5 * mword 5 * mword 6)))
            end)
            : M (option ((sop * mword 5 * mword 5 * mword 6)))
        | _ => returnm None
        end)
        : M (option ((sop * mword 5 * mword 5 * mword 6)))
    end)
    : M (option ((sop * mword 5 * mword 5 * mword 6))).

Definition _s1392_ (_s1393_ : string) : M (option ((iop * mword 5 * mword 5 * mword 12))) :=
   (match _s1393_ with
    | _s1394_ =>
       (itype_mnemonic_matches_prefix _s1394_) >>= fun w__0 : option ((iop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s1395_ _) =>
           (match (string_drop _s1394_ _s1395_) with
            | _s1396_ =>
               (spc_matches_prefix _s1396_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s1397_ _) =>
                   (match (string_drop _s1396_ _s1397_) with
                    | _s1398_ =>
                       (reg_name_matches_prefix _s1398_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s1399_ _) =>
                           (match (string_drop _s1398_ _s1399_) with
                            | _s1400_ =>
                               (sep_matches_prefix _s1400_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s1401_ _) =>
                                   (match (string_drop _s1400_ _s1401_) with
                                    | _s1402_ =>
                                       (reg_name_matches_prefix _s1402_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s1403_ _) =>
                                           (match (string_drop _s1402_ _s1403_) with
                                            | _s1404_ =>
                                               (sep_matches_prefix _s1404_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               returnm (match w__5 with
                                                        | Some (tt, existT _ _s1405_ _) =>
                                                           match (string_drop _s1404_ _s1405_) with
                                                           | _s1406_ =>
                                                              match (hex_bits_12_matches_prefix
                                                                       _s1406_) with
                                                              | Some (imm, existT _ _s1407_ _) =>
                                                                 let p0_ :=
                                                                   string_drop _s1406_ _s1407_ in
                                                                 if generic_eq p0_ "" then
                                                                   Some (op, rd, rs1, imm)
                                                                 else None
                                                              | _ => None
                                                              end
                                                           end
                                                        | _ => None
                                                        end)
                                            end)
                                            : M (option ((iop * mword 5 * mword 5 * mword 12)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((iop * mword 5 * mword 5 * mword 12)))
                                    end)
                                    : M (option ((iop * mword 5 * mword 5 * mword 12)))
                                | _ => returnm None
                                end)
                                : M (option ((iop * mword 5 * mword 5 * mword 12)))
                            end)
                            : M (option ((iop * mword 5 * mword 5 * mword 12)))
                        | _ => returnm None
                        end)
                        : M (option ((iop * mword 5 * mword 5 * mword 12)))
                    end)
                    : M (option ((iop * mword 5 * mword 5 * mword 12)))
                | _ => returnm None
                end)
                : M (option ((iop * mword 5 * mword 5 * mword 12)))
            end)
            : M (option ((iop * mword 5 * mword 5 * mword 12)))
        | _ => returnm None
        end)
        : M (option ((iop * mword 5 * mword 5 * mword 12)))
    end)
    : M (option ((iop * mword 5 * mword 5 * mword 12))).

Definition _s1375_ (_s1376_ : string) : M (option ((bop * mword 5 * mword 5 * mword 13))) :=
   (match _s1376_ with
    | _s1377_ =>
       (btype_mnemonic_matches_prefix _s1377_) >>= fun w__0 : option ((bop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s1378_ _) =>
           (match (string_drop _s1377_ _s1378_) with
            | _s1379_ =>
               (spc_matches_prefix _s1379_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s1380_ _) =>
                   (match (string_drop _s1379_ _s1380_) with
                    | _s1381_ =>
                       (reg_name_matches_prefix _s1381_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rs1, existT _ _s1382_ _) =>
                           (match (string_drop _s1381_ _s1382_) with
                            | _s1383_ =>
                               (sep_matches_prefix _s1383_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s1384_ _) =>
                                   (match (string_drop _s1383_ _s1384_) with
                                    | _s1385_ =>
                                       (reg_name_matches_prefix _s1385_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs2, existT _ _s1386_ _) =>
                                           (match (string_drop _s1385_ _s1386_) with
                                            | _s1387_ =>
                                               (sep_matches_prefix _s1387_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               returnm (match w__5 with
                                                        | Some (tt, existT _ _s1388_ _) =>
                                                           match (string_drop _s1387_ _s1388_) with
                                                           | _s1389_ =>
                                                              match (hex_bits_13_matches_prefix
                                                                       _s1389_) with
                                                              | Some (imm, existT _ _s1390_ _) =>
                                                                 let p0_ :=
                                                                   string_drop _s1389_ _s1390_ in
                                                                 if generic_eq p0_ "" then
                                                                   Some (op, rs1, rs2, imm)
                                                                 else None
                                                              | _ => None
                                                              end
                                                           end
                                                        | _ => None
                                                        end)
                                            end)
                                            : M (option ((bop * mword 5 * mword 5 * mword 13)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((bop * mword 5 * mword 5 * mword 13)))
                                    end)
                                    : M (option ((bop * mword 5 * mword 5 * mword 13)))
                                | _ => returnm None
                                end)
                                : M (option ((bop * mword 5 * mword 5 * mword 13)))
                            end)
                            : M (option ((bop * mword 5 * mword 5 * mword 13)))
                        | _ => returnm None
                        end)
                        : M (option ((bop * mword 5 * mword 5 * mword 13)))
                    end)
                    : M (option ((bop * mword 5 * mword 5 * mword 13)))
                | _ => returnm None
                end)
                : M (option ((bop * mword 5 * mword 5 * mword 13)))
            end)
            : M (option ((bop * mword 5 * mword 5 * mword 13)))
        | _ => returnm None
        end)
        : M (option ((bop * mword 5 * mword 5 * mword 13)))
    end)
    : M (option ((bop * mword 5 * mword 5 * mword 13))).

Definition _s1359_ (_s1360_ : string) : M (option ((mword 5 * mword 5 * mword 12))) :=
   let _s1361_ := _s1360_ in
   (if string_startswith _s1361_ "jalr" then
      (match (string_drop _s1361_ (projT1 (string_length "jalr"))) with
       | _s1362_ =>
          (spc_matches_prefix _s1362_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1363_ _) =>
              (match (string_drop _s1362_ _s1363_) with
               | _s1364_ =>
                  (reg_name_matches_prefix _s1364_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s1365_ _) =>
                      (match (string_drop _s1364_ _s1365_) with
                       | _s1366_ =>
                          (sep_matches_prefix _s1366_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s1367_ _) =>
                              (match (string_drop _s1366_ _s1367_) with
                               | _s1368_ =>
                                  (reg_name_matches_prefix _s1368_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rs1, existT _ _s1369_ _) =>
                                      (match (string_drop _s1368_ _s1369_) with
                                       | _s1370_ =>
                                          (sep_matches_prefix _s1370_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s1371_ _) =>
                                                      match (string_drop _s1370_ _s1371_) with
                                                      | _s1372_ =>
                                                         match (hex_bits_12_matches_prefix _s1372_) with
                                                         | Some (imm, existT _ _s1373_ _) =>
                                                            let p0_ := string_drop _s1372_ _s1373_ in
                                                            if generic_eq p0_ "" then
                                                              Some (rd, rs1, imm)
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 5 * mword 5 * mword 12)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 5 * mword 5 * mword 12)))
                               end)
                               : M (option ((mword 5 * mword 5 * mword 12)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 5 * mword 5 * mword 12)))
                       end)
                       : M (option ((mword 5 * mword 5 * mword 12)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 5 * mword 12)))
               end)
               : M (option ((mword 5 * mword 5 * mword 12)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5 * mword 12)))
       end)
       : M (option ((mword 5 * mword 5 * mword 12)))
    else returnm None)
    : M (option ((mword 5 * mword 5 * mword 12))).

Definition _s1347_ (_s1348_ : string) : M (option ((mword 5 * mword 21))) :=
   let _s1349_ := _s1348_ in
   (if string_startswith _s1349_ "jal" then
      (match (string_drop _s1349_ (projT1 (string_length "jal"))) with
       | _s1350_ =>
          (spc_matches_prefix _s1350_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s1351_ _) =>
              (match (string_drop _s1350_ _s1351_) with
               | _s1352_ =>
                  (reg_name_matches_prefix _s1352_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s1353_ _) =>
                      (match (string_drop _s1352_ _s1353_) with
                       | _s1354_ =>
                          (sep_matches_prefix _s1354_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s1355_ _) =>
                                      match (string_drop _s1354_ _s1355_) with
                                      | _s1356_ =>
                                         match (hex_bits_21_matches_prefix _s1356_) with
                                         | Some (imm, existT _ _s1357_ _) =>
                                            let p0_ := string_drop _s1356_ _s1357_ in
                                            if generic_eq p0_ "" then Some (rd, imm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 21)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 21)))
               end)
               : M (option ((mword 5 * mword 21)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 21)))
       end)
       : M (option ((mword 5 * mword 21)))
    else returnm None)
    : M (option ((mword 5 * mword 21))).

Definition _s1334_ (_s1335_ : string) : M (option ((uop * mword 5 * mword 20))) :=
   (match _s1335_ with
    | _s1336_ =>
       (utype_mnemonic_matches_prefix _s1336_) >>= fun w__0 : option ((uop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s1337_ _) =>
           (match (string_drop _s1336_ _s1337_) with
            | _s1338_ =>
               (spc_matches_prefix _s1338_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s1339_ _) =>
                   (match (string_drop _s1338_ _s1339_) with
                    | _s1340_ =>
                       (reg_name_matches_prefix _s1340_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s1341_ _) =>
                           (match (string_drop _s1340_ _s1341_) with
                            | _s1342_ =>
                               (sep_matches_prefix _s1342_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               returnm (match w__3 with
                                        | Some (tt, existT _ _s1343_ _) =>
                                           match (string_drop _s1342_ _s1343_) with
                                           | _s1344_ =>
                                              match (hex_bits_20_matches_prefix _s1344_) with
                                              | Some (imm, existT _ _s1345_ _) =>
                                                 let p0_ := string_drop _s1344_ _s1345_ in
                                                 if generic_eq p0_ "" then Some (op, rd, imm)
                                                 else None
                                              | _ => None
                                              end
                                           end
                                        | _ => None
                                        end)
                            end)
                            : M (option ((uop * mword 5 * mword 20)))
                        | _ => returnm None
                        end)
                        : M (option ((uop * mword 5 * mword 20)))
                    end)
                    : M (option ((uop * mword 5 * mword 20)))
                | _ => returnm None
                end)
                : M (option ((uop * mword 5 * mword 20)))
            end)
            : M (option ((uop * mword 5 * mword 20)))
        | _ => returnm None
        end)
        : M (option ((uop * mword 5 * mword 20)))
    end)
    : M (option ((uop * mword 5 * mword 20))).

Definition assembly_backwards (arg_ : string) : M (ast) :=
   let _s1346_ := arg_ in
   (_s1334_ _s1346_) >>= fun w__0 : option ((uop * mword 5 * mword 20)) =>
   (if match w__0 with | Some (op, rd, imm) => true | _ => false end then
      (_s1334_ _s1346_) >>= fun w__1 : option ((uop * mword 5 * mword 20)) =>
      (match w__1 with
       | Some (op, rd, imm) => returnm (UTYPE (imm, rd, op))
       | _ => exit tt  : M (ast)
       end)
       : M (ast)
    else
      (_s1347_ _s1346_) >>= fun w__4 : option ((mword 5 * mword 21)) =>
      (if match w__4 with | Some (rd, imm) => true | _ => false end then
         (_s1347_ _s1346_) >>= fun w__5 : option ((mword 5 * mword 21)) =>
         (match w__5 with
          | Some (rd, imm) => returnm (RISCV_JAL (imm, rd))
          | _ => exit tt  : M (ast)
          end)
          : M (ast)
       else
         (_s1359_ _s1346_) >>= fun w__8 : option ((mword 5 * mword 5 * mword 12)) =>
         (if match w__8 with | Some (rd, rs1, imm) => true | _ => false end then
            (_s1359_ _s1346_) >>= fun w__9 : option ((mword 5 * mword 5 * mword 12)) =>
            (match w__9 with
             | Some (rd, rs1, imm) => returnm (RISCV_JALR (imm, rs1, rd))
             | _ => exit tt  : M (ast)
             end)
             : M (ast)
          else
            (_s1375_ _s1346_) >>= fun w__12 : option ((bop * mword 5 * mword 5 * mword 13)) =>
            (if match w__12 with | Some (op, rs1, rs2, imm) => true | _ => false end then
               (_s1375_ _s1346_) >>= fun w__13 : option ((bop * mword 5 * mword 5 * mword 13)) =>
               (match w__13 with
                | Some (op, rs1, rs2, imm) => returnm (BTYPE (imm, rs2, rs1, op))
                | _ => exit tt  : M (ast)
                end)
                : M (ast)
             else
               (_s1392_ _s1346_) >>= fun w__16 : option ((iop * mword 5 * mword 5 * mword 12)) =>
               (if match w__16 with | Some (op, rd, rs1, imm) => true | _ => false end then
                  (_s1392_ _s1346_) >>= fun w__17 : option ((iop * mword 5 * mword 5 * mword 12)) =>
                  (match w__17 with
                   | Some (op, rd, rs1, imm) => returnm (ITYPE (imm, rs1, rd, op))
                   | _ => exit tt  : M (ast)
                   end)
                   : M (ast)
                else
                  (_s1409_ _s1346_) >>= fun w__20 : option ((sop * mword 5 * mword 5 * mword 6)) =>
                  (if match w__20 with | Some (op, rd, rs1, shamt) => true | _ => false end then
                     (_s1409_ _s1346_) >>= fun w__21 : option ((sop * mword 5 * mword 5 * mword 6)) =>
                     (match w__21 with
                      | Some (op, rd, rs1, shamt) => returnm (SHIFTIOP (shamt, rs1, rd, op))
                      | _ => exit tt  : M (ast)
                      end)
                      : M (ast)
                   else
                     (_s1426_ _s1346_) >>= fun w__24 : option ((rop * mword 5 * mword 5 * mword 5)) =>
                     (if match w__24 with | Some (op, rd, rs1, rs2) => true | _ => false end then
                        (_s1426_ _s1346_) >>= fun w__25 : option ((rop * mword 5 * mword 5 * mword 5)) =>
                        (match w__25 with
                         | Some (op, rd, rs1, rs2) => returnm (RTYPE (rs2, rs1, rd, op))
                         | _ => exit tt  : M (ast)
                         end)
                         : M (ast)
                      else
                        (_s1443_ _s1346_) >>= fun w__28 : option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)) =>
                        (if match w__28 with
                            | Some (size, is_unsigned, aq, rl, rd, imm, rs1) => true
                            | _ => false
                            end then
                           (_s1443_ _s1346_) >>= fun w__29 : option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)) =>
                           (match w__29 with
                            | Some (size, is_unsigned, aq, rl, rd, imm, rs1) =>
                               returnm (LOAD (imm, rs1, rd, is_unsigned, size, aq, rl))
                            | _ => exit tt  : M (ast)
                            end)
                            : M (ast)
                         else
                           (_s1473_ _s1346_) >>= fun w__32 : option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)) =>
                           (if match w__32 with
                               | Some (size, aq, rl, rs2, imm, rs1) => true
                               | _ => false
                               end then
                              (_s1473_ _s1346_) >>= fun w__33 : option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)) =>
                              (match w__33 with
                               | Some (size, aq, rl, rs2, imm, rs1) =>
                                  returnm (STORE (imm, rs2, rs1, size, aq, rl))
                               | _ => exit tt  : M (ast)
                               end)
                               : M (ast)
                            else
                              (_s1501_ _s1346_) >>= fun w__36 : option ((mword 5 * mword 5 * mword 12)) =>
                              (if match w__36 with
                                  | Some (rd, rs1, imm) => Z.eqb 64 64
                                  | _ => false
                                  end then
                                 (_s1501_ _s1346_) >>= fun w__37 : option ((mword 5 * mword 5 * mword 12)) =>
                                 (match w__37 with
                                  | Some (rd, rs1, imm) => returnm (ADDIW (imm, rs1, rd))
                                  | _ => exit tt  : M (ast)
                                  end)
                                  : M (ast)
                               else
                                 (_s1517_ _s1346_) >>= fun w__40 : option ((sop * mword 5 * mword 5 * mword 5)) =>
                                 (if match w__40 with
                                     | Some (op, rd, rs1, shamt) => Z.eqb 64 64
                                     | _ => false
                                     end then
                                    (_s1517_ _s1346_) >>= fun w__41 : option ((sop * mword 5 * mword 5 * mword 5)) =>
                                    (match w__41 with
                                     | Some (op, rd, rs1, shamt) =>
                                        returnm (SHIFTW (shamt, rs1, rd, op))
                                     | _ => exit tt  : M (ast)
                                     end)
                                     : M (ast)
                                  else
                                    (_s1534_ _s1346_) >>= fun w__44 : option ((ropw * mword 5 * mword 5 * mword 5)) =>
                                    (if match w__44 with
                                        | Some (op, rd, rs1, rs2) => Z.eqb 64 64
                                        | _ => false
                                        end then
                                       (_s1534_ _s1346_) >>= fun w__45 : option ((ropw * mword 5 * mword 5 * mword 5)) =>
                                       (match w__45 with
                                        | Some (op, rd, rs1, rs2) =>
                                           returnm (RTYPEW (rs2, rs1, rd, op))
                                        | _ => exit tt  : M (ast)
                                        end)
                                        : M (ast)
                                     else
                                       (_s1551_ _s1346_) >>= fun w__48 : option ((sopw * mword 5 * mword 5 * mword 5)) =>
                                       (if match w__48 with
                                           | Some (op, rd, rs1, shamt) => Z.eqb 64 64
                                           | _ => false
                                           end then
                                          (_s1551_ _s1346_) >>= fun w__49 : option ((sopw * mword 5 * mword 5 * mword 5)) =>
                                          (match w__49 with
                                           | Some (op, rd, rs1, shamt) =>
                                              returnm (SHIFTIWOP (shamt, rs1, rd, op))
                                           | _ => exit tt  : M (ast)
                                           end)
                                           : M (ast)
                                        else
                                          (_s1568_ _s1346_) >>= fun w__52 : option ((mword 4 * mword 4)) =>
                                          (if match w__52 with
                                              | Some (pred, succ) => true
                                              | _ => false
                                              end then
                                             (_s1568_ _s1346_) >>= fun w__53 : option ((mword 4 * mword 4)) =>
                                             (match w__53 with
                                              | Some (pred, succ) => returnm (FENCE (pred, succ))
                                              | _ => exit tt  : M (ast)
                                              end)
                                              : M (ast)
                                           else
                                             (_s1580_ _s1346_) >>= fun w__56 : option ((mword 4 * mword 4)) =>
                                             (if match w__56 with
                                                 | Some (pred, succ) => true
                                                 | _ => false
                                                 end then
                                                (_s1580_ _s1346_) >>= fun w__57 : option ((mword 4 * mword 4)) =>
                                                (match w__57 with
                                                 | Some (pred, succ) =>
                                                    returnm (FENCE_TSO (pred, succ))
                                                 | _ => exit tt  : M (ast)
                                                 end)
                                                 : M (ast)
                                              else if generic_eq _s1346_ "fence.i" then
                                                returnm (FENCEI tt)
                                              else if generic_eq _s1346_ "ecall" then
                                                returnm (ECALL tt)
                                              else if generic_eq _s1346_ "mret" then
                                                returnm (MRET tt)
                                              else if generic_eq _s1346_ "sret" then
                                                returnm (SRET tt)
                                              else if generic_eq _s1346_ "ebreak" then
                                                returnm (EBREAK tt)
                                              else if generic_eq _s1346_ "wfi" then returnm (WFI tt)
                                              else
                                                (_s1592_ _s1346_) >>= fun w__60 : option ((mword 5 * mword 5)) =>
                                                (if match w__60 with
                                                    | Some (rs1, rs2) => true
                                                    | _ => false
                                                    end then
                                                   (_s1592_ _s1346_) >>= fun w__61 : option ((mword 5 * mword 5)) =>
                                                   (match w__61 with
                                                    | Some (rs1, rs2) =>
                                                       returnm (SFENCE_VMA (rs1, rs2))
                                                    | _ => exit tt  : M (ast)
                                                    end)
                                                    : M (ast)
                                                 else
                                                   (_s1604_ _s1346_) >>= fun w__64 : option ((word_width * bool * bool * mword 5 * mword 5)) =>
                                                   (if match w__64 with
                                                       | Some (size, aq, rl, rd, rs1) => true
                                                       | _ => false
                                                       end then
                                                      (_s1604_ _s1346_) >>= fun w__65 : option ((word_width * bool * bool * mword 5 * mword 5)) =>
                                                      (match w__65 with
                                                       | Some (size, aq, rl, rd, rs1) =>
                                                          returnm (LOADRES (aq, rl, rs1, size, rd))
                                                       | _ => exit tt  : M (ast)
                                                       end)
                                                       : M (ast)
                                                    else
                                                      (_s1622_ _s1346_) >>= fun w__68 : option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)) =>
                                                      (if match w__68 with
                                                          | Some (size, aq, rl, rd, rs1, rs2) =>
                                                             true
                                                          | _ => false
                                                          end then
                                                         (_s1622_ _s1346_) >>= fun w__69 : option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)) =>
                                                         (match w__69 with
                                                          | Some (size, aq, rl, rd, rs1, rs2) =>
                                                             returnm (STORECON
                                                                        (aq, rl, rs2, rs1, size, rd))
                                                          | _ => exit tt  : M (ast)
                                                          end)
                                                          : M (ast)
                                                       else
                                                         (_s1644_ _s1346_) >>= fun w__72 : option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)) =>
                                                         (if match w__72 with
                                                             | Some
                                                               (op, width, aq, rl, rd, rs2, rs1) =>
                                                                true
                                                             | _ => false
                                                             end then
                                                            (_s1644_ _s1346_) >>= fun w__73 : option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)) =>
                                                            (match w__73 with
                                                             | Some
                                                               (op, width, aq, rl, rd, rs2, rs1) =>
                                                                returnm (AMO
                                                                           (op, aq, rl, rs2, rs1, width, rd))
                                                             | _ => exit tt  : M (ast)
                                                             end)
                                                             : M (ast)
                                                          else if generic_eq _s1346_ "c.nop" then
                                                            returnm (C_NOP tt)
                                                          else
                                                            (_s1670_ _s1346_) >>= fun w__76 : option ((mword 3 * mword 8)) =>
                                                            (if match w__76 with
                                                                | Some (rdc, nzimm) =>
                                                                   neq_vec nzimm (Ox"00"  : mword 8)
                                                                | _ => false
                                                                end then
                                                               (_s1670_ _s1346_) >>= fun w__77 : option ((mword 3 * mword 8)) =>
                                                               (match w__77 with
                                                                | Some (rdc, nzimm) =>
                                                                   returnm (C_ADDI4SPN (rdc, nzimm))
                                                                | _ => exit tt  : M (ast)
                                                                end)
                                                                : M (ast)
                                                             else
                                                               (_s1682_ _s1346_) >>= fun w__80 : option ((mword 3 * mword 3 * mword 5)) =>
                                                               (if match w__80 with
                                                                   | Some (rdc, rsc, uimm) => true
                                                                   | _ => false
                                                                   end then
                                                                  (_s1682_ _s1346_) >>= fun w__81 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                  (match w__81 with
                                                                   | Some (rdc, rsc, uimm) =>
                                                                      returnm (C_LW (uimm, rsc, rdc))
                                                                   | _ => exit tt  : M (ast)
                                                                   end)
                                                                   : M (ast)
                                                                else
                                                                  (_s1698_ _s1346_) >>= fun w__84 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                  (if match w__84 with
                                                                      | Some (rdc, rsc, uimm) =>
                                                                         Z.eqb 64 64
                                                                      | _ => false
                                                                      end then
                                                                     (_s1698_ _s1346_) >>= fun w__85 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                     (match w__85 with
                                                                      | Some (rdc, rsc, uimm) =>
                                                                         returnm (C_LD
                                                                                    (uimm, rsc, rdc))
                                                                      | _ => exit tt  : M (ast)
                                                                      end)
                                                                      : M (ast)
                                                                   else
                                                                     (_s1714_ _s1346_) >>= fun w__88 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                     (if match w__88 with
                                                                         | Some (rsc1, rsc2, uimm) =>
                                                                            true
                                                                         | _ => false
                                                                         end then
                                                                        (_s1714_ _s1346_) >>= fun w__89 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                        (match w__89 with
                                                                         | Some (rsc1, rsc2, uimm) =>
                                                                            returnm (C_SW
                                                                                       (uimm, rsc1, rsc2))
                                                                         | _ => exit tt  : M (ast)
                                                                         end)
                                                                         : M (ast)
                                                                      else
                                                                        (_s1730_ _s1346_) >>= fun w__92 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                        (if match w__92 with
                                                                            | Some
                                                                              (rsc1, rsc2, uimm) =>
                                                                               Z.eqb 64 64
                                                                            | _ => false
                                                                            end then
                                                                           (_s1730_ _s1346_) >>= fun w__93 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                           (match w__93 with
                                                                            | Some
                                                                              (rsc1, rsc2, uimm) =>
                                                                               returnm (C_SD
                                                                                          (uimm, rsc1, rsc2))
                                                                            | _ =>
                                                                               exit tt  : M (ast)
                                                                            end)
                                                                            : M (ast)
                                                                         else
                                                                           (_s1746_ _s1346_) >>= fun w__96 : option ((mword 5 * mword 6)) =>
                                                                           (if match w__96 with
                                                                               | Some (rsd, nzi) =>
                                                                                  andb
                                                                                    (neq_vec nzi
                                                                                       ('b"000000"
                                                                                        : mword 6))
                                                                                    (neq_vec rsd
                                                                                       zreg)
                                                                               | _ => false
                                                                               end then
                                                                              (_s1746_ _s1346_) >>= fun w__97 : option ((mword 5 * mword 6)) =>
                                                                              (match w__97 with
                                                                               | Some (rsd, nzi) =>
                                                                                  returnm (C_ADDI
                                                                                             (nzi, rsd))
                                                                               | _ =>
                                                                                  exit tt  : M (ast)
                                                                               end)
                                                                               : M (ast)
                                                                            else
                                                                              (_s1758_ _s1346_) >>= fun w__100 : option (mword 11) =>
                                                                              (if match w__100 with
                                                                                  | Some imm =>
                                                                                     Z.eqb 64 32
                                                                                  | _ => false
                                                                                  end then
                                                                                 (_s1758_ _s1346_) >>= fun w__101 : option (mword 11) =>
                                                                                 (match w__101 with
                                                                                  | Some imm =>
                                                                                     returnm (C_JAL
                                                                                                imm)
                                                                                  | _ =>
                                                                                     exit tt
                                                                                      : M (ast)
                                                                                  end)
                                                                                  : M (ast)
                                                                               else
                                                                                 (_s1766_ _s1346_) >>= fun w__104 : option ((mword 5 * mword 6)) =>
                                                                                 (if match w__104 with
                                                                                     | Some
                                                                                       (rsd, imm) =>
                                                                                        Z.eqb 64 64
                                                                                     | _ => false
                                                                                     end then
                                                                                    (_s1766_ _s1346_) >>= fun w__105 : option ((mword 5 * mword 6)) =>
                                                                                    (match w__105 with
                                                                                     | Some
                                                                                       (rsd, imm) =>
                                                                                        returnm (C_ADDIW
                                                                                                   (imm, rsd))
                                                                                     | _ =>
                                                                                        exit tt
                                                                                         : M (ast)
                                                                                     end)
                                                                                     : M (ast)
                                                                                  else
                                                                                    (_s1778_ _s1346_) >>= fun w__108 : option ((mword 5 * mword 6)) =>
                                                                                    (if match w__108 with
                                                                                        | Some
                                                                                          (rd, imm) =>
                                                                                           neq_vec
                                                                                             rd zreg
                                                                                        | _ => false
                                                                                        end then
                                                                                       (_s1778_
                                                                                          _s1346_) >>= fun w__109 : option ((mword 5 * mword 6)) =>
                                                                                       (match w__109 with
                                                                                        | Some
                                                                                          (rd, imm) =>
                                                                                           returnm (C_LI
                                                                                                      (imm, rd))
                                                                                        | _ =>
                                                                                           exit tt
                                                                                            : M (ast)
                                                                                        end)
                                                                                        : M (ast)
                                                                                     else
                                                                                       (_s1790_
                                                                                          _s1346_) >>= fun w__112 : option (mword 6) =>
                                                                                       (if match w__112 with
                                                                                           | Some
                                                                                             imm =>
                                                                                              neq_vec
                                                                                                imm
                                                                                                ('b"000000"
                                                                                                 : mword 6)
                                                                                           | _ =>
                                                                                              false
                                                                                           end then
                                                                                          (_s1790_
                                                                                             _s1346_) >>= fun w__113 : option (mword 6) =>
                                                                                          (match w__113 with
                                                                                           | Some
                                                                                             imm =>
                                                                                              returnm (C_ADDI16SP
                                                                                                         imm)
                                                                                           | _ =>
                                                                                              exit tt
                                                                                               : M (ast)
                                                                                           end)
                                                                                           : M (ast)
                                                                                        else
                                                                                          (_s1798_
                                                                                             _s1346_) >>= fun w__116 : option ((mword 5 * mword 6)) =>
                                                                                          (if match w__116 with
                                                                                              | Some
                                                                                                (rd, imm) =>
                                                                                                 andb
                                                                                                   (neq_vec
                                                                                                      rd
                                                                                                      zreg)
                                                                                                   (andb
                                                                                                      (neq_vec
                                                                                                         rd
                                                                                                         sp)
                                                                                                      (neq_vec
                                                                                                         imm
                                                                                                         ('b"000000"
                                                                                                          : mword 6)))
                                                                                              | _ =>
                                                                                                 false
                                                                                              end
                                                                                           then
                                                                                             (_s1798_
                                                                                                _s1346_) >>= fun w__117 : option ((mword 5 * mword 6)) =>
                                                                                             (match w__117 with
                                                                                              | Some
                                                                                                (rd, imm) =>
                                                                                                 returnm (C_LUI
                                                                                                            (imm, rd))
                                                                                              | _ =>
                                                                                                 exit tt
                                                                                                  : M (ast)
                                                                                              end)
                                                                                              : M (ast)
                                                                                           else
                                                                                             (_s1810_
                                                                                                _s1346_) >>= fun w__120 : option ((mword 3 * mword 6)) =>
                                                                                             (if match w__120 with
                                                                                                 | Some
                                                                                                   (rsd, shamt) =>
                                                                                                    neq_vec
                                                                                                      shamt
                                                                                                      ('b"000000"
                                                                                                       : mword 6)
                                                                                                 | _ =>
                                                                                                    false
                                                                                                 end
                                                                                              then
                                                                                                (_s1810_
                                                                                                   _s1346_) >>= fun w__121 : option ((mword 3 * mword 6)) =>
                                                                                                (match w__121 with
                                                                                                 | Some
                                                                                                   (rsd, shamt) =>
                                                                                                    returnm (C_SRLI
                                                                                                               (shamt, rsd))
                                                                                                 | _ =>
                                                                                                    exit tt
                                                                                                     : M (ast)
                                                                                                 end)
                                                                                                 : M (ast)
                                                                                              else
                                                                                                (_s1822_
                                                                                                   _s1346_) >>= fun w__124 : option ((mword 3 * mword 6)) =>
                                                                                                (if match w__124 with
                                                                                                    | Some
                                                                                                      (rsd, shamt) =>
                                                                                                       neq_vec
                                                                                                         shamt
                                                                                                         ('b"000000"
                                                                                                          : mword 6)
                                                                                                    | _ =>
                                                                                                       false
                                                                                                    end
                                                                                                 then
                                                                                                   (_s1822_
                                                                                                      _s1346_) >>= fun w__125 : option ((mword 3 * mword 6)) =>
                                                                                                   (match w__125 with
                                                                                                    | Some
                                                                                                      (rsd, shamt) =>
                                                                                                       returnm (C_SRAI
                                                                                                                  (shamt, rsd))
                                                                                                    | _ =>
                                                                                                       exit tt
                                                                                                        : M (ast)
                                                                                                    end)
                                                                                                    : M (ast)
                                                                                                 else
                                                                                                   (_s1834_
                                                                                                      _s1346_) >>= fun w__128 : option ((mword 3 * mword 6)) =>
                                                                                                   (if
                                                                                                      match w__128 with
                                                                                                      | Some
                                                                                                        (rsd, imm) =>
                                                                                                         true
                                                                                                      | _ =>
                                                                                                         false
                                                                                                      end
                                                                                                    then
                                                                                                      (_s1834_
                                                                                                         _s1346_) >>= fun w__129 : option ((mword 3 * mword 6)) =>
                                                                                                      (match w__129 with
                                                                                                       | Some
                                                                                                         (rsd, imm) =>
                                                                                                          returnm (C_ANDI
                                                                                                                     (imm, rsd))
                                                                                                       | _ =>
                                                                                                          exit tt
                                                                                                           : M (ast)
                                                                                                       end)
                                                                                                       : M (ast)
                                                                                                    else
                                                                                                      (_s1846_
                                                                                                         _s1346_) >>= fun w__132 : option ((mword 3 * mword 3)) =>
                                                                                                      (if
                                                                                                         match w__132 with
                                                                                                         | Some
                                                                                                           (rsd, rs2) =>
                                                                                                            true
                                                                                                         | _ =>
                                                                                                            false
                                                                                                         end
                                                                                                       then
                                                                                                         (_s1846_
                                                                                                            _s1346_) >>= fun w__133 : option ((mword 3 * mword 3)) =>
                                                                                                         (match w__133 with
                                                                                                          | Some
                                                                                                            (rsd, rs2) =>
                                                                                                             returnm (C_SUB
                                                                                                                        (rsd, rs2))
                                                                                                          | _ =>
                                                                                                             exit tt
                                                                                                              : M (ast)
                                                                                                          end)
                                                                                                          : M (ast)
                                                                                                       else
                                                                                                         (_s1858_
                                                                                                            _s1346_) >>= fun w__136 : option ((mword 3 * mword 3)) =>
                                                                                                         (if
                                                                                                            match w__136 with
                                                                                                            | Some
                                                                                                              (rsd, rs2) =>
                                                                                                               true
                                                                                                            | _ =>
                                                                                                               false
                                                                                                            end
                                                                                                          then
                                                                                                            (_s1858_
                                                                                                               _s1346_) >>= fun w__137 : option ((mword 3 * mword 3)) =>
                                                                                                            (match w__137 with
                                                                                                             | Some
                                                                                                               (rsd, rs2) =>
                                                                                                                returnm (C_XOR
                                                                                                                           (rsd, rs2))
                                                                                                             | _ =>
                                                                                                                exit tt
                                                                                                                 : M (ast)
                                                                                                             end)
                                                                                                             : M (ast)
                                                                                                          else
                                                                                                            (_s1870_
                                                                                                               _s1346_) >>= fun w__140 : option ((mword 3 * mword 3)) =>
                                                                                                            (if
                                                                                                               match w__140 with
                                                                                                               | Some
                                                                                                                 (rsd, rs2) =>
                                                                                                                  true
                                                                                                               | _ =>
                                                                                                                  false
                                                                                                               end
                                                                                                             then
                                                                                                               (_s1870_
                                                                                                                  _s1346_) >>= fun w__141 : option ((mword 3 * mword 3)) =>
                                                                                                               (match w__141 with
                                                                                                                | Some
                                                                                                                  (rsd, rs2) =>
                                                                                                                   returnm (C_OR
                                                                                                                              (rsd, rs2))
                                                                                                                | _ =>
                                                                                                                   exit tt
                                                                                                                    : M (ast)
                                                                                                                end)
                                                                                                                : M (ast)
                                                                                                             else
                                                                                                               (_s1882_
                                                                                                                  _s1346_) >>= fun w__144 : option ((mword 3 * mword 3)) =>
                                                                                                               (if
                                                                                                                  match w__144 with
                                                                                                                  | Some
                                                                                                                    (rsd, rs2) =>
                                                                                                                     true
                                                                                                                  | _ =>
                                                                                                                     false
                                                                                                                  end
                                                                                                                then
                                                                                                                  (_s1882_
                                                                                                                     _s1346_) >>= fun w__145 : option ((mword 3 * mword 3)) =>
                                                                                                                  (match w__145 with
                                                                                                                   | Some
                                                                                                                     (rsd, rs2) =>
                                                                                                                      returnm (C_AND
                                                                                                                                 (rsd, rs2))
                                                                                                                   | _ =>
                                                                                                                      exit tt
                                                                                                                       : M (ast)
                                                                                                                   end)
                                                                                                                   : M (ast)
                                                                                                                else
                                                                                                                  (_s1894_
                                                                                                                     _s1346_) >>= fun w__148 : option ((mword 3 * mword 3)) =>
                                                                                                                  (if
                                                                                                                     match w__148 with
                                                                                                                     | Some
                                                                                                                       (rsd, rs2) =>
                                                                                                                        Z.eqb
                                                                                                                          64
                                                                                                                          64
                                                                                                                     | _ =>
                                                                                                                        false
                                                                                                                     end
                                                                                                                   then
                                                                                                                     (_s1894_
                                                                                                                        _s1346_) >>= fun w__149 : option ((mword 3 * mword 3)) =>
                                                                                                                     (match w__149 with
                                                                                                                      | Some
                                                                                                                        (rsd, rs2) =>
                                                                                                                         returnm (C_SUBW
                                                                                                                                    (rsd, rs2))
                                                                                                                      | _ =>
                                                                                                                         exit tt
                                                                                                                          : M (ast)
                                                                                                                      end)
                                                                                                                      : M (ast)
                                                                                                                   else
                                                                                                                     (_s1906_
                                                                                                                        _s1346_) >>= fun w__152 : option ((mword 3 * mword 3)) =>
                                                                                                                     (if
                                                                                                                        match w__152 with
                                                                                                                        | Some
                                                                                                                          (rsd, rs2) =>
                                                                                                                           Z.eqb
                                                                                                                             64
                                                                                                                             64
                                                                                                                        | _ =>
                                                                                                                           false
                                                                                                                        end
                                                                                                                      then
                                                                                                                        (_s1906_
                                                                                                                           _s1346_) >>= fun w__153 : option ((mword 3 * mword 3)) =>
                                                                                                                        (match w__153 with
                                                                                                                         | Some
                                                                                                                           (rsd, rs2) =>
                                                                                                                            returnm (C_ADDW
                                                                                                                                       (rsd, rs2))
                                                                                                                         | _ =>
                                                                                                                            exit tt
                                                                                                                             : M (ast)
                                                                                                                         end)
                                                                                                                         : M (ast)
                                                                                                                      else
                                                                                                                        (_s1918_
                                                                                                                           _s1346_) >>= fun w__156 : option (mword 11) =>
                                                                                                                        (if
                                                                                                                           match w__156 with
                                                                                                                           | Some
                                                                                                                             imm =>
                                                                                                                              true
                                                                                                                           | _ =>
                                                                                                                              false
                                                                                                                           end
                                                                                                                         then
                                                                                                                           (_s1918_
                                                                                                                              _s1346_) >>= fun w__157 : option (mword 11) =>
                                                                                                                           (match w__157 with
                                                                                                                            | Some
                                                                                                                              imm =>
                                                                                                                               returnm (C_J
                                                                                                                                          imm)
                                                                                                                            | _ =>
                                                                                                                               exit tt
                                                                                                                                : M (ast)
                                                                                                                            end)
                                                                                                                            : M (ast)
                                                                                                                         else
                                                                                                                           (_s1926_
                                                                                                                              _s1346_) >>= fun w__160 : option ((mword 3 * mword 8)) =>
                                                                                                                           (if
                                                                                                                              match w__160 with
                                                                                                                              | Some
                                                                                                                                (rs, imm) =>
                                                                                                                                 true
                                                                                                                              | _ =>
                                                                                                                                 false
                                                                                                                              end
                                                                                                                            then
                                                                                                                              (_s1926_
                                                                                                                                 _s1346_) >>= fun w__161 : option ((mword 3 * mword 8)) =>
                                                                                                                              (match w__161 with
                                                                                                                               | Some
                                                                                                                                 (rs, imm) =>
                                                                                                                                  returnm (C_BEQZ
                                                                                                                                             (imm, rs))
                                                                                                                               | _ =>
                                                                                                                                  exit tt
                                                                                                                                   : M (ast)
                                                                                                                               end)
                                                                                                                               : M (ast)
                                                                                                                            else
                                                                                                                              (_s1938_
                                                                                                                                 _s1346_) >>= fun w__164 : option ((mword 3 * mword 8)) =>
                                                                                                                              (if
                                                                                                                                 match w__164 with
                                                                                                                                 | Some
                                                                                                                                   (rs, imm) =>
                                                                                                                                    true
                                                                                                                                 | _ =>
                                                                                                                                    false
                                                                                                                                 end
                                                                                                                               then
                                                                                                                                 (_s1938_
                                                                                                                                    _s1346_) >>= fun w__165 : option ((mword 3 * mword 8)) =>
                                                                                                                                 (match w__165 with
                                                                                                                                  | Some
                                                                                                                                    (rs, imm) =>
                                                                                                                                     returnm (C_BNEZ
                                                                                                                                                (imm, rs))
                                                                                                                                  | _ =>
                                                                                                                                     exit tt
                                                                                                                                      : M (ast)
                                                                                                                                  end)
                                                                                                                                  : M (ast)
                                                                                                                               else
                                                                                                                                 (_s1950_
                                                                                                                                    _s1346_) >>= fun w__168 : option ((mword 5 * mword 6)) =>
                                                                                                                                 (if
                                                                                                                                    match w__168 with
                                                                                                                                    | Some
                                                                                                                                      (rsd, shamt) =>
                                                                                                                                       andb
                                                                                                                                         (neq_vec
                                                                                                                                            shamt
                                                                                                                                            ('b"000000"
                                                                                                                                             : mword 6))
                                                                                                                                         (neq_vec
                                                                                                                                            rsd
                                                                                                                                            zreg)
                                                                                                                                    | _ =>
                                                                                                                                       false
                                                                                                                                    end
                                                                                                                                  then
                                                                                                                                    (_s1950_
                                                                                                                                       _s1346_) >>= fun w__169 : option ((mword 5 * mword 6)) =>
                                                                                                                                    (match w__169 with
                                                                                                                                     | Some
                                                                                                                                       (rsd, shamt) =>
                                                                                                                                        returnm (C_SLLI
                                                                                                                                                   (shamt, rsd))
                                                                                                                                     | _ =>
                                                                                                                                        exit tt
                                                                                                                                         : M (ast)
                                                                                                                                     end)
                                                                                                                                     : M (ast)
                                                                                                                                  else
                                                                                                                                    (_s1962_
                                                                                                                                       _s1346_) >>= fun w__172 : option ((mword 5 * mword 6)) =>
                                                                                                                                    (if
                                                                                                                                       match w__172 with
                                                                                                                                       | Some
                                                                                                                                         (rd, uimm) =>
                                                                                                                                          neq_vec
                                                                                                                                            rd
                                                                                                                                            zreg
                                                                                                                                       | _ =>
                                                                                                                                          false
                                                                                                                                       end
                                                                                                                                     then
                                                                                                                                       (_s1962_
                                                                                                                                          _s1346_) >>= fun w__173 : option ((mword 5 * mword 6)) =>
                                                                                                                                       (match w__173 with
                                                                                                                                        | Some
                                                                                                                                          (rd, uimm) =>
                                                                                                                                           returnm (C_LWSP
                                                                                                                                                      (uimm, rd))
                                                                                                                                        | _ =>
                                                                                                                                           exit tt
                                                                                                                                            : M (ast)
                                                                                                                                        end)
                                                                                                                                        : M (ast)
                                                                                                                                     else
                                                                                                                                       (_s1974_
                                                                                                                                          _s1346_) >>= fun w__176 : option ((mword 5 * mword 6)) =>
                                                                                                                                       (if
                                                                                                                                          match w__176 with
                                                                                                                                          | Some
                                                                                                                                            (rd, uimm) =>
                                                                                                                                             andb
                                                                                                                                               (neq_vec
                                                                                                                                                  rd
                                                                                                                                                  zreg)
                                                                                                                                               (Z.eqb
                                                                                                                                                  64
                                                                                                                                                  64)
                                                                                                                                          | _ =>
                                                                                                                                             false
                                                                                                                                          end
                                                                                                                                        then
                                                                                                                                          (_s1974_
                                                                                                                                             _s1346_) >>= fun w__177 : option ((mword 5 * mword 6)) =>
                                                                                                                                          (match w__177 with
                                                                                                                                           | Some
                                                                                                                                             (rd, uimm) =>
                                                                                                                                              returnm (C_LDSP
                                                                                                                                                         (uimm, rd))
                                                                                                                                           | _ =>
                                                                                                                                              exit tt
                                                                                                                                               : M (ast)
                                                                                                                                           end)
                                                                                                                                           : M (ast)
                                                                                                                                        else
                                                                                                                                          (_s1986_
                                                                                                                                             _s1346_) >>= fun w__180 : option ((mword 5 * mword 6)) =>
                                                                                                                                          (if
                                                                                                                                             match w__180 with
                                                                                                                                             | Some
                                                                                                                                               (rd, uimm) =>
                                                                                                                                                true
                                                                                                                                             | _ =>
                                                                                                                                                false
                                                                                                                                             end
                                                                                                                                           then
                                                                                                                                             (_s1986_
                                                                                                                                                _s1346_) >>= fun w__181 : option ((mword 5 * mword 6)) =>
                                                                                                                                             (match w__181 with
                                                                                                                                              | Some
                                                                                                                                                (rd, uimm) =>
                                                                                                                                                 returnm (C_SWSP
                                                                                                                                                            (uimm, rd))
                                                                                                                                              | _ =>
                                                                                                                                                 exit tt
                                                                                                                                                  : M (ast)
                                                                                                                                              end)
                                                                                                                                              : M (ast)
                                                                                                                                           else
                                                                                                                                             (_s1998_
                                                                                                                                                _s1346_) >>= fun w__184 : option ((mword 5 * mword 6)) =>
                                                                                                                                             (if
                                                                                                                                                match w__184 with
                                                                                                                                                | Some
                                                                                                                                                  (rs2, uimm) =>
                                                                                                                                                   Z.eqb
                                                                                                                                                     64
                                                                                                                                                     64
                                                                                                                                                | _ =>
                                                                                                                                                   false
                                                                                                                                                end
                                                                                                                                              then
                                                                                                                                                (_s1998_
                                                                                                                                                   _s1346_) >>= fun w__185 : option ((mword 5 * mword 6)) =>
                                                                                                                                                (match w__185 with
                                                                                                                                                 | Some
                                                                                                                                                   (rs2, uimm) =>
                                                                                                                                                    returnm (C_SDSP
                                                                                                                                                               (uimm, rs2))
                                                                                                                                                 | _ =>
                                                                                                                                                    exit tt
                                                                                                                                                     : M (ast)
                                                                                                                                                 end)
                                                                                                                                                 : M (ast)
                                                                                                                                              else
                                                                                                                                                (_s2010_
                                                                                                                                                   _s1346_) >>= fun w__188 : option (mword 5) =>
                                                                                                                                                (if
                                                                                                                                                   match w__188 with
                                                                                                                                                   | Some
                                                                                                                                                     rs1 =>
                                                                                                                                                      neq_vec
                                                                                                                                                        rs1
                                                                                                                                                        zreg
                                                                                                                                                   | _ =>
                                                                                                                                                      false
                                                                                                                                                   end
                                                                                                                                                 then
                                                                                                                                                   (_s2010_
                                                                                                                                                      _s1346_) >>= fun w__189 : option (mword 5) =>
                                                                                                                                                   (match w__189 with
                                                                                                                                                    | Some
                                                                                                                                                      rs1 =>
                                                                                                                                                       returnm (C_JR
                                                                                                                                                                  rs1)
                                                                                                                                                    | _ =>
                                                                                                                                                       exit tt
                                                                                                                                                        : M (ast)
                                                                                                                                                    end)
                                                                                                                                                    : M (ast)
                                                                                                                                                 else
                                                                                                                                                   (_s2018_
                                                                                                                                                      _s1346_) >>= fun w__192 : option (mword 5) =>
                                                                                                                                                   (if
                                                                                                                                                      match w__192 with
                                                                                                                                                      | Some
                                                                                                                                                        rs1 =>
                                                                                                                                                         neq_vec
                                                                                                                                                           rs1
                                                                                                                                                           zreg
                                                                                                                                                      | _ =>
                                                                                                                                                         false
                                                                                                                                                      end
                                                                                                                                                    then
                                                                                                                                                      (_s2018_
                                                                                                                                                         _s1346_) >>= fun w__193 : option (mword 5) =>
                                                                                                                                                      (match w__193 with
                                                                                                                                                       | Some
                                                                                                                                                         rs1 =>
                                                                                                                                                          returnm (C_JALR
                                                                                                                                                                     rs1)
                                                                                                                                                       | _ =>
                                                                                                                                                          exit tt
                                                                                                                                                           : M (ast)
                                                                                                                                                       end)
                                                                                                                                                       : M (ast)
                                                                                                                                                    else
                                                                                                                                                      (_s2026_
                                                                                                                                                         _s1346_) >>= fun w__196 : option ((mword 5 * mword 5)) =>
                                                                                                                                                      (if
                                                                                                                                                         match w__196 with
                                                                                                                                                         | Some
                                                                                                                                                           (rd, rs2) =>
                                                                                                                                                            andb
                                                                                                                                                              (neq_vec
                                                                                                                                                                 rd
                                                                                                                                                                 zreg)
                                                                                                                                                              (neq_vec
                                                                                                                                                                 rs2
                                                                                                                                                                 zreg)
                                                                                                                                                         | _ =>
                                                                                                                                                            false
                                                                                                                                                         end
                                                                                                                                                       then
                                                                                                                                                         (_s2026_
                                                                                                                                                            _s1346_) >>= fun w__197 : option ((mword 5 * mword 5)) =>
                                                                                                                                                         (match w__197 with
                                                                                                                                                          | Some
                                                                                                                                                            (rd, rs2) =>
                                                                                                                                                             returnm (C_MV
                                                                                                                                                                        (rd, rs2))
                                                                                                                                                          | _ =>
                                                                                                                                                             exit tt
                                                                                                                                                              : M (ast)
                                                                                                                                                          end)
                                                                                                                                                          : M (ast)
                                                                                                                                                       else if
                                                                                                                                                         generic_eq
                                                                                                                                                           _s1346_
                                                                                                                                                           "c.ebreak"
                                                                                                                                                       then
                                                                                                                                                         returnm (C_EBREAK
                                                                                                                                                                    tt)
                                                                                                                                                       else
                                                                                                                                                         (_s2038_
                                                                                                                                                            _s1346_) >>= fun w__200 : option ((mword 5 * mword 5)) =>
                                                                                                                                                         (if
                                                                                                                                                            match w__200 with
                                                                                                                                                            | Some
                                                                                                                                                              (rsd, rs2) =>
                                                                                                                                                               andb
                                                                                                                                                                 (neq_vec
                                                                                                                                                                    rsd
                                                                                                                                                                    zreg)
                                                                                                                                                                 (neq_vec
                                                                                                                                                                    rs2
                                                                                                                                                                    zreg)
                                                                                                                                                            | _ =>
                                                                                                                                                               false
                                                                                                                                                            end
                                                                                                                                                          then
                                                                                                                                                            (_s2038_
                                                                                                                                                               _s1346_) >>= fun w__201 : option ((mword 5 * mword 5)) =>
                                                                                                                                                            (match w__201 with
                                                                                                                                                             | Some
                                                                                                                                                               (rsd, rs2) =>
                                                                                                                                                                returnm (C_ADD
                                                                                                                                                                           (rsd, rs2))
                                                                                                                                                             | _ =>
                                                                                                                                                                exit tt
                                                                                                                                                                 : M (ast)
                                                                                                                                                             end)
                                                                                                                                                             : M (ast)
                                                                                                                                                          else
                                                                                                                                                            (_s2050_
                                                                                                                                                               _s1346_) >>= fun w__204 : option ((bool * bool * bool * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                            (if
                                                                                                                                                               match w__204 with
                                                                                                                                                               | Some
                                                                                                                                                                 (high, signed1, signed2, rd, rs1, rs2) =>
                                                                                                                                                                  true
                                                                                                                                                               | _ =>
                                                                                                                                                                  false
                                                                                                                                                               end
                                                                                                                                                             then
                                                                                                                                                               (_s2050_
                                                                                                                                                                  _s1346_) >>= fun w__205 : option ((bool * bool * bool * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                               (match w__205 with
                                                                                                                                                                | Some
                                                                                                                                                                  (high, signed1, signed2, rd, rs1, rs2) =>
                                                                                                                                                                   returnm (MUL
                                                                                                                                                                              (rs2, rs1, rd, high, signed1, signed2))
                                                                                                                                                                | _ =>
                                                                                                                                                                   exit tt
                                                                                                                                                                    : M (ast)
                                                                                                                                                                end)
                                                                                                                                                                : M (ast)
                                                                                                                                                             else
                                                                                                                                                               (_s2067_
                                                                                                                                                                  _s1346_) >>= fun w__208 : option ((bool * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                               (if
                                                                                                                                                                  match w__208 with
                                                                                                                                                                  | Some
                                                                                                                                                                    (s, rd, rs1, rs2) =>
                                                                                                                                                                     true
                                                                                                                                                                  | _ =>
                                                                                                                                                                     false
                                                                                                                                                                  end
                                                                                                                                                                then
                                                                                                                                                                  (_s2067_
                                                                                                                                                                     _s1346_) >>= fun w__209 : option ((bool * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                  (match w__209 with
                                                                                                                                                                   | Some
                                                                                                                                                                     (s, rd, rs1, rs2) =>
                                                                                                                                                                      returnm (DIV
                                                                                                                                                                                 (rs2, rs1, rd, s))
                                                                                                                                                                   | _ =>
                                                                                                                                                                      exit tt
                                                                                                                                                                       : M (ast)
                                                                                                                                                                   end)
                                                                                                                                                                   : M (ast)
                                                                                                                                                                else
                                                                                                                                                                  (_s2085_
                                                                                                                                                                     _s1346_) >>= fun w__212 : option ((bool * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                  (if
                                                                                                                                                                     match w__212 with
                                                                                                                                                                     | Some
                                                                                                                                                                       (s, rd, rs1, rs2) =>
                                                                                                                                                                        true
                                                                                                                                                                     | _ =>
                                                                                                                                                                        false
                                                                                                                                                                     end
                                                                                                                                                                   then
                                                                                                                                                                     (_s2085_
                                                                                                                                                                        _s1346_) >>= fun w__213 : option ((bool * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                     (match w__213 with
                                                                                                                                                                      | Some
                                                                                                                                                                        (s, rd, rs1, rs2) =>
                                                                                                                                                                         returnm (REM
                                                                                                                                                                                    (rs2, rs1, rd, s))
                                                                                                                                                                      | _ =>
                                                                                                                                                                         exit tt
                                                                                                                                                                          : M (ast)
                                                                                                                                                                      end)
                                                                                                                                                                      : M (ast)
                                                                                                                                                                   else
                                                                                                                                                                     (_s2103_
                                                                                                                                                                        _s1346_) >>= fun w__216 : option ((mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                     (if
                                                                                                                                                                        match w__216 with
                                                                                                                                                                        | Some
                                                                                                                                                                          (rd, rs1, rs2) =>
                                                                                                                                                                           Z.eqb
                                                                                                                                                                             64
                                                                                                                                                                             64
                                                                                                                                                                        | _ =>
                                                                                                                                                                           false
                                                                                                                                                                        end
                                                                                                                                                                      then
                                                                                                                                                                        (_s2103_
                                                                                                                                                                           _s1346_) >>= fun w__217 : option ((mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                        (match w__217 with
                                                                                                                                                                         | Some
                                                                                                                                                                           (rd, rs1, rs2) =>
                                                                                                                                                                            returnm (MULW
                                                                                                                                                                                       (rs2, rs1, rd))
                                                                                                                                                                         | _ =>
                                                                                                                                                                            exit tt
                                                                                                                                                                             : M (ast)
                                                                                                                                                                         end)
                                                                                                                                                                         : M (ast)
                                                                                                                                                                      else
                                                                                                                                                                        (_s2119_
                                                                                                                                                                           _s1346_) >>= fun w__220 : option ((bool * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                        (if
                                                                                                                                                                           match w__220 with
                                                                                                                                                                           | Some
                                                                                                                                                                             (s, rd, rs1, rs2) =>
                                                                                                                                                                              Z.eqb
                                                                                                                                                                                64
                                                                                                                                                                                64
                                                                                                                                                                           | _ =>
                                                                                                                                                                              false
                                                                                                                                                                           end
                                                                                                                                                                         then
                                                                                                                                                                           (_s2119_
                                                                                                                                                                              _s1346_) >>= fun w__221 : option ((bool * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                           (match w__221 with
                                                                                                                                                                            | Some
                                                                                                                                                                              (s, rd, rs1, rs2) =>
                                                                                                                                                                               returnm (DIVW
                                                                                                                                                                                          (rs2, rs1, rd, s))
                                                                                                                                                                            | _ =>
                                                                                                                                                                               exit tt
                                                                                                                                                                                : M (ast)
                                                                                                                                                                            end)
                                                                                                                                                                            : M (ast)
                                                                                                                                                                         else
                                                                                                                                                                           (_s2138_
                                                                                                                                                                              _s1346_) >>= fun w__224 : option ((bool * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                           (if
                                                                                                                                                                              match w__224 with
                                                                                                                                                                              | Some
                                                                                                                                                                                (s, rd, rs1, rs2) =>
                                                                                                                                                                                 Z.eqb
                                                                                                                                                                                   64
                                                                                                                                                                                   64
                                                                                                                                                                              | _ =>
                                                                                                                                                                                 false
                                                                                                                                                                              end
                                                                                                                                                                            then
                                                                                                                                                                              (_s2138_
                                                                                                                                                                                 _s1346_) >>= fun w__225 : option ((bool * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                              (match w__225 with
                                                                                                                                                                               | Some
                                                                                                                                                                                 (s, rd, rs1, rs2) =>
                                                                                                                                                                                  returnm (REMW
                                                                                                                                                                                             (rs2, rs1, rd, s))
                                                                                                                                                                               | _ =>
                                                                                                                                                                                  exit tt
                                                                                                                                                                                   : M (ast)
                                                                                                                                                                               end)
                                                                                                                                                                               : M (ast)
                                                                                                                                                                            else
                                                                                                                                                                              (_s2157_
                                                                                                                                                                                 _s1346_) >>= fun w__228 : option ((csrop * mword 5 * mword 12 * mword 5)) =>
                                                                                                                                                                              (if
                                                                                                                                                                                 match w__228 with
                                                                                                                                                                                 | Some
                                                                                                                                                                                   (op, rd, csr, rs1) =>
                                                                                                                                                                                    true
                                                                                                                                                                                 | _ =>
                                                                                                                                                                                    false
                                                                                                                                                                                 end
                                                                                                                                                                               then
                                                                                                                                                                                 (_s2157_
                                                                                                                                                                                    _s1346_) >>= fun w__229 : option ((csrop * mword 5 * mword 12 * mword 5)) =>
                                                                                                                                                                                 (match w__229 with
                                                                                                                                                                                  | Some
                                                                                                                                                                                    (op, rd, csr, rs1) =>
                                                                                                                                                                                     returnm (CSR
                                                                                                                                                                                                (csr, rs1, rd, true, op))
                                                                                                                                                                                  | _ =>
                                                                                                                                                                                     exit tt
                                                                                                                                                                                      : M (ast)
                                                                                                                                                                                  end)
                                                                                                                                                                                  : M (ast)
                                                                                                                                                                               else
                                                                                                                                                                                 (_s2175_
                                                                                                                                                                                    _s1346_) >>= fun w__232 : option ((csrop * mword 5 * mword 12 * mword 5)) =>
                                                                                                                                                                                 (if
                                                                                                                                                                                    match w__232 with
                                                                                                                                                                                    | Some
                                                                                                                                                                                      (op, rd, csr, rs1) =>
                                                                                                                                                                                       true
                                                                                                                                                                                    | _ =>
                                                                                                                                                                                       false
                                                                                                                                                                                    end
                                                                                                                                                                                  then
                                                                                                                                                                                    (_s2175_
                                                                                                                                                                                       _s1346_) >>= fun w__233 : option ((csrop * mword 5 * mword 12 * mword 5)) =>
                                                                                                                                                                                    (match w__233 with
                                                                                                                                                                                     | Some
                                                                                                                                                                                       (op, rd, csr, rs1) =>
                                                                                                                                                                                        returnm (CSR
                                                                                                                                                                                                   (csr, rs1, rd, false, op))
                                                                                                                                                                                     | _ =>
                                                                                                                                                                                        exit tt
                                                                                                                                                                                         : M (ast)
                                                                                                                                                                                     end)
                                                                                                                                                                                     : M (ast)
                                                                                                                                                                                  else if
                                                                                                                                                                                    generic_eq
                                                                                                                                                                                      _s1346_
                                                                                                                                                                                      "uret"
                                                                                                                                                                                  then
                                                                                                                                                                                    returnm (URET
                                                                                                                                                                                               tt)
                                                                                                                                                                                  else if
                                                                                                                                                                                    match (_s2192_
                                                                                                                                                                                             _s1346_) with
                                                                                                                                                                                    | Some
                                                                                                                                                                                      imm =>
                                                                                                                                                                                       true
                                                                                                                                                                                    | _ =>
                                                                                                                                                                                       false
                                                                                                                                                                                    end
                                                                                                                                                                                  then
                                                                                                                                                                                    (match (_s2192_
                                                                                                                                                                                              _s1346_) with
                                                                                                                                                                                     | Some
                                                                                                                                                                                       imm =>
                                                                                                                                                                                        returnm (C_NOP_HINT
                                                                                                                                                                                                   imm)
                                                                                                                                                                                     | _ =>
                                                                                                                                                                                        exit tt
                                                                                                                                                                                         : M (ast)
                                                                                                                                                                                     end)
                                                                                                                                                                                     : M (ast)
                                                                                                                                                                                  else
                                                                                                                                                                                    (_s2198_
                                                                                                                                                                                       _s1346_) >>= fun w__238 : option (mword 5) =>
                                                                                                                                                                                    (if
                                                                                                                                                                                       match w__238 with
                                                                                                                                                                                       | Some
                                                                                                                                                                                         rsd =>
                                                                                                                                                                                          neq_vec
                                                                                                                                                                                            rsd
                                                                                                                                                                                            zreg
                                                                                                                                                                                       | _ =>
                                                                                                                                                                                          false
                                                                                                                                                                                       end
                                                                                                                                                                                     then
                                                                                                                                                                                       (_s2198_
                                                                                                                                                                                          _s1346_) >>= fun w__239 : option (mword 5) =>
                                                                                                                                                                                       (match w__239 with
                                                                                                                                                                                        | Some
                                                                                                                                                                                          rsd =>
                                                                                                                                                                                           returnm (C_ADDI_HINT
                                                                                                                                                                                                      rsd)
                                                                                                                                                                                        | _ =>
                                                                                                                                                                                           exit tt
                                                                                                                                                                                            : M (ast)
                                                                                                                                                                                        end)
                                                                                                                                                                                        : M (ast)
                                                                                                                                                                                     else if
                                                                                                                                                                                       match (_s2204_
                                                                                                                                                                                                _s1346_) with
                                                                                                                                                                                       | Some
                                                                                                                                                                                         imm =>
                                                                                                                                                                                          true
                                                                                                                                                                                       | _ =>
                                                                                                                                                                                          false
                                                                                                                                                                                       end
                                                                                                                                                                                     then
                                                                                                                                                                                       (match (_s2204_
                                                                                                                                                                                                 _s1346_) with
                                                                                                                                                                                        | Some
                                                                                                                                                                                          imm =>
                                                                                                                                                                                           returnm (C_LI_HINT
                                                                                                                                                                                                      imm)
                                                                                                                                                                                        | _ =>
                                                                                                                                                                                           exit tt
                                                                                                                                                                                            : M (ast)
                                                                                                                                                                                        end)
                                                                                                                                                                                        : M (ast)
                                                                                                                                                                                     else if
                                                                                                                                                                                       match (_s2210_
                                                                                                                                                                                                _s1346_) with
                                                                                                                                                                                       | Some
                                                                                                                                                                                         imm =>
                                                                                                                                                                                          neq_vec
                                                                                                                                                                                            imm
                                                                                                                                                                                            ('b"000000"
                                                                                                                                                                                             : mword 6)
                                                                                                                                                                                       | _ =>
                                                                                                                                                                                          false
                                                                                                                                                                                       end
                                                                                                                                                                                     then
                                                                                                                                                                                       (match (_s2210_
                                                                                                                                                                                                 _s1346_) with
                                                                                                                                                                                        | Some
                                                                                                                                                                                          imm =>
                                                                                                                                                                                           returnm (C_LUI_HINT
                                                                                                                                                                                                      imm)
                                                                                                                                                                                        | _ =>
                                                                                                                                                                                           exit tt
                                                                                                                                                                                            : M (ast)
                                                                                                                                                                                        end)
                                                                                                                                                                                        : M (ast)
                                                                                                                                                                                     else
                                                                                                                                                                                       (_s2216_
                                                                                                                                                                                          _s1346_) >>= fun w__246 : option (mword 5) =>
                                                                                                                                                                                       (if
                                                                                                                                                                                          match w__246 with
                                                                                                                                                                                          | Some
                                                                                                                                                                                            rs2 =>
                                                                                                                                                                                             neq_vec
                                                                                                                                                                                               rs2
                                                                                                                                                                                               zreg
                                                                                                                                                                                          | _ =>
                                                                                                                                                                                             false
                                                                                                                                                                                          end
                                                                                                                                                                                        then
                                                                                                                                                                                          (_s2216_
                                                                                                                                                                                             _s1346_) >>= fun w__247 : option (mword 5) =>
                                                                                                                                                                                          (match w__247 with
                                                                                                                                                                                           | Some
                                                                                                                                                                                             rs2 =>
                                                                                                                                                                                              returnm (C_MV_HINT
                                                                                                                                                                                                         rs2)
                                                                                                                                                                                           | _ =>
                                                                                                                                                                                              exit tt
                                                                                                                                                                                               : M (ast)
                                                                                                                                                                                           end)
                                                                                                                                                                                           : M (ast)
                                                                                                                                                                                        else
                                                                                                                                                                                          (_s2222_
                                                                                                                                                                                             _s1346_) >>= fun w__250 : option (mword 5) =>
                                                                                                                                                                                          (if
                                                                                                                                                                                             match w__250 with
                                                                                                                                                                                             | Some
                                                                                                                                                                                               rs2 =>
                                                                                                                                                                                                neq_vec
                                                                                                                                                                                                  rs2
                                                                                                                                                                                                  zreg
                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                false
                                                                                                                                                                                             end
                                                                                                                                                                                           then
                                                                                                                                                                                             (_s2222_
                                                                                                                                                                                                _s1346_) >>= fun w__251 : option (mword 5) =>
                                                                                                                                                                                             (match w__251 with
                                                                                                                                                                                              | Some
                                                                                                                                                                                                rs2 =>
                                                                                                                                                                                                 returnm (C_ADD_HINT
                                                                                                                                                                                                            rs2)
                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                 exit tt
                                                                                                                                                                                                  : M (ast)
                                                                                                                                                                                              end)
                                                                                                                                                                                              : M (ast)
                                                                                                                                                                                           else
                                                                                                                                                                                             (_s2228_
                                                                                                                                                                                                _s1346_) >>= fun w__254 : option ((mword 5 * mword 6)) =>
                                                                                                                                                                                             (if
                                                                                                                                                                                                match w__254 with
                                                                                                                                                                                                | Some
                                                                                                                                                                                                  (rsd, shamt) =>
                                                                                                                                                                                                   orb
                                                                                                                                                                                                     (eq_vec
                                                                                                                                                                                                        shamt
                                                                                                                                                                                                        ('b"000000"
                                                                                                                                                                                                         : mword 6))
                                                                                                                                                                                                     (eq_vec
                                                                                                                                                                                                        rsd
                                                                                                                                                                                                        zreg)
                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                   false
                                                                                                                                                                                                end
                                                                                                                                                                                              then
                                                                                                                                                                                                (_s2228_
                                                                                                                                                                                                   _s1346_) >>= fun w__255 : option ((mword 5 * mword 6)) =>
                                                                                                                                                                                                (match w__255 with
                                                                                                                                                                                                 | Some
                                                                                                                                                                                                   (rsd, shamt) =>
                                                                                                                                                                                                    returnm (C_SLLI_HINT
                                                                                                                                                                                                               (shamt, rsd))
                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                    exit tt
                                                                                                                                                                                                     : M (ast)
                                                                                                                                                                                                 end)
                                                                                                                                                                                                 : M (ast)
                                                                                                                                                                                              else
                                                                                                                                                                                                (_s2237_
                                                                                                                                                                                                   _s1346_) >>= fun w__258 : option (mword 3) =>
                                                                                                                                                                                                (if
                                                                                                                                                                                                   match w__258 with
                                                                                                                                                                                                   | Some
                                                                                                                                                                                                     rsd =>
                                                                                                                                                                                                      true
                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                      false
                                                                                                                                                                                                   end
                                                                                                                                                                                                 then
                                                                                                                                                                                                   (_s2237_
                                                                                                                                                                                                      _s1346_) >>= fun w__259 : option (mword 3) =>
                                                                                                                                                                                                   (match w__259 with
                                                                                                                                                                                                    | Some
                                                                                                                                                                                                      rsd =>
                                                                                                                                                                                                       returnm (C_SRLI_HINT
                                                                                                                                                                                                                  rsd)
                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                       exit tt
                                                                                                                                                                                                        : M (ast)
                                                                                                                                                                                                    end)
                                                                                                                                                                                                    : M (ast)
                                                                                                                                                                                                 else
                                                                                                                                                                                                   (_s2243_
                                                                                                                                                                                                      _s1346_) >>= fun w__262 : option (mword 3) =>
                                                                                                                                                                                                   (if
                                                                                                                                                                                                      match w__262 with
                                                                                                                                                                                                      | Some
                                                                                                                                                                                                        rsd =>
                                                                                                                                                                                                         true
                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                         false
                                                                                                                                                                                                      end
                                                                                                                                                                                                    then
                                                                                                                                                                                                      (_s2243_
                                                                                                                                                                                                         _s1346_) >>= fun w__263 : option (mword 3) =>
                                                                                                                                                                                                      (match w__263 with
                                                                                                                                                                                                       | Some
                                                                                                                                                                                                         rsd =>
                                                                                                                                                                                                          returnm (C_SRAI_HINT
                                                                                                                                                                                                                     rsd)
                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                          exit tt
                                                                                                                                                                                                           : M (ast)
                                                                                                                                                                                                       end)
                                                                                                                                                                                                       : M (ast)
                                                                                                                                                                                                    else
                                                                                                                                                                                                      (_s2249_
                                                                                                                                                                                                         _s1346_) >>= fun w__266 : option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)) =>
                                                                                                                                                                                                      (if
                                                                                                                                                                                                         match w__266 with
                                                                                                                                                                                                         | Some
                                                                                                                                                                                                           (pred, succ, rs, rd, fm) =>
                                                                                                                                                                                                            orb
                                                                                                                                                                                                              (andb
                                                                                                                                                                                                                 (neq_vec
                                                                                                                                                                                                                    fm
                                                                                                                                                                                                                    (Ox"0"
                                                                                                                                                                                                                     : mword 4))
                                                                                                                                                                                                                 (neq_vec
                                                                                                                                                                                                                    fm
                                                                                                                                                                                                                    (Ox"8"
                                                                                                                                                                                                                     : mword 4)))
                                                                                                                                                                                                              (orb
                                                                                                                                                                                                                 (neq_vec
                                                                                                                                                                                                                    rs
                                                                                                                                                                                                                    ('b"00000"
                                                                                                                                                                                                                     : mword 5))
                                                                                                                                                                                                                 (neq_vec
                                                                                                                                                                                                                    rd
                                                                                                                                                                                                                    ('b"00000"
                                                                                                                                                                                                                     : mword 5)))
                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                            false
                                                                                                                                                                                                         end
                                                                                                                                                                                                       then
                                                                                                                                                                                                         (_s2249_
                                                                                                                                                                                                            _s1346_) >>= fun w__267 : option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)) =>
                                                                                                                                                                                                         (match w__267 with
                                                                                                                                                                                                          | Some
                                                                                                                                                                                                            (pred, succ, rs, rd, fm) =>
                                                                                                                                                                                                             returnm (FENCE_RESERVED
                                                                                                                                                                                                                        (fm, pred, succ, rs, rd))
                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                             exit tt
                                                                                                                                                                                                              : M (ast)
                                                                                                                                                                                                          end)
                                                                                                                                                                                                          : M (ast)
                                                                                                                                                                                                       else
                                                                                                                                                                                                         (_s2267_
                                                                                                                                                                                                            _s1346_) >>= fun w__270 : option ((mword 5 * mword 5 * mword 12)) =>
                                                                                                                                                                                                         (if
                                                                                                                                                                                                            match w__270 with
                                                                                                                                                                                                            | Some
                                                                                                                                                                                                              (rd, rs, imm) =>
                                                                                                                                                                                                               orb
                                                                                                                                                                                                                 (neq_vec
                                                                                                                                                                                                                    imm
                                                                                                                                                                                                                    (Ox"000"
                                                                                                                                                                                                                     : mword 12))
                                                                                                                                                                                                                 (orb
                                                                                                                                                                                                                    (neq_vec
                                                                                                                                                                                                                       rs
                                                                                                                                                                                                                       zreg)
                                                                                                                                                                                                                    (neq_vec
                                                                                                                                                                                                                       rd
                                                                                                                                                                                                                       zreg))
                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                               false
                                                                                                                                                                                                            end
                                                                                                                                                                                                          then
                                                                                                                                                                                                            (_s2267_
                                                                                                                                                                                                               _s1346_) >>= fun w__271 : option ((mword 5 * mword 5 * mword 12)) =>
                                                                                                                                                                                                            (match w__271 with
                                                                                                                                                                                                             | Some
                                                                                                                                                                                                               (rd, rs, imm) =>
                                                                                                                                                                                                                returnm (FENCEI_RESERVED
                                                                                                                                                                                                                           (imm, rs, rd))
                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                exit tt
                                                                                                                                                                                                                 : M (ast)
                                                                                                                                                                                                             end)
                                                                                                                                                                                                             : M (ast)
                                                                                                                                                                                                          else
                                                                                                                                                                                                            (_s2279_
                                                                                                                                                                                                               _s1346_) >>= fun w__274 : option ((word_width * mword 5 * mword 12 * mword 5)) =>
                                                                                                                                                                                                            (if
                                                                                                                                                                                                               match w__274 with
                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                 (width, rd, imm, rs1) =>
                                                                                                                                                                                                                  true
                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                  false
                                                                                                                                                                                                               end
                                                                                                                                                                                                             then
                                                                                                                                                                                                               (_s2279_
                                                                                                                                                                                                                  _s1346_) >>= fun w__275 : option ((word_width * mword 5 * mword 12 * mword 5)) =>
                                                                                                                                                                                                               (match w__275 with
                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                  (width, rd, imm, rs1) =>
                                                                                                                                                                                                                   returnm (LOAD_FP
                                                                                                                                                                                                                              (imm, rs1, rd, width))
                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                   exit tt
                                                                                                                                                                                                                    : M (ast)
                                                                                                                                                                                                                end)
                                                                                                                                                                                                                : M (ast)
                                                                                                                                                                                                             else
                                                                                                                                                                                                               (_s2303_
                                                                                                                                                                                                                  _s1346_) >>= fun w__278 : option ((word_width * mword 5 * mword 12 * mword 5)) =>
                                                                                                                                                                                                               (if
                                                                                                                                                                                                                  match w__278 with
                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                    (width, rs2, imm, rs1) =>
                                                                                                                                                                                                                     true
                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                     false
                                                                                                                                                                                                                  end
                                                                                                                                                                                                                then
                                                                                                                                                                                                                  (_s2303_
                                                                                                                                                                                                                     _s1346_) >>= fun w__279 : option ((word_width * mword 5 * mword 12 * mword 5)) =>
                                                                                                                                                                                                                  (match w__279 with
                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                     (width, rs2, imm, rs1) =>
                                                                                                                                                                                                                      returnm (STORE_FP
                                                                                                                                                                                                                                 (imm, rs2, rs1, width))
                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                      exit tt
                                                                                                                                                                                                                       : M (ast)
                                                                                                                                                                                                                   end)
                                                                                                                                                                                                                   : M (ast)
                                                                                                                                                                                                                else
                                                                                                                                                                                                                  (_s2327_
                                                                                                                                                                                                                     _s1346_) >>= fun w__282 : option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                  (if
                                                                                                                                                                                                                     match w__282 with
                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                       (op, rd, rs1, rs2, rs3, rm) =>
                                                                                                                                                                                                                        true
                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                        false
                                                                                                                                                                                                                     end
                                                                                                                                                                                                                   then
                                                                                                                                                                                                                     (_s2327_
                                                                                                                                                                                                                        _s1346_) >>= fun w__283 : option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                     (match w__283 with
                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                        (op, rd, rs1, rs2, rs3, rm) =>
                                                                                                                                                                                                                         returnm (F_MADD_TYPE_S
                                                                                                                                                                                                                                    (rs3, rs2, rs1, rm, rd, op))
                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                         exit tt
                                                                                                                                                                                                                          : M (ast)
                                                                                                                                                                                                                      end)
                                                                                                                                                                                                                      : M (ast)
                                                                                                                                                                                                                   else
                                                                                                                                                                                                                     (_s2352_
                                                                                                                                                                                                                        _s1346_) >>= fun w__286 : option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                     (if
                                                                                                                                                                                                                        match w__286 with
                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                          (op, rd, rs1, rs2, rm) =>
                                                                                                                                                                                                                           true
                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                           false
                                                                                                                                                                                                                        end
                                                                                                                                                                                                                      then
                                                                                                                                                                                                                        (_s2352_
                                                                                                                                                                                                                           _s1346_) >>= fun w__287 : option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                        (match w__287 with
                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                           (op, rd, rs1, rs2, rm) =>
                                                                                                                                                                                                                            returnm (F_BIN_RM_TYPE_S
                                                                                                                                                                                                                                       (rs2, rs1, rm, rd, op))
                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                            exit tt
                                                                                                                                                                                                                             : M (ast)
                                                                                                                                                                                                                         end)
                                                                                                                                                                                                                         : M (ast)
                                                                                                                                                                                                                      else
                                                                                                                                                                                                                        (_s2373_
                                                                                                                                                                                                                           _s1346_) >>= fun w__290 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                        (if
                                                                                                                                                                                                                           match w__290 with
                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                             (FSQRT_S, rd, rs1, rm) =>
                                                                                                                                                                                                                              true
                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                              false
                                                                                                                                                                                                                           end
                                                                                                                                                                                                                         then
                                                                                                                                                                                                                           (_s2373_
                                                                                                                                                                                                                              _s1346_) >>= fun w__291 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                           (match w__291 with
                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                              (FSQRT_S, rd, rs1, rm) =>
                                                                                                                                                                                                                               returnm (F_UN_RM_TYPE_S
                                                                                                                                                                                                                                          (rs1, rm, rd, FSQRT_S))
                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                               exit tt
                                                                                                                                                                                                                                : M (ast)
                                                                                                                                                                                                                            end)
                                                                                                                                                                                                                            : M (ast)
                                                                                                                                                                                                                         else
                                                                                                                                                                                                                           (_s2390_
                                                                                                                                                                                                                              _s1346_) >>= fun w__294 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                           (if
                                                                                                                                                                                                                              match w__294 with
                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                (FCVT_W_S, rd, rs1, rm) =>
                                                                                                                                                                                                                                 true
                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                 false
                                                                                                                                                                                                                              end
                                                                                                                                                                                                                            then
                                                                                                                                                                                                                              (_s2390_
                                                                                                                                                                                                                                 _s1346_) >>= fun w__295 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                              (match w__295 with
                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                 (FCVT_W_S, rd, rs1, rm) =>
                                                                                                                                                                                                                                  returnm (F_UN_RM_TYPE_S
                                                                                                                                                                                                                                             (rs1, rm, rd, FCVT_W_S))
                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                  exit tt
                                                                                                                                                                                                                                   : M (ast)
                                                                                                                                                                                                                               end)
                                                                                                                                                                                                                               : M (ast)
                                                                                                                                                                                                                            else
                                                                                                                                                                                                                              (_s2407_
                                                                                                                                                                                                                                 _s1346_) >>= fun w__298 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                              (if
                                                                                                                                                                                                                                 match w__298 with
                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                   (FCVT_WU_S, rd, rs1, rm) =>
                                                                                                                                                                                                                                    true
                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                    false
                                                                                                                                                                                                                                 end
                                                                                                                                                                                                                               then
                                                                                                                                                                                                                                 (_s2407_
                                                                                                                                                                                                                                    _s1346_) >>= fun w__299 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                 (match w__299 with
                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                    (FCVT_WU_S, rd, rs1, rm) =>
                                                                                                                                                                                                                                     returnm (F_UN_RM_TYPE_S
                                                                                                                                                                                                                                                (rs1, rm, rd, FCVT_WU_S))
                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                     exit tt
                                                                                                                                                                                                                                      : M (ast)
                                                                                                                                                                                                                                  end)
                                                                                                                                                                                                                                  : M (ast)
                                                                                                                                                                                                                               else
                                                                                                                                                                                                                                 (_s2424_
                                                                                                                                                                                                                                    _s1346_) >>= fun w__302 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                 (if
                                                                                                                                                                                                                                    match w__302 with
                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                      (FCVT_S_W, rd, rs1, rm) =>
                                                                                                                                                                                                                                       true
                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                       false
                                                                                                                                                                                                                                    end
                                                                                                                                                                                                                                  then
                                                                                                                                                                                                                                    (_s2424_
                                                                                                                                                                                                                                       _s1346_) >>= fun w__303 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                    (match w__303 with
                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                       (FCVT_S_W, rd, rs1, rm) =>
                                                                                                                                                                                                                                        returnm (F_UN_RM_TYPE_S
                                                                                                                                                                                                                                                   (rs1, rm, rd, FCVT_S_W))
                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                        exit tt
                                                                                                                                                                                                                                         : M (ast)
                                                                                                                                                                                                                                     end)
                                                                                                                                                                                                                                     : M (ast)
                                                                                                                                                                                                                                  else
                                                                                                                                                                                                                                    (_s2441_
                                                                                                                                                                                                                                       _s1346_) >>= fun w__306 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                    (if
                                                                                                                                                                                                                                       match w__306 with
                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                         (FCVT_S_WU, rd, rs1, rm) =>
                                                                                                                                                                                                                                          true
                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                          false
                                                                                                                                                                                                                                       end
                                                                                                                                                                                                                                     then
                                                                                                                                                                                                                                       (_s2441_
                                                                                                                                                                                                                                          _s1346_) >>= fun w__307 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                       (match w__307 with
                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                          (FCVT_S_WU, rd, rs1, rm) =>
                                                                                                                                                                                                                                           returnm (F_UN_RM_TYPE_S
                                                                                                                                                                                                                                                      (rs1, rm, rd, FCVT_S_WU))
                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                           exit tt
                                                                                                                                                                                                                                            : M (ast)
                                                                                                                                                                                                                                        end)
                                                                                                                                                                                                                                        : M (ast)
                                                                                                                                                                                                                                     else
                                                                                                                                                                                                                                       (_s2458_
                                                                                                                                                                                                                                          _s1346_) >>= fun w__310 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                       (if
                                                                                                                                                                                                                                          match w__310 with
                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                            (FCVT_L_S, rd, rs1, rm) =>
                                                                                                                                                                                                                                             true
                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                             false
                                                                                                                                                                                                                                          end
                                                                                                                                                                                                                                        then
                                                                                                                                                                                                                                          (_s2458_
                                                                                                                                                                                                                                             _s1346_) >>= fun w__311 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                          (match w__311 with
                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                             (FCVT_L_S, rd, rs1, rm) =>
                                                                                                                                                                                                                                              returnm (F_UN_RM_TYPE_S
                                                                                                                                                                                                                                                         (rs1, rm, rd, FCVT_L_S))
                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                              exit tt
                                                                                                                                                                                                                                               : M (ast)
                                                                                                                                                                                                                                           end)
                                                                                                                                                                                                                                           : M (ast)
                                                                                                                                                                                                                                        else
                                                                                                                                                                                                                                          (_s2475_
                                                                                                                                                                                                                                             _s1346_) >>= fun w__314 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                          (if
                                                                                                                                                                                                                                             match w__314 with
                                                                                                                                                                                                                                             | Some
                                                                                                                                                                                                                                               (FCVT_LU_S, rd, rs1, rm) =>
                                                                                                                                                                                                                                                true
                                                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                                                false
                                                                                                                                                                                                                                             end
                                                                                                                                                                                                                                           then
                                                                                                                                                                                                                                             (_s2475_
                                                                                                                                                                                                                                                _s1346_) >>= fun w__315 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                             (match w__315 with
                                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                                (FCVT_LU_S, rd, rs1, rm) =>
                                                                                                                                                                                                                                                 returnm (F_UN_RM_TYPE_S
                                                                                                                                                                                                                                                            (rs1, rm, rd, FCVT_LU_S))
                                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                                 exit tt
                                                                                                                                                                                                                                                  : M (ast)
                                                                                                                                                                                                                                              end)
                                                                                                                                                                                                                                              : M (ast)
                                                                                                                                                                                                                                           else
                                                                                                                                                                                                                                             (_s2492_
                                                                                                                                                                                                                                                _s1346_) >>= fun w__318 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                             (if
                                                                                                                                                                                                                                                match w__318 with
                                                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                                                  (FCVT_S_L, rd, rs1, rm) =>
                                                                                                                                                                                                                                                   true
                                                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                                                   false
                                                                                                                                                                                                                                                end
                                                                                                                                                                                                                                              then
                                                                                                                                                                                                                                                (_s2492_
                                                                                                                                                                                                                                                   _s1346_) >>= fun w__319 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                (match w__319 with
                                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                                   (FCVT_S_L, rd, rs1, rm) =>
                                                                                                                                                                                                                                                    returnm (F_UN_RM_TYPE_S
                                                                                                                                                                                                                                                               (rs1, rm, rd, FCVT_S_L))
                                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                                    exit tt
                                                                                                                                                                                                                                                     : M (ast)
                                                                                                                                                                                                                                                 end)
                                                                                                                                                                                                                                                 : M (ast)
                                                                                                                                                                                                                                              else
                                                                                                                                                                                                                                                (_s2509_
                                                                                                                                                                                                                                                   _s1346_) >>= fun w__322 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                (if
                                                                                                                                                                                                                                                   match w__322 with
                                                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                                                     (FCVT_S_LU, rd, rs1, rm) =>
                                                                                                                                                                                                                                                      true
                                                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                                                      false
                                                                                                                                                                                                                                                   end
                                                                                                                                                                                                                                                 then
                                                                                                                                                                                                                                                   (_s2509_
                                                                                                                                                                                                                                                      _s1346_) >>= fun w__323 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                   (match w__323 with
                                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                                      (FCVT_S_LU, rd, rs1, rm) =>
                                                                                                                                                                                                                                                       returnm (F_UN_RM_TYPE_S
                                                                                                                                                                                                                                                                  (rs1, rm, rd, FCVT_S_LU))
                                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                                       exit tt
                                                                                                                                                                                                                                                        : M (ast)
                                                                                                                                                                                                                                                    end)
                                                                                                                                                                                                                                                    : M (ast)
                                                                                                                                                                                                                                                 else
                                                                                                                                                                                                                                                   (_s2526_
                                                                                                                                                                                                                                                      _s1346_) >>= fun w__326 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                   (if
                                                                                                                                                                                                                                                      match w__326 with
                                                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                                                        (FSGNJ_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                         true
                                                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                                                         false
                                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                                    then
                                                                                                                                                                                                                                                      (_s2526_
                                                                                                                                                                                                                                                         _s1346_) >>= fun w__327 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                      (match w__327 with
                                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                                         (FSGNJ_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                          returnm (F_BIN_TYPE_S
                                                                                                                                                                                                                                                                     (rs2, rs1, rd, FSGNJ_S))
                                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                                          exit tt
                                                                                                                                                                                                                                                           : M (ast)
                                                                                                                                                                                                                                                       end)
                                                                                                                                                                                                                                                       : M (ast)
                                                                                                                                                                                                                                                    else
                                                                                                                                                                                                                                                      (_s2543_
                                                                                                                                                                                                                                                         _s1346_) >>= fun w__330 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                      (if
                                                                                                                                                                                                                                                         match w__330 with
                                                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                                                           (FSGNJN_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                            true
                                                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                                                            false
                                                                                                                                                                                                                                                         end
                                                                                                                                                                                                                                                       then
                                                                                                                                                                                                                                                         (_s2543_
                                                                                                                                                                                                                                                            _s1346_) >>= fun w__331 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                         (match w__331 with
                                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                                            (FSGNJN_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                             returnm (F_BIN_TYPE_S
                                                                                                                                                                                                                                                                        (rs2, rs1, rd, FSGNJN_S))
                                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                                             exit tt
                                                                                                                                                                                                                                                              : M (ast)
                                                                                                                                                                                                                                                          end)
                                                                                                                                                                                                                                                          : M (ast)
                                                                                                                                                                                                                                                       else
                                                                                                                                                                                                                                                         (_s2560_
                                                                                                                                                                                                                                                            _s1346_) >>= fun w__334 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                         (if
                                                                                                                                                                                                                                                            match w__334 with
                                                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                                                              (FSGNJX_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                               true
                                                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                                                               false
                                                                                                                                                                                                                                                            end
                                                                                                                                                                                                                                                          then
                                                                                                                                                                                                                                                            (_s2560_
                                                                                                                                                                                                                                                               _s1346_) >>= fun w__335 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                            (match w__335 with
                                                                                                                                                                                                                                                             | Some
                                                                                                                                                                                                                                                               (FSGNJX_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                returnm (F_BIN_TYPE_S
                                                                                                                                                                                                                                                                           (rs2, rs1, rd, FSGNJX_S))
                                                                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                                                                exit tt
                                                                                                                                                                                                                                                                 : M (ast)
                                                                                                                                                                                                                                                             end)
                                                                                                                                                                                                                                                             : M (ast)
                                                                                                                                                                                                                                                          else
                                                                                                                                                                                                                                                            (_s2577_
                                                                                                                                                                                                                                                               _s1346_) >>= fun w__338 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                            (if
                                                                                                                                                                                                                                                               match w__338 with
                                                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                                                 (FMIN_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                  true
                                                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                                                  false
                                                                                                                                                                                                                                                               end
                                                                                                                                                                                                                                                             then
                                                                                                                                                                                                                                                               (_s2577_
                                                                                                                                                                                                                                                                  _s1346_) >>= fun w__339 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                               (match w__339 with
                                                                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                                                                  (FMIN_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                   returnm (F_BIN_TYPE_S
                                                                                                                                                                                                                                                                              (rs2, rs1, rd, FMIN_S))
                                                                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                                                                   exit tt
                                                                                                                                                                                                                                                                    : M (ast)
                                                                                                                                                                                                                                                                end)
                                                                                                                                                                                                                                                                : M (ast)
                                                                                                                                                                                                                                                             else
                                                                                                                                                                                                                                                               (_s2594_
                                                                                                                                                                                                                                                                  _s1346_) >>= fun w__342 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                               (if
                                                                                                                                                                                                                                                                  match w__342 with
                                                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                                                    (FMAX_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                     true
                                                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                                                     false
                                                                                                                                                                                                                                                                  end
                                                                                                                                                                                                                                                                then
                                                                                                                                                                                                                                                                  (_s2594_
                                                                                                                                                                                                                                                                     _s1346_) >>= fun w__343 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                  (match w__343 with
                                                                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                                                                     (FMAX_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                      returnm (F_BIN_TYPE_S
                                                                                                                                                                                                                                                                                 (rs2, rs1, rd, FMAX_S))
                                                                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                                                                      exit tt
                                                                                                                                                                                                                                                                       : M (ast)
                                                                                                                                                                                                                                                                   end)
                                                                                                                                                                                                                                                                   : M (ast)
                                                                                                                                                                                                                                                                else
                                                                                                                                                                                                                                                                  (_s2611_
                                                                                                                                                                                                                                                                     _s1346_) >>= fun w__346 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                  (if
                                                                                                                                                                                                                                                                     match w__346 with
                                                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                                                       (FEQ_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                        true
                                                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                                                        false
                                                                                                                                                                                                                                                                     end
                                                                                                                                                                                                                                                                   then
                                                                                                                                                                                                                                                                     (_s2611_
                                                                                                                                                                                                                                                                        _s1346_) >>= fun w__347 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                     (match w__347 with
                                                                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                                                                        (FEQ_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                         returnm (F_BIN_TYPE_S
                                                                                                                                                                                                                                                                                    (rs2, rs1, rd, FEQ_S))
                                                                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                                                                         exit tt
                                                                                                                                                                                                                                                                          : M (ast)
                                                                                                                                                                                                                                                                      end)
                                                                                                                                                                                                                                                                      : M (ast)
                                                                                                                                                                                                                                                                   else
                                                                                                                                                                                                                                                                     (_s2628_
                                                                                                                                                                                                                                                                        _s1346_) >>= fun w__350 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                     (if
                                                                                                                                                                                                                                                                        match w__350 with
                                                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                                                          (FLT_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                           true
                                                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                                                           false
                                                                                                                                                                                                                                                                        end
                                                                                                                                                                                                                                                                      then
                                                                                                                                                                                                                                                                        (_s2628_
                                                                                                                                                                                                                                                                           _s1346_) >>= fun w__351 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                        (match w__351 with
                                                                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                                                                           (FLT_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                            returnm (F_BIN_TYPE_S
                                                                                                                                                                                                                                                                                       (rs2, rs1, rd, FLT_S))
                                                                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                                                                            exit tt
                                                                                                                                                                                                                                                                             : M (ast)
                                                                                                                                                                                                                                                                         end)
                                                                                                                                                                                                                                                                         : M (ast)
                                                                                                                                                                                                                                                                      else
                                                                                                                                                                                                                                                                        (_s2645_
                                                                                                                                                                                                                                                                           _s1346_) >>= fun w__354 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                        (if
                                                                                                                                                                                                                                                                           match w__354 with
                                                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                                                             (FLE_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                              true
                                                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                                                              false
                                                                                                                                                                                                                                                                           end
                                                                                                                                                                                                                                                                         then
                                                                                                                                                                                                                                                                           (_s2645_
                                                                                                                                                                                                                                                                              _s1346_) >>= fun w__355 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                           (match w__355 with
                                                                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                                                                              (FLE_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                               returnm (F_BIN_TYPE_S
                                                                                                                                                                                                                                                                                          (rs2, rs1, rd, FLE_S))
                                                                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                                                                               exit tt
                                                                                                                                                                                                                                                                                : M (ast)
                                                                                                                                                                                                                                                                            end)
                                                                                                                                                                                                                                                                            : M (ast)
                                                                                                                                                                                                                                                                         else
                                                                                                                                                                                                                                                                           (_s2662_
                                                                                                                                                                                                                                                                              _s1346_) >>= fun w__358 : option ((f_un_op_S * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                           (if
                                                                                                                                                                                                                                                                              match w__358 with
                                                                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                                                                (FMV_X_W, rd, rs1) =>
                                                                                                                                                                                                                                                                                 true
                                                                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                                                                 false
                                                                                                                                                                                                                                                                              end
                                                                                                                                                                                                                                                                            then
                                                                                                                                                                                                                                                                              (_s2662_
                                                                                                                                                                                                                                                                                 _s1346_) >>= fun w__359 : option ((f_un_op_S * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                              (match w__359 with
                                                                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                                                                 (FMV_X_W, rd, rs1) =>
                                                                                                                                                                                                                                                                                  returnm (F_UN_TYPE_S
                                                                                                                                                                                                                                                                                             (rs1, rd, FMV_X_W))
                                                                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                                                                  exit tt
                                                                                                                                                                                                                                                                                   : M (ast)
                                                                                                                                                                                                                                                                               end)
                                                                                                                                                                                                                                                                               : M (ast)
                                                                                                                                                                                                                                                                            else
                                                                                                                                                                                                                                                                              (_s2675_
                                                                                                                                                                                                                                                                                 _s1346_) >>= fun w__362 : option ((f_un_op_S * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                              (if
                                                                                                                                                                                                                                                                                 match w__362 with
                                                                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                                                                   (FMV_W_X, rd, rs1) =>
                                                                                                                                                                                                                                                                                    true
                                                                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                                                                    false
                                                                                                                                                                                                                                                                                 end
                                                                                                                                                                                                                                                                               then
                                                                                                                                                                                                                                                                                 (_s2675_
                                                                                                                                                                                                                                                                                    _s1346_) >>= fun w__363 : option ((f_un_op_S * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                 (match w__363 with
                                                                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                                                                    (FMV_W_X, rd, rs1) =>
                                                                                                                                                                                                                                                                                     returnm (F_UN_TYPE_S
                                                                                                                                                                                                                                                                                                (rs1, rd, FMV_W_X))
                                                                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                                                                     exit tt
                                                                                                                                                                                                                                                                                      : M (ast)
                                                                                                                                                                                                                                                                                  end)
                                                                                                                                                                                                                                                                                  : M (ast)
                                                                                                                                                                                                                                                                               else
                                                                                                                                                                                                                                                                                 (_s2688_
                                                                                                                                                                                                                                                                                    _s1346_) >>= fun w__366 : option ((f_un_op_S * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                 (if
                                                                                                                                                                                                                                                                                    match w__366 with
                                                                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                                                                      (FCLASS_S, rd, rs1) =>
                                                                                                                                                                                                                                                                                       true
                                                                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                                                                       false
                                                                                                                                                                                                                                                                                    end
                                                                                                                                                                                                                                                                                  then
                                                                                                                                                                                                                                                                                    (_s2688_
                                                                                                                                                                                                                                                                                       _s1346_) >>= fun w__367 : option ((f_un_op_S * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                    (match w__367 with
                                                                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                                                                       (FCLASS_S, rd, rs1) =>
                                                                                                                                                                                                                                                                                        returnm (F_UN_TYPE_S
                                                                                                                                                                                                                                                                                                   (rs1, rd, FCLASS_S))
                                                                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                                                                        exit tt
                                                                                                                                                                                                                                                                                         : M (ast)
                                                                                                                                                                                                                                                                                     end)
                                                                                                                                                                                                                                                                                     : M (ast)
                                                                                                                                                                                                                                                                                  else
                                                                                                                                                                                                                                                                                    (_s2701_
                                                                                                                                                                                                                                                                                       _s1346_) >>= fun w__370 : option ((mword 5 * mword 6)) =>
                                                                                                                                                                                                                                                                                    (if
                                                                                                                                                                                                                                                                                       match w__370 with
                                                                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                                                                         (rd, imm) =>
                                                                                                                                                                                                                                                                                          Z.eqb
                                                                                                                                                                                                                                                                                            64
                                                                                                                                                                                                                                                                                            32
                                                                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                                                                          false
                                                                                                                                                                                                                                                                                       end
                                                                                                                                                                                                                                                                                     then
                                                                                                                                                                                                                                                                                       (_s2701_
                                                                                                                                                                                                                                                                                          _s1346_) >>= fun w__371 : option ((mword 5 * mword 6)) =>
                                                                                                                                                                                                                                                                                       (match w__371 with
                                                                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                                                                          (rd, imm) =>
                                                                                                                                                                                                                                                                                           returnm (C_FLWSP
                                                                                                                                                                                                                                                                                                      (imm, rd))
                                                                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                                                                           exit tt
                                                                                                                                                                                                                                                                                            : M (ast)
                                                                                                                                                                                                                                                                                        end)
                                                                                                                                                                                                                                                                                        : M (ast)
                                                                                                                                                                                                                                                                                     else
                                                                                                                                                                                                                                                                                       (_s2713_
                                                                                                                                                                                                                                                                                          _s1346_) >>= fun w__374 : option ((mword 5 * mword 6)) =>
                                                                                                                                                                                                                                                                                       (if
                                                                                                                                                                                                                                                                                          match w__374 with
                                                                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                                                                            (rd, uimm) =>
                                                                                                                                                                                                                                                                                             Z.eqb
                                                                                                                                                                                                                                                                                               64
                                                                                                                                                                                                                                                                                               32
                                                                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                                                                             false
                                                                                                                                                                                                                                                                                          end
                                                                                                                                                                                                                                                                                        then
                                                                                                                                                                                                                                                                                          (_s2713_
                                                                                                                                                                                                                                                                                             _s1346_) >>= fun w__375 : option ((mword 5 * mword 6)) =>
                                                                                                                                                                                                                                                                                          (match w__375 with
                                                                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                                                                             (rd, uimm) =>
                                                                                                                                                                                                                                                                                              returnm (C_FSWSP
                                                                                                                                                                                                                                                                                                         (uimm, rd))
                                                                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                                                                              exit tt
                                                                                                                                                                                                                                                                                               : M (ast)
                                                                                                                                                                                                                                                                                           end)
                                                                                                                                                                                                                                                                                           : M (ast)
                                                                                                                                                                                                                                                                                        else
                                                                                                                                                                                                                                                                                          (_s2725_
                                                                                                                                                                                                                                                                                             _s1346_) >>= fun w__378 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                                                                                                                                                                                                                                          (if
                                                                                                                                                                                                                                                                                             match w__378 with
                                                                                                                                                                                                                                                                                             | Some
                                                                                                                                                                                                                                                                                               (rdc, rsc, uimm) =>
                                                                                                                                                                                                                                                                                                Z.eqb
                                                                                                                                                                                                                                                                                                  64
                                                                                                                                                                                                                                                                                                  32
                                                                                                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                                                                                                false
                                                                                                                                                                                                                                                                                             end
                                                                                                                                                                                                                                                                                           then
                                                                                                                                                                                                                                                                                             (_s2725_
                                                                                                                                                                                                                                                                                                _s1346_) >>= fun w__379 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                                                                                                                                                                                                                                             (match w__379 with
                                                                                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                                                                                (rdc, rsc, uimm) =>
                                                                                                                                                                                                                                                                                                 returnm (C_FLW
                                                                                                                                                                                                                                                                                                            (uimm, rsc, rdc))
                                                                                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                                                                                 exit tt
                                                                                                                                                                                                                                                                                                  : M (ast)
                                                                                                                                                                                                                                                                                              end)
                                                                                                                                                                                                                                                                                              : M (ast)
                                                                                                                                                                                                                                                                                           else
                                                                                                                                                                                                                                                                                             (_s2741_
                                                                                                                                                                                                                                                                                                _s1346_) >>= fun w__382 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                                                                                                                                                                                                                                             (if
                                                                                                                                                                                                                                                                                                match w__382 with
                                                                                                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                                                                                                  (rsc1, rsc2, uimm) =>
                                                                                                                                                                                                                                                                                                   Z.eqb
                                                                                                                                                                                                                                                                                                     64
                                                                                                                                                                                                                                                                                                     32
                                                                                                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                                                                                                   false
                                                                                                                                                                                                                                                                                                end
                                                                                                                                                                                                                                                                                              then
                                                                                                                                                                                                                                                                                                (_s2741_
                                                                                                                                                                                                                                                                                                   _s1346_) >>= fun w__383 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                                                                                                                                                                                                                                                (match w__383 with
                                                                                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                                                                                   (rsc1, rsc2, uimm) =>
                                                                                                                                                                                                                                                                                                    returnm (C_FSW
                                                                                                                                                                                                                                                                                                               (uimm, rsc1, rsc2))
                                                                                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                                                                                    exit tt
                                                                                                                                                                                                                                                                                                     : M (ast)
                                                                                                                                                                                                                                                                                                 end)
                                                                                                                                                                                                                                                                                                 : M (ast)
                                                                                                                                                                                                                                                                                              else
                                                                                                                                                                                                                                                                                                (_s2757_
                                                                                                                                                                                                                                                                                                   _s1346_) >>= fun w__386 : option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                (if
                                                                                                                                                                                                                                                                                                   match w__386 with
                                                                                                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                                                                                                     (op, rd, rs1, rs2, rs3, rm) =>
                                                                                                                                                                                                                                                                                                      true
                                                                                                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                                                                                                      false
                                                                                                                                                                                                                                                                                                   end
                                                                                                                                                                                                                                                                                                 then
                                                                                                                                                                                                                                                                                                   (_s2757_
                                                                                                                                                                                                                                                                                                      _s1346_) >>= fun w__387 : option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                   (match w__387 with
                                                                                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                                                                                      (op, rd, rs1, rs2, rs3, rm) =>
                                                                                                                                                                                                                                                                                                       returnm (F_MADD_TYPE_D
                                                                                                                                                                                                                                                                                                                  (rs3, rs2, rs1, rm, rd, op))
                                                                                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                                                                                       exit tt
                                                                                                                                                                                                                                                                                                        : M (ast)
                                                                                                                                                                                                                                                                                                    end)
                                                                                                                                                                                                                                                                                                    : M (ast)
                                                                                                                                                                                                                                                                                                 else
                                                                                                                                                                                                                                                                                                   (_s2782_
                                                                                                                                                                                                                                                                                                      _s1346_) >>= fun w__390 : option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                   (if
                                                                                                                                                                                                                                                                                                      match w__390 with
                                                                                                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                                                                                                        (op, rd, rs1, rs2, rm) =>
                                                                                                                                                                                                                                                                                                         true
                                                                                                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                                                                                                         false
                                                                                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                                                                                    then
                                                                                                                                                                                                                                                                                                      (_s2782_
                                                                                                                                                                                                                                                                                                         _s1346_) >>= fun w__391 : option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                      (match w__391 with
                                                                                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                                                                                         (op, rd, rs1, rs2, rm) =>
                                                                                                                                                                                                                                                                                                          returnm (F_BIN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                     (rs2, rs1, rm, rd, op))
                                                                                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                                                                                          exit tt
                                                                                                                                                                                                                                                                                                           : M (ast)
                                                                                                                                                                                                                                                                                                       end)
                                                                                                                                                                                                                                                                                                       : M (ast)
                                                                                                                                                                                                                                                                                                    else
                                                                                                                                                                                                                                                                                                      (_s2803_
                                                                                                                                                                                                                                                                                                         _s1346_) >>= fun w__394 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                      (if
                                                                                                                                                                                                                                                                                                         match w__394 with
                                                                                                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                                                                                                           (FSQRT_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                            true
                                                                                                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                                                                                                            false
                                                                                                                                                                                                                                                                                                         end
                                                                                                                                                                                                                                                                                                       then
                                                                                                                                                                                                                                                                                                         (_s2803_
                                                                                                                                                                                                                                                                                                            _s1346_) >>= fun w__395 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                         (match w__395 with
                                                                                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                                                                                            (FSQRT_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                             returnm (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                        (rs1, rm, rd, FSQRT_D))
                                                                                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                                                                                             exit tt
                                                                                                                                                                                                                                                                                                              : M (ast)
                                                                                                                                                                                                                                                                                                          end)
                                                                                                                                                                                                                                                                                                          : M (ast)
                                                                                                                                                                                                                                                                                                       else
                                                                                                                                                                                                                                                                                                         (_s2820_
                                                                                                                                                                                                                                                                                                            _s1346_) >>= fun w__398 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                         (if
                                                                                                                                                                                                                                                                                                            match w__398 with
                                                                                                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                                                                                                              (FCVT_W_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                               true
                                                                                                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                                                                                                               false
                                                                                                                                                                                                                                                                                                            end
                                                                                                                                                                                                                                                                                                          then
                                                                                                                                                                                                                                                                                                            (_s2820_
                                                                                                                                                                                                                                                                                                               _s1346_) >>= fun w__399 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                            (match w__399 with
                                                                                                                                                                                                                                                                                                             | Some
                                                                                                                                                                                                                                                                                                               (FCVT_W_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                returnm (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                           (rs1, rm, rd, FCVT_W_D))
                                                                                                                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                                                                                                                exit tt
                                                                                                                                                                                                                                                                                                                 : M (ast)
                                                                                                                                                                                                                                                                                                             end)
                                                                                                                                                                                                                                                                                                             : M (ast)
                                                                                                                                                                                                                                                                                                          else
                                                                                                                                                                                                                                                                                                            (_s2837_
                                                                                                                                                                                                                                                                                                               _s1346_) >>= fun w__402 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                            (if
                                                                                                                                                                                                                                                                                                               match w__402 with
                                                                                                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                                                                                                 (FCVT_WU_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                  true
                                                                                                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                                                                                                  false
                                                                                                                                                                                                                                                                                                               end
                                                                                                                                                                                                                                                                                                             then
                                                                                                                                                                                                                                                                                                               (_s2837_
                                                                                                                                                                                                                                                                                                                  _s1346_) >>= fun w__403 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                               (match w__403 with
                                                                                                                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                                                                                                                  (FCVT_WU_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                   returnm (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                              (rs1, rm, rd, FCVT_WU_D))
                                                                                                                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                                                                                                                   exit tt
                                                                                                                                                                                                                                                                                                                    : M (ast)
                                                                                                                                                                                                                                                                                                                end)
                                                                                                                                                                                                                                                                                                                : M (ast)
                                                                                                                                                                                                                                                                                                             else
                                                                                                                                                                                                                                                                                                               (_s2854_
                                                                                                                                                                                                                                                                                                                  _s1346_) >>= fun w__406 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                               (if
                                                                                                                                                                                                                                                                                                                  match w__406 with
                                                                                                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                                                                                                    (FCVT_D_W, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                     true
                                                                                                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                                                                                                     false
                                                                                                                                                                                                                                                                                                                  end
                                                                                                                                                                                                                                                                                                                then
                                                                                                                                                                                                                                                                                                                  (_s2854_
                                                                                                                                                                                                                                                                                                                     _s1346_) >>= fun w__407 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                  (match w__407 with
                                                                                                                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                                                                                                                     (FCVT_D_W, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                      returnm (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                                 (rs1, rm, rd, FCVT_D_W))
                                                                                                                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                                                                                                                      exit tt
                                                                                                                                                                                                                                                                                                                       : M (ast)
                                                                                                                                                                                                                                                                                                                   end)
                                                                                                                                                                                                                                                                                                                   : M (ast)
                                                                                                                                                                                                                                                                                                                else
                                                                                                                                                                                                                                                                                                                  (_s2871_
                                                                                                                                                                                                                                                                                                                     _s1346_) >>= fun w__410 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                  (if
                                                                                                                                                                                                                                                                                                                     match w__410 with
                                                                                                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                                                                                                       (FCVT_D_WU, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                        true
                                                                                                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                                                                                                        false
                                                                                                                                                                                                                                                                                                                     end
                                                                                                                                                                                                                                                                                                                   then
                                                                                                                                                                                                                                                                                                                     (_s2871_
                                                                                                                                                                                                                                                                                                                        _s1346_) >>= fun w__411 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                     (match w__411 with
                                                                                                                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                                                                                                                        (FCVT_D_WU, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                         returnm (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                                    (rs1, rm, rd, FCVT_D_WU))
                                                                                                                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                                                                                                                         exit tt
                                                                                                                                                                                                                                                                                                                          : M (ast)
                                                                                                                                                                                                                                                                                                                      end)
                                                                                                                                                                                                                                                                                                                      : M (ast)
                                                                                                                                                                                                                                                                                                                   else
                                                                                                                                                                                                                                                                                                                     (_s2888_
                                                                                                                                                                                                                                                                                                                        _s1346_) >>= fun w__414 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                     (if
                                                                                                                                                                                                                                                                                                                        match w__414 with
                                                                                                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                                                                                                          (FCVT_L_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                           true
                                                                                                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                                                                                                           false
                                                                                                                                                                                                                                                                                                                        end
                                                                                                                                                                                                                                                                                                                      then
                                                                                                                                                                                                                                                                                                                        (_s2888_
                                                                                                                                                                                                                                                                                                                           _s1346_) >>= fun w__415 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                        (match w__415 with
                                                                                                                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                                                                                                                           (FCVT_L_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                            returnm (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                                       (rs1, rm, rd, FCVT_L_D))
                                                                                                                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                                                                                                                            exit tt
                                                                                                                                                                                                                                                                                                                             : M (ast)
                                                                                                                                                                                                                                                                                                                         end)
                                                                                                                                                                                                                                                                                                                         : M (ast)
                                                                                                                                                                                                                                                                                                                      else
                                                                                                                                                                                                                                                                                                                        (_s2905_
                                                                                                                                                                                                                                                                                                                           _s1346_) >>= fun w__418 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                        (if
                                                                                                                                                                                                                                                                                                                           match w__418 with
                                                                                                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                                                                                                             (FCVT_LU_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                              true
                                                                                                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                                                                                                              false
                                                                                                                                                                                                                                                                                                                           end
                                                                                                                                                                                                                                                                                                                         then
                                                                                                                                                                                                                                                                                                                           (_s2905_
                                                                                                                                                                                                                                                                                                                              _s1346_) >>= fun w__419 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                           (match w__419 with
                                                                                                                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                                                                                                                              (FCVT_LU_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                               returnm (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                                          (rs1, rm, rd, FCVT_LU_D))
                                                                                                                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                                                                                                                               exit tt
                                                                                                                                                                                                                                                                                                                                : M (ast)
                                                                                                                                                                                                                                                                                                                            end)
                                                                                                                                                                                                                                                                                                                            : M (ast)
                                                                                                                                                                                                                                                                                                                         else
                                                                                                                                                                                                                                                                                                                           (_s2922_
                                                                                                                                                                                                                                                                                                                              _s1346_) >>= fun w__422 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                           (if
                                                                                                                                                                                                                                                                                                                              match w__422 with
                                                                                                                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                                                                                                                (FCVT_D_L, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                                 true
                                                                                                                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                                                                                                                 false
                                                                                                                                                                                                                                                                                                                              end
                                                                                                                                                                                                                                                                                                                            then
                                                                                                                                                                                                                                                                                                                              (_s2922_
                                                                                                                                                                                                                                                                                                                                 _s1346_) >>= fun w__423 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                              (match w__423 with
                                                                                                                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                                                                                                                 (FCVT_D_L, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                                  returnm (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                                             (rs1, rm, rd, FCVT_D_L))
                                                                                                                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                                                                                                                  exit tt
                                                                                                                                                                                                                                                                                                                                   : M (ast)
                                                                                                                                                                                                                                                                                                                               end)
                                                                                                                                                                                                                                                                                                                               : M (ast)
                                                                                                                                                                                                                                                                                                                            else
                                                                                                                                                                                                                                                                                                                              (_s2939_
                                                                                                                                                                                                                                                                                                                                 _s1346_) >>= fun w__426 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                              (if
                                                                                                                                                                                                                                                                                                                                 match w__426 with
                                                                                                                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                                                                                                                   (FCVT_D_LU, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                                    true
                                                                                                                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                                                                                                                    false
                                                                                                                                                                                                                                                                                                                                 end
                                                                                                                                                                                                                                                                                                                               then
                                                                                                                                                                                                                                                                                                                                 (_s2939_
                                                                                                                                                                                                                                                                                                                                    _s1346_) >>= fun w__427 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                                 (match w__427 with
                                                                                                                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                                                                                                                    (FCVT_D_LU, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                                     returnm (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                                                (rs1, rm, rd, FCVT_D_LU))
                                                                                                                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                                                                                                                     exit tt
                                                                                                                                                                                                                                                                                                                                      : M (ast)
                                                                                                                                                                                                                                                                                                                                  end)
                                                                                                                                                                                                                                                                                                                                  : M (ast)
                                                                                                                                                                                                                                                                                                                               else
                                                                                                                                                                                                                                                                                                                                 (_s2956_
                                                                                                                                                                                                                                                                                                                                    _s1346_) >>= fun w__430 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                                 (if
                                                                                                                                                                                                                                                                                                                                    match w__430 with
                                                                                                                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                                                                                                                      (FCVT_S_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                                       true
                                                                                                                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                                                                                                                       false
                                                                                                                                                                                                                                                                                                                                    end
                                                                                                                                                                                                                                                                                                                                  then
                                                                                                                                                                                                                                                                                                                                    (_s2956_
                                                                                                                                                                                                                                                                                                                                       _s1346_) >>= fun w__431 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                                    (match w__431 with
                                                                                                                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                                                                                                                       (FCVT_S_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                                        returnm (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                                                   (rs1, rm, rd, FCVT_S_D))
                                                                                                                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                                                                                                                        exit tt
                                                                                                                                                                                                                                                                                                                                         : M (ast)
                                                                                                                                                                                                                                                                                                                                     end)
                                                                                                                                                                                                                                                                                                                                     : M (ast)
                                                                                                                                                                                                                                                                                                                                  else
                                                                                                                                                                                                                                                                                                                                    (_s2973_
                                                                                                                                                                                                                                                                                                                                       _s1346_) >>= fun w__434 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                                    (if
                                                                                                                                                                                                                                                                                                                                       match w__434 with
                                                                                                                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                                                                                                                         (FCVT_D_S, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                                          true
                                                                                                                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                                                                                                                          false
                                                                                                                                                                                                                                                                                                                                       end
                                                                                                                                                                                                                                                                                                                                     then
                                                                                                                                                                                                                                                                                                                                       (_s2973_
                                                                                                                                                                                                                                                                                                                                          _s1346_) >>= fun w__435 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                                       (match w__435 with
                                                                                                                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                                                                                                                          (FCVT_D_S, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                                           returnm (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                                                      (rs1, rm, rd, FCVT_D_S))
                                                                                                                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                                                                                                                           exit tt
                                                                                                                                                                                                                                                                                                                                            : M (ast)
                                                                                                                                                                                                                                                                                                                                        end)
                                                                                                                                                                                                                                                                                                                                        : M (ast)
                                                                                                                                                                                                                                                                                                                                     else
                                                                                                                                                                                                                                                                                                                                       (_s2990_
                                                                                                                                                                                                                                                                                                                                          _s1346_) >>= fun w__438 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                       (if
                                                                                                                                                                                                                                                                                                                                          match w__438 with
                                                                                                                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                                                                                                                            (FSGNJ_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                             true
                                                                                                                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                                                                                                                             false
                                                                                                                                                                                                                                                                                                                                          end
                                                                                                                                                                                                                                                                                                                                        then
                                                                                                                                                                                                                                                                                                                                          (_s2990_
                                                                                                                                                                                                                                                                                                                                             _s1346_) >>= fun w__439 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                          (match w__439 with
                                                                                                                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                                                                                                                             (FSGNJ_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                              returnm (F_BIN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                         (rs2, rs1, rd, FSGNJ_D))
                                                                                                                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                                                                                                                              exit tt
                                                                                                                                                                                                                                                                                                                                               : M (ast)
                                                                                                                                                                                                                                                                                                                                           end)
                                                                                                                                                                                                                                                                                                                                           : M (ast)
                                                                                                                                                                                                                                                                                                                                        else
                                                                                                                                                                                                                                                                                                                                          (_s3007_
                                                                                                                                                                                                                                                                                                                                             _s1346_) >>= fun w__442 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                          (if
                                                                                                                                                                                                                                                                                                                                             match w__442 with
                                                                                                                                                                                                                                                                                                                                             | Some
                                                                                                                                                                                                                                                                                                                                               (FSGNJN_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                true
                                                                                                                                                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                                                                                                                                                false
                                                                                                                                                                                                                                                                                                                                             end
                                                                                                                                                                                                                                                                                                                                           then
                                                                                                                                                                                                                                                                                                                                             (_s3007_
                                                                                                                                                                                                                                                                                                                                                _s1346_) >>= fun w__443 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                             (match w__443 with
                                                                                                                                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                                                                                                                                (FSGNJN_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                 returnm (F_BIN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                            (rs2, rs1, rd, FSGNJN_D))
                                                                                                                                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                                                                                                                                 exit tt
                                                                                                                                                                                                                                                                                                                                                  : M (ast)
                                                                                                                                                                                                                                                                                                                                              end)
                                                                                                                                                                                                                                                                                                                                              : M (ast)
                                                                                                                                                                                                                                                                                                                                           else
                                                                                                                                                                                                                                                                                                                                             (_s3024_
                                                                                                                                                                                                                                                                                                                                                _s1346_) >>= fun w__446 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                             (if
                                                                                                                                                                                                                                                                                                                                                match w__446 with
                                                                                                                                                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                                                                                                                                                  (FSGNJX_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                   true
                                                                                                                                                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                                                                                                                                                   false
                                                                                                                                                                                                                                                                                                                                                end
                                                                                                                                                                                                                                                                                                                                              then
                                                                                                                                                                                                                                                                                                                                                (_s3024_
                                                                                                                                                                                                                                                                                                                                                   _s1346_) >>= fun w__447 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                (match w__447 with
                                                                                                                                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                                                                                                                                   (FSGNJX_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                    returnm (F_BIN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                               (rs2, rs1, rd, FSGNJX_D))
                                                                                                                                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                                                                                                                                    exit tt
                                                                                                                                                                                                                                                                                                                                                     : M (ast)
                                                                                                                                                                                                                                                                                                                                                 end)
                                                                                                                                                                                                                                                                                                                                                 : M (ast)
                                                                                                                                                                                                                                                                                                                                              else
                                                                                                                                                                                                                                                                                                                                                (_s3041_
                                                                                                                                                                                                                                                                                                                                                   _s1346_) >>= fun w__450 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                (if
                                                                                                                                                                                                                                                                                                                                                   match w__450 with
                                                                                                                                                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                                                                                                                                                     (FMIN_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                      true
                                                                                                                                                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                                                                                                                                                      false
                                                                                                                                                                                                                                                                                                                                                   end
                                                                                                                                                                                                                                                                                                                                                 then
                                                                                                                                                                                                                                                                                                                                                   (_s3041_
                                                                                                                                                                                                                                                                                                                                                      _s1346_) >>= fun w__451 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                   (match w__451 with
                                                                                                                                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                                                                                                                                      (FMIN_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                       returnm (F_BIN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                                  (rs2, rs1, rd, FMIN_D))
                                                                                                                                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                                                                                                                                       exit tt
                                                                                                                                                                                                                                                                                                                                                        : M (ast)
                                                                                                                                                                                                                                                                                                                                                    end)
                                                                                                                                                                                                                                                                                                                                                    : M (ast)
                                                                                                                                                                                                                                                                                                                                                 else
                                                                                                                                                                                                                                                                                                                                                   (_s3058_
                                                                                                                                                                                                                                                                                                                                                      _s1346_) >>= fun w__454 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                   (if
                                                                                                                                                                                                                                                                                                                                                      match w__454 with
                                                                                                                                                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                                                                                                                                                        (FMAX_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                         true
                                                                                                                                                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                                                                                                                                                         false
                                                                                                                                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                                                                                                                                    then
                                                                                                                                                                                                                                                                                                                                                      (_s3058_
                                                                                                                                                                                                                                                                                                                                                         _s1346_) >>= fun w__455 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                      (match w__455 with
                                                                                                                                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                                                                                                                                         (FMAX_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                          returnm (F_BIN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                                     (rs2, rs1, rd, FMAX_D))
                                                                                                                                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                                                                                                                                          exit tt
                                                                                                                                                                                                                                                                                                                                                           : M (ast)
                                                                                                                                                                                                                                                                                                                                                       end)
                                                                                                                                                                                                                                                                                                                                                       : M (ast)
                                                                                                                                                                                                                                                                                                                                                    else
                                                                                                                                                                                                                                                                                                                                                      (_s3075_
                                                                                                                                                                                                                                                                                                                                                         _s1346_) >>= fun w__458 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                      (if
                                                                                                                                                                                                                                                                                                                                                         match w__458 with
                                                                                                                                                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                                                                                                                                                           (FEQ_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                            true
                                                                                                                                                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                                                                                                                                                            false
                                                                                                                                                                                                                                                                                                                                                         end
                                                                                                                                                                                                                                                                                                                                                       then
                                                                                                                                                                                                                                                                                                                                                         (_s3075_
                                                                                                                                                                                                                                                                                                                                                            _s1346_) >>= fun w__459 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                         (match w__459 with
                                                                                                                                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                                                                                                                                            (FEQ_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                             returnm (F_BIN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                                        (rs2, rs1, rd, FEQ_D))
                                                                                                                                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                                                                                                                                             exit tt
                                                                                                                                                                                                                                                                                                                                                              : M (ast)
                                                                                                                                                                                                                                                                                                                                                          end)
                                                                                                                                                                                                                                                                                                                                                          : M (ast)
                                                                                                                                                                                                                                                                                                                                                       else
                                                                                                                                                                                                                                                                                                                                                         (_s3092_
                                                                                                                                                                                                                                                                                                                                                            _s1346_) >>= fun w__462 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                         (if
                                                                                                                                                                                                                                                                                                                                                            match w__462 with
                                                                                                                                                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                                                                                                                                                              (FLT_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                               true
                                                                                                                                                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                                                                                                                                                               false
                                                                                                                                                                                                                                                                                                                                                            end
                                                                                                                                                                                                                                                                                                                                                          then
                                                                                                                                                                                                                                                                                                                                                            (_s3092_
                                                                                                                                                                                                                                                                                                                                                               _s1346_) >>= fun w__463 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                            (match w__463 with
                                                                                                                                                                                                                                                                                                                                                             | Some
                                                                                                                                                                                                                                                                                                                                                               (FLT_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                                returnm (F_BIN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                                           (rs2, rs1, rd, FLT_D))
                                                                                                                                                                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                                                                                                                                                                exit tt
                                                                                                                                                                                                                                                                                                                                                                 : M (ast)
                                                                                                                                                                                                                                                                                                                                                             end)
                                                                                                                                                                                                                                                                                                                                                             : M (ast)
                                                                                                                                                                                                                                                                                                                                                          else
                                                                                                                                                                                                                                                                                                                                                            (_s3109_
                                                                                                                                                                                                                                                                                                                                                               _s1346_) >>= fun w__466 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                            (if
                                                                                                                                                                                                                                                                                                                                                               match w__466 with
                                                                                                                                                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                                                                                                                                                 (FLE_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                                  true
                                                                                                                                                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                                                                                                                                                  false
                                                                                                                                                                                                                                                                                                                                                               end
                                                                                                                                                                                                                                                                                                                                                             then
                                                                                                                                                                                                                                                                                                                                                               (_s3109_
                                                                                                                                                                                                                                                                                                                                                                  _s1346_) >>= fun w__467 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                               (match w__467 with
                                                                                                                                                                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                                                                                                                                                                  (FLE_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                                   returnm (F_BIN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                                              (rs2, rs1, rd, FLE_D))
                                                                                                                                                                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                                                                                                                                                                   exit tt
                                                                                                                                                                                                                                                                                                                                                                    : M (ast)
                                                                                                                                                                                                                                                                                                                                                                end)
                                                                                                                                                                                                                                                                                                                                                                : M (ast)
                                                                                                                                                                                                                                                                                                                                                             else
                                                                                                                                                                                                                                                                                                                                                               (_s3126_
                                                                                                                                                                                                                                                                                                                                                                  _s1346_) >>= fun w__470 : option ((f_un_op_D * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                               (if
                                                                                                                                                                                                                                                                                                                                                                  match w__470 with
                                                                                                                                                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                                                                                                                                                    (FMV_X_D, rd, rs1) =>
                                                                                                                                                                                                                                                                                                                                                                     true
                                                                                                                                                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                                                                                                                                                     false
                                                                                                                                                                                                                                                                                                                                                                  end
                                                                                                                                                                                                                                                                                                                                                                then
                                                                                                                                                                                                                                                                                                                                                                  (_s3126_
                                                                                                                                                                                                                                                                                                                                                                     _s1346_) >>= fun w__471 : option ((f_un_op_D * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                                  (match w__471 with
                                                                                                                                                                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                                                                                                                                                                     (FMV_X_D, rd, rs1) =>
                                                                                                                                                                                                                                                                                                                                                                      returnm (F_UN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                                                 (rs1, rd, FMV_X_D))
                                                                                                                                                                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                                                                                                                                                                      exit tt
                                                                                                                                                                                                                                                                                                                                                                       : M (ast)
                                                                                                                                                                                                                                                                                                                                                                   end)
                                                                                                                                                                                                                                                                                                                                                                   : M (ast)
                                                                                                                                                                                                                                                                                                                                                                else
                                                                                                                                                                                                                                                                                                                                                                  (_s3139_
                                                                                                                                                                                                                                                                                                                                                                     _s1346_) >>= fun w__474 : option ((f_un_op_D * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                                  (if
                                                                                                                                                                                                                                                                                                                                                                     match w__474 with
                                                                                                                                                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                                                                                                                                                       (FMV_D_X, rd, rs1) =>
                                                                                                                                                                                                                                                                                                                                                                        true
                                                                                                                                                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                                                                                                                                                        false
                                                                                                                                                                                                                                                                                                                                                                     end
                                                                                                                                                                                                                                                                                                                                                                   then
                                                                                                                                                                                                                                                                                                                                                                     (_s3139_
                                                                                                                                                                                                                                                                                                                                                                        _s1346_) >>= fun w__475 : option ((f_un_op_D * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                                     (match w__475 with
                                                                                                                                                                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                                                                                                                                                                        (FMV_D_X, rd, rs1) =>
                                                                                                                                                                                                                                                                                                                                                                         returnm (F_UN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                                                    (rs1, rd, FMV_D_X))
                                                                                                                                                                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                                                                                                                                                                         exit tt
                                                                                                                                                                                                                                                                                                                                                                          : M (ast)
                                                                                                                                                                                                                                                                                                                                                                      end)
                                                                                                                                                                                                                                                                                                                                                                      : M (ast)
                                                                                                                                                                                                                                                                                                                                                                   else
                                                                                                                                                                                                                                                                                                                                                                     (_s3152_
                                                                                                                                                                                                                                                                                                                                                                        _s1346_) >>= fun w__478 : option ((f_un_op_D * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                                     (if
                                                                                                                                                                                                                                                                                                                                                                        match w__478 with
                                                                                                                                                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                                                                                                                                                          (FCLASS_D, rd, rs1) =>
                                                                                                                                                                                                                                                                                                                                                                           true
                                                                                                                                                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                                                                                                                                                           false
                                                                                                                                                                                                                                                                                                                                                                        end
                                                                                                                                                                                                                                                                                                                                                                      then
                                                                                                                                                                                                                                                                                                                                                                        (_s3152_
                                                                                                                                                                                                                                                                                                                                                                           _s1346_) >>= fun w__479 : option ((f_un_op_D * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                                        (match w__479 with
                                                                                                                                                                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                                                                                                                                                                           (FCLASS_D, rd, rs1) =>
                                                                                                                                                                                                                                                                                                                                                                            returnm (F_UN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                                                       (rs1, rd, FCLASS_D))
                                                                                                                                                                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                                                                                                                                                                            exit tt
                                                                                                                                                                                                                                                                                                                                                                             : M (ast)
                                                                                                                                                                                                                                                                                                                                                                         end)
                                                                                                                                                                                                                                                                                                                                                                         : M (ast)
                                                                                                                                                                                                                                                                                                                                                                      else
                                                                                                                                                                                                                                                                                                                                                                        (_s3165_
                                                                                                                                                                                                                                                                                                                                                                           _s1346_) >>= fun w__482 : option ((mword 5 * mword 6)) =>
                                                                                                                                                                                                                                                                                                                                                                        (if
                                                                                                                                                                                                                                                                                                                                                                           match w__482 with
                                                                                                                                                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                                                                                                                                                             (rd, uimm) =>
                                                                                                                                                                                                                                                                                                                                                                              orb
                                                                                                                                                                                                                                                                                                                                                                                (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                   64
                                                                                                                                                                                                                                                                                                                                                                                   32)
                                                                                                                                                                                                                                                                                                                                                                                (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                   64
                                                                                                                                                                                                                                                                                                                                                                                   64)
                                                                                                                                                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                                                                                                                                                              false
                                                                                                                                                                                                                                                                                                                                                                           end
                                                                                                                                                                                                                                                                                                                                                                         then
                                                                                                                                                                                                                                                                                                                                                                           (_s3165_
                                                                                                                                                                                                                                                                                                                                                                              _s1346_) >>= fun w__483 : option ((mword 5 * mword 6)) =>
                                                                                                                                                                                                                                                                                                                                                                           (match w__483 with
                                                                                                                                                                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                                                                                                                                                                              (rd, uimm) =>
                                                                                                                                                                                                                                                                                                                                                                               returnm (C_FLDSP
                                                                                                                                                                                                                                                                                                                                                                                          (uimm, rd))
                                                                                                                                                                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                                                                                                                                                                               exit tt
                                                                                                                                                                                                                                                                                                                                                                                : M (ast)
                                                                                                                                                                                                                                                                                                                                                                            end)
                                                                                                                                                                                                                                                                                                                                                                            : M (ast)
                                                                                                                                                                                                                                                                                                                                                                         else
                                                                                                                                                                                                                                                                                                                                                                           (_s3177_
                                                                                                                                                                                                                                                                                                                                                                              _s1346_) >>= fun w__486 : option ((mword 5 * mword 6)) =>
                                                                                                                                                                                                                                                                                                                                                                           (if
                                                                                                                                                                                                                                                                                                                                                                              match w__486 with
                                                                                                                                                                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                                                                                                                                                                (rs2, uimm) =>
                                                                                                                                                                                                                                                                                                                                                                                 orb
                                                                                                                                                                                                                                                                                                                                                                                   (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                      64
                                                                                                                                                                                                                                                                                                                                                                                      32)
                                                                                                                                                                                                                                                                                                                                                                                   (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                      64
                                                                                                                                                                                                                                                                                                                                                                                      64)
                                                                                                                                                                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                                                                                                                                                                 false
                                                                                                                                                                                                                                                                                                                                                                              end
                                                                                                                                                                                                                                                                                                                                                                            then
                                                                                                                                                                                                                                                                                                                                                                              (_s3177_
                                                                                                                                                                                                                                                                                                                                                                                 _s1346_) >>= fun w__487 : option ((mword 5 * mword 6)) =>
                                                                                                                                                                                                                                                                                                                                                                              (match w__487 with
                                                                                                                                                                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                                                                                                                                                                 (rs2, uimm) =>
                                                                                                                                                                                                                                                                                                                                                                                  returnm (C_FSDSP
                                                                                                                                                                                                                                                                                                                                                                                             (uimm, rs2))
                                                                                                                                                                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                                                                                                                                                                  exit tt
                                                                                                                                                                                                                                                                                                                                                                                   : M (ast)
                                                                                                                                                                                                                                                                                                                                                                               end)
                                                                                                                                                                                                                                                                                                                                                                               : M (ast)
                                                                                                                                                                                                                                                                                                                                                                            else
                                                                                                                                                                                                                                                                                                                                                                              (_s3189_
                                                                                                                                                                                                                                                                                                                                                                                 _s1346_) >>= fun w__490 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                                              (if
                                                                                                                                                                                                                                                                                                                                                                                 match w__490 with
                                                                                                                                                                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                                                                                                                                                                   (rdc, rsc, uimm) =>
                                                                                                                                                                                                                                                                                                                                                                                    orb
                                                                                                                                                                                                                                                                                                                                                                                      (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                         64
                                                                                                                                                                                                                                                                                                                                                                                         32)
                                                                                                                                                                                                                                                                                                                                                                                      (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                         64
                                                                                                                                                                                                                                                                                                                                                                                         64)
                                                                                                                                                                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                                                                                                                                                                    false
                                                                                                                                                                                                                                                                                                                                                                                 end
                                                                                                                                                                                                                                                                                                                                                                               then
                                                                                                                                                                                                                                                                                                                                                                                 (_s3189_
                                                                                                                                                                                                                                                                                                                                                                                    _s1346_) >>= fun w__491 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                                                 (match w__491 with
                                                                                                                                                                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                                                                                                                                                                    (rdc, rsc, uimm) =>
                                                                                                                                                                                                                                                                                                                                                                                     returnm (C_FLD
                                                                                                                                                                                                                                                                                                                                                                                                (uimm, rsc, rdc))
                                                                                                                                                                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                                                                                                                                                                     exit tt
                                                                                                                                                                                                                                                                                                                                                                                      : M (ast)
                                                                                                                                                                                                                                                                                                                                                                                  end)
                                                                                                                                                                                                                                                                                                                                                                                  : M (ast)
                                                                                                                                                                                                                                                                                                                                                                               else
                                                                                                                                                                                                                                                                                                                                                                                 (_s3205_
                                                                                                                                                                                                                                                                                                                                                                                    _s1346_) >>= fun w__494 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                                                 (if
                                                                                                                                                                                                                                                                                                                                                                                    match w__494 with
                                                                                                                                                                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                                                                                                                                                                      (rsc1, rsc2, uimm) =>
                                                                                                                                                                                                                                                                                                                                                                                       orb
                                                                                                                                                                                                                                                                                                                                                                                         (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                            64
                                                                                                                                                                                                                                                                                                                                                                                            32)
                                                                                                                                                                                                                                                                                                                                                                                         (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                            64
                                                                                                                                                                                                                                                                                                                                                                                            64)
                                                                                                                                                                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                                                                                                                                                                       false
                                                                                                                                                                                                                                                                                                                                                                                    end
                                                                                                                                                                                                                                                                                                                                                                                  then
                                                                                                                                                                                                                                                                                                                                                                                    (_s3205_
                                                                                                                                                                                                                                                                                                                                                                                       _s1346_) >>= fun w__495 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                                                    (match w__495 with
                                                                                                                                                                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                                                                                                                                                                       (rsc1, rsc2, uimm) =>
                                                                                                                                                                                                                                                                                                                                                                                        returnm (C_FSD
                                                                                                                                                                                                                                                                                                                                                                                                   (uimm, rsc1, rsc2))
                                                                                                                                                                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                                                                                                                                                                        exit tt
                                                                                                                                                                                                                                                                                                                                                                                         : M (ast)
                                                                                                                                                                                                                                                                                                                                                                                     end)
                                                                                                                                                                                                                                                                                                                                                                                     : M (ast)
                                                                                                                                                                                                                                                                                                                                                                                  else
                                                                                                                                                                                                                                                                                                                                                                                    (_s3221_
                                                                                                                                                                                                                                                                                                                                                                                       _s1346_) >>= fun w__498 : option (mword 32) =>
                                                                                                                                                                                                                                                                                                                                                                                    (if
                                                                                                                                                                                                                                                                                                                                                                                       match w__498 with
                                                                                                                                                                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                                                                                                                                                                         s =>
                                                                                                                                                                                                                                                                                                                                                                                          true
                                                                                                                                                                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                                                                                                                                                                          false
                                                                                                                                                                                                                                                                                                                                                                                       end
                                                                                                                                                                                                                                                                                                                                                                                     then
                                                                                                                                                                                                                                                                                                                                                                                       (_s3221_
                                                                                                                                                                                                                                                                                                                                                                                          _s1346_) >>= fun w__499 : option (mword 32) =>
                                                                                                                                                                                                                                                                                                                                                                                       (match w__499 with
                                                                                                                                                                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                                                                                                                                                                          s =>
                                                                                                                                                                                                                                                                                                                                                                                           returnm (ILLEGAL
                                                                                                                                                                                                                                                                                                                                                                                                      s)
                                                                                                                                                                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                                                                                                                                                                           exit tt
                                                                                                                                                                                                                                                                                                                                                                                            : M (ast)
                                                                                                                                                                                                                                                                                                                                                                                        end)
                                                                                                                                                                                                                                                                                                                                                                                        : M (ast)
                                                                                                                                                                                                                                                                                                                                                                                     else
                                                                                                                                                                                                                                                                                                                                                                                       (_s3229_
                                                                                                                                                                                                                                                                                                                                                                                          _s1346_) >>= fun w__502 : option (mword 16) =>
                                                                                                                                                                                                                                                                                                                                                                                       (if
                                                                                                                                                                                                                                                                                                                                                                                          match w__502 with
                                                                                                                                                                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                                                                                                                                                                            s =>
                                                                                                                                                                                                                                                                                                                                                                                             true
                                                                                                                                                                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                                                                                                                                                                             false
                                                                                                                                                                                                                                                                                                                                                                                          end
                                                                                                                                                                                                                                                                                                                                                                                        then
                                                                                                                                                                                                                                                                                                                                                                                          (_s3229_
                                                                                                                                                                                                                                                                                                                                                                                             _s1346_) >>= fun w__503 : option (mword 16) =>
                                                                                                                                                                                                                                                                                                                                                                                          (match w__503 with
                                                                                                                                                                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                                                                                                                                                                             s =>
                                                                                                                                                                                                                                                                                                                                                                                              returnm (C_ILLEGAL
                                                                                                                                                                                                                                                                                                                                                                                                         s)
                                                                                                                                                                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                                                                                                                                                                              exit tt
                                                                                                                                                                                                                                                                                                                                                                                               : M (ast)
                                                                                                                                                                                                                                                                                                                                                                                           end)
                                                                                                                                                                                                                                                                                                                                                                                           : M (ast)
                                                                                                                                                                                                                                                                                                                                                                                        else
                                                                                                                                                                                                                                                                                                                                                                                          assert_exp' false "Pattern match failure at unknown location" >>= fun _ =>
                                                                                                                                                                                                                                                                                                                                                                                          exit tt)
                                                                                                                                                                                                                                                                                                                                                                                        : M (ast))
                                                                                                                                                                                                                                                                                                                                                                                     : M (ast))
                                                                                                                                                                                                                                                                                                                                                                                  : M (ast))
                                                                                                                                                                                                                                                                                                                                                                               : M (ast))
                                                                                                                                                                                                                                                                                                                                                                            : M (ast))
                                                                                                                                                                                                                                                                                                                                                                         : M (ast))
                                                                                                                                                                                                                                                                                                                                                                      : M (ast))
                                                                                                                                                                                                                                                                                                                                                                   : M (ast))
                                                                                                                                                                                                                                                                                                                                                                : M (ast))
                                                                                                                                                                                                                                                                                                                                                             : M (ast))
                                                                                                                                                                                                                                                                                                                                                          : M (ast))
                                                                                                                                                                                                                                                                                                                                                       : M (ast))
                                                                                                                                                                                                                                                                                                                                                    : M (ast))
                                                                                                                                                                                                                                                                                                                                                 : M (ast))
                                                                                                                                                                                                                                                                                                                                              : M (ast))
                                                                                                                                                                                                                                                                                                                                           : M (ast))
                                                                                                                                                                                                                                                                                                                                        : M (ast))
                                                                                                                                                                                                                                                                                                                                     : M (ast))
                                                                                                                                                                                                                                                                                                                                  : M (ast))
                                                                                                                                                                                                                                                                                                                               : M (ast))
                                                                                                                                                                                                                                                                                                                            : M (ast))
                                                                                                                                                                                                                                                                                                                         : M (ast))
                                                                                                                                                                                                                                                                                                                      : M (ast))
                                                                                                                                                                                                                                                                                                                   : M (ast))
                                                                                                                                                                                                                                                                                                                : M (ast))
                                                                                                                                                                                                                                                                                                             : M (ast))
                                                                                                                                                                                                                                                                                                          : M (ast))
                                                                                                                                                                                                                                                                                                       : M (ast))
                                                                                                                                                                                                                                                                                                    : M (ast))
                                                                                                                                                                                                                                                                                                 : M (ast))
                                                                                                                                                                                                                                                                                              : M (ast))
                                                                                                                                                                                                                                                                                           : M (ast))
                                                                                                                                                                                                                                                                                        : M (ast))
                                                                                                                                                                                                                                                                                     : M (ast))
                                                                                                                                                                                                                                                                                  : M (ast))
                                                                                                                                                                                                                                                                               : M (ast))
                                                                                                                                                                                                                                                                            : M (ast))
                                                                                                                                                                                                                                                                         : M (ast))
                                                                                                                                                                                                                                                                      : M (ast))
                                                                                                                                                                                                                                                                   : M (ast))
                                                                                                                                                                                                                                                                : M (ast))
                                                                                                                                                                                                                                                             : M (ast))
                                                                                                                                                                                                                                                          : M (ast))
                                                                                                                                                                                                                                                       : M (ast))
                                                                                                                                                                                                                                                    : M (ast))
                                                                                                                                                                                                                                                 : M (ast))
                                                                                                                                                                                                                                              : M (ast))
                                                                                                                                                                                                                                           : M (ast))
                                                                                                                                                                                                                                        : M (ast))
                                                                                                                                                                                                                                     : M (ast))
                                                                                                                                                                                                                                  : M (ast))
                                                                                                                                                                                                                               : M (ast))
                                                                                                                                                                                                                            : M (ast))
                                                                                                                                                                                                                         : M (ast))
                                                                                                                                                                                                                      : M (ast))
                                                                                                                                                                                                                   : M (ast))
                                                                                                                                                                                                                : M (ast))
                                                                                                                                                                                                             : M (ast))
                                                                                                                                                                                                          : M (ast))
                                                                                                                                                                                                       : M (ast))
                                                                                                                                                                                                    : M (ast))
                                                                                                                                                                                                 : M (ast))
                                                                                                                                                                                              : M (ast))
                                                                                                                                                                                           : M (ast))
                                                                                                                                                                                        : M (ast))
                                                                                                                                                                                     : M (ast))
                                                                                                                                                                                  : M (ast))
                                                                                                                                                                               : M (ast))
                                                                                                                                                                            : M (ast))
                                                                                                                                                                         : M (ast))
                                                                                                                                                                      : M (ast))
                                                                                                                                                                   : M (ast))
                                                                                                                                                                : M (ast))
                                                                                                                                                             : M (ast))
                                                                                                                                                          : M (ast))
                                                                                                                                                       : M (ast))
                                                                                                                                                    : M (ast))
                                                                                                                                                 : M (ast))
                                                                                                                                              : M (ast))
                                                                                                                                           : M (ast))
                                                                                                                                        : M (ast))
                                                                                                                                     : M (ast))
                                                                                                                                  : M (ast))
                                                                                                                               : M (ast))
                                                                                                                            : M (ast))
                                                                                                                         : M (ast))
                                                                                                                      : M (ast))
                                                                                                                   : M (ast))
                                                                                                                : M (ast))
                                                                                                             : M (ast))
                                                                                                          : M (ast))
                                                                                                       : M (ast))
                                                                                                    : M (ast))
                                                                                                 : M (ast))
                                                                                              : M (ast))
                                                                                           : M (ast))
                                                                                        : M (ast))
                                                                                     : M (ast))
                                                                                  : M (ast))
                                                                               : M (ast))
                                                                            : M (ast))
                                                                         : M (ast))
                                                                      : M (ast))
                                                                   : M (ast))
                                                                : M (ast))
                                                             : M (ast))
                                                          : M (ast))
                                                       : M (ast))
                                                    : M (ast))
                                                 : M (ast))
                                              : M (ast))
                                           : M (ast))
                                        : M (ast))
                                     : M (ast))
                                  : M (ast))
                               : M (ast))
                            : M (ast))
                         : M (ast))
                      : M (ast))
                   : M (ast))
                : M (ast))
             : M (ast))
          : M (ast))
       : M (ast))
    : M (ast).

Definition assembly_forwards_matches (arg_ : ast) : bool :=
   match arg_ with
   | UTYPE (imm, rd, op) => true
   | RISCV_JAL (imm, rd) => true
   | RISCV_JALR (imm, rs1, rd) => true
   | BTYPE (imm, rs2, rs1, op) => true
   | ITYPE (imm, rs1, rd, op) => true
   | SHIFTIOP (shamt, rs1, rd, op) => true
   | RTYPE (rs2, rs1, rd, op) => true
   | LOAD (imm, rs1, rd, is_unsigned, size, aq, rl) => true
   | STORE (imm, rs2, rs1, size, aq, rl) => true
   | ADDIW (imm, rs1, rd) => if sumbool_of_bool (Z.eqb 64 64) then true else false
   | SHIFTW (shamt, rs1, rd, op) => if sumbool_of_bool (Z.eqb 64 64) then true else false
   | RTYPEW (rs2, rs1, rd, op) => if sumbool_of_bool (Z.eqb 64 64) then true else false
   | SHIFTIWOP (shamt, rs1, rd, op) => if sumbool_of_bool (Z.eqb 64 64) then true else false
   | FENCE (pred, succ) => true
   | FENCE_TSO (pred, succ) => true
   | FENCEI tt => true
   | ECALL tt => true
   | MRET tt => true
   | SRET tt => true
   | EBREAK tt => true
   | WFI tt => true
   | SFENCE_VMA (rs1, rs2) => true
   | LOADRES (aq, rl, rs1, size, rd) => true
   | STORECON (aq, rl, rs2, rs1, size, rd) => true
   | AMO (op, aq, rl, rs2, rs1, width, rd) => true
   | C_NOP tt => true
   | C_ADDI4SPN (rdc, nzimm) => if neq_vec nzimm (Ox"00"  : mword 8) then true else false
   | C_LW (uimm, rsc, rdc) => true
   | C_LD (uimm, rsc, rdc) => if sumbool_of_bool (Z.eqb 64 64) then true else false
   | C_SW (uimm, rsc1, rsc2) => true
   | C_SD (uimm, rsc1, rsc2) => if sumbool_of_bool (Z.eqb 64 64) then true else false
   | C_ADDI (nzi, rsd) =>
      if andb (neq_vec nzi ('b"000000"  : mword 6)) (neq_vec rsd zreg) then true else false
   | C_JAL imm => if sumbool_of_bool (Z.eqb 64 32) then true else false
   | C_ADDIW (imm, rsd) => if sumbool_of_bool (Z.eqb 64 64) then true else false
   | C_LI (imm, rd) => if neq_vec rd zreg then true else false
   | C_ADDI16SP imm => if neq_vec imm ('b"000000"  : mword 6) then true else false
   | C_LUI (imm, rd) =>
      if andb (neq_vec rd zreg) (andb (neq_vec rd sp) (neq_vec imm ('b"000000"  : mword 6))) then
        true
      else false
   | C_SRLI (shamt, rsd) => if neq_vec shamt ('b"000000"  : mword 6) then true else false
   | C_SRAI (shamt, rsd) => if neq_vec shamt ('b"000000"  : mword 6) then true else false
   | C_ANDI (imm, rsd) => true
   | C_SUB (rsd, rs2) => true
   | C_XOR (rsd, rs2) => true
   | C_OR (rsd, rs2) => true
   | C_AND (rsd, rs2) => true
   | C_SUBW (rsd, rs2) => if sumbool_of_bool (Z.eqb 64 64) then true else false
   | C_ADDW (rsd, rs2) => if sumbool_of_bool (Z.eqb 64 64) then true else false
   | C_J imm => true
   | C_BEQZ (imm, rs) => true
   | C_BNEZ (imm, rs) => true
   | C_SLLI (shamt, rsd) =>
      if andb (neq_vec shamt ('b"000000"  : mword 6)) (neq_vec rsd zreg) then true else false
   | C_LWSP (uimm, rd) => if neq_vec rd zreg then true else false
   | C_LDSP (uimm, rd) =>
      if sumbool_of_bool (andb (neq_vec rd zreg) (Z.eqb 64 64)) then true else false
   | C_SWSP (uimm, rd) => true
   | C_SDSP (uimm, rs2) => if sumbool_of_bool (Z.eqb 64 64) then true else false
   | C_JR rs1 => if neq_vec rs1 zreg then true else false
   | C_JALR rs1 => if neq_vec rs1 zreg then true else false
   | C_MV (rd, rs2) => if andb (neq_vec rd zreg) (neq_vec rs2 zreg) then true else false
   | C_EBREAK tt => true
   | C_ADD (rsd, rs2) => if andb (neq_vec rsd zreg) (neq_vec rs2 zreg) then true else false
   | MUL (rs2, rs1, rd, high, signed1, signed2) => true
   | DIV (rs2, rs1, rd, s) => true
   | REM (rs2, rs1, rd, s) => true
   | MULW (rs2, rs1, rd) => if sumbool_of_bool (Z.eqb 64 64) then true else false
   | DIVW (rs2, rs1, rd, s) => if sumbool_of_bool (Z.eqb 64 64) then true else false
   | REMW (rs2, rs1, rd, s) => if sumbool_of_bool (Z.eqb 64 64) then true else false
   | CSR (csr, rs1, rd, true, op) => true
   | CSR (csr, rs1, rd, false, op) => true
   | URET tt => true
   | C_NOP_HINT imm => true
   | C_ADDI_HINT rsd => if neq_vec rsd zreg then true else false
   | C_LI_HINT imm => true
   | C_LUI_HINT imm => if neq_vec imm ('b"000000"  : mword 6) then true else false
   | C_MV_HINT rs2 => if neq_vec rs2 zreg then true else false
   | C_ADD_HINT rs2 => if neq_vec rs2 zreg then true else false
   | C_SLLI_HINT (shamt, rsd) =>
      if orb (eq_vec shamt ('b"000000"  : mword 6)) (eq_vec rsd zreg) then true else false
   | C_SRLI_HINT rsd => true
   | C_SRAI_HINT rsd => true
   | FENCE_RESERVED (fm, pred, succ, rs, rd) =>
      if orb (andb (neq_vec fm (Ox"0"  : mword 4)) (neq_vec fm (Ox"8"  : mword 4)))
           (orb (neq_vec rs ('b"00000"  : mword 5)) (neq_vec rd ('b"00000"  : mword 5))) then
        true
      else false
   | FENCEI_RESERVED (imm, rs, rd) =>
      if orb (neq_vec imm (Ox"000"  : mword 12)) (orb (neq_vec rs zreg) (neq_vec rd zreg)) then true
      else false
   | LOAD_FP (imm, rs1, rd, width) => true
   | STORE_FP (imm, rs2, rs1, width) => true
   | F_MADD_TYPE_S (rs3, rs2, rs1, rm, rd, op) => true
   | F_BIN_RM_TYPE_S (rs2, rs1, rm, rd, op) => true
   | F_UN_RM_TYPE_S (rs1, rm, rd, FSQRT_S) => true
   | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_W_S) => true
   | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_WU_S) => true
   | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_W) => true
   | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_WU) => true
   | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_L_S) => true
   | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_LU_S) => true
   | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_L) => true
   | F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_LU) => true
   | F_BIN_TYPE_S (rs2, rs1, rd, FSGNJ_S) => true
   | F_BIN_TYPE_S (rs2, rs1, rd, FSGNJN_S) => true
   | F_BIN_TYPE_S (rs2, rs1, rd, FSGNJX_S) => true
   | F_BIN_TYPE_S (rs2, rs1, rd, FMIN_S) => true
   | F_BIN_TYPE_S (rs2, rs1, rd, FMAX_S) => true
   | F_BIN_TYPE_S (rs2, rs1, rd, FEQ_S) => true
   | F_BIN_TYPE_S (rs2, rs1, rd, FLT_S) => true
   | F_BIN_TYPE_S (rs2, rs1, rd, FLE_S) => true
   | F_UN_TYPE_S (rs1, rd, FMV_X_W) => true
   | F_UN_TYPE_S (rs1, rd, FMV_W_X) => true
   | F_UN_TYPE_S (rs1, rd, FCLASS_S) => true
   | C_FLWSP (imm, rd) => if sumbool_of_bool (Z.eqb 64 32) then true else false
   | C_FSWSP (uimm, rd) => if sumbool_of_bool (Z.eqb 64 32) then true else false
   | C_FLW (uimm, rsc, rdc) => if sumbool_of_bool (Z.eqb 64 32) then true else false
   | C_FSW (uimm, rsc1, rsc2) => if sumbool_of_bool (Z.eqb 64 32) then true else false
   | F_MADD_TYPE_D (rs3, rs2, rs1, rm, rd, op) => true
   | F_BIN_RM_TYPE_D (rs2, rs1, rm, rd, op) => true
   | F_UN_RM_TYPE_D (rs1, rm, rd, FSQRT_D) => true
   | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_W_D) => true
   | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_WU_D) => true
   | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_W) => true
   | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_WU) => true
   | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_L_D) => true
   | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_LU_D) => true
   | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_L) => true
   | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_LU) => true
   | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_S_D) => true
   | F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_S) => true
   | F_BIN_TYPE_D (rs2, rs1, rd, FSGNJ_D) => true
   | F_BIN_TYPE_D (rs2, rs1, rd, FSGNJN_D) => true
   | F_BIN_TYPE_D (rs2, rs1, rd, FSGNJX_D) => true
   | F_BIN_TYPE_D (rs2, rs1, rd, FMIN_D) => true
   | F_BIN_TYPE_D (rs2, rs1, rd, FMAX_D) => true
   | F_BIN_TYPE_D (rs2, rs1, rd, FEQ_D) => true
   | F_BIN_TYPE_D (rs2, rs1, rd, FLT_D) => true
   | F_BIN_TYPE_D (rs2, rs1, rd, FLE_D) => true
   | F_UN_TYPE_D (rs1, rd, FMV_X_D) => true
   | F_UN_TYPE_D (rs1, rd, FMV_D_X) => true
   | F_UN_TYPE_D (rs1, rd, FCLASS_D) => true
   | C_FLDSP (uimm, rd) => if sumbool_of_bool (orb (Z.eqb 64 32) (Z.eqb 64 64)) then true else false
   | C_FSDSP (uimm, rs2) =>
      if sumbool_of_bool (orb (Z.eqb 64 32) (Z.eqb 64 64)) then true else false
   | C_FLD (uimm, rsc, rdc) =>
      if sumbool_of_bool (orb (Z.eqb 64 32) (Z.eqb 64 64)) then true else false
   | C_FSD (uimm, rsc1, rsc2) =>
      if sumbool_of_bool (orb (Z.eqb 64 32) (Z.eqb 64 64)) then true else false
   | ILLEGAL s => true
   | C_ILLEGAL s => true
   end.

Definition _s5132_ (_s5133_ : string) : M (option (mword 16)) :=
   let _s5134_ := _s5133_ in
   (if string_startswith _s5134_ "c.illegal" then
      (match (string_drop _s5134_ (projT1 (string_length "c.illegal"))) with
       | _s5135_ =>
          (spc_matches_prefix _s5135_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          returnm (match w__0 with
                   | Some (tt, existT _ _s5136_ _) =>
                      match (string_drop _s5135_ _s5136_) with
                      | _s5137_ =>
                         match (hex_bits_16_matches_prefix _s5137_) with
                         | Some (s, existT _ _s5138_ _) =>
                            let p0_ := string_drop _s5137_ _s5138_ in
                            if generic_eq p0_ "" then Some s
                            else None
                         | _ => None
                         end
                      end
                   | _ => None
                   end)
       end)
       : M (option (mword 16))
    else returnm None)
    : M (option (mword 16)).

Definition _s5124_ (_s5125_ : string) : M (option (mword 32)) :=
   let _s5126_ := _s5125_ in
   (if string_startswith _s5126_ "illegal" then
      (match (string_drop _s5126_ (projT1 (string_length "illegal"))) with
       | _s5127_ =>
          (spc_matches_prefix _s5127_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          returnm (match w__0 with
                   | Some (tt, existT _ _s5128_ _) =>
                      match (string_drop _s5127_ _s5128_) with
                      | _s5129_ =>
                         match (hex_bits_32_matches_prefix _s5129_) with
                         | Some (s, existT _ _s5130_ _) =>
                            let p0_ := string_drop _s5129_ _s5130_ in
                            if generic_eq p0_ "" then Some s
                            else None
                         | _ => None
                         end
                      end
                   | _ => None
                   end)
       end)
       : M (option (mword 32))
    else returnm None)
    : M (option (mword 32)).

Definition _s5108_ (_s5109_ : string) : M (option ((mword 3 * mword 3 * mword 5))) :=
   let _s5110_ := _s5109_ in
   (if string_startswith _s5110_ "c.fsd" then
      (match (string_drop _s5110_ (projT1 (string_length "c.fsd"))) with
       | _s5111_ =>
          (spc_matches_prefix _s5111_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5112_ _) =>
              (match (string_drop _s5111_ _s5112_) with
               | _s5113_ =>
                  (creg_name_matches_prefix _s5113_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsc1, existT _ _s5114_ _) =>
                      (match (string_drop _s5113_ _s5114_) with
                       | _s5115_ =>
                          (sep_matches_prefix _s5115_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s5116_ _) =>
                              (match (string_drop _s5115_ _s5116_) with
                               | _s5117_ =>
                                  (creg_name_matches_prefix _s5117_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc2, existT _ _s5118_ _) =>
                                      (match (string_drop _s5117_ _s5118_) with
                                       | _s5119_ =>
                                          (sep_matches_prefix _s5119_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s5120_ _) =>
                                                      match (string_drop _s5119_ _s5120_) with
                                                      | _s5121_ =>
                                                         match (hex_bits_8_matches_prefix _s5121_) with
                                                         | Some (v__1462, existT _ _s5122_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1462 2 0)
                                                                 ('b"000"
                                                                  : mword (2 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1462 7 3 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1462 7 3 in
                                                              let p0_ := string_drop _s5121_ _s5122_ in
                                                              if generic_eq p0_ "" then
                                                                Some (rsc1, rsc2, uimm)
                                                              else None
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5))).

Definition _s5092_ (_s5093_ : string) : M (option ((mword 3 * mword 3 * mword 5))) :=
   let _s5094_ := _s5093_ in
   (if string_startswith _s5094_ "c.fld" then
      (match (string_drop _s5094_ (projT1 (string_length "c.fld"))) with
       | _s5095_ =>
          (spc_matches_prefix _s5095_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5096_ _) =>
              (match (string_drop _s5095_ _s5096_) with
               | _s5097_ =>
                  (creg_name_matches_prefix _s5097_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rdc, existT _ _s5098_ _) =>
                      (match (string_drop _s5097_ _s5098_) with
                       | _s5099_ =>
                          (sep_matches_prefix _s5099_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s5100_ _) =>
                              (match (string_drop _s5099_ _s5100_) with
                               | _s5101_ =>
                                  (creg_name_matches_prefix _s5101_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc, existT _ _s5102_ _) =>
                                      (match (string_drop _s5101_ _s5102_) with
                                       | _s5103_ =>
                                          (sep_matches_prefix _s5103_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s5104_ _) =>
                                                      match (string_drop _s5103_ _s5104_) with
                                                      | _s5105_ =>
                                                         match (hex_bits_8_matches_prefix _s5105_) with
                                                         | Some (v__1464, existT _ _s5106_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1464 2 0)
                                                                 ('b"000"
                                                                  : mword (2 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1464 7 3 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1464 7 3 in
                                                              let p0_ := string_drop _s5105_ _s5106_ in
                                                              if generic_eq p0_ "" then
                                                                Some (rdc, rsc, uimm)
                                                              else None
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5))).

Definition _s5080_ (_s5081_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s5082_ := _s5081_ in
   (if string_startswith _s5082_ "c.fsdsp" then
      (match (string_drop _s5082_ (projT1 (string_length "c.fsdsp"))) with
       | _s5083_ =>
          (spc_matches_prefix _s5083_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5084_ _) =>
              (match (string_drop _s5083_ _s5084_) with
               | _s5085_ =>
                  (reg_name_matches_prefix _s5085_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rs2, existT _ _s5086_ _) =>
                      (match (string_drop _s5085_ _s5086_) with
                       | _s5087_ =>
                          (sep_matches_prefix _s5087_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s5088_ _) =>
                                      match (string_drop _s5087_ _s5088_) with
                                      | _s5089_ =>
                                         match (hex_bits_6_matches_prefix _s5089_) with
                                         | Some (uimm, existT _ _s5090_ _) =>
                                            let p0_ := string_drop _s5089_ _s5090_ in
                                            if generic_eq p0_ "" then Some (rs2, uimm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s5068_ (_s5069_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s5070_ := _s5069_ in
   (if string_startswith _s5070_ "c.fldsp" then
      (match (string_drop _s5070_ (projT1 (string_length "c.fldsp"))) with
       | _s5071_ =>
          (spc_matches_prefix _s5071_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5072_ _) =>
              (match (string_drop _s5071_ _s5072_) with
               | _s5073_ =>
                  (reg_name_matches_prefix _s5073_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s5074_ _) =>
                      (match (string_drop _s5073_ _s5074_) with
                       | _s5075_ =>
                          (sep_matches_prefix _s5075_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s5076_ _) =>
                                      match (string_drop _s5075_ _s5076_) with
                                      | _s5077_ =>
                                         match (hex_bits_6_matches_prefix _s5077_) with
                                         | Some (uimm, existT _ _s5078_ _) =>
                                            let p0_ := string_drop _s5077_ _s5078_ in
                                            if generic_eq p0_ "" then Some (rd, uimm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s5055_ (_s5056_ : string) : M (option ((f_un_op_D * mword 5 * mword 5))) :=
   (match _s5056_ with
    | _s5057_ =>
       (f_un_type_mnemonic_D_matches_prefix _s5057_) >>= fun w__0 : option ((f_un_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCLASS_D, existT _ _s5058_ _) =>
           (match (string_drop _s5057_ _s5058_) with
            | _s5059_ =>
               (spc_matches_prefix _s5059_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s5060_ _) =>
                   (match (string_drop _s5059_ _s5060_) with
                    | _s5061_ =>
                       (reg_name_matches_prefix _s5061_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s5062_ _) =>
                           (match (string_drop _s5061_ _s5062_) with
                            | _s5063_ =>
                               (sep_matches_prefix _s5063_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s5064_ _) =>
                                   (match (string_drop _s5063_ _s5064_) with
                                    | _s5065_ =>
                                       (freg_name_matches_prefix _s5065_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       returnm (match w__4 with
                                                | Some (rs1, existT _ _s5066_ _) =>
                                                   let p0_ := string_drop _s5065_ _s5066_ in
                                                   if generic_eq p0_ "" then
                                                     Some (FCLASS_D, rd, rs1)
                                                   else None
                                                | _ => None
                                                end)
                                    end)
                                    : M (option ((f_un_op_D * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_op_D * mword 5 * mword 5)))
                            end)
                            : M (option ((f_un_op_D * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_op_D * mword 5 * mword 5)))
                    end)
                    : M (option ((f_un_op_D * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_un_op_D * mword 5 * mword 5)))
            end)
            : M (option ((f_un_op_D * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_un_op_D * mword 5 * mword 5)))
    end)
    : M (option ((f_un_op_D * mword 5 * mword 5))).

Definition _s5042_ (_s5043_ : string) : M (option ((f_un_op_D * mword 5 * mword 5))) :=
   (match _s5043_ with
    | _s5044_ =>
       (f_un_type_mnemonic_D_matches_prefix _s5044_) >>= fun w__0 : option ((f_un_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMV_D_X, existT _ _s5045_ _) =>
           (match (string_drop _s5044_ _s5045_) with
            | _s5046_ =>
               (spc_matches_prefix _s5046_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s5047_ _) =>
                   (match (string_drop _s5046_ _s5047_) with
                    | _s5048_ =>
                       (freg_name_matches_prefix _s5048_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s5049_ _) =>
                           (match (string_drop _s5048_ _s5049_) with
                            | _s5050_ =>
                               (sep_matches_prefix _s5050_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s5051_ _) =>
                                   (match (string_drop _s5050_ _s5051_) with
                                    | _s5052_ =>
                                       (reg_name_matches_prefix _s5052_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       returnm (match w__4 with
                                                | Some (rs1, existT _ _s5053_ _) =>
                                                   let p0_ := string_drop _s5052_ _s5053_ in
                                                   if generic_eq p0_ "" then Some (FMV_D_X, rd, rs1)
                                                   else None
                                                | _ => None
                                                end)
                                    end)
                                    : M (option ((f_un_op_D * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_op_D * mword 5 * mword 5)))
                            end)
                            : M (option ((f_un_op_D * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_op_D * mword 5 * mword 5)))
                    end)
                    : M (option ((f_un_op_D * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_un_op_D * mword 5 * mword 5)))
            end)
            : M (option ((f_un_op_D * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_un_op_D * mword 5 * mword 5)))
    end)
    : M (option ((f_un_op_D * mword 5 * mword 5))).

Definition _s5029_ (_s5030_ : string) : M (option ((f_un_op_D * mword 5 * mword 5))) :=
   (match _s5030_ with
    | _s5031_ =>
       (f_un_type_mnemonic_D_matches_prefix _s5031_) >>= fun w__0 : option ((f_un_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMV_X_D, existT _ _s5032_ _) =>
           (match (string_drop _s5031_ _s5032_) with
            | _s5033_ =>
               (spc_matches_prefix _s5033_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s5034_ _) =>
                   (match (string_drop _s5033_ _s5034_) with
                    | _s5035_ =>
                       (reg_name_matches_prefix _s5035_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s5036_ _) =>
                           (match (string_drop _s5035_ _s5036_) with
                            | _s5037_ =>
                               (sep_matches_prefix _s5037_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s5038_ _) =>
                                   (match (string_drop _s5037_ _s5038_) with
                                    | _s5039_ =>
                                       (freg_name_matches_prefix _s5039_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       returnm (match w__4 with
                                                | Some (rs1, existT _ _s5040_ _) =>
                                                   let p0_ := string_drop _s5039_ _s5040_ in
                                                   if generic_eq p0_ "" then Some (FMV_X_D, rd, rs1)
                                                   else None
                                                | _ => None
                                                end)
                                    end)
                                    : M (option ((f_un_op_D * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_op_D * mword 5 * mword 5)))
                            end)
                            : M (option ((f_un_op_D * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_op_D * mword 5 * mword 5)))
                    end)
                    : M (option ((f_un_op_D * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_un_op_D * mword 5 * mword 5)))
            end)
            : M (option ((f_un_op_D * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_un_op_D * mword 5 * mword 5)))
    end)
    : M (option ((f_un_op_D * mword 5 * mword 5))).

Definition _s5012_ (_s5013_ : string) : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))) :=
   (match _s5013_ with
    | _s5014_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s5014_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FLE_D, existT _ _s5015_ _) =>
           (match (string_drop _s5014_ _s5015_) with
            | _s5016_ =>
               (spc_matches_prefix _s5016_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s5017_ _) =>
                   (match (string_drop _s5016_ _s5017_) with
                    | _s5018_ =>
                       (reg_name_matches_prefix _s5018_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s5019_ _) =>
                           (match (string_drop _s5018_ _s5019_) with
                            | _s5020_ =>
                               (sep_matches_prefix _s5020_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s5021_ _) =>
                                   (match (string_drop _s5020_ _s5021_) with
                                    | _s5022_ =>
                                       (freg_name_matches_prefix _s5022_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s5023_ _) =>
                                           (match (string_drop _s5022_ _s5023_) with
                                            | _s5024_ =>
                                               (sep_matches_prefix _s5024_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s5025_ _) =>
                                                   (match (string_drop _s5024_ _s5025_) with
                                                    | _s5026_ =>
                                                       (freg_name_matches_prefix _s5026_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s5027_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s5026_ _s5027_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FLE_D, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))).

Definition _s4995_ (_s4996_ : string) : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))) :=
   (match _s4996_ with
    | _s4997_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s4997_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FLT_D, existT _ _s4998_ _) =>
           (match (string_drop _s4997_ _s4998_) with
            | _s4999_ =>
               (spc_matches_prefix _s4999_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s5000_ _) =>
                   (match (string_drop _s4999_ _s5000_) with
                    | _s5001_ =>
                       (reg_name_matches_prefix _s5001_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s5002_ _) =>
                           (match (string_drop _s5001_ _s5002_) with
                            | _s5003_ =>
                               (sep_matches_prefix _s5003_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s5004_ _) =>
                                   (match (string_drop _s5003_ _s5004_) with
                                    | _s5005_ =>
                                       (freg_name_matches_prefix _s5005_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s5006_ _) =>
                                           (match (string_drop _s5005_ _s5006_) with
                                            | _s5007_ =>
                                               (sep_matches_prefix _s5007_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s5008_ _) =>
                                                   (match (string_drop _s5007_ _s5008_) with
                                                    | _s5009_ =>
                                                       (freg_name_matches_prefix _s5009_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s5010_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s5009_ _s5010_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FLT_D, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))).

Definition _s4978_ (_s4979_ : string) : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))) :=
   (match _s4979_ with
    | _s4980_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s4980_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FEQ_D, existT _ _s4981_ _) =>
           (match (string_drop _s4980_ _s4981_) with
            | _s4982_ =>
               (spc_matches_prefix _s4982_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4983_ _) =>
                   (match (string_drop _s4982_ _s4983_) with
                    | _s4984_ =>
                       (reg_name_matches_prefix _s4984_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4985_ _) =>
                           (match (string_drop _s4984_ _s4985_) with
                            | _s4986_ =>
                               (sep_matches_prefix _s4986_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4987_ _) =>
                                   (match (string_drop _s4986_ _s4987_) with
                                    | _s4988_ =>
                                       (freg_name_matches_prefix _s4988_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4989_ _) =>
                                           (match (string_drop _s4988_ _s4989_) with
                                            | _s4990_ =>
                                               (sep_matches_prefix _s4990_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4991_ _) =>
                                                   (match (string_drop _s4990_ _s4991_) with
                                                    | _s4992_ =>
                                                       (freg_name_matches_prefix _s4992_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s4993_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4992_ _s4993_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FEQ_D, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))).

Definition _s4961_ (_s4962_ : string) : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))) :=
   (match _s4962_ with
    | _s4963_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s4963_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMAX_D, existT _ _s4964_ _) =>
           (match (string_drop _s4963_ _s4964_) with
            | _s4965_ =>
               (spc_matches_prefix _s4965_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4966_ _) =>
                   (match (string_drop _s4965_ _s4966_) with
                    | _s4967_ =>
                       (freg_name_matches_prefix _s4967_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4968_ _) =>
                           (match (string_drop _s4967_ _s4968_) with
                            | _s4969_ =>
                               (sep_matches_prefix _s4969_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4970_ _) =>
                                   (match (string_drop _s4969_ _s4970_) with
                                    | _s4971_ =>
                                       (freg_name_matches_prefix _s4971_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4972_ _) =>
                                           (match (string_drop _s4971_ _s4972_) with
                                            | _s4973_ =>
                                               (sep_matches_prefix _s4973_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4974_ _) =>
                                                   (match (string_drop _s4973_ _s4974_) with
                                                    | _s4975_ =>
                                                       (freg_name_matches_prefix _s4975_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s4976_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4975_ _s4976_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FMAX_D, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))).

Definition _s4944_ (_s4945_ : string) : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))) :=
   (match _s4945_ with
    | _s4946_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s4946_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMIN_D, existT _ _s4947_ _) =>
           (match (string_drop _s4946_ _s4947_) with
            | _s4948_ =>
               (spc_matches_prefix _s4948_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4949_ _) =>
                   (match (string_drop _s4948_ _s4949_) with
                    | _s4950_ =>
                       (freg_name_matches_prefix _s4950_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4951_ _) =>
                           (match (string_drop _s4950_ _s4951_) with
                            | _s4952_ =>
                               (sep_matches_prefix _s4952_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4953_ _) =>
                                   (match (string_drop _s4952_ _s4953_) with
                                    | _s4954_ =>
                                       (freg_name_matches_prefix _s4954_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4955_ _) =>
                                           (match (string_drop _s4954_ _s4955_) with
                                            | _s4956_ =>
                                               (sep_matches_prefix _s4956_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4957_ _) =>
                                                   (match (string_drop _s4956_ _s4957_) with
                                                    | _s4958_ =>
                                                       (freg_name_matches_prefix _s4958_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s4959_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4958_ _s4959_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FMIN_D, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))).

Definition _s4927_ (_s4928_ : string) : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))) :=
   (match _s4928_ with
    | _s4929_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s4929_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSGNJX_D, existT _ _s4930_ _) =>
           (match (string_drop _s4929_ _s4930_) with
            | _s4931_ =>
               (spc_matches_prefix _s4931_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4932_ _) =>
                   (match (string_drop _s4931_ _s4932_) with
                    | _s4933_ =>
                       (freg_name_matches_prefix _s4933_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4934_ _) =>
                           (match (string_drop _s4933_ _s4934_) with
                            | _s4935_ =>
                               (sep_matches_prefix _s4935_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4936_ _) =>
                                   (match (string_drop _s4935_ _s4936_) with
                                    | _s4937_ =>
                                       (freg_name_matches_prefix _s4937_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4938_ _) =>
                                           (match (string_drop _s4937_ _s4938_) with
                                            | _s4939_ =>
                                               (sep_matches_prefix _s4939_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4940_ _) =>
                                                   (match (string_drop _s4939_ _s4940_) with
                                                    | _s4941_ =>
                                                       (freg_name_matches_prefix _s4941_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s4942_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4941_ _s4942_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FSGNJX_D, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))).

Definition _s4910_ (_s4911_ : string) : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))) :=
   (match _s4911_ with
    | _s4912_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s4912_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSGNJN_D, existT _ _s4913_ _) =>
           (match (string_drop _s4912_ _s4913_) with
            | _s4914_ =>
               (spc_matches_prefix _s4914_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4915_ _) =>
                   (match (string_drop _s4914_ _s4915_) with
                    | _s4916_ =>
                       (freg_name_matches_prefix _s4916_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4917_ _) =>
                           (match (string_drop _s4916_ _s4917_) with
                            | _s4918_ =>
                               (sep_matches_prefix _s4918_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4919_ _) =>
                                   (match (string_drop _s4918_ _s4919_) with
                                    | _s4920_ =>
                                       (freg_name_matches_prefix _s4920_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4921_ _) =>
                                           (match (string_drop _s4920_ _s4921_) with
                                            | _s4922_ =>
                                               (sep_matches_prefix _s4922_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4923_ _) =>
                                                   (match (string_drop _s4922_ _s4923_) with
                                                    | _s4924_ =>
                                                       (freg_name_matches_prefix _s4924_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s4925_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4924_ _s4925_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FSGNJN_D, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))).

Definition _s4893_ (_s4894_ : string) : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))) :=
   (match _s4894_ with
    | _s4895_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s4895_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSGNJ_D, existT _ _s4896_ _) =>
           (match (string_drop _s4895_ _s4896_) with
            | _s4897_ =>
               (spc_matches_prefix _s4897_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4898_ _) =>
                   (match (string_drop _s4897_ _s4898_) with
                    | _s4899_ =>
                       (freg_name_matches_prefix _s4899_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4900_ _) =>
                           (match (string_drop _s4899_ _s4900_) with
                            | _s4901_ =>
                               (sep_matches_prefix _s4901_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4902_ _) =>
                                   (match (string_drop _s4901_ _s4902_) with
                                    | _s4903_ =>
                                       (freg_name_matches_prefix _s4903_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4904_ _) =>
                                           (match (string_drop _s4903_ _s4904_) with
                                            | _s4905_ =>
                                               (sep_matches_prefix _s4905_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4906_ _) =>
                                                   (match (string_drop _s4905_ _s4906_) with
                                                    | _s4907_ =>
                                                       (freg_name_matches_prefix _s4907_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s4908_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4907_ _s4908_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FSGNJ_D, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5))).

Definition _s4876_ (_s4877_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4877_ with
    | _s4878_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s4878_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_D_S, existT _ _s4879_ _) =>
           (match (string_drop _s4878_ _s4879_) with
            | _s4880_ =>
               (spc_matches_prefix _s4880_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4881_ _) =>
                   (match (string_drop _s4880_ _s4881_) with
                    | _s4882_ =>
                       (freg_name_matches_prefix _s4882_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4883_ _) =>
                           (match (string_drop _s4882_ _s4883_) with
                            | _s4884_ =>
                               (sep_matches_prefix _s4884_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4885_ _) =>
                                   (match (string_drop _s4884_ _s4885_) with
                                    | _s4886_ =>
                                       (freg_name_matches_prefix _s4886_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4887_ _) =>
                                           (match (string_drop _s4886_ _s4887_) with
                                            | _s4888_ =>
                                               (sep_matches_prefix _s4888_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4889_ _) =>
                                                   (match (string_drop _s4888_ _s4889_) with
                                                    | _s4890_ =>
                                                       (frm_mnemonic_matches_prefix _s4890_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s4891_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4890_ _s4891_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_D_S, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s4859_ (_s4860_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4860_ with
    | _s4861_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s4861_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_S_D, existT _ _s4862_ _) =>
           (match (string_drop _s4861_ _s4862_) with
            | _s4863_ =>
               (spc_matches_prefix _s4863_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4864_ _) =>
                   (match (string_drop _s4863_ _s4864_) with
                    | _s4865_ =>
                       (freg_name_matches_prefix _s4865_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4866_ _) =>
                           (match (string_drop _s4865_ _s4866_) with
                            | _s4867_ =>
                               (sep_matches_prefix _s4867_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4868_ _) =>
                                   (match (string_drop _s4867_ _s4868_) with
                                    | _s4869_ =>
                                       (freg_name_matches_prefix _s4869_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4870_ _) =>
                                           (match (string_drop _s4869_ _s4870_) with
                                            | _s4871_ =>
                                               (sep_matches_prefix _s4871_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4872_ _) =>
                                                   (match (string_drop _s4871_ _s4872_) with
                                                    | _s4873_ =>
                                                       (frm_mnemonic_matches_prefix _s4873_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s4874_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4873_ _s4874_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_S_D, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s4842_ (_s4843_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4843_ with
    | _s4844_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s4844_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_D_LU, existT _ _s4845_ _) =>
           (match (string_drop _s4844_ _s4845_) with
            | _s4846_ =>
               (spc_matches_prefix _s4846_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4847_ _) =>
                   (match (string_drop _s4846_ _s4847_) with
                    | _s4848_ =>
                       (freg_name_matches_prefix _s4848_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4849_ _) =>
                           (match (string_drop _s4848_ _s4849_) with
                            | _s4850_ =>
                               (sep_matches_prefix _s4850_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4851_ _) =>
                                   (match (string_drop _s4850_ _s4851_) with
                                    | _s4852_ =>
                                       (reg_name_matches_prefix _s4852_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4853_ _) =>
                                           (match (string_drop _s4852_ _s4853_) with
                                            | _s4854_ =>
                                               (sep_matches_prefix _s4854_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4855_ _) =>
                                                   (match (string_drop _s4854_ _s4855_) with
                                                    | _s4856_ =>
                                                       (frm_mnemonic_matches_prefix _s4856_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s4857_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4856_ _s4857_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_D_LU, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s4825_ (_s4826_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4826_ with
    | _s4827_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s4827_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_D_L, existT _ _s4828_ _) =>
           (match (string_drop _s4827_ _s4828_) with
            | _s4829_ =>
               (spc_matches_prefix _s4829_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4830_ _) =>
                   (match (string_drop _s4829_ _s4830_) with
                    | _s4831_ =>
                       (freg_name_matches_prefix _s4831_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4832_ _) =>
                           (match (string_drop _s4831_ _s4832_) with
                            | _s4833_ =>
                               (sep_matches_prefix _s4833_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4834_ _) =>
                                   (match (string_drop _s4833_ _s4834_) with
                                    | _s4835_ =>
                                       (reg_name_matches_prefix _s4835_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4836_ _) =>
                                           (match (string_drop _s4835_ _s4836_) with
                                            | _s4837_ =>
                                               (sep_matches_prefix _s4837_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4838_ _) =>
                                                   (match (string_drop _s4837_ _s4838_) with
                                                    | _s4839_ =>
                                                       (frm_mnemonic_matches_prefix _s4839_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s4840_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4839_ _s4840_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_D_L, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s4808_ (_s4809_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4809_ with
    | _s4810_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s4810_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_LU_D, existT _ _s4811_ _) =>
           (match (string_drop _s4810_ _s4811_) with
            | _s4812_ =>
               (spc_matches_prefix _s4812_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4813_ _) =>
                   (match (string_drop _s4812_ _s4813_) with
                    | _s4814_ =>
                       (reg_name_matches_prefix _s4814_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4815_ _) =>
                           (match (string_drop _s4814_ _s4815_) with
                            | _s4816_ =>
                               (sep_matches_prefix _s4816_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4817_ _) =>
                                   (match (string_drop _s4816_ _s4817_) with
                                    | _s4818_ =>
                                       (freg_name_matches_prefix _s4818_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4819_ _) =>
                                           (match (string_drop _s4818_ _s4819_) with
                                            | _s4820_ =>
                                               (sep_matches_prefix _s4820_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4821_ _) =>
                                                   (match (string_drop _s4820_ _s4821_) with
                                                    | _s4822_ =>
                                                       (frm_mnemonic_matches_prefix _s4822_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s4823_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4822_ _s4823_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_LU_D, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s4791_ (_s4792_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4792_ with
    | _s4793_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s4793_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_L_D, existT _ _s4794_ _) =>
           (match (string_drop _s4793_ _s4794_) with
            | _s4795_ =>
               (spc_matches_prefix _s4795_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4796_ _) =>
                   (match (string_drop _s4795_ _s4796_) with
                    | _s4797_ =>
                       (reg_name_matches_prefix _s4797_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4798_ _) =>
                           (match (string_drop _s4797_ _s4798_) with
                            | _s4799_ =>
                               (sep_matches_prefix _s4799_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4800_ _) =>
                                   (match (string_drop _s4799_ _s4800_) with
                                    | _s4801_ =>
                                       (freg_name_matches_prefix _s4801_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4802_ _) =>
                                           (match (string_drop _s4801_ _s4802_) with
                                            | _s4803_ =>
                                               (sep_matches_prefix _s4803_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4804_ _) =>
                                                   (match (string_drop _s4803_ _s4804_) with
                                                    | _s4805_ =>
                                                       (frm_mnemonic_matches_prefix _s4805_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s4806_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4805_ _s4806_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_L_D, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s4774_ (_s4775_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4775_ with
    | _s4776_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s4776_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_D_WU, existT _ _s4777_ _) =>
           (match (string_drop _s4776_ _s4777_) with
            | _s4778_ =>
               (spc_matches_prefix _s4778_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4779_ _) =>
                   (match (string_drop _s4778_ _s4779_) with
                    | _s4780_ =>
                       (freg_name_matches_prefix _s4780_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4781_ _) =>
                           (match (string_drop _s4780_ _s4781_) with
                            | _s4782_ =>
                               (sep_matches_prefix _s4782_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4783_ _) =>
                                   (match (string_drop _s4782_ _s4783_) with
                                    | _s4784_ =>
                                       (reg_name_matches_prefix _s4784_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4785_ _) =>
                                           (match (string_drop _s4784_ _s4785_) with
                                            | _s4786_ =>
                                               (sep_matches_prefix _s4786_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4787_ _) =>
                                                   (match (string_drop _s4786_ _s4787_) with
                                                    | _s4788_ =>
                                                       (frm_mnemonic_matches_prefix _s4788_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s4789_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4788_ _s4789_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_D_WU, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s4757_ (_s4758_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4758_ with
    | _s4759_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s4759_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_D_W, existT _ _s4760_ _) =>
           (match (string_drop _s4759_ _s4760_) with
            | _s4761_ =>
               (spc_matches_prefix _s4761_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4762_ _) =>
                   (match (string_drop _s4761_ _s4762_) with
                    | _s4763_ =>
                       (freg_name_matches_prefix _s4763_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4764_ _) =>
                           (match (string_drop _s4763_ _s4764_) with
                            | _s4765_ =>
                               (sep_matches_prefix _s4765_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4766_ _) =>
                                   (match (string_drop _s4765_ _s4766_) with
                                    | _s4767_ =>
                                       (reg_name_matches_prefix _s4767_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4768_ _) =>
                                           (match (string_drop _s4767_ _s4768_) with
                                            | _s4769_ =>
                                               (sep_matches_prefix _s4769_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4770_ _) =>
                                                   (match (string_drop _s4769_ _s4770_) with
                                                    | _s4771_ =>
                                                       (frm_mnemonic_matches_prefix _s4771_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s4772_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4771_ _s4772_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_D_W, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s4740_ (_s4741_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4741_ with
    | _s4742_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s4742_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_WU_D, existT _ _s4743_ _) =>
           (match (string_drop _s4742_ _s4743_) with
            | _s4744_ =>
               (spc_matches_prefix _s4744_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4745_ _) =>
                   (match (string_drop _s4744_ _s4745_) with
                    | _s4746_ =>
                       (reg_name_matches_prefix _s4746_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4747_ _) =>
                           (match (string_drop _s4746_ _s4747_) with
                            | _s4748_ =>
                               (sep_matches_prefix _s4748_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4749_ _) =>
                                   (match (string_drop _s4748_ _s4749_) with
                                    | _s4750_ =>
                                       (freg_name_matches_prefix _s4750_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4751_ _) =>
                                           (match (string_drop _s4750_ _s4751_) with
                                            | _s4752_ =>
                                               (sep_matches_prefix _s4752_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4753_ _) =>
                                                   (match (string_drop _s4752_ _s4753_) with
                                                    | _s4754_ =>
                                                       (frm_mnemonic_matches_prefix _s4754_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s4755_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4754_ _s4755_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_WU_D, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s4723_ (_s4724_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4724_ with
    | _s4725_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s4725_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_W_D, existT _ _s4726_ _) =>
           (match (string_drop _s4725_ _s4726_) with
            | _s4727_ =>
               (spc_matches_prefix _s4727_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4728_ _) =>
                   (match (string_drop _s4727_ _s4728_) with
                    | _s4729_ =>
                       (reg_name_matches_prefix _s4729_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4730_ _) =>
                           (match (string_drop _s4729_ _s4730_) with
                            | _s4731_ =>
                               (sep_matches_prefix _s4731_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4732_ _) =>
                                   (match (string_drop _s4731_ _s4732_) with
                                    | _s4733_ =>
                                       (freg_name_matches_prefix _s4733_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4734_ _) =>
                                           (match (string_drop _s4733_ _s4734_) with
                                            | _s4735_ =>
                                               (sep_matches_prefix _s4735_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4736_ _) =>
                                                   (match (string_drop _s4735_ _s4736_) with
                                                    | _s4737_ =>
                                                       (frm_mnemonic_matches_prefix _s4737_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s4738_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4737_ _s4738_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_W_D, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s4706_ (_s4707_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4707_ with
    | _s4708_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s4708_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSQRT_D, existT _ _s4709_ _) =>
           (match (string_drop _s4708_ _s4709_) with
            | _s4710_ =>
               (spc_matches_prefix _s4710_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4711_ _) =>
                   (match (string_drop _s4710_ _s4711_) with
                    | _s4712_ =>
                       (freg_name_matches_prefix _s4712_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4713_ _) =>
                           (match (string_drop _s4712_ _s4713_) with
                            | _s4714_ =>
                               (sep_matches_prefix _s4714_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4715_ _) =>
                                   (match (string_drop _s4714_ _s4715_) with
                                    | _s4716_ =>
                                       (freg_name_matches_prefix _s4716_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4717_ _) =>
                                           (match (string_drop _s4716_ _s4717_) with
                                            | _s4718_ =>
                                               (sep_matches_prefix _s4718_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4719_ _) =>
                                                   (match (string_drop _s4718_ _s4719_) with
                                                    | _s4720_ =>
                                                       (frm_mnemonic_matches_prefix _s4720_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s4721_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4720_ _s4721_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FSQRT_D, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode))).

Definition _s4685_ (_s4686_ : string)
: M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4686_ with
    | _s4687_ =>
       (f_bin_rm_type_mnemonic_D_matches_prefix _s4687_) >>= fun w__0 : option ((f_bin_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s4688_ _) =>
           (match (string_drop _s4687_ _s4688_) with
            | _s4689_ =>
               (spc_matches_prefix _s4689_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4690_ _) =>
                   (match (string_drop _s4689_ _s4690_) with
                    | _s4691_ =>
                       (freg_name_matches_prefix _s4691_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4692_ _) =>
                           (match (string_drop _s4691_ _s4692_) with
                            | _s4693_ =>
                               (sep_matches_prefix _s4693_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4694_ _) =>
                                   (match (string_drop _s4693_ _s4694_) with
                                    | _s4695_ =>
                                       (freg_name_matches_prefix _s4695_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4696_ _) =>
                                           (match (string_drop _s4695_ _s4696_) with
                                            | _s4697_ =>
                                               (sep_matches_prefix _s4697_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4698_ _) =>
                                                   (match (string_drop _s4697_ _s4698_) with
                                                    | _s4699_ =>
                                                       (freg_name_matches_prefix _s4699_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       (match w__6 with
                                                        | Some (rs2, existT _ _s4700_ _) =>
                                                           (match (string_drop _s4699_ _s4700_) with
                                                            | _s4701_ =>
                                                               (sep_matches_prefix _s4701_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                 0)})) =>
                                                               (match w__7 with
                                                                | Some (tt, existT _ _s4702_ _) =>
                                                                   (match (string_drop _s4701_
                                                                             _s4702_) with
                                                                    | _s4703_ =>
                                                                       (frm_mnemonic_matches_prefix
                                                                          _s4703_) >>= fun w__8 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                                         0)})) =>
                                                                       returnm (match w__8 with
                                                                                | Some
                                                                                  (rm, existT _ _s4704_ _) =>
                                                                                   let p0_ :=
                                                                                     string_drop
                                                                                       _s4703_
                                                                                       _s4704_ in
                                                                                   if generic_eq p0_
                                                                                        "" then
                                                                                     Some
                                                                                       (op, rd, rs1, rs2, rm)
                                                                                   else None
                                                                                | _ => None
                                                                                end)
                                                                    end)
                                                                    : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                | _ => returnm None
                                                                end)
                                                                : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                            end)
                                                            : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                        | _ => returnm None
                                                        end)
                                                        : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                    end)
                                                    : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode))).

Definition _s4660_ (_s4661_ : string)
: M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4661_ with
    | _s4662_ =>
       (f_madd_type_mnemonic_D_matches_prefix _s4662_) >>= fun w__0 : option ((f_madd_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s4663_ _) =>
           (match (string_drop _s4662_ _s4663_) with
            | _s4664_ =>
               (spc_matches_prefix _s4664_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4665_ _) =>
                   (match (string_drop _s4664_ _s4665_) with
                    | _s4666_ =>
                       (freg_name_matches_prefix _s4666_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4667_ _) =>
                           (match (string_drop _s4666_ _s4667_) with
                            | _s4668_ =>
                               (sep_matches_prefix _s4668_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4669_ _) =>
                                   (match (string_drop _s4668_ _s4669_) with
                                    | _s4670_ =>
                                       (freg_name_matches_prefix _s4670_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4671_ _) =>
                                           (match (string_drop _s4670_ _s4671_) with
                                            | _s4672_ =>
                                               (sep_matches_prefix _s4672_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4673_ _) =>
                                                   (match (string_drop _s4672_ _s4673_) with
                                                    | _s4674_ =>
                                                       (freg_name_matches_prefix _s4674_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       (match w__6 with
                                                        | Some (rs2, existT _ _s4675_ _) =>
                                                           (match (string_drop _s4674_ _s4675_) with
                                                            | _s4676_ =>
                                                               (sep_matches_prefix _s4676_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                 0)})) =>
                                                               (match w__7 with
                                                                | Some (tt, existT _ _s4677_ _) =>
                                                                   (match (string_drop _s4676_
                                                                             _s4677_) with
                                                                    | _s4678_ =>
                                                                       (freg_name_matches_prefix
                                                                          _s4678_) >>= fun w__8 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                         0)})) =>
                                                                       (match w__8 with
                                                                        | Some
                                                                          (rs3, existT _ _s4679_ _) =>
                                                                           (match (string_drop
                                                                                     _s4678_ _s4679_) with
                                                                            | _s4680_ =>
                                                                               (sep_matches_prefix
                                                                                  _s4680_) >>= fun w__9 : option ((unit * {n : Z & ArithFact (n >=?
                                                                                 0)})) =>
                                                                               (match w__9 with
                                                                                | Some
                                                                                  (tt, existT _ _s4681_ _) =>
                                                                                   (match (string_drop
                                                                                             _s4680_
                                                                                             _s4681_) with
                                                                                    | _s4682_ =>
                                                                                       (frm_mnemonic_matches_prefix
                                                                                          _s4682_) >>= fun w__10 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                                                         0)})) =>
                                                                                       returnm (match w__10 with
                                                                                                | Some
                                                                                                  (rm, existT _ _s4683_ _) =>
                                                                                                   let p0_ :=
                                                                                                     string_drop
                                                                                                       _s4682_
                                                                                                       _s4683_ in
                                                                                                   if
                                                                                                     generic_eq
                                                                                                       p0_
                                                                                                       ""
                                                                                                   then
                                                                                                     Some
                                                                                                       (op, rd, rs1, rs2, rs3, rm)
                                                                                                   else
                                                                                                     None
                                                                                                | _ =>
                                                                                                   None
                                                                                                end)
                                                                                    end)
                                                                                    : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                                | _ => returnm None
                                                                                end)
                                                                                : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                            end)
                                                                            : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                        | _ => returnm None
                                                                        end)
                                                                        : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                    end)
                                                                    : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                | _ => returnm None
                                                                end)
                                                                : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                            end)
                                                            : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                        | _ => returnm None
                                                        end)
                                                        : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                    end)
                                                    : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode))).

Definition _s4644_ (_s4645_ : string) : M (option ((mword 3 * mword 3 * mword 5))) :=
   let _s4646_ := _s4645_ in
   (if string_startswith _s4646_ "c.fsw" then
      (match (string_drop _s4646_ (projT1 (string_length "c.fsw"))) with
       | _s4647_ =>
          (spc_matches_prefix _s4647_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s4648_ _) =>
              (match (string_drop _s4647_ _s4648_) with
               | _s4649_ =>
                  (creg_name_matches_prefix _s4649_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsc1, existT _ _s4650_ _) =>
                      (match (string_drop _s4649_ _s4650_) with
                       | _s4651_ =>
                          (sep_matches_prefix _s4651_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s4652_ _) =>
                              (match (string_drop _s4651_ _s4652_) with
                               | _s4653_ =>
                                  (creg_name_matches_prefix _s4653_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc2, existT _ _s4654_ _) =>
                                      (match (string_drop _s4653_ _s4654_) with
                                       | _s4655_ =>
                                          (sep_matches_prefix _s4655_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s4656_ _) =>
                                                      match (string_drop _s4655_ _s4656_) with
                                                      | _s4657_ =>
                                                         match (hex_bits_7_matches_prefix _s4657_) with
                                                         | Some (v__1466, existT _ _s4658_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1466 1 0)
                                                                 ('b"00"
                                                                  : mword (1 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1466 6 2 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1466 6 2 in
                                                              let p0_ := string_drop _s4657_ _s4658_ in
                                                              if generic_eq p0_ "" then
                                                                Some (rsc1, rsc2, uimm)
                                                              else None
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5))).

Definition _s4628_ (_s4629_ : string) : M (option ((mword 3 * mword 3 * mword 5))) :=
   let _s4630_ := _s4629_ in
   (if string_startswith _s4630_ "c.flw" then
      (match (string_drop _s4630_ (projT1 (string_length "c.flw"))) with
       | _s4631_ =>
          (spc_matches_prefix _s4631_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s4632_ _) =>
              (match (string_drop _s4631_ _s4632_) with
               | _s4633_ =>
                  (creg_name_matches_prefix _s4633_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rdc, existT _ _s4634_ _) =>
                      (match (string_drop _s4633_ _s4634_) with
                       | _s4635_ =>
                          (sep_matches_prefix _s4635_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s4636_ _) =>
                              (match (string_drop _s4635_ _s4636_) with
                               | _s4637_ =>
                                  (creg_name_matches_prefix _s4637_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc, existT _ _s4638_ _) =>
                                      (match (string_drop _s4637_ _s4638_) with
                                       | _s4639_ =>
                                          (sep_matches_prefix _s4639_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s4640_ _) =>
                                                      match (string_drop _s4639_ _s4640_) with
                                                      | _s4641_ =>
                                                         match (hex_bits_7_matches_prefix _s4641_) with
                                                         | Some (v__1468, existT _ _s4642_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1468 1 0)
                                                                 ('b"00"
                                                                  : mword (1 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1468 6 2 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1468 6 2 in
                                                              let p0_ := string_drop _s4641_ _s4642_ in
                                                              if generic_eq p0_ "" then
                                                                Some (rdc, rsc, uimm)
                                                              else None
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5))).

Definition _s4616_ (_s4617_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s4618_ := _s4617_ in
   (if string_startswith _s4618_ "c.fswsp" then
      (match (string_drop _s4618_ (projT1 (string_length "c.fswsp"))) with
       | _s4619_ =>
          (spc_matches_prefix _s4619_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s4620_ _) =>
              (match (string_drop _s4619_ _s4620_) with
               | _s4621_ =>
                  (reg_name_matches_prefix _s4621_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s4622_ _) =>
                      (match (string_drop _s4621_ _s4622_) with
                       | _s4623_ =>
                          (sep_matches_prefix _s4623_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s4624_ _) =>
                                      match (string_drop _s4623_ _s4624_) with
                                      | _s4625_ =>
                                         match (hex_bits_6_matches_prefix _s4625_) with
                                         | Some (uimm, existT _ _s4626_ _) =>
                                            let p0_ := string_drop _s4625_ _s4626_ in
                                            if generic_eq p0_ "" then Some (rd, uimm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s4604_ (_s4605_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s4606_ := _s4605_ in
   (if string_startswith _s4606_ "c.flwsp" then
      (match (string_drop _s4606_ (projT1 (string_length "c.flwsp"))) with
       | _s4607_ =>
          (spc_matches_prefix _s4607_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s4608_ _) =>
              (match (string_drop _s4607_ _s4608_) with
               | _s4609_ =>
                  (reg_name_matches_prefix _s4609_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s4610_ _) =>
                      (match (string_drop _s4609_ _s4610_) with
                       | _s4611_ =>
                          (sep_matches_prefix _s4611_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s4612_ _) =>
                                      match (string_drop _s4611_ _s4612_) with
                                      | _s4613_ =>
                                         match (hex_bits_6_matches_prefix _s4613_) with
                                         | Some (imm, existT _ _s4614_ _) =>
                                            let p0_ := string_drop _s4613_ _s4614_ in
                                            if generic_eq p0_ "" then Some (rd, imm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s4591_ (_s4592_ : string) : M (option ((f_un_op_S * mword 5 * mword 5))) :=
   (match _s4592_ with
    | _s4593_ =>
       (f_un_type_mnemonic_S_matches_prefix _s4593_) >>= fun w__0 : option ((f_un_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCLASS_S, existT _ _s4594_ _) =>
           (match (string_drop _s4593_ _s4594_) with
            | _s4595_ =>
               (spc_matches_prefix _s4595_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4596_ _) =>
                   (match (string_drop _s4595_ _s4596_) with
                    | _s4597_ =>
                       (reg_name_matches_prefix _s4597_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4598_ _) =>
                           (match (string_drop _s4597_ _s4598_) with
                            | _s4599_ =>
                               (sep_matches_prefix _s4599_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4600_ _) =>
                                   (match (string_drop _s4599_ _s4600_) with
                                    | _s4601_ =>
                                       (freg_name_matches_prefix _s4601_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       returnm (match w__4 with
                                                | Some (rs1, existT _ _s4602_ _) =>
                                                   let p0_ := string_drop _s4601_ _s4602_ in
                                                   if generic_eq p0_ "" then
                                                     Some (FCLASS_S, rd, rs1)
                                                   else None
                                                | _ => None
                                                end)
                                    end)
                                    : M (option ((f_un_op_S * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_op_S * mword 5 * mword 5)))
                            end)
                            : M (option ((f_un_op_S * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_op_S * mword 5 * mword 5)))
                    end)
                    : M (option ((f_un_op_S * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_un_op_S * mword 5 * mword 5)))
            end)
            : M (option ((f_un_op_S * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_un_op_S * mword 5 * mword 5)))
    end)
    : M (option ((f_un_op_S * mword 5 * mword 5))).

Definition _s4578_ (_s4579_ : string) : M (option ((f_un_op_S * mword 5 * mword 5))) :=
   (match _s4579_ with
    | _s4580_ =>
       (f_un_type_mnemonic_S_matches_prefix _s4580_) >>= fun w__0 : option ((f_un_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMV_W_X, existT _ _s4581_ _) =>
           (match (string_drop _s4580_ _s4581_) with
            | _s4582_ =>
               (spc_matches_prefix _s4582_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4583_ _) =>
                   (match (string_drop _s4582_ _s4583_) with
                    | _s4584_ =>
                       (freg_name_matches_prefix _s4584_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4585_ _) =>
                           (match (string_drop _s4584_ _s4585_) with
                            | _s4586_ =>
                               (sep_matches_prefix _s4586_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4587_ _) =>
                                   (match (string_drop _s4586_ _s4587_) with
                                    | _s4588_ =>
                                       (reg_name_matches_prefix _s4588_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       returnm (match w__4 with
                                                | Some (rs1, existT _ _s4589_ _) =>
                                                   let p0_ := string_drop _s4588_ _s4589_ in
                                                   if generic_eq p0_ "" then Some (FMV_W_X, rd, rs1)
                                                   else None
                                                | _ => None
                                                end)
                                    end)
                                    : M (option ((f_un_op_S * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_op_S * mword 5 * mword 5)))
                            end)
                            : M (option ((f_un_op_S * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_op_S * mword 5 * mword 5)))
                    end)
                    : M (option ((f_un_op_S * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_un_op_S * mword 5 * mword 5)))
            end)
            : M (option ((f_un_op_S * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_un_op_S * mword 5 * mword 5)))
    end)
    : M (option ((f_un_op_S * mword 5 * mword 5))).

Definition _s4565_ (_s4566_ : string) : M (option ((f_un_op_S * mword 5 * mword 5))) :=
   (match _s4566_ with
    | _s4567_ =>
       (f_un_type_mnemonic_S_matches_prefix _s4567_) >>= fun w__0 : option ((f_un_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMV_X_W, existT _ _s4568_ _) =>
           (match (string_drop _s4567_ _s4568_) with
            | _s4569_ =>
               (spc_matches_prefix _s4569_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4570_ _) =>
                   (match (string_drop _s4569_ _s4570_) with
                    | _s4571_ =>
                       (reg_name_matches_prefix _s4571_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4572_ _) =>
                           (match (string_drop _s4571_ _s4572_) with
                            | _s4573_ =>
                               (sep_matches_prefix _s4573_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4574_ _) =>
                                   (match (string_drop _s4573_ _s4574_) with
                                    | _s4575_ =>
                                       (freg_name_matches_prefix _s4575_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       returnm (match w__4 with
                                                | Some (rs1, existT _ _s4576_ _) =>
                                                   let p0_ := string_drop _s4575_ _s4576_ in
                                                   if generic_eq p0_ "" then Some (FMV_X_W, rd, rs1)
                                                   else None
                                                | _ => None
                                                end)
                                    end)
                                    : M (option ((f_un_op_S * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_op_S * mword 5 * mword 5)))
                            end)
                            : M (option ((f_un_op_S * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_op_S * mword 5 * mword 5)))
                    end)
                    : M (option ((f_un_op_S * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_un_op_S * mword 5 * mword 5)))
            end)
            : M (option ((f_un_op_S * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_un_op_S * mword 5 * mword 5)))
    end)
    : M (option ((f_un_op_S * mword 5 * mword 5))).

Definition _s4548_ (_s4549_ : string) : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))) :=
   (match _s4549_ with
    | _s4550_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s4550_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FLE_S, existT _ _s4551_ _) =>
           (match (string_drop _s4550_ _s4551_) with
            | _s4552_ =>
               (spc_matches_prefix _s4552_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4553_ _) =>
                   (match (string_drop _s4552_ _s4553_) with
                    | _s4554_ =>
                       (reg_name_matches_prefix _s4554_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4555_ _) =>
                           (match (string_drop _s4554_ _s4555_) with
                            | _s4556_ =>
                               (sep_matches_prefix _s4556_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4557_ _) =>
                                   (match (string_drop _s4556_ _s4557_) with
                                    | _s4558_ =>
                                       (freg_name_matches_prefix _s4558_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4559_ _) =>
                                           (match (string_drop _s4558_ _s4559_) with
                                            | _s4560_ =>
                                               (sep_matches_prefix _s4560_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4561_ _) =>
                                                   (match (string_drop _s4560_ _s4561_) with
                                                    | _s4562_ =>
                                                       (freg_name_matches_prefix _s4562_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s4563_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4562_ _s4563_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FLE_S, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))).

Definition _s4531_ (_s4532_ : string) : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))) :=
   (match _s4532_ with
    | _s4533_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s4533_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FLT_S, existT _ _s4534_ _) =>
           (match (string_drop _s4533_ _s4534_) with
            | _s4535_ =>
               (spc_matches_prefix _s4535_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4536_ _) =>
                   (match (string_drop _s4535_ _s4536_) with
                    | _s4537_ =>
                       (reg_name_matches_prefix _s4537_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4538_ _) =>
                           (match (string_drop _s4537_ _s4538_) with
                            | _s4539_ =>
                               (sep_matches_prefix _s4539_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4540_ _) =>
                                   (match (string_drop _s4539_ _s4540_) with
                                    | _s4541_ =>
                                       (freg_name_matches_prefix _s4541_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4542_ _) =>
                                           (match (string_drop _s4541_ _s4542_) with
                                            | _s4543_ =>
                                               (sep_matches_prefix _s4543_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4544_ _) =>
                                                   (match (string_drop _s4543_ _s4544_) with
                                                    | _s4545_ =>
                                                       (freg_name_matches_prefix _s4545_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s4546_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4545_ _s4546_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FLT_S, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))).

Definition _s4514_ (_s4515_ : string) : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))) :=
   (match _s4515_ with
    | _s4516_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s4516_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FEQ_S, existT _ _s4517_ _) =>
           (match (string_drop _s4516_ _s4517_) with
            | _s4518_ =>
               (spc_matches_prefix _s4518_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4519_ _) =>
                   (match (string_drop _s4518_ _s4519_) with
                    | _s4520_ =>
                       (reg_name_matches_prefix _s4520_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4521_ _) =>
                           (match (string_drop _s4520_ _s4521_) with
                            | _s4522_ =>
                               (sep_matches_prefix _s4522_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4523_ _) =>
                                   (match (string_drop _s4522_ _s4523_) with
                                    | _s4524_ =>
                                       (freg_name_matches_prefix _s4524_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4525_ _) =>
                                           (match (string_drop _s4524_ _s4525_) with
                                            | _s4526_ =>
                                               (sep_matches_prefix _s4526_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4527_ _) =>
                                                   (match (string_drop _s4526_ _s4527_) with
                                                    | _s4528_ =>
                                                       (freg_name_matches_prefix _s4528_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s4529_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4528_ _s4529_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FEQ_S, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))).

Definition _s4497_ (_s4498_ : string) : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))) :=
   (match _s4498_ with
    | _s4499_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s4499_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMAX_S, existT _ _s4500_ _) =>
           (match (string_drop _s4499_ _s4500_) with
            | _s4501_ =>
               (spc_matches_prefix _s4501_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4502_ _) =>
                   (match (string_drop _s4501_ _s4502_) with
                    | _s4503_ =>
                       (freg_name_matches_prefix _s4503_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4504_ _) =>
                           (match (string_drop _s4503_ _s4504_) with
                            | _s4505_ =>
                               (sep_matches_prefix _s4505_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4506_ _) =>
                                   (match (string_drop _s4505_ _s4506_) with
                                    | _s4507_ =>
                                       (freg_name_matches_prefix _s4507_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4508_ _) =>
                                           (match (string_drop _s4507_ _s4508_) with
                                            | _s4509_ =>
                                               (sep_matches_prefix _s4509_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4510_ _) =>
                                                   (match (string_drop _s4509_ _s4510_) with
                                                    | _s4511_ =>
                                                       (freg_name_matches_prefix _s4511_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s4512_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4511_ _s4512_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FMAX_S, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))).

Definition _s4480_ (_s4481_ : string) : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))) :=
   (match _s4481_ with
    | _s4482_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s4482_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMIN_S, existT _ _s4483_ _) =>
           (match (string_drop _s4482_ _s4483_) with
            | _s4484_ =>
               (spc_matches_prefix _s4484_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4485_ _) =>
                   (match (string_drop _s4484_ _s4485_) with
                    | _s4486_ =>
                       (freg_name_matches_prefix _s4486_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4487_ _) =>
                           (match (string_drop _s4486_ _s4487_) with
                            | _s4488_ =>
                               (sep_matches_prefix _s4488_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4489_ _) =>
                                   (match (string_drop _s4488_ _s4489_) with
                                    | _s4490_ =>
                                       (freg_name_matches_prefix _s4490_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4491_ _) =>
                                           (match (string_drop _s4490_ _s4491_) with
                                            | _s4492_ =>
                                               (sep_matches_prefix _s4492_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4493_ _) =>
                                                   (match (string_drop _s4492_ _s4493_) with
                                                    | _s4494_ =>
                                                       (freg_name_matches_prefix _s4494_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s4495_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4494_ _s4495_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FMIN_S, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))).

Definition _s4463_ (_s4464_ : string) : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))) :=
   (match _s4464_ with
    | _s4465_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s4465_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSGNJX_S, existT _ _s4466_ _) =>
           (match (string_drop _s4465_ _s4466_) with
            | _s4467_ =>
               (spc_matches_prefix _s4467_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4468_ _) =>
                   (match (string_drop _s4467_ _s4468_) with
                    | _s4469_ =>
                       (freg_name_matches_prefix _s4469_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4470_ _) =>
                           (match (string_drop _s4469_ _s4470_) with
                            | _s4471_ =>
                               (sep_matches_prefix _s4471_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4472_ _) =>
                                   (match (string_drop _s4471_ _s4472_) with
                                    | _s4473_ =>
                                       (freg_name_matches_prefix _s4473_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4474_ _) =>
                                           (match (string_drop _s4473_ _s4474_) with
                                            | _s4475_ =>
                                               (sep_matches_prefix _s4475_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4476_ _) =>
                                                   (match (string_drop _s4475_ _s4476_) with
                                                    | _s4477_ =>
                                                       (freg_name_matches_prefix _s4477_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s4478_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4477_ _s4478_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FSGNJX_S, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))).

Definition _s4446_ (_s4447_ : string) : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))) :=
   (match _s4447_ with
    | _s4448_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s4448_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSGNJN_S, existT _ _s4449_ _) =>
           (match (string_drop _s4448_ _s4449_) with
            | _s4450_ =>
               (spc_matches_prefix _s4450_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4451_ _) =>
                   (match (string_drop _s4450_ _s4451_) with
                    | _s4452_ =>
                       (freg_name_matches_prefix _s4452_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4453_ _) =>
                           (match (string_drop _s4452_ _s4453_) with
                            | _s4454_ =>
                               (sep_matches_prefix _s4454_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4455_ _) =>
                                   (match (string_drop _s4454_ _s4455_) with
                                    | _s4456_ =>
                                       (freg_name_matches_prefix _s4456_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4457_ _) =>
                                           (match (string_drop _s4456_ _s4457_) with
                                            | _s4458_ =>
                                               (sep_matches_prefix _s4458_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4459_ _) =>
                                                   (match (string_drop _s4458_ _s4459_) with
                                                    | _s4460_ =>
                                                       (freg_name_matches_prefix _s4460_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s4461_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4460_ _s4461_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FSGNJN_S, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))).

Definition _s4429_ (_s4430_ : string) : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))) :=
   (match _s4430_ with
    | _s4431_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s4431_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSGNJ_S, existT _ _s4432_ _) =>
           (match (string_drop _s4431_ _s4432_) with
            | _s4433_ =>
               (spc_matches_prefix _s4433_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4434_ _) =>
                   (match (string_drop _s4433_ _s4434_) with
                    | _s4435_ =>
                       (freg_name_matches_prefix _s4435_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4436_ _) =>
                           (match (string_drop _s4435_ _s4436_) with
                            | _s4437_ =>
                               (sep_matches_prefix _s4437_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4438_ _) =>
                                   (match (string_drop _s4437_ _s4438_) with
                                    | _s4439_ =>
                                       (freg_name_matches_prefix _s4439_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4440_ _) =>
                                           (match (string_drop _s4439_ _s4440_) with
                                            | _s4441_ =>
                                               (sep_matches_prefix _s4441_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4442_ _) =>
                                                   (match (string_drop _s4441_ _s4442_) with
                                                    | _s4443_ =>
                                                       (freg_name_matches_prefix _s4443_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s4444_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4443_ _s4444_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FSGNJ_S, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5))).

Definition _s4412_ (_s4413_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4413_ with
    | _s4414_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s4414_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_S_LU, existT _ _s4415_ _) =>
           (match (string_drop _s4414_ _s4415_) with
            | _s4416_ =>
               (spc_matches_prefix _s4416_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4417_ _) =>
                   (match (string_drop _s4416_ _s4417_) with
                    | _s4418_ =>
                       (freg_name_matches_prefix _s4418_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4419_ _) =>
                           (match (string_drop _s4418_ _s4419_) with
                            | _s4420_ =>
                               (sep_matches_prefix _s4420_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4421_ _) =>
                                   (match (string_drop _s4420_ _s4421_) with
                                    | _s4422_ =>
                                       (reg_name_matches_prefix _s4422_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4423_ _) =>
                                           (match (string_drop _s4422_ _s4423_) with
                                            | _s4424_ =>
                                               (sep_matches_prefix _s4424_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4425_ _) =>
                                                   (match (string_drop _s4424_ _s4425_) with
                                                    | _s4426_ =>
                                                       (frm_mnemonic_matches_prefix _s4426_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s4427_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4426_ _s4427_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_S_LU, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))).

Definition _s4395_ (_s4396_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4396_ with
    | _s4397_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s4397_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_S_L, existT _ _s4398_ _) =>
           (match (string_drop _s4397_ _s4398_) with
            | _s4399_ =>
               (spc_matches_prefix _s4399_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4400_ _) =>
                   (match (string_drop _s4399_ _s4400_) with
                    | _s4401_ =>
                       (freg_name_matches_prefix _s4401_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4402_ _) =>
                           (match (string_drop _s4401_ _s4402_) with
                            | _s4403_ =>
                               (sep_matches_prefix _s4403_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4404_ _) =>
                                   (match (string_drop _s4403_ _s4404_) with
                                    | _s4405_ =>
                                       (reg_name_matches_prefix _s4405_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4406_ _) =>
                                           (match (string_drop _s4405_ _s4406_) with
                                            | _s4407_ =>
                                               (sep_matches_prefix _s4407_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4408_ _) =>
                                                   (match (string_drop _s4407_ _s4408_) with
                                                    | _s4409_ =>
                                                       (frm_mnemonic_matches_prefix _s4409_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s4410_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4409_ _s4410_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_S_L, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))).

Definition _s4378_ (_s4379_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4379_ with
    | _s4380_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s4380_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_LU_S, existT _ _s4381_ _) =>
           (match (string_drop _s4380_ _s4381_) with
            | _s4382_ =>
               (spc_matches_prefix _s4382_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4383_ _) =>
                   (match (string_drop _s4382_ _s4383_) with
                    | _s4384_ =>
                       (reg_name_matches_prefix _s4384_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4385_ _) =>
                           (match (string_drop _s4384_ _s4385_) with
                            | _s4386_ =>
                               (sep_matches_prefix _s4386_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4387_ _) =>
                                   (match (string_drop _s4386_ _s4387_) with
                                    | _s4388_ =>
                                       (freg_name_matches_prefix _s4388_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4389_ _) =>
                                           (match (string_drop _s4388_ _s4389_) with
                                            | _s4390_ =>
                                               (sep_matches_prefix _s4390_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4391_ _) =>
                                                   (match (string_drop _s4390_ _s4391_) with
                                                    | _s4392_ =>
                                                       (frm_mnemonic_matches_prefix _s4392_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s4393_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4392_ _s4393_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_LU_S, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))).

Definition _s4361_ (_s4362_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4362_ with
    | _s4363_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s4363_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_L_S, existT _ _s4364_ _) =>
           (match (string_drop _s4363_ _s4364_) with
            | _s4365_ =>
               (spc_matches_prefix _s4365_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4366_ _) =>
                   (match (string_drop _s4365_ _s4366_) with
                    | _s4367_ =>
                       (reg_name_matches_prefix _s4367_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4368_ _) =>
                           (match (string_drop _s4367_ _s4368_) with
                            | _s4369_ =>
                               (sep_matches_prefix _s4369_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4370_ _) =>
                                   (match (string_drop _s4369_ _s4370_) with
                                    | _s4371_ =>
                                       (freg_name_matches_prefix _s4371_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4372_ _) =>
                                           (match (string_drop _s4371_ _s4372_) with
                                            | _s4373_ =>
                                               (sep_matches_prefix _s4373_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4374_ _) =>
                                                   (match (string_drop _s4373_ _s4374_) with
                                                    | _s4375_ =>
                                                       (frm_mnemonic_matches_prefix _s4375_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s4376_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4375_ _s4376_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_L_S, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))).

Definition _s4344_ (_s4345_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4345_ with
    | _s4346_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s4346_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_S_WU, existT _ _s4347_ _) =>
           (match (string_drop _s4346_ _s4347_) with
            | _s4348_ =>
               (spc_matches_prefix _s4348_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4349_ _) =>
                   (match (string_drop _s4348_ _s4349_) with
                    | _s4350_ =>
                       (freg_name_matches_prefix _s4350_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4351_ _) =>
                           (match (string_drop _s4350_ _s4351_) with
                            | _s4352_ =>
                               (sep_matches_prefix _s4352_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4353_ _) =>
                                   (match (string_drop _s4352_ _s4353_) with
                                    | _s4354_ =>
                                       (reg_name_matches_prefix _s4354_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4355_ _) =>
                                           (match (string_drop _s4354_ _s4355_) with
                                            | _s4356_ =>
                                               (sep_matches_prefix _s4356_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4357_ _) =>
                                                   (match (string_drop _s4356_ _s4357_) with
                                                    | _s4358_ =>
                                                       (frm_mnemonic_matches_prefix _s4358_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s4359_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4358_ _s4359_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_S_WU, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))).

Definition _s4327_ (_s4328_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4328_ with
    | _s4329_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s4329_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_S_W, existT _ _s4330_ _) =>
           (match (string_drop _s4329_ _s4330_) with
            | _s4331_ =>
               (spc_matches_prefix _s4331_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4332_ _) =>
                   (match (string_drop _s4331_ _s4332_) with
                    | _s4333_ =>
                       (freg_name_matches_prefix _s4333_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4334_ _) =>
                           (match (string_drop _s4333_ _s4334_) with
                            | _s4335_ =>
                               (sep_matches_prefix _s4335_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4336_ _) =>
                                   (match (string_drop _s4335_ _s4336_) with
                                    | _s4337_ =>
                                       (reg_name_matches_prefix _s4337_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4338_ _) =>
                                           (match (string_drop _s4337_ _s4338_) with
                                            | _s4339_ =>
                                               (sep_matches_prefix _s4339_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4340_ _) =>
                                                   (match (string_drop _s4339_ _s4340_) with
                                                    | _s4341_ =>
                                                       (frm_mnemonic_matches_prefix _s4341_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s4342_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4341_ _s4342_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_S_W, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))).

Definition _s4310_ (_s4311_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4311_ with
    | _s4312_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s4312_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_WU_S, existT _ _s4313_ _) =>
           (match (string_drop _s4312_ _s4313_) with
            | _s4314_ =>
               (spc_matches_prefix _s4314_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4315_ _) =>
                   (match (string_drop _s4314_ _s4315_) with
                    | _s4316_ =>
                       (reg_name_matches_prefix _s4316_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4317_ _) =>
                           (match (string_drop _s4316_ _s4317_) with
                            | _s4318_ =>
                               (sep_matches_prefix _s4318_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4319_ _) =>
                                   (match (string_drop _s4318_ _s4319_) with
                                    | _s4320_ =>
                                       (freg_name_matches_prefix _s4320_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4321_ _) =>
                                           (match (string_drop _s4320_ _s4321_) with
                                            | _s4322_ =>
                                               (sep_matches_prefix _s4322_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4323_ _) =>
                                                   (match (string_drop _s4322_ _s4323_) with
                                                    | _s4324_ =>
                                                       (frm_mnemonic_matches_prefix _s4324_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s4325_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4324_ _s4325_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_WU_S, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))).

Definition _s4293_ (_s4294_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4294_ with
    | _s4295_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s4295_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_W_S, existT _ _s4296_ _) =>
           (match (string_drop _s4295_ _s4296_) with
            | _s4297_ =>
               (spc_matches_prefix _s4297_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4298_ _) =>
                   (match (string_drop _s4297_ _s4298_) with
                    | _s4299_ =>
                       (reg_name_matches_prefix _s4299_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4300_ _) =>
                           (match (string_drop _s4299_ _s4300_) with
                            | _s4301_ =>
                               (sep_matches_prefix _s4301_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4302_ _) =>
                                   (match (string_drop _s4301_ _s4302_) with
                                    | _s4303_ =>
                                       (freg_name_matches_prefix _s4303_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4304_ _) =>
                                           (match (string_drop _s4303_ _s4304_) with
                                            | _s4305_ =>
                                               (sep_matches_prefix _s4305_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4306_ _) =>
                                                   (match (string_drop _s4305_ _s4306_) with
                                                    | _s4307_ =>
                                                       (frm_mnemonic_matches_prefix _s4307_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s4308_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4307_ _s4308_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FCVT_W_S, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))).

Definition _s4276_ (_s4277_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4277_ with
    | _s4278_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s4278_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSQRT_S, existT _ _s4279_ _) =>
           (match (string_drop _s4278_ _s4279_) with
            | _s4280_ =>
               (spc_matches_prefix _s4280_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4281_ _) =>
                   (match (string_drop _s4280_ _s4281_) with
                    | _s4282_ =>
                       (freg_name_matches_prefix _s4282_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4283_ _) =>
                           (match (string_drop _s4282_ _s4283_) with
                            | _s4284_ =>
                               (sep_matches_prefix _s4284_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4285_ _) =>
                                   (match (string_drop _s4284_ _s4285_) with
                                    | _s4286_ =>
                                       (freg_name_matches_prefix _s4286_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4287_ _) =>
                                           (match (string_drop _s4286_ _s4287_) with
                                            | _s4288_ =>
                                               (sep_matches_prefix _s4288_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4289_ _) =>
                                                   (match (string_drop _s4288_ _s4289_) with
                                                    | _s4290_ =>
                                                       (frm_mnemonic_matches_prefix _s4290_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s4291_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4290_ _s4291_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (FSQRT_S, rd, rs1, rm)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode))).

Definition _s4255_ (_s4256_ : string)
: M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4256_ with
    | _s4257_ =>
       (f_bin_rm_type_mnemonic_S_matches_prefix _s4257_) >>= fun w__0 : option ((f_bin_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s4258_ _) =>
           (match (string_drop _s4257_ _s4258_) with
            | _s4259_ =>
               (spc_matches_prefix _s4259_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4260_ _) =>
                   (match (string_drop _s4259_ _s4260_) with
                    | _s4261_ =>
                       (freg_name_matches_prefix _s4261_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4262_ _) =>
                           (match (string_drop _s4261_ _s4262_) with
                            | _s4263_ =>
                               (sep_matches_prefix _s4263_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4264_ _) =>
                                   (match (string_drop _s4263_ _s4264_) with
                                    | _s4265_ =>
                                       (freg_name_matches_prefix _s4265_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4266_ _) =>
                                           (match (string_drop _s4265_ _s4266_) with
                                            | _s4267_ =>
                                               (sep_matches_prefix _s4267_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4268_ _) =>
                                                   (match (string_drop _s4267_ _s4268_) with
                                                    | _s4269_ =>
                                                       (freg_name_matches_prefix _s4269_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       (match w__6 with
                                                        | Some (rs2, existT _ _s4270_ _) =>
                                                           (match (string_drop _s4269_ _s4270_) with
                                                            | _s4271_ =>
                                                               (sep_matches_prefix _s4271_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                 0)})) =>
                                                               (match w__7 with
                                                                | Some (tt, existT _ _s4272_ _) =>
                                                                   (match (string_drop _s4271_
                                                                             _s4272_) with
                                                                    | _s4273_ =>
                                                                       (frm_mnemonic_matches_prefix
                                                                          _s4273_) >>= fun w__8 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                                         0)})) =>
                                                                       returnm (match w__8 with
                                                                                | Some
                                                                                  (rm, existT _ _s4274_ _) =>
                                                                                   let p0_ :=
                                                                                     string_drop
                                                                                       _s4273_
                                                                                       _s4274_ in
                                                                                   if generic_eq p0_
                                                                                        "" then
                                                                                     Some
                                                                                       (op, rd, rs1, rs2, rm)
                                                                                   else None
                                                                                | _ => None
                                                                                end)
                                                                    end)
                                                                    : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                | _ => returnm None
                                                                end)
                                                                : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                            end)
                                                            : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                        | _ => returnm None
                                                        end)
                                                        : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                    end)
                                                    : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode))).

Definition _s4230_ (_s4231_ : string)
: M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode))) :=
   (match _s4231_ with
    | _s4232_ =>
       (f_madd_type_mnemonic_S_matches_prefix _s4232_) >>= fun w__0 : option ((f_madd_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s4233_ _) =>
           (match (string_drop _s4232_ _s4233_) with
            | _s4234_ =>
               (spc_matches_prefix _s4234_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4235_ _) =>
                   (match (string_drop _s4234_ _s4235_) with
                    | _s4236_ =>
                       (freg_name_matches_prefix _s4236_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4237_ _) =>
                           (match (string_drop _s4236_ _s4237_) with
                            | _s4238_ =>
                               (sep_matches_prefix _s4238_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4239_ _) =>
                                   (match (string_drop _s4238_ _s4239_) with
                                    | _s4240_ =>
                                       (freg_name_matches_prefix _s4240_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s4241_ _) =>
                                           (match (string_drop _s4240_ _s4241_) with
                                            | _s4242_ =>
                                               (sep_matches_prefix _s4242_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4243_ _) =>
                                                   (match (string_drop _s4242_ _s4243_) with
                                                    | _s4244_ =>
                                                       (freg_name_matches_prefix _s4244_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       (match w__6 with
                                                        | Some (rs2, existT _ _s4245_ _) =>
                                                           (match (string_drop _s4244_ _s4245_) with
                                                            | _s4246_ =>
                                                               (sep_matches_prefix _s4246_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                 0)})) =>
                                                               (match w__7 with
                                                                | Some (tt, existT _ _s4247_ _) =>
                                                                   (match (string_drop _s4246_
                                                                             _s4247_) with
                                                                    | _s4248_ =>
                                                                       (freg_name_matches_prefix
                                                                          _s4248_) >>= fun w__8 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                         0)})) =>
                                                                       (match w__8 with
                                                                        | Some
                                                                          (rs3, existT _ _s4249_ _) =>
                                                                           (match (string_drop
                                                                                     _s4248_ _s4249_) with
                                                                            | _s4250_ =>
                                                                               (sep_matches_prefix
                                                                                  _s4250_) >>= fun w__9 : option ((unit * {n : Z & ArithFact (n >=?
                                                                                 0)})) =>
                                                                               (match w__9 with
                                                                                | Some
                                                                                  (tt, existT _ _s4251_ _) =>
                                                                                   (match (string_drop
                                                                                             _s4250_
                                                                                             _s4251_) with
                                                                                    | _s4252_ =>
                                                                                       (frm_mnemonic_matches_prefix
                                                                                          _s4252_) >>= fun w__10 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                                                         0)})) =>
                                                                                       returnm (match w__10 with
                                                                                                | Some
                                                                                                  (rm, existT _ _s4253_ _) =>
                                                                                                   let p0_ :=
                                                                                                     string_drop
                                                                                                       _s4252_
                                                                                                       _s4253_ in
                                                                                                   if
                                                                                                     generic_eq
                                                                                                       p0_
                                                                                                       ""
                                                                                                   then
                                                                                                     Some
                                                                                                       (op, rd, rs1, rs2, rs3, rm)
                                                                                                   else
                                                                                                     None
                                                                                                | _ =>
                                                                                                   None
                                                                                                end)
                                                                                    end)
                                                                                    : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                                | _ => returnm None
                                                                                end)
                                                                                : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                            end)
                                                                            : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                        | _ => returnm None
                                                                        end)
                                                                        : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                    end)
                                                                    : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                                | _ => returnm None
                                                                end)
                                                                : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                            end)
                                                            : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                        | _ => returnm None
                                                        end)
                                                        : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                    end)
                                                    : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                            end)
                                            : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                    end)
                                    : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                                | _ => returnm None
                                end)
                                : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                            end)
                            : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                        | _ => returnm None
                        end)
                        : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                    end)
                    : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
                | _ => returnm None
                end)
                : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
            end)
            : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
        | _ => returnm None
        end)
        : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)))
    end)
    : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode))).

Definition _s4206_ (_s4207_ : string) : M (option ((word_width * mword 5 * mword 12 * mword 5))) :=
   let _s4208_ := _s4207_ in
   (if string_startswith _s4208_ "fs" then
      (match (string_drop _s4208_ (projT1 (string_length "fs"))) with
       | _s4209_ =>
          (size_mnemonic_matches_prefix _s4209_) >>= fun w__0 : option ((word_width * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (width, existT _ _s4210_ _) =>
              (match (string_drop _s4209_ _s4210_) with
               | _s4211_ =>
                  (spc_matches_prefix _s4211_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (tt, existT _ _s4212_ _) =>
                      (match (string_drop _s4211_ _s4212_) with
                       | _s4213_ =>
                          (freg_name_matches_prefix _s4213_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rs2, existT _ _s4214_ _) =>
                              (match (string_drop _s4213_ _s4214_) with
                               | _s4215_ =>
                                  (sep_matches_prefix _s4215_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s4216_ _) =>
                                      (match (string_drop _s4215_ _s4216_) with
                                       | _s4217_ =>
                                          (match (hex_bits_12_matches_prefix _s4217_) with
                                           | Some (imm, existT _ _s4218_ _) =>
                                              (match (string_drop _s4217_ _s4218_) with
                                               | _s4219_ =>
                                                  (opt_spc_matches_prefix _s4219_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__4 with
                                                   | Some (tt, existT _ _s4220_ _) =>
                                                      let _s4221_ := string_drop _s4219_ _s4220_ in
                                                      (if string_startswith _s4221_ "(" then
                                                         (match (string_drop _s4221_
                                                                   (projT1
                                                                    (string_length "("))) with
                                                          | _s4222_ =>
                                                             (opt_spc_matches_prefix _s4222_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                               0)})) =>
                                                             (match w__5 with
                                                              | Some (tt, existT _ _s4223_ _) =>
                                                                 (match (string_drop _s4222_ _s4223_) with
                                                                  | _s4224_ =>
                                                                     (reg_name_matches_prefix
                                                                        _s4224_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                       0)})) =>
                                                                     (match w__6 with
                                                                      | Some
                                                                        (rs1, existT _ _s4225_ _) =>
                                                                         (match (string_drop _s4224_
                                                                                   _s4225_) with
                                                                          | _s4226_ =>
                                                                             (opt_spc_matches_prefix
                                                                                _s4226_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                               0)})) =>
                                                                             returnm (match w__7 with
                                                                                      | Some
                                                                                        (tt, existT _ _s4227_ _) =>
                                                                                         let _s4228_ :=
                                                                                           string_drop
                                                                                             _s4226_
                                                                                             _s4227_ in
                                                                                         if string_startswith
                                                                                              _s4228_
                                                                                              ")"
                                                                                         then
                                                                                           let p0_ :=
                                                                                             string_drop
                                                                                               _s4228_
                                                                                               (projT1
                                                                                                (string_length
                                                                                                   ")")) in
                                                                                           if generic_eq
                                                                                                p0_
                                                                                                ""
                                                                                           then
                                                                                             Some
                                                                                               (width, rs2, imm, rs1)
                                                                                           else None
                                                                                         else None
                                                                                      | _ => None
                                                                                      end)
                                                                          end)
                                                                          : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                                      | _ => returnm None
                                                                      end)
                                                                      : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                                  end)
                                                                  : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                              | _ => returnm None
                                                              end)
                                                              : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                          end)
                                                          : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                       else returnm None)
                                                       : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                               end)
                                               : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                       end)
                                       : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                               end)
                               : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                       end)
                       : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((word_width * mword 5 * mword 12 * mword 5)))
               end)
               : M (option ((word_width * mword 5 * mword 12 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((word_width * mword 5 * mword 12 * mword 5)))
       end)
       : M (option ((word_width * mword 5 * mword 12 * mword 5)))
    else returnm None)
    : M (option ((word_width * mword 5 * mword 12 * mword 5))).

Definition _s4182_ (_s4183_ : string) : M (option ((word_width * mword 5 * mword 12 * mword 5))) :=
   let _s4184_ := _s4183_ in
   (if string_startswith _s4184_ "fl" then
      (match (string_drop _s4184_ (projT1 (string_length "fl"))) with
       | _s4185_ =>
          (size_mnemonic_matches_prefix _s4185_) >>= fun w__0 : option ((word_width * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (width, existT _ _s4186_ _) =>
              (match (string_drop _s4185_ _s4186_) with
               | _s4187_ =>
                  (spc_matches_prefix _s4187_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (tt, existT _ _s4188_ _) =>
                      (match (string_drop _s4187_ _s4188_) with
                       | _s4189_ =>
                          (freg_name_matches_prefix _s4189_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rd, existT _ _s4190_ _) =>
                              (match (string_drop _s4189_ _s4190_) with
                               | _s4191_ =>
                                  (sep_matches_prefix _s4191_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s4192_ _) =>
                                      (match (string_drop _s4191_ _s4192_) with
                                       | _s4193_ =>
                                          (match (hex_bits_12_matches_prefix _s4193_) with
                                           | Some (imm, existT _ _s4194_ _) =>
                                              (match (string_drop _s4193_ _s4194_) with
                                               | _s4195_ =>
                                                  (opt_spc_matches_prefix _s4195_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__4 with
                                                   | Some (tt, existT _ _s4196_ _) =>
                                                      let _s4197_ := string_drop _s4195_ _s4196_ in
                                                      (if string_startswith _s4197_ "(" then
                                                         (match (string_drop _s4197_
                                                                   (projT1
                                                                    (string_length "("))) with
                                                          | _s4198_ =>
                                                             (opt_spc_matches_prefix _s4198_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                               0)})) =>
                                                             (match w__5 with
                                                              | Some (tt, existT _ _s4199_ _) =>
                                                                 (match (string_drop _s4198_ _s4199_) with
                                                                  | _s4200_ =>
                                                                     (reg_name_matches_prefix
                                                                        _s4200_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                       0)})) =>
                                                                     (match w__6 with
                                                                      | Some
                                                                        (rs1, existT _ _s4201_ _) =>
                                                                         (match (string_drop _s4200_
                                                                                   _s4201_) with
                                                                          | _s4202_ =>
                                                                             (opt_spc_matches_prefix
                                                                                _s4202_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                               0)})) =>
                                                                             returnm (match w__7 with
                                                                                      | Some
                                                                                        (tt, existT _ _s4203_ _) =>
                                                                                         let _s4204_ :=
                                                                                           string_drop
                                                                                             _s4202_
                                                                                             _s4203_ in
                                                                                         if string_startswith
                                                                                              _s4204_
                                                                                              ")"
                                                                                         then
                                                                                           let p0_ :=
                                                                                             string_drop
                                                                                               _s4204_
                                                                                               (projT1
                                                                                                (string_length
                                                                                                   ")")) in
                                                                                           if generic_eq
                                                                                                p0_
                                                                                                ""
                                                                                           then
                                                                                             Some
                                                                                               (width, rd, imm, rs1)
                                                                                           else None
                                                                                         else None
                                                                                      | _ => None
                                                                                      end)
                                                                          end)
                                                                          : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                                      | _ => returnm None
                                                                      end)
                                                                      : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                                  end)
                                                                  : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                              | _ => returnm None
                                                              end)
                                                              : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                          end)
                                                          : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                       else returnm None)
                                                       : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                               end)
                                               : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                       end)
                                       : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                               end)
                               : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                       end)
                       : M (option ((word_width * mword 5 * mword 12 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((word_width * mword 5 * mword 12 * mword 5)))
               end)
               : M (option ((word_width * mword 5 * mword 12 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((word_width * mword 5 * mword 12 * mword 5)))
       end)
       : M (option ((word_width * mword 5 * mword 12 * mword 5)))
    else returnm None)
    : M (option ((word_width * mword 5 * mword 12 * mword 5))).

Definition _s4170_ (_s4171_ : string) : M (option ((mword 5 * mword 5 * mword 12))) :=
   let _s4172_ := _s4171_ in
   (if string_startswith _s4172_ "fence.i.reserved." then
      (match (string_drop _s4172_ (projT1 (string_length "fence.i.reserved."))) with
       | _s4173_ =>
          (reg_name_matches_prefix _s4173_) >>= fun w__0 : option ((mword 5 * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (rd, existT _ _s4174_ _) =>
              let _s4175_ := string_drop _s4173_ _s4174_ in
              (if string_startswith _s4175_ "." then
                 (match (string_drop _s4175_ (projT1 (string_length "."))) with
                  | _s4176_ =>
                     (reg_name_matches_prefix _s4176_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                       0)})) =>
                     returnm (match w__1 with
                              | Some (rs, existT _ _s4177_ _) =>
                                 let _s4178_ := string_drop _s4176_ _s4177_ in
                                 if string_startswith _s4178_ "." then
                                   match (string_drop _s4178_ (projT1 (string_length "."))) with
                                   | _s4179_ =>
                                      match (hex_bits_12_matches_prefix _s4179_) with
                                      | Some (imm, existT _ _s4180_ _) =>
                                         let p0_ := string_drop _s4179_ _s4180_ in
                                         if generic_eq p0_ "" then Some (rd, rs, imm)
                                         else None
                                      | _ => None
                                      end
                                   end
                                 else None
                              | _ => None
                              end)
                  end)
                  : M (option ((mword 5 * mword 5 * mword 12)))
               else returnm None)
               : M (option ((mword 5 * mword 5 * mword 12)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5 * mword 12)))
       end)
       : M (option ((mword 5 * mword 5 * mword 12)))
    else returnm None)
    : M (option ((mword 5 * mword 5 * mword 12))).

Definition _s4152_ (_s4153_ : string)
: M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4))) :=
   let _s4154_ := _s4153_ in
   (if string_startswith _s4154_ "fence.reserved." then
      (match (string_drop _s4154_ (projT1 (string_length "fence.reserved."))) with
       | _s4155_ =>
          (fence_bits_matches_prefix _s4155_) >>= fun w__0 : option ((mword 4 * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (pred, existT _ _s4156_ _) =>
              let _s4157_ := string_drop _s4155_ _s4156_ in
              (if string_startswith _s4157_ "." then
                 (match (string_drop _s4157_ (projT1 (string_length "."))) with
                  | _s4158_ =>
                     (fence_bits_matches_prefix _s4158_) >>= fun w__1 : option ((mword 4 * {n : Z & ArithFact (n >=?
                       0)})) =>
                     (match w__1 with
                      | Some (succ, existT _ _s4159_ _) =>
                         let _s4160_ := string_drop _s4158_ _s4159_ in
                         (if string_startswith _s4160_ "." then
                            (match (string_drop _s4160_ (projT1 (string_length "."))) with
                             | _s4161_ =>
                                (reg_name_matches_prefix _s4161_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                  0)})) =>
                                (match w__2 with
                                 | Some (rs, existT _ _s4162_ _) =>
                                    let _s4163_ := string_drop _s4161_ _s4162_ in
                                    (if string_startswith _s4163_ "." then
                                       (match (string_drop _s4163_ (projT1 (string_length "."))) with
                                        | _s4164_ =>
                                           (reg_name_matches_prefix _s4164_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                             0)})) =>
                                           returnm (match w__3 with
                                                    | Some (rd, existT _ _s4165_ _) =>
                                                       let _s4166_ := string_drop _s4164_ _s4165_ in
                                                       if string_startswith _s4166_ "." then
                                                         match (string_drop _s4166_
                                                                  (projT1
                                                                   (string_length "."))) with
                                                         | _s4167_ =>
                                                            match (hex_bits_4_matches_prefix _s4167_) with
                                                            | Some (fm, existT _ _s4168_ _) =>
                                                               let p0_ :=
                                                                 string_drop _s4167_ _s4168_ in
                                                               if generic_eq p0_ "" then
                                                                 Some (pred, succ, rs, rd, fm)
                                                               else None
                                                            | _ => None
                                                            end
                                                         end
                                                       else None
                                                    | _ => None
                                                    end)
                                        end)
                                        : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)))
                                     else returnm None)
                                     : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)))
                                 | _ => returnm None
                                 end)
                                 : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)))
                             end)
                             : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)))
                          else returnm None)
                          : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)))
                      | _ => returnm None
                      end)
                      : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)))
                  end)
                  : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)))
               else returnm None)
               : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)))
           | _ => returnm None
           end)
           : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)))
       end)
       : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)))
    else returnm None)
    : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4))).

Definition _s4146_ (_s4147_ : string) : M (option (mword 3)) :=
   let _s4148_ := _s4147_ in
   (if string_startswith _s4148_ "c.srai.hint." then
      (match (string_drop _s4148_ (projT1 (string_length "c.srai.hint."))) with
       | _s4149_ =>
          (creg_name_matches_prefix _s4149_) >>= fun w__0 : option ((mword 3 * {n : Z & ArithFact (n >=?
            0)})) =>
          returnm (match w__0 with
                   | Some (rsd, existT _ _s4150_ _) =>
                      let p0_ := string_drop _s4149_ _s4150_ in
                      if generic_eq p0_ "" then Some rsd
                      else None
                   | _ => None
                   end)
       end)
       : M (option (mword 3))
    else returnm None)
    : M (option (mword 3)).

Definition _s4140_ (_s4141_ : string) : M (option (mword 3)) :=
   let _s4142_ := _s4141_ in
   (if string_startswith _s4142_ "c.srli.hint." then
      (match (string_drop _s4142_ (projT1 (string_length "c.srli.hint."))) with
       | _s4143_ =>
          (creg_name_matches_prefix _s4143_) >>= fun w__0 : option ((mword 3 * {n : Z & ArithFact (n >=?
            0)})) =>
          returnm (match w__0 with
                   | Some (rsd, existT _ _s4144_ _) =>
                      let p0_ := string_drop _s4143_ _s4144_ in
                      if generic_eq p0_ "" then Some rsd
                      else None
                   | _ => None
                   end)
       end)
       : M (option (mword 3))
    else returnm None)
    : M (option (mword 3)).

Definition _s4131_ (_s4132_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s4133_ := _s4132_ in
   (if string_startswith _s4133_ "c.slli.hint." then
      (match (string_drop _s4133_ (projT1 (string_length "c.slli.hint."))) with
       | _s4134_ =>
          (reg_name_matches_prefix _s4134_) >>= fun w__0 : option ((mword 5 * {n : Z & ArithFact (n >=?
            0)})) =>
          returnm (match w__0 with
                   | Some (rsd, existT _ _s4135_ _) =>
                      let _s4136_ := string_drop _s4134_ _s4135_ in
                      if string_startswith _s4136_ "." then
                        match (string_drop _s4136_ (projT1 (string_length "."))) with
                        | _s4137_ =>
                           match (hex_bits_6_matches_prefix _s4137_) with
                           | Some (shamt, existT _ _s4138_ _) =>
                              let p0_ := string_drop _s4137_ _s4138_ in
                              if generic_eq p0_ "" then Some (rsd, shamt)
                              else None
                           | _ => None
                           end
                        end
                      else None
                   | _ => None
                   end)
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s4125_ (_s4126_ : string) : M (option (mword 5)) :=
   let _s4127_ := _s4126_ in
   (if string_startswith _s4127_ "c.add.hint." then
      (match (string_drop _s4127_ (projT1 (string_length "c.add.hint."))) with
       | _s4128_ =>
          (reg_name_matches_prefix _s4128_) >>= fun w__0 : option ((mword 5 * {n : Z & ArithFact (n >=?
            0)})) =>
          returnm (match w__0 with
                   | Some (rs2, existT _ _s4129_ _) =>
                      let p0_ := string_drop _s4128_ _s4129_ in
                      if generic_eq p0_ "" then Some rs2
                      else None
                   | _ => None
                   end)
       end)
       : M (option (mword 5))
    else returnm None)
    : M (option (mword 5)).

Definition _s4119_ (_s4120_ : string) : M (option (mword 5)) :=
   let _s4121_ := _s4120_ in
   (if string_startswith _s4121_ "c.mv.hint." then
      (match (string_drop _s4121_ (projT1 (string_length "c.mv.hint."))) with
       | _s4122_ =>
          (reg_name_matches_prefix _s4122_) >>= fun w__0 : option ((mword 5 * {n : Z & ArithFact (n >=?
            0)})) =>
          returnm (match w__0 with
                   | Some (rs2, existT _ _s4123_ _) =>
                      let p0_ := string_drop _s4122_ _s4123_ in
                      if generic_eq p0_ "" then Some rs2
                      else None
                   | _ => None
                   end)
       end)
       : M (option (mword 5))
    else returnm None)
    : M (option (mword 5)).

Definition _s4113_ (_s4114_ : string) : option (mword 6) :=
   let _s4115_ := _s4114_ in
   if string_startswith _s4115_ "c.lui.hint." then
     match (string_drop _s4115_ (projT1 (string_length "c.lui.hint."))) with
     | _s4116_ =>
        match (hex_bits_6_matches_prefix _s4116_) with
        | Some (imm, existT _ _s4117_ _) =>
           let p0_ := string_drop _s4116_ _s4117_ in
           if generic_eq p0_ "" then Some imm
           else None
        | _ => None
        end
     end
   else None.

Definition _s4107_ (_s4108_ : string) : option (mword 6) :=
   let _s4109_ := _s4108_ in
   if string_startswith _s4109_ "c.li.hint." then
     match (string_drop _s4109_ (projT1 (string_length "c.li.hint."))) with
     | _s4110_ =>
        match (hex_bits_6_matches_prefix _s4110_) with
        | Some (imm, existT _ _s4111_ _) =>
           let p0_ := string_drop _s4110_ _s4111_ in
           if generic_eq p0_ "" then Some imm
           else None
        | _ => None
        end
     end
   else None.

Definition _s4101_ (_s4102_ : string) : M (option (mword 5)) :=
   let _s4103_ := _s4102_ in
   (if string_startswith _s4103_ "c.addi.hint." then
      (match (string_drop _s4103_ (projT1 (string_length "c.addi.hint."))) with
       | _s4104_ =>
          (reg_name_matches_prefix _s4104_) >>= fun w__0 : option ((mword 5 * {n : Z & ArithFact (n >=?
            0)})) =>
          returnm (match w__0 with
                   | Some (rsd, existT _ _s4105_ _) =>
                      let p0_ := string_drop _s4104_ _s4105_ in
                      if generic_eq p0_ "" then Some rsd
                      else None
                   | _ => None
                   end)
       end)
       : M (option (mword 5))
    else returnm None)
    : M (option (mword 5)).

Definition _s4095_ (_s4096_ : string) : option (mword 6) :=
   let _s4097_ := _s4096_ in
   if string_startswith _s4097_ "c.nop.hint." then
     match (string_drop _s4097_ (projT1 (string_length "c.nop.hint."))) with
     | _s4098_ =>
        match (hex_bits_6_matches_prefix _s4098_) with
        | Some (imm, existT _ _s4099_ _) =>
           let p0_ := string_drop _s4098_ _s4099_ in
           if generic_eq p0_ "" then Some imm
           else None
        | _ => None
        end
     end
   else None.

Definition _s4078_ (_s4079_ : string) : M (option ((csrop * mword 5 * mword 12 * mword 5))) :=
   (match _s4079_ with
    | _s4080_ =>
       (csr_mnemonic_matches_prefix _s4080_) >>= fun w__0 : option ((csrop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s4081_ _) =>
           (match (string_drop _s4080_ _s4081_) with
            | _s4082_ =>
               (spc_matches_prefix _s4082_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s4083_ _) =>
                   (match (string_drop _s4082_ _s4083_) with
                    | _s4084_ =>
                       (reg_name_matches_prefix _s4084_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s4085_ _) =>
                           (match (string_drop _s4084_ _s4085_) with
                            | _s4086_ =>
                               (sep_matches_prefix _s4086_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s4087_ _) =>
                                   (match (string_drop _s4086_ _s4087_) with
                                    | _s4088_ =>
                                       (csr_name_map_matches_prefix _s4088_) >>= fun w__4 : option ((mword 12 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (csr, existT _ _s4089_ _) =>
                                           (match (string_drop _s4088_ _s4089_) with
                                            | _s4090_ =>
                                               (sep_matches_prefix _s4090_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s4091_ _) =>
                                                   (match (string_drop _s4090_ _s4091_) with
                                                    | _s4092_ =>
                                                       (reg_name_matches_prefix _s4092_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs1, existT _ _s4093_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s4092_ _s4093_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (op, rd, csr, rs1)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                                            end)
                                            : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                                    end)
                                    : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                            end)
                            : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                    end)
                    : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((csrop * mword 5 * mword 12 * mword 5)))
            end)
            : M (option ((csrop * mword 5 * mword 12 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((csrop * mword 5 * mword 12 * mword 5)))
    end)
    : M (option ((csrop * mword 5 * mword 12 * mword 5))).

Definition _s4060_ (_s4061_ : string) : M (option ((csrop * mword 5 * mword 12 * mword 5))) :=
   (match _s4061_ with
    | _s4062_ =>
       (csr_mnemonic_matches_prefix _s4062_) >>= fun w__0 : option ((csrop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s4063_ _) =>
           let _s4064_ := string_drop _s4062_ _s4063_ in
           (if string_startswith _s4064_ "i" then
              (match (string_drop _s4064_ (projT1 (string_length "i"))) with
               | _s4065_ =>
                  (spc_matches_prefix _s4065_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (tt, existT _ _s4066_ _) =>
                      (match (string_drop _s4065_ _s4066_) with
                       | _s4067_ =>
                          (reg_name_matches_prefix _s4067_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rd, existT _ _s4068_ _) =>
                              (match (string_drop _s4067_ _s4068_) with
                               | _s4069_ =>
                                  (sep_matches_prefix _s4069_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s4070_ _) =>
                                      (match (string_drop _s4069_ _s4070_) with
                                       | _s4071_ =>
                                          (csr_name_map_matches_prefix _s4071_) >>= fun w__4 : option ((mword 12 * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (csr, existT _ _s4072_ _) =>
                                              (match (string_drop _s4071_ _s4072_) with
                                               | _s4073_ =>
                                                  (sep_matches_prefix _s4073_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  returnm (match w__5 with
                                                           | Some (tt, existT _ _s4074_ _) =>
                                                              match (string_drop _s4073_ _s4074_) with
                                                              | _s4075_ =>
                                                                 match (hex_bits_5_matches_prefix
                                                                          _s4075_) with
                                                                 | Some (rs1, existT _ _s4076_ _) =>
                                                                    let p0_ :=
                                                                      string_drop _s4075_ _s4076_ in
                                                                    if generic_eq p0_ "" then
                                                                      Some (op, rd, csr, rs1)
                                                                    else None
                                                                 | _ => None
                                                                 end
                                                              end
                                                           | _ => None
                                                           end)
                                               end)
                                               : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                                       end)
                                       : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                               end)
                               : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                       end)
                       : M (option ((csrop * mword 5 * mword 12 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((csrop * mword 5 * mword 12 * mword 5)))
               end)
               : M (option ((csrop * mword 5 * mword 12 * mword 5)))
            else returnm None)
            : M (option ((csrop * mword 5 * mword 12 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((csrop * mword 5 * mword 12 * mword 5)))
    end)
    : M (option ((csrop * mword 5 * mword 12 * mword 5))).

Definition _s4041_ (_s4042_ : string) : M (option ((bool * mword 5 * mword 5 * mword 5))) :=
   let _s4043_ := _s4042_ in
   (if string_startswith _s4043_ "rem" then
      (match (string_drop _s4043_ (projT1 (string_length "rem"))) with
       | _s4044_ =>
          (maybe_not_u_matches_prefix _s4044_) >>= fun w__0 : option ((bool * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (s, existT _ _s4045_ _) =>
              let _s4046_ := string_drop _s4044_ _s4045_ in
              (if string_startswith _s4046_ "w" then
                 (match (string_drop _s4046_ (projT1 (string_length "w"))) with
                  | _s4047_ =>
                     (spc_matches_prefix _s4047_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                       0)})) =>
                     (match w__1 with
                      | Some (tt, existT _ _s4048_ _) =>
                         (match (string_drop _s4047_ _s4048_) with
                          | _s4049_ =>
                             (reg_name_matches_prefix _s4049_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                               0)})) =>
                             (match w__2 with
                              | Some (rd, existT _ _s4050_ _) =>
                                 (match (string_drop _s4049_ _s4050_) with
                                  | _s4051_ =>
                                     (sep_matches_prefix _s4051_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                       0)})) =>
                                     (match w__3 with
                                      | Some (tt, existT _ _s4052_ _) =>
                                         (match (string_drop _s4051_ _s4052_) with
                                          | _s4053_ =>
                                             (reg_name_matches_prefix _s4053_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                               0)})) =>
                                             (match w__4 with
                                              | Some (rs1, existT _ _s4054_ _) =>
                                                 (match (string_drop _s4053_ _s4054_) with
                                                  | _s4055_ =>
                                                     (sep_matches_prefix _s4055_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                       0)})) =>
                                                     (match w__5 with
                                                      | Some (tt, existT _ _s4056_ _) =>
                                                         (match (string_drop _s4055_ _s4056_) with
                                                          | _s4057_ =>
                                                             (reg_name_matches_prefix _s4057_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                               0)})) =>
                                                             returnm (match w__6 with
                                                                      | Some
                                                                        (rs2, existT _ _s4058_ _) =>
                                                                         let p0_ :=
                                                                           string_drop _s4057_
                                                                             _s4058_ in
                                                                         if generic_eq p0_ "" then
                                                                           Some (s, rd, rs1, rs2)
                                                                         else None
                                                                      | _ => None
                                                                      end)
                                                          end)
                                                          : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                                      | _ => returnm None
                                                      end)
                                                      : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                                  end)
                                                  : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                              | _ => returnm None
                                              end)
                                              : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                          end)
                                          : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                      | _ => returnm None
                                      end)
                                      : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                  end)
                                  : M (option ((bool * mword 5 * mword 5 * mword 5)))
                              | _ => returnm None
                              end)
                              : M (option ((bool * mword 5 * mword 5 * mword 5)))
                          end)
                          : M (option ((bool * mword 5 * mword 5 * mword 5)))
                      | _ => returnm None
                      end)
                      : M (option ((bool * mword 5 * mword 5 * mword 5)))
                  end)
                  : M (option ((bool * mword 5 * mword 5 * mword 5)))
               else returnm None)
               : M (option ((bool * mword 5 * mword 5 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((bool * mword 5 * mword 5 * mword 5)))
       end)
       : M (option ((bool * mword 5 * mword 5 * mword 5)))
    else returnm None)
    : M (option ((bool * mword 5 * mword 5 * mword 5))).

Definition _s4022_ (_s4023_ : string) : M (option ((bool * mword 5 * mword 5 * mword 5))) :=
   let _s4024_ := _s4023_ in
   (if string_startswith _s4024_ "div" then
      (match (string_drop _s4024_ (projT1 (string_length "div"))) with
       | _s4025_ =>
          (maybe_not_u_matches_prefix _s4025_) >>= fun w__0 : option ((bool * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (s, existT _ _s4026_ _) =>
              let _s4027_ := string_drop _s4025_ _s4026_ in
              (if string_startswith _s4027_ "w" then
                 (match (string_drop _s4027_ (projT1 (string_length "w"))) with
                  | _s4028_ =>
                     (spc_matches_prefix _s4028_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                       0)})) =>
                     (match w__1 with
                      | Some (tt, existT _ _s4029_ _) =>
                         (match (string_drop _s4028_ _s4029_) with
                          | _s4030_ =>
                             (reg_name_matches_prefix _s4030_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                               0)})) =>
                             (match w__2 with
                              | Some (rd, existT _ _s4031_ _) =>
                                 (match (string_drop _s4030_ _s4031_) with
                                  | _s4032_ =>
                                     (sep_matches_prefix _s4032_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                       0)})) =>
                                     (match w__3 with
                                      | Some (tt, existT _ _s4033_ _) =>
                                         (match (string_drop _s4032_ _s4033_) with
                                          | _s4034_ =>
                                             (reg_name_matches_prefix _s4034_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                               0)})) =>
                                             (match w__4 with
                                              | Some (rs1, existT _ _s4035_ _) =>
                                                 (match (string_drop _s4034_ _s4035_) with
                                                  | _s4036_ =>
                                                     (sep_matches_prefix _s4036_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                       0)})) =>
                                                     (match w__5 with
                                                      | Some (tt, existT _ _s4037_ _) =>
                                                         (match (string_drop _s4036_ _s4037_) with
                                                          | _s4038_ =>
                                                             (reg_name_matches_prefix _s4038_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                               0)})) =>
                                                             returnm (match w__6 with
                                                                      | Some
                                                                        (rs2, existT _ _s4039_ _) =>
                                                                         let p0_ :=
                                                                           string_drop _s4038_
                                                                             _s4039_ in
                                                                         if generic_eq p0_ "" then
                                                                           Some (s, rd, rs1, rs2)
                                                                         else None
                                                                      | _ => None
                                                                      end)
                                                          end)
                                                          : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                                      | _ => returnm None
                                                      end)
                                                      : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                                  end)
                                                  : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                              | _ => returnm None
                                              end)
                                              : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                          end)
                                          : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                      | _ => returnm None
                                      end)
                                      : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                  end)
                                  : M (option ((bool * mword 5 * mword 5 * mword 5)))
                              | _ => returnm None
                              end)
                              : M (option ((bool * mword 5 * mword 5 * mword 5)))
                          end)
                          : M (option ((bool * mword 5 * mword 5 * mword 5)))
                      | _ => returnm None
                      end)
                      : M (option ((bool * mword 5 * mword 5 * mword 5)))
                  end)
                  : M (option ((bool * mword 5 * mword 5 * mword 5)))
               else returnm None)
               : M (option ((bool * mword 5 * mword 5 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((bool * mword 5 * mword 5 * mword 5)))
       end)
       : M (option ((bool * mword 5 * mword 5 * mword 5)))
    else returnm None)
    : M (option ((bool * mword 5 * mword 5 * mword 5))).

Definition _s4006_ (_s4007_ : string) : M (option ((mword 5 * mword 5 * mword 5))) :=
   let _s4008_ := _s4007_ in
   (if string_startswith _s4008_ "mulw" then
      (match (string_drop _s4008_ (projT1 (string_length "mulw"))) with
       | _s4009_ =>
          (spc_matches_prefix _s4009_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s4010_ _) =>
              (match (string_drop _s4009_ _s4010_) with
               | _s4011_ =>
                  (reg_name_matches_prefix _s4011_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s4012_ _) =>
                      (match (string_drop _s4011_ _s4012_) with
                       | _s4013_ =>
                          (sep_matches_prefix _s4013_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s4014_ _) =>
                              (match (string_drop _s4013_ _s4014_) with
                               | _s4015_ =>
                                  (reg_name_matches_prefix _s4015_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rs1, existT _ _s4016_ _) =>
                                      (match (string_drop _s4015_ _s4016_) with
                                       | _s4017_ =>
                                          (sep_matches_prefix _s4017_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (tt, existT _ _s4018_ _) =>
                                              (match (string_drop _s4017_ _s4018_) with
                                               | _s4019_ =>
                                                  (reg_name_matches_prefix _s4019_) >>= fun w__5 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  returnm (match w__5 with
                                                           | Some (rs2, existT _ _s4020_ _) =>
                                                              let p0_ := string_drop _s4019_ _s4020_ in
                                                              if generic_eq p0_ "" then
                                                                Some (rd, rs1, rs2)
                                                              else None
                                                           | _ => None
                                                           end)
                                               end)
                                               : M (option ((mword 5 * mword 5 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((mword 5 * mword 5 * mword 5)))
                                       end)
                                       : M (option ((mword 5 * mword 5 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 5 * mword 5 * mword 5)))
                               end)
                               : M (option ((mword 5 * mword 5 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 5 * mword 5 * mword 5)))
                       end)
                       : M (option ((mword 5 * mword 5 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 5 * mword 5)))
               end)
               : M (option ((mword 5 * mword 5 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5 * mword 5)))
       end)
       : M (option ((mword 5 * mword 5 * mword 5)))
    else returnm None)
    : M (option ((mword 5 * mword 5 * mword 5))).

Definition _s3988_ (_s3989_ : string) : M (option ((bool * mword 5 * mword 5 * mword 5))) :=
   let _s3990_ := _s3989_ in
   (if string_startswith _s3990_ "rem" then
      (match (string_drop _s3990_ (projT1 (string_length "rem"))) with
       | _s3991_ =>
          (maybe_not_u_matches_prefix _s3991_) >>= fun w__0 : option ((bool * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (s, existT _ _s3992_ _) =>
              (match (string_drop _s3991_ _s3992_) with
               | _s3993_ =>
                  (spc_matches_prefix _s3993_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (tt, existT _ _s3994_ _) =>
                      (match (string_drop _s3993_ _s3994_) with
                       | _s3995_ =>
                          (reg_name_matches_prefix _s3995_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rd, existT _ _s3996_ _) =>
                              (match (string_drop _s3995_ _s3996_) with
                               | _s3997_ =>
                                  (sep_matches_prefix _s3997_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s3998_ _) =>
                                      (match (string_drop _s3997_ _s3998_) with
                                       | _s3999_ =>
                                          (reg_name_matches_prefix _s3999_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (rs1, existT _ _s4000_ _) =>
                                              (match (string_drop _s3999_ _s4000_) with
                                               | _s4001_ =>
                                                  (sep_matches_prefix _s4001_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (tt, existT _ _s4002_ _) =>
                                                      (match (string_drop _s4001_ _s4002_) with
                                                       | _s4003_ =>
                                                          (reg_name_matches_prefix _s4003_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                            0)})) =>
                                                          returnm (match w__6 with
                                                                   | Some (rs2, existT _ _s4004_ _) =>
                                                                      let p0_ :=
                                                                        string_drop _s4003_ _s4004_ in
                                                                      if generic_eq p0_ "" then
                                                                        Some (s, rd, rs1, rs2)
                                                                      else None
                                                                   | _ => None
                                                                   end)
                                                       end)
                                                       : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                               end)
                                               : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                       end)
                                       : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((bool * mword 5 * mword 5 * mword 5)))
                               end)
                               : M (option ((bool * mword 5 * mword 5 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((bool * mword 5 * mword 5 * mword 5)))
                       end)
                       : M (option ((bool * mword 5 * mword 5 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((bool * mword 5 * mword 5 * mword 5)))
               end)
               : M (option ((bool * mword 5 * mword 5 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((bool * mword 5 * mword 5 * mword 5)))
       end)
       : M (option ((bool * mword 5 * mword 5 * mword 5)))
    else returnm None)
    : M (option ((bool * mword 5 * mword 5 * mword 5))).

Definition _s3970_ (_s3971_ : string) : M (option ((bool * mword 5 * mword 5 * mword 5))) :=
   let _s3972_ := _s3971_ in
   (if string_startswith _s3972_ "div" then
      (match (string_drop _s3972_ (projT1 (string_length "div"))) with
       | _s3973_ =>
          (maybe_not_u_matches_prefix _s3973_) >>= fun w__0 : option ((bool * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (s, existT _ _s3974_ _) =>
              (match (string_drop _s3973_ _s3974_) with
               | _s3975_ =>
                  (spc_matches_prefix _s3975_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (tt, existT _ _s3976_ _) =>
                      (match (string_drop _s3975_ _s3976_) with
                       | _s3977_ =>
                          (reg_name_matches_prefix _s3977_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rd, existT _ _s3978_ _) =>
                              (match (string_drop _s3977_ _s3978_) with
                               | _s3979_ =>
                                  (sep_matches_prefix _s3979_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s3980_ _) =>
                                      (match (string_drop _s3979_ _s3980_) with
                                       | _s3981_ =>
                                          (reg_name_matches_prefix _s3981_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (rs1, existT _ _s3982_ _) =>
                                              (match (string_drop _s3981_ _s3982_) with
                                               | _s3983_ =>
                                                  (sep_matches_prefix _s3983_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (tt, existT _ _s3984_ _) =>
                                                      (match (string_drop _s3983_ _s3984_) with
                                                       | _s3985_ =>
                                                          (reg_name_matches_prefix _s3985_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                            0)})) =>
                                                          returnm (match w__6 with
                                                                   | Some (rs2, existT _ _s3986_ _) =>
                                                                      let p0_ :=
                                                                        string_drop _s3985_ _s3986_ in
                                                                      if generic_eq p0_ "" then
                                                                        Some (s, rd, rs1, rs2)
                                                                      else None
                                                                   | _ => None
                                                                   end)
                                                       end)
                                                       : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                               end)
                                               : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                       end)
                                       : M (option ((bool * mword 5 * mword 5 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((bool * mword 5 * mword 5 * mword 5)))
                               end)
                               : M (option ((bool * mword 5 * mword 5 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((bool * mword 5 * mword 5 * mword 5)))
                       end)
                       : M (option ((bool * mword 5 * mword 5 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((bool * mword 5 * mword 5 * mword 5)))
               end)
               : M (option ((bool * mword 5 * mword 5 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((bool * mword 5 * mword 5 * mword 5)))
       end)
       : M (option ((bool * mword 5 * mword 5 * mword 5)))
    else returnm None)
    : M (option ((bool * mword 5 * mword 5 * mword 5))).

Definition _s3953_ (_s3954_ : string)
: M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5))) :=
   (match _s3954_ with
    | _s3955_ =>
       (mul_mnemonic_matches_prefix _s3955_) >>= fun w__0 : option (((bool * bool * bool) * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some ((high, signed1, signed2), existT _ _s3956_ _) =>
           (match (string_drop _s3955_ _s3956_) with
            | _s3957_ =>
               (spc_matches_prefix _s3957_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s3958_ _) =>
                   (match (string_drop _s3957_ _s3958_) with
                    | _s3959_ =>
                       (reg_name_matches_prefix _s3959_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s3960_ _) =>
                           (match (string_drop _s3959_ _s3960_) with
                            | _s3961_ =>
                               (sep_matches_prefix _s3961_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s3962_ _) =>
                                   (match (string_drop _s3961_ _s3962_) with
                                    | _s3963_ =>
                                       (reg_name_matches_prefix _s3963_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s3964_ _) =>
                                           (match (string_drop _s3963_ _s3964_) with
                                            | _s3965_ =>
                                               (sep_matches_prefix _s3965_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s3966_ _) =>
                                                   (match (string_drop _s3965_ _s3966_) with
                                                    | _s3967_ =>
                                                       (reg_name_matches_prefix _s3967_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s3968_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s3967_ _s3968_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some
                                                                       (high, signed1, signed2, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5))).

Definition _s3941_ (_s3942_ : string) : M (option ((mword 5 * mword 5))) :=
   let _s3943_ := _s3942_ in
   (if string_startswith _s3943_ "c.add" then
      (match (string_drop _s3943_ (projT1 (string_length "c.add"))) with
       | _s3944_ =>
          (spc_matches_prefix _s3944_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3945_ _) =>
              (match (string_drop _s3944_ _s3945_) with
               | _s3946_ =>
                  (reg_name_matches_prefix _s3946_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s3947_ _) =>
                      (match (string_drop _s3946_ _s3947_) with
                       | _s3948_ =>
                          (sep_matches_prefix _s3948_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s3949_ _) =>
                              (match (string_drop _s3948_ _s3949_) with
                               | _s3950_ =>
                                  (reg_name_matches_prefix _s3950_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s3951_ _) =>
                                              let p0_ := string_drop _s3950_ _s3951_ in
                                              if generic_eq p0_ "" then Some (rsd, rs2)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 5 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 5 * mword 5)))
                       end)
                       : M (option ((mword 5 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 5)))
               end)
               : M (option ((mword 5 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5)))
       end)
       : M (option ((mword 5 * mword 5)))
    else returnm None)
    : M (option ((mword 5 * mword 5))).

Definition _s3929_ (_s3930_ : string) : M (option ((mword 5 * mword 5))) :=
   let _s3931_ := _s3930_ in
   (if string_startswith _s3931_ "c.mv" then
      (match (string_drop _s3931_ (projT1 (string_length "c.mv"))) with
       | _s3932_ =>
          (spc_matches_prefix _s3932_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3933_ _) =>
              (match (string_drop _s3932_ _s3933_) with
               | _s3934_ =>
                  (reg_name_matches_prefix _s3934_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s3935_ _) =>
                      (match (string_drop _s3934_ _s3935_) with
                       | _s3936_ =>
                          (sep_matches_prefix _s3936_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s3937_ _) =>
                              (match (string_drop _s3936_ _s3937_) with
                               | _s3938_ =>
                                  (reg_name_matches_prefix _s3938_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s3939_ _) =>
                                              let p0_ := string_drop _s3938_ _s3939_ in
                                              if generic_eq p0_ "" then Some (rd, rs2)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 5 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 5 * mword 5)))
                       end)
                       : M (option ((mword 5 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 5)))
               end)
               : M (option ((mword 5 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5)))
       end)
       : M (option ((mword 5 * mword 5)))
    else returnm None)
    : M (option ((mword 5 * mword 5))).

Definition _s3921_ (_s3922_ : string) : M (option (mword 5)) :=
   let _s3923_ := _s3922_ in
   (if string_startswith _s3923_ "c.jalr" then
      (match (string_drop _s3923_ (projT1 (string_length "c.jalr"))) with
       | _s3924_ =>
          (spc_matches_prefix _s3924_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3925_ _) =>
              (match (string_drop _s3924_ _s3925_) with
               | _s3926_ =>
                  (reg_name_matches_prefix _s3926_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  returnm (match w__1 with
                           | Some (rs1, existT _ _s3927_ _) =>
                              let p0_ := string_drop _s3926_ _s3927_ in
                              if generic_eq p0_ "" then Some rs1
                              else None
                           | _ => None
                           end)
               end)
               : M (option (mword 5))
           | _ => returnm None
           end)
           : M (option (mword 5))
       end)
       : M (option (mword 5))
    else returnm None)
    : M (option (mword 5)).

Definition _s3913_ (_s3914_ : string) : M (option (mword 5)) :=
   let _s3915_ := _s3914_ in
   (if string_startswith _s3915_ "c.jr" then
      (match (string_drop _s3915_ (projT1 (string_length "c.jr"))) with
       | _s3916_ =>
          (spc_matches_prefix _s3916_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3917_ _) =>
              (match (string_drop _s3916_ _s3917_) with
               | _s3918_ =>
                  (reg_name_matches_prefix _s3918_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  returnm (match w__1 with
                           | Some (rs1, existT _ _s3919_ _) =>
                              let p0_ := string_drop _s3918_ _s3919_ in
                              if generic_eq p0_ "" then Some rs1
                              else None
                           | _ => None
                           end)
               end)
               : M (option (mword 5))
           | _ => returnm None
           end)
           : M (option (mword 5))
       end)
       : M (option (mword 5))
    else returnm None)
    : M (option (mword 5)).

Definition _s3901_ (_s3902_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s3903_ := _s3902_ in
   (if string_startswith _s3903_ "c.sdsp" then
      (match (string_drop _s3903_ (projT1 (string_length "c.sdsp"))) with
       | _s3904_ =>
          (spc_matches_prefix _s3904_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3905_ _) =>
              (match (string_drop _s3904_ _s3905_) with
               | _s3906_ =>
                  (reg_name_matches_prefix _s3906_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rs2, existT _ _s3907_ _) =>
                      (match (string_drop _s3906_ _s3907_) with
                       | _s3908_ =>
                          (sep_matches_prefix _s3908_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s3909_ _) =>
                                      match (string_drop _s3908_ _s3909_) with
                                      | _s3910_ =>
                                         match (hex_bits_6_matches_prefix _s3910_) with
                                         | Some (uimm, existT _ _s3911_ _) =>
                                            let p0_ := string_drop _s3910_ _s3911_ in
                                            if generic_eq p0_ "" then Some (rs2, uimm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s3889_ (_s3890_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s3891_ := _s3890_ in
   (if string_startswith _s3891_ "c.swsp" then
      (match (string_drop _s3891_ (projT1 (string_length "c.swsp"))) with
       | _s3892_ =>
          (spc_matches_prefix _s3892_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3893_ _) =>
              (match (string_drop _s3892_ _s3893_) with
               | _s3894_ =>
                  (reg_name_matches_prefix _s3894_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s3895_ _) =>
                      (match (string_drop _s3894_ _s3895_) with
                       | _s3896_ =>
                          (sep_matches_prefix _s3896_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s3897_ _) =>
                                      match (string_drop _s3896_ _s3897_) with
                                      | _s3898_ =>
                                         match (hex_bits_6_matches_prefix _s3898_) with
                                         | Some (uimm, existT _ _s3899_ _) =>
                                            let p0_ := string_drop _s3898_ _s3899_ in
                                            if generic_eq p0_ "" then Some (rd, uimm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s3877_ (_s3878_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s3879_ := _s3878_ in
   (if string_startswith _s3879_ "c.ldsp" then
      (match (string_drop _s3879_ (projT1 (string_length "c.ldsp"))) with
       | _s3880_ =>
          (spc_matches_prefix _s3880_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3881_ _) =>
              (match (string_drop _s3880_ _s3881_) with
               | _s3882_ =>
                  (reg_name_matches_prefix _s3882_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s3883_ _) =>
                      (match (string_drop _s3882_ _s3883_) with
                       | _s3884_ =>
                          (sep_matches_prefix _s3884_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s3885_ _) =>
                                      match (string_drop _s3884_ _s3885_) with
                                      | _s3886_ =>
                                         match (hex_bits_6_matches_prefix _s3886_) with
                                         | Some (uimm, existT _ _s3887_ _) =>
                                            let p0_ := string_drop _s3886_ _s3887_ in
                                            if generic_eq p0_ "" then Some (rd, uimm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s3865_ (_s3866_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s3867_ := _s3866_ in
   (if string_startswith _s3867_ "c.lwsp" then
      (match (string_drop _s3867_ (projT1 (string_length "c.lwsp"))) with
       | _s3868_ =>
          (spc_matches_prefix _s3868_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3869_ _) =>
              (match (string_drop _s3868_ _s3869_) with
               | _s3870_ =>
                  (reg_name_matches_prefix _s3870_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s3871_ _) =>
                      (match (string_drop _s3870_ _s3871_) with
                       | _s3872_ =>
                          (sep_matches_prefix _s3872_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s3873_ _) =>
                                      match (string_drop _s3872_ _s3873_) with
                                      | _s3874_ =>
                                         match (hex_bits_6_matches_prefix _s3874_) with
                                         | Some (uimm, existT _ _s3875_ _) =>
                                            let p0_ := string_drop _s3874_ _s3875_ in
                                            if generic_eq p0_ "" then Some (rd, uimm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s3853_ (_s3854_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s3855_ := _s3854_ in
   (if string_startswith _s3855_ "c.slli" then
      (match (string_drop _s3855_ (projT1 (string_length "c.slli"))) with
       | _s3856_ =>
          (spc_matches_prefix _s3856_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3857_ _) =>
              (match (string_drop _s3856_ _s3857_) with
               | _s3858_ =>
                  (reg_name_matches_prefix _s3858_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s3859_ _) =>
                      (match (string_drop _s3858_ _s3859_) with
                       | _s3860_ =>
                          (sep_matches_prefix _s3860_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s3861_ _) =>
                                      match (string_drop _s3860_ _s3861_) with
                                      | _s3862_ =>
                                         match (hex_bits_6_matches_prefix _s3862_) with
                                         | Some (shamt, existT _ _s3863_ _) =>
                                            let p0_ := string_drop _s3862_ _s3863_ in
                                            if generic_eq p0_ "" then Some (rsd, shamt)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s3841_ (_s3842_ : string) : M (option ((mword 3 * mword 8))) :=
   let _s3843_ := _s3842_ in
   (if string_startswith _s3843_ "c.bnez" then
      (match (string_drop _s3843_ (projT1 (string_length "c.bnez"))) with
       | _s3844_ =>
          (spc_matches_prefix _s3844_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3845_ _) =>
              (match (string_drop _s3844_ _s3845_) with
               | _s3846_ =>
                  (creg_name_matches_prefix _s3846_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rs, existT _ _s3847_ _) =>
                      (match (string_drop _s3846_ _s3847_) with
                       | _s3848_ =>
                          (sep_matches_prefix _s3848_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s3849_ _) =>
                                      match (string_drop _s3848_ _s3849_) with
                                      | _s3850_ =>
                                         match (hex_bits_8_matches_prefix _s3850_) with
                                         | Some (imm, existT _ _s3851_ _) =>
                                            let p0_ := string_drop _s3850_ _s3851_ in
                                            if generic_eq p0_ "" then Some (rs, imm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 3 * mword 8)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 8)))
               end)
               : M (option ((mword 3 * mword 8)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 8)))
       end)
       : M (option ((mword 3 * mword 8)))
    else returnm None)
    : M (option ((mword 3 * mword 8))).

Definition _s3829_ (_s3830_ : string) : M (option ((mword 3 * mword 8))) :=
   let _s3831_ := _s3830_ in
   (if string_startswith _s3831_ "c.beqz" then
      (match (string_drop _s3831_ (projT1 (string_length "c.beqz"))) with
       | _s3832_ =>
          (spc_matches_prefix _s3832_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3833_ _) =>
              (match (string_drop _s3832_ _s3833_) with
               | _s3834_ =>
                  (creg_name_matches_prefix _s3834_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rs, existT _ _s3835_ _) =>
                      (match (string_drop _s3834_ _s3835_) with
                       | _s3836_ =>
                          (sep_matches_prefix _s3836_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s3837_ _) =>
                                      match (string_drop _s3836_ _s3837_) with
                                      | _s3838_ =>
                                         match (hex_bits_8_matches_prefix _s3838_) with
                                         | Some (imm, existT _ _s3839_ _) =>
                                            let p0_ := string_drop _s3838_ _s3839_ in
                                            if generic_eq p0_ "" then Some (rs, imm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 3 * mword 8)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 8)))
               end)
               : M (option ((mword 3 * mword 8)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 8)))
       end)
       : M (option ((mword 3 * mword 8)))
    else returnm None)
    : M (option ((mword 3 * mword 8))).

Definition _s3821_ (_s3822_ : string) : M (option (mword 11)) :=
   let _s3823_ := _s3822_ in
   (if string_startswith _s3823_ "c.j" then
      (match (string_drop _s3823_ (projT1 (string_length "c.j"))) with
       | _s3824_ =>
          (spc_matches_prefix _s3824_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          returnm (match w__0 with
                   | Some (tt, existT _ _s3825_ _) =>
                      match (string_drop _s3824_ _s3825_) with
                      | _s3826_ =>
                         match (hex_bits_11_matches_prefix _s3826_) with
                         | Some (imm, existT _ _s3827_ _) =>
                            let p0_ := string_drop _s3826_ _s3827_ in
                            if generic_eq p0_ "" then Some imm
                            else None
                         | _ => None
                         end
                      end
                   | _ => None
                   end)
       end)
       : M (option (mword 11))
    else returnm None)
    : M (option (mword 11)).

Definition _s3809_ (_s3810_ : string) : M (option ((mword 3 * mword 3))) :=
   let _s3811_ := _s3810_ in
   (if string_startswith _s3811_ "c.addw" then
      (match (string_drop _s3811_ (projT1 (string_length "c.addw"))) with
       | _s3812_ =>
          (spc_matches_prefix _s3812_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3813_ _) =>
              (match (string_drop _s3812_ _s3813_) with
               | _s3814_ =>
                  (creg_name_matches_prefix _s3814_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s3815_ _) =>
                      (match (string_drop _s3814_ _s3815_) with
                       | _s3816_ =>
                          (sep_matches_prefix _s3816_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s3817_ _) =>
                              (match (string_drop _s3816_ _s3817_) with
                               | _s3818_ =>
                                  (creg_name_matches_prefix _s3818_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s3819_ _) =>
                                              let p0_ := string_drop _s3818_ _s3819_ in
                                              if generic_eq p0_ "" then Some (rsd, rs2)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 3 * mword 3)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3)))
                       end)
                       : M (option ((mword 3 * mword 3)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3)))
               end)
               : M (option ((mword 3 * mword 3)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3)))
       end)
       : M (option ((mword 3 * mword 3)))
    else returnm None)
    : M (option ((mword 3 * mword 3))).

Definition _s3797_ (_s3798_ : string) : M (option ((mword 3 * mword 3))) :=
   let _s3799_ := _s3798_ in
   (if string_startswith _s3799_ "c.subw" then
      (match (string_drop _s3799_ (projT1 (string_length "c.subw"))) with
       | _s3800_ =>
          (spc_matches_prefix _s3800_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3801_ _) =>
              (match (string_drop _s3800_ _s3801_) with
               | _s3802_ =>
                  (creg_name_matches_prefix _s3802_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s3803_ _) =>
                      (match (string_drop _s3802_ _s3803_) with
                       | _s3804_ =>
                          (sep_matches_prefix _s3804_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s3805_ _) =>
                              (match (string_drop _s3804_ _s3805_) with
                               | _s3806_ =>
                                  (creg_name_matches_prefix _s3806_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s3807_ _) =>
                                              let p0_ := string_drop _s3806_ _s3807_ in
                                              if generic_eq p0_ "" then Some (rsd, rs2)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 3 * mword 3)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3)))
                       end)
                       : M (option ((mword 3 * mword 3)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3)))
               end)
               : M (option ((mword 3 * mword 3)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3)))
       end)
       : M (option ((mword 3 * mword 3)))
    else returnm None)
    : M (option ((mword 3 * mword 3))).

Definition _s3785_ (_s3786_ : string) : M (option ((mword 3 * mword 3))) :=
   let _s3787_ := _s3786_ in
   (if string_startswith _s3787_ "c.and" then
      (match (string_drop _s3787_ (projT1 (string_length "c.and"))) with
       | _s3788_ =>
          (spc_matches_prefix _s3788_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3789_ _) =>
              (match (string_drop _s3788_ _s3789_) with
               | _s3790_ =>
                  (creg_name_matches_prefix _s3790_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s3791_ _) =>
                      (match (string_drop _s3790_ _s3791_) with
                       | _s3792_ =>
                          (sep_matches_prefix _s3792_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s3793_ _) =>
                              (match (string_drop _s3792_ _s3793_) with
                               | _s3794_ =>
                                  (creg_name_matches_prefix _s3794_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s3795_ _) =>
                                              let p0_ := string_drop _s3794_ _s3795_ in
                                              if generic_eq p0_ "" then Some (rsd, rs2)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 3 * mword 3)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3)))
                       end)
                       : M (option ((mword 3 * mword 3)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3)))
               end)
               : M (option ((mword 3 * mword 3)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3)))
       end)
       : M (option ((mword 3 * mword 3)))
    else returnm None)
    : M (option ((mword 3 * mword 3))).

Definition _s3773_ (_s3774_ : string) : M (option ((mword 3 * mword 3))) :=
   let _s3775_ := _s3774_ in
   (if string_startswith _s3775_ "c.or" then
      (match (string_drop _s3775_ (projT1 (string_length "c.or"))) with
       | _s3776_ =>
          (spc_matches_prefix _s3776_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3777_ _) =>
              (match (string_drop _s3776_ _s3777_) with
               | _s3778_ =>
                  (creg_name_matches_prefix _s3778_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s3779_ _) =>
                      (match (string_drop _s3778_ _s3779_) with
                       | _s3780_ =>
                          (sep_matches_prefix _s3780_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s3781_ _) =>
                              (match (string_drop _s3780_ _s3781_) with
                               | _s3782_ =>
                                  (creg_name_matches_prefix _s3782_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s3783_ _) =>
                                              let p0_ := string_drop _s3782_ _s3783_ in
                                              if generic_eq p0_ "" then Some (rsd, rs2)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 3 * mword 3)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3)))
                       end)
                       : M (option ((mword 3 * mword 3)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3)))
               end)
               : M (option ((mword 3 * mword 3)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3)))
       end)
       : M (option ((mword 3 * mword 3)))
    else returnm None)
    : M (option ((mword 3 * mword 3))).

Definition _s3761_ (_s3762_ : string) : M (option ((mword 3 * mword 3))) :=
   let _s3763_ := _s3762_ in
   (if string_startswith _s3763_ "c.xor" then
      (match (string_drop _s3763_ (projT1 (string_length "c.xor"))) with
       | _s3764_ =>
          (spc_matches_prefix _s3764_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3765_ _) =>
              (match (string_drop _s3764_ _s3765_) with
               | _s3766_ =>
                  (creg_name_matches_prefix _s3766_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s3767_ _) =>
                      (match (string_drop _s3766_ _s3767_) with
                       | _s3768_ =>
                          (sep_matches_prefix _s3768_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s3769_ _) =>
                              (match (string_drop _s3768_ _s3769_) with
                               | _s3770_ =>
                                  (creg_name_matches_prefix _s3770_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s3771_ _) =>
                                              let p0_ := string_drop _s3770_ _s3771_ in
                                              if generic_eq p0_ "" then Some (rsd, rs2)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 3 * mword 3)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3)))
                       end)
                       : M (option ((mword 3 * mword 3)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3)))
               end)
               : M (option ((mword 3 * mword 3)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3)))
       end)
       : M (option ((mword 3 * mword 3)))
    else returnm None)
    : M (option ((mword 3 * mword 3))).

Definition _s3749_ (_s3750_ : string) : M (option ((mword 3 * mword 3))) :=
   let _s3751_ := _s3750_ in
   (if string_startswith _s3751_ "c.sub" then
      (match (string_drop _s3751_ (projT1 (string_length "c.sub"))) with
       | _s3752_ =>
          (spc_matches_prefix _s3752_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3753_ _) =>
              (match (string_drop _s3752_ _s3753_) with
               | _s3754_ =>
                  (creg_name_matches_prefix _s3754_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s3755_ _) =>
                      (match (string_drop _s3754_ _s3755_) with
                       | _s3756_ =>
                          (sep_matches_prefix _s3756_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s3757_ _) =>
                              (match (string_drop _s3756_ _s3757_) with
                               | _s3758_ =>
                                  (creg_name_matches_prefix _s3758_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s3759_ _) =>
                                              let p0_ := string_drop _s3758_ _s3759_ in
                                              if generic_eq p0_ "" then Some (rsd, rs2)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 3 * mword 3)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3)))
                       end)
                       : M (option ((mword 3 * mword 3)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3)))
               end)
               : M (option ((mword 3 * mword 3)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3)))
       end)
       : M (option ((mword 3 * mword 3)))
    else returnm None)
    : M (option ((mword 3 * mword 3))).

Definition _s3737_ (_s3738_ : string) : M (option ((mword 3 * mword 6))) :=
   let _s3739_ := _s3738_ in
   (if string_startswith _s3739_ "c.andi" then
      (match (string_drop _s3739_ (projT1 (string_length "c.andi"))) with
       | _s3740_ =>
          (spc_matches_prefix _s3740_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3741_ _) =>
              (match (string_drop _s3740_ _s3741_) with
               | _s3742_ =>
                  (creg_name_matches_prefix _s3742_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s3743_ _) =>
                      (match (string_drop _s3742_ _s3743_) with
                       | _s3744_ =>
                          (sep_matches_prefix _s3744_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s3745_ _) =>
                                      match (string_drop _s3744_ _s3745_) with
                                      | _s3746_ =>
                                         match (hex_bits_6_matches_prefix _s3746_) with
                                         | Some (imm, existT _ _s3747_ _) =>
                                            let p0_ := string_drop _s3746_ _s3747_ in
                                            if generic_eq p0_ "" then Some (rsd, imm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 3 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 6)))
               end)
               : M (option ((mword 3 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 6)))
       end)
       : M (option ((mword 3 * mword 6)))
    else returnm None)
    : M (option ((mword 3 * mword 6))).

Definition _s3725_ (_s3726_ : string) : M (option ((mword 3 * mword 6))) :=
   let _s3727_ := _s3726_ in
   (if string_startswith _s3727_ "c.srai" then
      (match (string_drop _s3727_ (projT1 (string_length "c.srai"))) with
       | _s3728_ =>
          (spc_matches_prefix _s3728_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3729_ _) =>
              (match (string_drop _s3728_ _s3729_) with
               | _s3730_ =>
                  (creg_name_matches_prefix _s3730_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s3731_ _) =>
                      (match (string_drop _s3730_ _s3731_) with
                       | _s3732_ =>
                          (sep_matches_prefix _s3732_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s3733_ _) =>
                                      match (string_drop _s3732_ _s3733_) with
                                      | _s3734_ =>
                                         match (hex_bits_6_matches_prefix _s3734_) with
                                         | Some (shamt, existT _ _s3735_ _) =>
                                            let p0_ := string_drop _s3734_ _s3735_ in
                                            if generic_eq p0_ "" then Some (rsd, shamt)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 3 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 6)))
               end)
               : M (option ((mword 3 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 6)))
       end)
       : M (option ((mword 3 * mword 6)))
    else returnm None)
    : M (option ((mword 3 * mword 6))).

Definition _s3713_ (_s3714_ : string) : M (option ((mword 3 * mword 6))) :=
   let _s3715_ := _s3714_ in
   (if string_startswith _s3715_ "c.srli" then
      (match (string_drop _s3715_ (projT1 (string_length "c.srli"))) with
       | _s3716_ =>
          (spc_matches_prefix _s3716_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3717_ _) =>
              (match (string_drop _s3716_ _s3717_) with
               | _s3718_ =>
                  (creg_name_matches_prefix _s3718_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s3719_ _) =>
                      (match (string_drop _s3718_ _s3719_) with
                       | _s3720_ =>
                          (sep_matches_prefix _s3720_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s3721_ _) =>
                                      match (string_drop _s3720_ _s3721_) with
                                      | _s3722_ =>
                                         match (hex_bits_6_matches_prefix _s3722_) with
                                         | Some (shamt, existT _ _s3723_ _) =>
                                            let p0_ := string_drop _s3722_ _s3723_ in
                                            if generic_eq p0_ "" then Some (rsd, shamt)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 3 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 6)))
               end)
               : M (option ((mword 3 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 6)))
       end)
       : M (option ((mword 3 * mword 6)))
    else returnm None)
    : M (option ((mword 3 * mword 6))).

Definition _s3701_ (_s3702_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s3703_ := _s3702_ in
   (if string_startswith _s3703_ "c.lui" then
      (match (string_drop _s3703_ (projT1 (string_length "c.lui"))) with
       | _s3704_ =>
          (spc_matches_prefix _s3704_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3705_ _) =>
              (match (string_drop _s3704_ _s3705_) with
               | _s3706_ =>
                  (reg_name_matches_prefix _s3706_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s3707_ _) =>
                      (match (string_drop _s3706_ _s3707_) with
                       | _s3708_ =>
                          (sep_matches_prefix _s3708_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s3709_ _) =>
                                      match (string_drop _s3708_ _s3709_) with
                                      | _s3710_ =>
                                         match (hex_bits_6_matches_prefix _s3710_) with
                                         | Some (imm, existT _ _s3711_ _) =>
                                            let p0_ := string_drop _s3710_ _s3711_ in
                                            if generic_eq p0_ "" then Some (rd, imm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s3693_ (_s3694_ : string) : M (option (mword 6)) :=
   let _s3695_ := _s3694_ in
   (if string_startswith _s3695_ "c.addi16sp" then
      (match (string_drop _s3695_ (projT1 (string_length "c.addi16sp"))) with
       | _s3696_ =>
          (spc_matches_prefix _s3696_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          returnm (match w__0 with
                   | Some (tt, existT _ _s3697_ _) =>
                      match (string_drop _s3696_ _s3697_) with
                      | _s3698_ =>
                         match (hex_bits_6_matches_prefix _s3698_) with
                         | Some (imm, existT _ _s3699_ _) =>
                            let p0_ := string_drop _s3698_ _s3699_ in
                            if generic_eq p0_ "" then Some imm
                            else None
                         | _ => None
                         end
                      end
                   | _ => None
                   end)
       end)
       : M (option (mword 6))
    else returnm None)
    : M (option (mword 6)).

Definition _s3681_ (_s3682_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s3683_ := _s3682_ in
   (if string_startswith _s3683_ "c.li" then
      (match (string_drop _s3683_ (projT1 (string_length "c.li"))) with
       | _s3684_ =>
          (spc_matches_prefix _s3684_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3685_ _) =>
              (match (string_drop _s3684_ _s3685_) with
               | _s3686_ =>
                  (reg_name_matches_prefix _s3686_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s3687_ _) =>
                      (match (string_drop _s3686_ _s3687_) with
                       | _s3688_ =>
                          (sep_matches_prefix _s3688_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s3689_ _) =>
                                      match (string_drop _s3688_ _s3689_) with
                                      | _s3690_ =>
                                         match (hex_bits_6_matches_prefix _s3690_) with
                                         | Some (imm, existT _ _s3691_ _) =>
                                            let p0_ := string_drop _s3690_ _s3691_ in
                                            if generic_eq p0_ "" then Some (rd, imm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s3669_ (_s3670_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s3671_ := _s3670_ in
   (if string_startswith _s3671_ "c.addiw" then
      (match (string_drop _s3671_ (projT1 (string_length "c.addiw"))) with
       | _s3672_ =>
          (spc_matches_prefix _s3672_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3673_ _) =>
              (match (string_drop _s3672_ _s3673_) with
               | _s3674_ =>
                  (reg_name_matches_prefix _s3674_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s3675_ _) =>
                      (match (string_drop _s3674_ _s3675_) with
                       | _s3676_ =>
                          (sep_matches_prefix _s3676_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s3677_ _) =>
                                      match (string_drop _s3676_ _s3677_) with
                                      | _s3678_ =>
                                         match (hex_bits_6_matches_prefix _s3678_) with
                                         | Some (imm, existT _ _s3679_ _) =>
                                            let p0_ := string_drop _s3678_ _s3679_ in
                                            if generic_eq p0_ "" then Some (rsd, imm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s3661_ (_s3662_ : string) : M (option (mword 11)) :=
   let _s3663_ := _s3662_ in
   (if string_startswith _s3663_ "c.jal" then
      (match (string_drop _s3663_ (projT1 (string_length "c.jal"))) with
       | _s3664_ =>
          (spc_matches_prefix _s3664_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          returnm (match w__0 with
                   | Some (tt, existT _ _s3665_ _) =>
                      match (string_drop _s3664_ _s3665_) with
                      | _s3666_ =>
                         match (hex_bits_12_matches_prefix _s3666_) with
                         | Some (v__1470, existT _ _s3667_ _) =>
                            if eq_vec (subrange_vec_dec v__1470 0 0) ('b"0"  : mword (0 - 0 + 1))
                            then
                              let imm : mword 11 := subrange_vec_dec v__1470 11 1 in
                              let imm : mword 11 := subrange_vec_dec v__1470 11 1 in
                              let p0_ := string_drop _s3666_ _s3667_ in
                              if generic_eq p0_ "" then Some imm
                              else None
                            else None
                         | _ => None
                         end
                      end
                   | _ => None
                   end)
       end)
       : M (option (mword 11))
    else returnm None)
    : M (option (mword 11)).

Definition _s3649_ (_s3650_ : string) : M (option ((mword 5 * mword 6))) :=
   let _s3651_ := _s3650_ in
   (if string_startswith _s3651_ "c.addi" then
      (match (string_drop _s3651_ (projT1 (string_length "c.addi"))) with
       | _s3652_ =>
          (spc_matches_prefix _s3652_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3653_ _) =>
              (match (string_drop _s3652_ _s3653_) with
               | _s3654_ =>
                  (reg_name_matches_prefix _s3654_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s3655_ _) =>
                      (match (string_drop _s3654_ _s3655_) with
                       | _s3656_ =>
                          (sep_matches_prefix _s3656_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s3657_ _) =>
                                      match (string_drop _s3656_ _s3657_) with
                                      | _s3658_ =>
                                         match (hex_bits_6_matches_prefix _s3658_) with
                                         | Some (nzi, existT _ _s3659_ _) =>
                                            let p0_ := string_drop _s3658_ _s3659_ in
                                            if generic_eq p0_ "" then Some (rsd, nzi)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6)))
               end)
               : M (option ((mword 5 * mword 6)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6)))
       end)
       : M (option ((mword 5 * mword 6)))
    else returnm None)
    : M (option ((mword 5 * mword 6))).

Definition _s3633_ (_s3634_ : string) : M (option ((mword 3 * mword 3 * mword 5))) :=
   let _s3635_ := _s3634_ in
   (if string_startswith _s3635_ "c.sd" then
      (match (string_drop _s3635_ (projT1 (string_length "c.sd"))) with
       | _s3636_ =>
          (spc_matches_prefix _s3636_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3637_ _) =>
              (match (string_drop _s3636_ _s3637_) with
               | _s3638_ =>
                  (creg_name_matches_prefix _s3638_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsc1, existT _ _s3639_ _) =>
                      (match (string_drop _s3638_ _s3639_) with
                       | _s3640_ =>
                          (sep_matches_prefix _s3640_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s3641_ _) =>
                              (match (string_drop _s3640_ _s3641_) with
                               | _s3642_ =>
                                  (creg_name_matches_prefix _s3642_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc2, existT _ _s3643_ _) =>
                                      (match (string_drop _s3642_ _s3643_) with
                                       | _s3644_ =>
                                          (sep_matches_prefix _s3644_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s3645_ _) =>
                                                      match (string_drop _s3644_ _s3645_) with
                                                      | _s3646_ =>
                                                         match (hex_bits_8_matches_prefix _s3646_) with
                                                         | Some (v__1472, existT _ _s3647_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1472 2 0)
                                                                 ('b"000"
                                                                  : mword (2 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1472 7 3 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1472 7 3 in
                                                              let p0_ := string_drop _s3646_ _s3647_ in
                                                              if generic_eq p0_ "" then
                                                                Some (rsc1, rsc2, uimm)
                                                              else None
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5))).

Definition _s3617_ (_s3618_ : string) : M (option ((mword 3 * mword 3 * mword 5))) :=
   let _s3619_ := _s3618_ in
   (if string_startswith _s3619_ "c.sw" then
      (match (string_drop _s3619_ (projT1 (string_length "c.sw"))) with
       | _s3620_ =>
          (spc_matches_prefix _s3620_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3621_ _) =>
              (match (string_drop _s3620_ _s3621_) with
               | _s3622_ =>
                  (creg_name_matches_prefix _s3622_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsc1, existT _ _s3623_ _) =>
                      (match (string_drop _s3622_ _s3623_) with
                       | _s3624_ =>
                          (sep_matches_prefix _s3624_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s3625_ _) =>
                              (match (string_drop _s3624_ _s3625_) with
                               | _s3626_ =>
                                  (creg_name_matches_prefix _s3626_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc2, existT _ _s3627_ _) =>
                                      (match (string_drop _s3626_ _s3627_) with
                                       | _s3628_ =>
                                          (sep_matches_prefix _s3628_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s3629_ _) =>
                                                      match (string_drop _s3628_ _s3629_) with
                                                      | _s3630_ =>
                                                         match (hex_bits_7_matches_prefix _s3630_) with
                                                         | Some (v__1474, existT _ _s3631_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1474 1 0)
                                                                 ('b"00"
                                                                  : mword (1 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1474 6 2 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1474 6 2 in
                                                              let p0_ := string_drop _s3630_ _s3631_ in
                                                              if generic_eq p0_ "" then
                                                                Some (rsc1, rsc2, uimm)
                                                              else None
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5))).

Definition _s3601_ (_s3602_ : string) : M (option ((mword 3 * mword 3 * mword 5))) :=
   let _s3603_ := _s3602_ in
   (if string_startswith _s3603_ "c.ld" then
      (match (string_drop _s3603_ (projT1 (string_length "c.ld"))) with
       | _s3604_ =>
          (spc_matches_prefix _s3604_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3605_ _) =>
              (match (string_drop _s3604_ _s3605_) with
               | _s3606_ =>
                  (creg_name_matches_prefix _s3606_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rdc, existT _ _s3607_ _) =>
                      (match (string_drop _s3606_ _s3607_) with
                       | _s3608_ =>
                          (sep_matches_prefix _s3608_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s3609_ _) =>
                              (match (string_drop _s3608_ _s3609_) with
                               | _s3610_ =>
                                  (creg_name_matches_prefix _s3610_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc, existT _ _s3611_ _) =>
                                      (match (string_drop _s3610_ _s3611_) with
                                       | _s3612_ =>
                                          (sep_matches_prefix _s3612_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s3613_ _) =>
                                                      match (string_drop _s3612_ _s3613_) with
                                                      | _s3614_ =>
                                                         match (hex_bits_8_matches_prefix _s3614_) with
                                                         | Some (v__1476, existT _ _s3615_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1476 2 0)
                                                                 ('b"000"
                                                                  : mword (2 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1476 7 3 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1476 7 3 in
                                                              let p0_ := string_drop _s3614_ _s3615_ in
                                                              if generic_eq p0_ "" then
                                                                Some (rdc, rsc, uimm)
                                                              else None
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5))).

Definition _s3585_ (_s3586_ : string) : M (option ((mword 3 * mword 3 * mword 5))) :=
   let _s3587_ := _s3586_ in
   (if string_startswith _s3587_ "c.lw" then
      (match (string_drop _s3587_ (projT1 (string_length "c.lw"))) with
       | _s3588_ =>
          (spc_matches_prefix _s3588_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3589_ _) =>
              (match (string_drop _s3588_ _s3589_) with
               | _s3590_ =>
                  (creg_name_matches_prefix _s3590_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rdc, existT _ _s3591_ _) =>
                      (match (string_drop _s3590_ _s3591_) with
                       | _s3592_ =>
                          (sep_matches_prefix _s3592_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s3593_ _) =>
                              (match (string_drop _s3592_ _s3593_) with
                               | _s3594_ =>
                                  (creg_name_matches_prefix _s3594_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc, existT _ _s3595_ _) =>
                                      (match (string_drop _s3594_ _s3595_) with
                                       | _s3596_ =>
                                          (sep_matches_prefix _s3596_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s3597_ _) =>
                                                      match (string_drop _s3596_ _s3597_) with
                                                      | _s3598_ =>
                                                         match (hex_bits_7_matches_prefix _s3598_) with
                                                         | Some (v__1478, existT _ _s3599_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1478 1 0)
                                                                 ('b"00"
                                                                  : mword (1 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1478 6 2 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1478 6 2 in
                                                              let p0_ := string_drop _s3598_ _s3599_ in
                                                              if generic_eq p0_ "" then
                                                                Some (rdc, rsc, uimm)
                                                              else None
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5))).

Definition _s3573_ (_s3574_ : string) : M (option ((mword 3 * mword 8))) :=
   let _s3575_ := _s3574_ in
   (if string_startswith _s3575_ "c.addi4spn" then
      (match (string_drop _s3575_ (projT1 (string_length "c.addi4spn"))) with
       | _s3576_ =>
          (spc_matches_prefix _s3576_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3577_ _) =>
              (match (string_drop _s3576_ _s3577_) with
               | _s3578_ =>
                  (creg_name_matches_prefix _s3578_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rdc, existT _ _s3579_ _) =>
                      (match (string_drop _s3578_ _s3579_) with
                       | _s3580_ =>
                          (sep_matches_prefix _s3580_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s3581_ _) =>
                                      match (string_drop _s3580_ _s3581_) with
                                      | _s3582_ =>
                                         match (hex_bits_10_matches_prefix _s3582_) with
                                         | Some (v__1480, existT _ _s3583_ _) =>
                                            if eq_vec (subrange_vec_dec v__1480 1 0)
                                                 ('b"00"
                                                  : mword (1 - 0 + 1)) then
                                              let nzimm : mword 8 := subrange_vec_dec v__1480 9 2 in
                                              let nzimm : mword 8 := subrange_vec_dec v__1480 9 2 in
                                              let p0_ := string_drop _s3582_ _s3583_ in
                                              if generic_eq p0_ "" then Some (rdc, nzimm)
                                              else None
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 3 * mword 8)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 8)))
               end)
               : M (option ((mword 3 * mword 8)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 8)))
       end)
       : M (option ((mword 3 * mword 8)))
    else returnm None)
    : M (option ((mword 3 * mword 8))).

Definition _s3547_ (_s3548_ : string)
: M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5))) :=
   (match _s3548_ with
    | _s3549_ =>
       (amo_mnemonic_matches_prefix _s3549_) >>= fun w__0 : option ((amoop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s3550_ _) =>
           let _s3551_ := string_drop _s3549_ _s3550_ in
           (if string_startswith _s3551_ "." then
              (match (string_drop _s3551_ (projT1 (string_length "."))) with
               | _s3552_ =>
                  (size_mnemonic_matches_prefix _s3552_) >>= fun w__1 : option ((word_width * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (width, existT _ _s3553_ _) =>
                      (match (string_drop _s3552_ _s3553_) with
                       | _s3554_ =>
                          (maybe_aq_matches_prefix _s3554_) >>= fun w__2 : option ((bool * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (aq, existT _ _s3555_ _) =>
                              (match (string_drop _s3554_ _s3555_) with
                               | _s3556_ =>
                                  (maybe_rl_matches_prefix _s3556_) >>= fun w__3 : option ((bool * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rl, existT _ _s3557_ _) =>
                                      (match (string_drop _s3556_ _s3557_) with
                                       | _s3558_ =>
                                          (spc_matches_prefix _s3558_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (tt, existT _ _s3559_ _) =>
                                              (match (string_drop _s3558_ _s3559_) with
                                               | _s3560_ =>
                                                  (reg_name_matches_prefix _s3560_) >>= fun w__5 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (rd, existT _ _s3561_ _) =>
                                                      (match (string_drop _s3560_ _s3561_) with
                                                       | _s3562_ =>
                                                          (sep_matches_prefix _s3562_) >>= fun w__6 : option ((unit * {n : Z & ArithFact (n >=?
                                                            0)})) =>
                                                          (match w__6 with
                                                           | Some (tt, existT _ _s3563_ _) =>
                                                              (match (string_drop _s3562_ _s3563_) with
                                                               | _s3564_ =>
                                                                  (reg_name_matches_prefix _s3564_) >>= fun w__7 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                    0)})) =>
                                                                  (match w__7 with
                                                                   | Some (rs2, existT _ _s3565_ _) =>
                                                                      (match (string_drop _s3564_
                                                                                _s3565_) with
                                                                       | _s3566_ =>
                                                                          (sep_matches_prefix
                                                                             _s3566_) >>= fun w__8 : option ((unit * {n : Z & ArithFact (n >=?
                                                                            0)})) =>
                                                                          (match w__8 with
                                                                           | Some
                                                                             (tt, existT _ _s3567_ _) =>
                                                                              let _s3568_ :=
                                                                                string_drop _s3566_
                                                                                  _s3567_ in
                                                                              (if string_startswith
                                                                                    _s3568_ "(" then
                                                                                 (match (string_drop
                                                                                           _s3568_
                                                                                           (projT1
                                                                                            (string_length
                                                                                               "("))) with
                                                                                  | _s3569_ =>
                                                                                     (reg_name_matches_prefix
                                                                                        _s3569_) >>= fun w__9 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                                       0)})) =>
                                                                                     returnm (match w__9 with
                                                                                              | Some
                                                                                                (rs1, existT _ _s3570_ _) =>
                                                                                                 let _s3571_ :=
                                                                                                   string_drop
                                                                                                     _s3569_
                                                                                                     _s3570_ in
                                                                                                 if string_startswith
                                                                                                      _s3571_
                                                                                                      ")"
                                                                                                 then
                                                                                                   let p0_ :=
                                                                                                     string_drop
                                                                                                       _s3571_
                                                                                                       (projT1
                                                                                                        (string_length
                                                                                                           ")")) in
                                                                                                   if
                                                                                                     generic_eq
                                                                                                       p0_
                                                                                                       ""
                                                                                                   then
                                                                                                     Some
                                                                                                       (op, width, aq, rl, rd, rs2, rs1)
                                                                                                   else
                                                                                                     None
                                                                                                 else
                                                                                                   None
                                                                                              | _ =>
                                                                                                 None
                                                                                              end)
                                                                                  end)
                                                                                  : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                                               else returnm None)
                                                                               : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                                           | _ => returnm None
                                                                           end)
                                                                           : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                                       end)
                                                                       : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                                   | _ => returnm None
                                                                   end)
                                                                   : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                               end)
                                                               : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                           | _ => returnm None
                                                           end)
                                                           : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                       end)
                                                       : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                               end)
                                               : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                       end)
                                       : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                               end)
                               : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                       end)
                       : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
               end)
               : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
            else returnm None)
            : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5))).

Definition _s3525_ (_s3526_ : string)
: M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5))) :=
   let _s3527_ := _s3526_ in
   (if string_startswith _s3527_ "sc." then
      (match (string_drop _s3527_ (projT1 (string_length "sc."))) with
       | _s3528_ =>
          (size_mnemonic_matches_prefix _s3528_) >>= fun w__0 : option ((word_width * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (size, existT _ _s3529_ _) =>
              (match (string_drop _s3528_ _s3529_) with
               | _s3530_ =>
                  (maybe_aq_matches_prefix _s3530_) >>= fun w__1 : option ((bool * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (aq, existT _ _s3531_ _) =>
                      (match (string_drop _s3530_ _s3531_) with
                       | _s3532_ =>
                          (maybe_rl_matches_prefix _s3532_) >>= fun w__2 : option ((bool * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rl, existT _ _s3533_ _) =>
                              (match (string_drop _s3532_ _s3533_) with
                               | _s3534_ =>
                                  (spc_matches_prefix _s3534_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s3535_ _) =>
                                      (match (string_drop _s3534_ _s3535_) with
                                       | _s3536_ =>
                                          (reg_name_matches_prefix _s3536_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (rd, existT _ _s3537_ _) =>
                                              (match (string_drop _s3536_ _s3537_) with
                                               | _s3538_ =>
                                                  (sep_matches_prefix _s3538_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (tt, existT _ _s3539_ _) =>
                                                      (match (string_drop _s3538_ _s3539_) with
                                                       | _s3540_ =>
                                                          (reg_name_matches_prefix _s3540_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                            0)})) =>
                                                          (match w__6 with
                                                           | Some (rs1, existT _ _s3541_ _) =>
                                                              (match (string_drop _s3540_ _s3541_) with
                                                               | _s3542_ =>
                                                                  (sep_matches_prefix _s3542_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                    0)})) =>
                                                                  (match w__7 with
                                                                   | Some (tt, existT _ _s3543_ _) =>
                                                                      (match (string_drop _s3542_
                                                                                _s3543_) with
                                                                       | _s3544_ =>
                                                                          (reg_name_matches_prefix
                                                                             _s3544_) >>= fun w__8 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                            0)})) =>
                                                                          returnm (match w__8 with
                                                                                   | Some
                                                                                     (rs2, existT _ _s3545_ _) =>
                                                                                      let p0_ :=
                                                                                        string_drop
                                                                                          _s3544_
                                                                                          _s3545_ in
                                                                                      if generic_eq
                                                                                           p0_ ""
                                                                                      then
                                                                                        Some
                                                                                          (size, aq, rl, rd, rs1, rs2)
                                                                                      else None
                                                                                   | _ => None
                                                                                   end)
                                                                       end)
                                                                       : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                                   | _ => returnm None
                                                                   end)
                                                                   : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                               end)
                                                               : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                           | _ => returnm None
                                                           end)
                                                           : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                       end)
                                                       : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                               end)
                                               : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                       end)
                                       : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                               end)
                               : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                       end)
                       : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
               end)
               : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
       end)
       : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)))
    else returnm None)
    : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5))).

Definition _s3507_ (_s3508_ : string) : M (option ((word_width * bool * bool * mword 5 * mword 5))) :=
   let _s3509_ := _s3508_ in
   (if string_startswith _s3509_ "lr." then
      (match (string_drop _s3509_ (projT1 (string_length "lr."))) with
       | _s3510_ =>
          (size_mnemonic_matches_prefix _s3510_) >>= fun w__0 : option ((word_width * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (size, existT _ _s3511_ _) =>
              (match (string_drop _s3510_ _s3511_) with
               | _s3512_ =>
                  (maybe_aq_matches_prefix _s3512_) >>= fun w__1 : option ((bool * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (aq, existT _ _s3513_ _) =>
                      (match (string_drop _s3512_ _s3513_) with
                       | _s3514_ =>
                          (maybe_rl_matches_prefix _s3514_) >>= fun w__2 : option ((bool * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rl, existT _ _s3515_ _) =>
                              (match (string_drop _s3514_ _s3515_) with
                               | _s3516_ =>
                                  (spc_matches_prefix _s3516_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s3517_ _) =>
                                      (match (string_drop _s3516_ _s3517_) with
                                       | _s3518_ =>
                                          (reg_name_matches_prefix _s3518_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (rd, existT _ _s3519_ _) =>
                                              (match (string_drop _s3518_ _s3519_) with
                                               | _s3520_ =>
                                                  (sep_matches_prefix _s3520_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (tt, existT _ _s3521_ _) =>
                                                      (match (string_drop _s3520_ _s3521_) with
                                                       | _s3522_ =>
                                                          (reg_name_matches_prefix _s3522_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                            0)})) =>
                                                          returnm (match w__6 with
                                                                   | Some (rs1, existT _ _s3523_ _) =>
                                                                      let p0_ :=
                                                                        string_drop _s3522_ _s3523_ in
                                                                      if generic_eq p0_ "" then
                                                                        Some (size, aq, rl, rd, rs1)
                                                                      else None
                                                                   | _ => None
                                                                   end)
                                                       end)
                                                       : M (option ((word_width * bool * bool * mword 5 * mword 5)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((word_width * bool * bool * mword 5 * mword 5)))
                                               end)
                                               : M (option ((word_width * bool * bool * mword 5 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((word_width * bool * bool * mword 5 * mword 5)))
                                       end)
                                       : M (option ((word_width * bool * bool * mword 5 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((word_width * bool * bool * mword 5 * mword 5)))
                               end)
                               : M (option ((word_width * bool * bool * mword 5 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((word_width * bool * bool * mword 5 * mword 5)))
                       end)
                       : M (option ((word_width * bool * bool * mword 5 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((word_width * bool * bool * mword 5 * mword 5)))
               end)
               : M (option ((word_width * bool * bool * mword 5 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((word_width * bool * bool * mword 5 * mword 5)))
       end)
       : M (option ((word_width * bool * bool * mword 5 * mword 5)))
    else returnm None)
    : M (option ((word_width * bool * bool * mword 5 * mword 5))).

Definition _s3495_ (_s3496_ : string) : M (option ((mword 5 * mword 5))) :=
   let _s3497_ := _s3496_ in
   (if string_startswith _s3497_ "sfence.vma" then
      (match (string_drop _s3497_ (projT1 (string_length "sfence.vma"))) with
       | _s3498_ =>
          (spc_matches_prefix _s3498_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3499_ _) =>
              (match (string_drop _s3498_ _s3499_) with
               | _s3500_ =>
                  (reg_name_matches_prefix _s3500_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rs1, existT _ _s3501_ _) =>
                      (match (string_drop _s3500_ _s3501_) with
                       | _s3502_ =>
                          (sep_matches_prefix _s3502_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s3503_ _) =>
                              (match (string_drop _s3502_ _s3503_) with
                               | _s3504_ =>
                                  (reg_name_matches_prefix _s3504_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s3505_ _) =>
                                              let p0_ := string_drop _s3504_ _s3505_ in
                                              if generic_eq p0_ "" then Some (rs1, rs2)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 5 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 5 * mword 5)))
                       end)
                       : M (option ((mword 5 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 5)))
               end)
               : M (option ((mword 5 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5)))
       end)
       : M (option ((mword 5 * mword 5)))
    else returnm None)
    : M (option ((mword 5 * mword 5))).

Definition _s3483_ (_s3484_ : string) : M (option ((mword 4 * mword 4))) :=
   let _s3485_ := _s3484_ in
   (if string_startswith _s3485_ "fence.tso" then
      (match (string_drop _s3485_ (projT1 (string_length "fence.tso"))) with
       | _s3486_ =>
          (spc_matches_prefix _s3486_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3487_ _) =>
              (match (string_drop _s3486_ _s3487_) with
               | _s3488_ =>
                  (fence_bits_matches_prefix _s3488_) >>= fun w__1 : option ((mword 4 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (pred, existT _ _s3489_ _) =>
                      (match (string_drop _s3488_ _s3489_) with
                       | _s3490_ =>
                          (sep_matches_prefix _s3490_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s3491_ _) =>
                              (match (string_drop _s3490_ _s3491_) with
                               | _s3492_ =>
                                  (fence_bits_matches_prefix _s3492_) >>= fun w__3 : option ((mword 4 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (succ, existT _ _s3493_ _) =>
                                              let p0_ := string_drop _s3492_ _s3493_ in
                                              if generic_eq p0_ "" then Some (pred, succ)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 4 * mword 4)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 4 * mword 4)))
                       end)
                       : M (option ((mword 4 * mword 4)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 4 * mword 4)))
               end)
               : M (option ((mword 4 * mword 4)))
           | _ => returnm None
           end)
           : M (option ((mword 4 * mword 4)))
       end)
       : M (option ((mword 4 * mword 4)))
    else returnm None)
    : M (option ((mword 4 * mword 4))).

Definition _s3471_ (_s3472_ : string) : M (option ((mword 4 * mword 4))) :=
   let _s3473_ := _s3472_ in
   (if string_startswith _s3473_ "fence" then
      (match (string_drop _s3473_ (projT1 (string_length "fence"))) with
       | _s3474_ =>
          (spc_matches_prefix _s3474_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3475_ _) =>
              (match (string_drop _s3474_ _s3475_) with
               | _s3476_ =>
                  (fence_bits_matches_prefix _s3476_) >>= fun w__1 : option ((mword 4 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (pred, existT _ _s3477_ _) =>
                      (match (string_drop _s3476_ _s3477_) with
                       | _s3478_ =>
                          (sep_matches_prefix _s3478_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s3479_ _) =>
                              (match (string_drop _s3478_ _s3479_) with
                               | _s3480_ =>
                                  (fence_bits_matches_prefix _s3480_) >>= fun w__3 : option ((mword 4 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (succ, existT _ _s3481_ _) =>
                                              let p0_ := string_drop _s3480_ _s3481_ in
                                              if generic_eq p0_ "" then Some (pred, succ)
                                              else None
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 4 * mword 4)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 4 * mword 4)))
                       end)
                       : M (option ((mword 4 * mword 4)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 4 * mword 4)))
               end)
               : M (option ((mword 4 * mword 4)))
           | _ => returnm None
           end)
           : M (option ((mword 4 * mword 4)))
       end)
       : M (option ((mword 4 * mword 4)))
    else returnm None)
    : M (option ((mword 4 * mword 4))).

Definition _s3454_ (_s3455_ : string) : M (option ((sopw * mword 5 * mword 5 * mword 5))) :=
   (match _s3455_ with
    | _s3456_ =>
       (shiftiwop_mnemonic_matches_prefix _s3456_) >>= fun w__0 : option ((sopw * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s3457_ _) =>
           (match (string_drop _s3456_ _s3457_) with
            | _s3458_ =>
               (spc_matches_prefix _s3458_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s3459_ _) =>
                   (match (string_drop _s3458_ _s3459_) with
                    | _s3460_ =>
                       (reg_name_matches_prefix _s3460_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s3461_ _) =>
                           (match (string_drop _s3460_ _s3461_) with
                            | _s3462_ =>
                               (sep_matches_prefix _s3462_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s3463_ _) =>
                                   (match (string_drop _s3462_ _s3463_) with
                                    | _s3464_ =>
                                       (reg_name_matches_prefix _s3464_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s3465_ _) =>
                                           (match (string_drop _s3464_ _s3465_) with
                                            | _s3466_ =>
                                               (sep_matches_prefix _s3466_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               returnm (match w__5 with
                                                        | Some (tt, existT _ _s3467_ _) =>
                                                           match (string_drop _s3466_ _s3467_) with
                                                           | _s3468_ =>
                                                              match (hex_bits_5_matches_prefix
                                                                       _s3468_) with
                                                              | Some (shamt, existT _ _s3469_ _) =>
                                                                 let p0_ :=
                                                                   string_drop _s3468_ _s3469_ in
                                                                 if generic_eq p0_ "" then
                                                                   Some (op, rd, rs1, shamt)
                                                                 else None
                                                              | _ => None
                                                              end
                                                           end
                                                        | _ => None
                                                        end)
                                            end)
                                            : M (option ((sopw * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((sopw * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((sopw * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((sopw * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((sopw * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((sopw * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((sopw * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((sopw * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((sopw * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((sopw * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((sopw * mword 5 * mword 5 * mword 5))).

Definition _s3437_ (_s3438_ : string) : M (option ((ropw * mword 5 * mword 5 * mword 5))) :=
   (match _s3438_ with
    | _s3439_ =>
       (rtypew_mnemonic_matches_prefix _s3439_) >>= fun w__0 : option ((ropw * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s3440_ _) =>
           (match (string_drop _s3439_ _s3440_) with
            | _s3441_ =>
               (spc_matches_prefix _s3441_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s3442_ _) =>
                   (match (string_drop _s3441_ _s3442_) with
                    | _s3443_ =>
                       (reg_name_matches_prefix _s3443_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s3444_ _) =>
                           (match (string_drop _s3443_ _s3444_) with
                            | _s3445_ =>
                               (sep_matches_prefix _s3445_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s3446_ _) =>
                                   (match (string_drop _s3445_ _s3446_) with
                                    | _s3447_ =>
                                       (reg_name_matches_prefix _s3447_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s3448_ _) =>
                                           (match (string_drop _s3447_ _s3448_) with
                                            | _s3449_ =>
                                               (sep_matches_prefix _s3449_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s3450_ _) =>
                                                   (match (string_drop _s3449_ _s3450_) with
                                                    | _s3451_ =>
                                                       (reg_name_matches_prefix _s3451_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s3452_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s3451_ _s3452_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (op, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((ropw * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((ropw * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((ropw * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((ropw * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((ropw * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((ropw * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((ropw * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((ropw * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((ropw * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((ropw * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((ropw * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((ropw * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((ropw * mword 5 * mword 5 * mword 5))).

Definition _s3420_ (_s3421_ : string) : M (option ((sop * mword 5 * mword 5 * mword 5))) :=
   (match _s3421_ with
    | _s3422_ =>
       (shiftw_mnemonic_matches_prefix _s3422_) >>= fun w__0 : option ((sop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s3423_ _) =>
           (match (string_drop _s3422_ _s3423_) with
            | _s3424_ =>
               (spc_matches_prefix _s3424_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s3425_ _) =>
                   (match (string_drop _s3424_ _s3425_) with
                    | _s3426_ =>
                       (reg_name_matches_prefix _s3426_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s3427_ _) =>
                           (match (string_drop _s3426_ _s3427_) with
                            | _s3428_ =>
                               (sep_matches_prefix _s3428_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s3429_ _) =>
                                   (match (string_drop _s3428_ _s3429_) with
                                    | _s3430_ =>
                                       (reg_name_matches_prefix _s3430_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s3431_ _) =>
                                           (match (string_drop _s3430_ _s3431_) with
                                            | _s3432_ =>
                                               (sep_matches_prefix _s3432_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               returnm (match w__5 with
                                                        | Some (tt, existT _ _s3433_ _) =>
                                                           match (string_drop _s3432_ _s3433_) with
                                                           | _s3434_ =>
                                                              match (hex_bits_5_matches_prefix
                                                                       _s3434_) with
                                                              | Some (shamt, existT _ _s3435_ _) =>
                                                                 let p0_ :=
                                                                   string_drop _s3434_ _s3435_ in
                                                                 if generic_eq p0_ "" then
                                                                   Some (op, rd, rs1, shamt)
                                                                 else None
                                                              | _ => None
                                                              end
                                                           end
                                                        | _ => None
                                                        end)
                                            end)
                                            : M (option ((sop * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((sop * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((sop * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((sop * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((sop * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((sop * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((sop * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((sop * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((sop * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((sop * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((sop * mword 5 * mword 5 * mword 5))).

Definition _s3404_ (_s3405_ : string) : M (option ((mword 5 * mword 5 * mword 12))) :=
   let _s3406_ := _s3405_ in
   (if string_startswith _s3406_ "addiw" then
      (match (string_drop _s3406_ (projT1 (string_length "addiw"))) with
       | _s3407_ =>
          (spc_matches_prefix _s3407_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3408_ _) =>
              (match (string_drop _s3407_ _s3408_) with
               | _s3409_ =>
                  (reg_name_matches_prefix _s3409_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s3410_ _) =>
                      (match (string_drop _s3409_ _s3410_) with
                       | _s3411_ =>
                          (sep_matches_prefix _s3411_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s3412_ _) =>
                              (match (string_drop _s3411_ _s3412_) with
                               | _s3413_ =>
                                  (reg_name_matches_prefix _s3413_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rs1, existT _ _s3414_ _) =>
                                      (match (string_drop _s3413_ _s3414_) with
                                       | _s3415_ =>
                                          (sep_matches_prefix _s3415_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s3416_ _) =>
                                                      match (string_drop _s3415_ _s3416_) with
                                                      | _s3417_ =>
                                                         match (hex_bits_12_matches_prefix _s3417_) with
                                                         | Some (imm, existT _ _s3418_ _) =>
                                                            let p0_ := string_drop _s3417_ _s3418_ in
                                                            if generic_eq p0_ "" then
                                                              Some (rd, rs1, imm)
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 5 * mword 5 * mword 12)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 5 * mword 5 * mword 12)))
                               end)
                               : M (option ((mword 5 * mword 5 * mword 12)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 5 * mword 5 * mword 12)))
                       end)
                       : M (option ((mword 5 * mword 5 * mword 12)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 5 * mword 12)))
               end)
               : M (option ((mword 5 * mword 5 * mword 12)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5 * mword 12)))
       end)
       : M (option ((mword 5 * mword 5 * mword 12)))
    else returnm None)
    : M (option ((mword 5 * mword 5 * mword 12))).

Definition _s3376_ (_s3377_ : string)
: M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5))) :=
   let _s3378_ := _s3377_ in
   (if string_startswith _s3378_ "s" then
      (match (string_drop _s3378_ (projT1 (string_length "s"))) with
       | _s3379_ =>
          (size_mnemonic_matches_prefix _s3379_) >>= fun w__0 : option ((word_width * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (size, existT _ _s3380_ _) =>
              (match (string_drop _s3379_ _s3380_) with
               | _s3381_ =>
                  (maybe_aq_matches_prefix _s3381_) >>= fun w__1 : option ((bool * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (aq, existT _ _s3382_ _) =>
                      (match (string_drop _s3381_ _s3382_) with
                       | _s3383_ =>
                          (maybe_rl_matches_prefix _s3383_) >>= fun w__2 : option ((bool * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rl, existT _ _s3384_ _) =>
                              (match (string_drop _s3383_ _s3384_) with
                               | _s3385_ =>
                                  (spc_matches_prefix _s3385_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s3386_ _) =>
                                      (match (string_drop _s3385_ _s3386_) with
                                       | _s3387_ =>
                                          (reg_name_matches_prefix _s3387_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (rs2, existT _ _s3388_ _) =>
                                              (match (string_drop _s3387_ _s3388_) with
                                               | _s3389_ =>
                                                  (sep_matches_prefix _s3389_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (tt, existT _ _s3390_ _) =>
                                                      (match (string_drop _s3389_ _s3390_) with
                                                       | _s3391_ =>
                                                          (match (hex_bits_12_matches_prefix _s3391_) with
                                                           | Some (imm, existT _ _s3392_ _) =>
                                                              (match (string_drop _s3391_ _s3392_) with
                                                               | _s3393_ =>
                                                                  (opt_spc_matches_prefix _s3393_) >>= fun w__6 : option ((unit * {n : Z & ArithFact (n >=?
                                                                    0)})) =>
                                                                  (match w__6 with
                                                                   | Some (tt, existT _ _s3394_ _) =>
                                                                      let _s3395_ :=
                                                                        string_drop _s3393_ _s3394_ in
                                                                      (if string_startswith _s3395_
                                                                            "(" then
                                                                         (match (string_drop _s3395_
                                                                                   (projT1
                                                                                    (string_length
                                                                                       "("))) with
                                                                          | _s3396_ =>
                                                                             (opt_spc_matches_prefix
                                                                                _s3396_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                               0)})) =>
                                                                             (match w__7 with
                                                                              | Some
                                                                                (tt, existT _ _s3397_ _) =>
                                                                                 (match (string_drop
                                                                                           _s3396_
                                                                                           _s3397_) with
                                                                                  | _s3398_ =>
                                                                                     (reg_name_matches_prefix
                                                                                        _s3398_) >>= fun w__8 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                                       0)})) =>
                                                                                     (match w__8 with
                                                                                      | Some
                                                                                        (rs1, existT _ _s3399_ _) =>
                                                                                         (match (string_drop
                                                                                                   _s3398_
                                                                                                   _s3399_) with
                                                                                          | _s3400_ =>
                                                                                             (opt_spc_matches_prefix
                                                                                                _s3400_) >>= fun w__9 : option ((unit * {n : Z & ArithFact (n >=?
                                                                                               0)})) =>
                                                                                             returnm (match w__9 with
                                                                                                      | Some
                                                                                                        (tt, existT _ _s3401_ _) =>
                                                                                                         let _s3402_ :=
                                                                                                           string_drop
                                                                                                             _s3400_
                                                                                                             _s3401_ in
                                                                                                         if
                                                                                                           string_startswith
                                                                                                             _s3402_
                                                                                                             ")"
                                                                                                         then
                                                                                                           let p0_ :=
                                                                                                             string_drop
                                                                                                               _s3402_
                                                                                                               (projT1
                                                                                                                (string_length
                                                                                                                   ")")) in
                                                                                                           if
                                                                                                             generic_eq
                                                                                                               p0_
                                                                                                               ""
                                                                                                           then
                                                                                                             Some
                                                                                                               (size, aq, rl, rs2, imm, rs1)
                                                                                                           else
                                                                                                             None
                                                                                                         else
                                                                                                           None
                                                                                                      | _ =>
                                                                                                         None
                                                                                                      end)
                                                                                          end)
                                                                                          : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                                      | _ =>
                                                                                         returnm None
                                                                                      end)
                                                                                      : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                                  end)
                                                                                  : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                              | _ => returnm None
                                                                              end)
                                                                              : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                          end)
                                                                          : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                       else returnm None)
                                                                       : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                   | _ => returnm None
                                                                   end)
                                                                   : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                                               end)
                                                               : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                                           | _ => returnm None
                                                           end)
                                                           : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                                       end)
                                                       : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                               end)
                                               : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                       end)
                                       : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                               end)
                               : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                       end)
                       : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
               end)
               : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
       end)
       : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)))
    else returnm None)
    : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5))).

Definition _s3346_ (_s3347_ : string)
: M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5))) :=
   let _s3348_ := _s3347_ in
   (if string_startswith _s3348_ "l" then
      (match (string_drop _s3348_ (projT1 (string_length "l"))) with
       | _s3349_ =>
          (size_mnemonic_matches_prefix _s3349_) >>= fun w__0 : option ((word_width * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (size, existT _ _s3350_ _) =>
              (match (string_drop _s3349_ _s3350_) with
               | _s3351_ =>
                  (maybe_u_matches_prefix _s3351_) >>= fun w__1 : option ((bool * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (is_unsigned, existT _ _s3352_ _) =>
                      (match (string_drop _s3351_ _s3352_) with
                       | _s3353_ =>
                          (maybe_aq_matches_prefix _s3353_) >>= fun w__2 : option ((bool * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (aq, existT _ _s3354_ _) =>
                              (match (string_drop _s3353_ _s3354_) with
                               | _s3355_ =>
                                  (maybe_rl_matches_prefix _s3355_) >>= fun w__3 : option ((bool * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rl, existT _ _s3356_ _) =>
                                      (match (string_drop _s3355_ _s3356_) with
                                       | _s3357_ =>
                                          (spc_matches_prefix _s3357_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (tt, existT _ _s3358_ _) =>
                                              (match (string_drop _s3357_ _s3358_) with
                                               | _s3359_ =>
                                                  (reg_name_matches_prefix _s3359_) >>= fun w__5 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (rd, existT _ _s3360_ _) =>
                                                      (match (string_drop _s3359_ _s3360_) with
                                                       | _s3361_ =>
                                                          (sep_matches_prefix _s3361_) >>= fun w__6 : option ((unit * {n : Z & ArithFact (n >=?
                                                            0)})) =>
                                                          (match w__6 with
                                                           | Some (tt, existT _ _s3362_ _) =>
                                                              (match (string_drop _s3361_ _s3362_) with
                                                               | _s3363_ =>
                                                                  (match (hex_bits_12_matches_prefix
                                                                            _s3363_) with
                                                                   | Some (imm, existT _ _s3364_ _) =>
                                                                      (match (string_drop _s3363_
                                                                                _s3364_) with
                                                                       | _s3365_ =>
                                                                          (opt_spc_matches_prefix
                                                                             _s3365_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                            0)})) =>
                                                                          (match w__7 with
                                                                           | Some
                                                                             (tt, existT _ _s3366_ _) =>
                                                                              let _s3367_ :=
                                                                                string_drop _s3365_
                                                                                  _s3366_ in
                                                                              (if string_startswith
                                                                                    _s3367_ "(" then
                                                                                 (match (string_drop
                                                                                           _s3367_
                                                                                           (projT1
                                                                                            (string_length
                                                                                               "("))) with
                                                                                  | _s3368_ =>
                                                                                     (opt_spc_matches_prefix
                                                                                        _s3368_) >>= fun w__8 : option ((unit * {n : Z & ArithFact (n >=?
                                                                                       0)})) =>
                                                                                     (match w__8 with
                                                                                      | Some
                                                                                        (tt, existT _ _s3369_ _) =>
                                                                                         (match (string_drop
                                                                                                   _s3368_
                                                                                                   _s3369_) with
                                                                                          | _s3370_ =>
                                                                                             (reg_name_matches_prefix
                                                                                                _s3370_) >>= fun w__9 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                                               0)})) =>
                                                                                             (match w__9 with
                                                                                              | Some
                                                                                                (rs1, existT _ _s3371_ _) =>
                                                                                                 (match (string_drop
                                                                                                           _s3370_
                                                                                                           _s3371_) with
                                                                                                  | _s3372_ =>
                                                                                                     (opt_spc_matches_prefix
                                                                                                        _s3372_) >>= fun w__10 : option ((unit * {n : Z & ArithFact (n >=?
                                                                                                       0)})) =>
                                                                                                     returnm (match w__10 with
                                                                                                              | Some
                                                                                                                (tt, existT _ _s3373_ _) =>
                                                                                                                 let _s3374_ :=
                                                                                                                   string_drop
                                                                                                                     _s3372_
                                                                                                                     _s3373_ in
                                                                                                                 if
                                                                                                                   string_startswith
                                                                                                                     _s3374_
                                                                                                                     ")"
                                                                                                                 then
                                                                                                                   let p0_ :=
                                                                                                                     string_drop
                                                                                                                       _s3374_
                                                                                                                       (projT1
                                                                                                                        (string_length
                                                                                                                           ")")) in
                                                                                                                   if
                                                                                                                     generic_eq
                                                                                                                       p0_
                                                                                                                       ""
                                                                                                                   then
                                                                                                                     Some
                                                                                                                       (size, is_unsigned, aq, rl, rd, imm, rs1)
                                                                                                                   else
                                                                                                                     None
                                                                                                                 else
                                                                                                                   None
                                                                                                              | _ =>
                                                                                                                 None
                                                                                                              end)
                                                                                                  end)
                                                                                                  : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                                              | _ =>
                                                                                                 returnm None
                                                                                              end)
                                                                                              : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                                          end)
                                                                                          : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                                      | _ =>
                                                                                         returnm None
                                                                                      end)
                                                                                      : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                                  end)
                                                                                  : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                               else returnm None)
                                                                               : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                           | _ => returnm None
                                                                           end)
                                                                           : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                       end)
                                                                       : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                                   | _ => returnm None
                                                                   end)
                                                                   : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                               end)
                                                               : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                           | _ => returnm None
                                                           end)
                                                           : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                       end)
                                                       : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                               end)
                                               : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                       end)
                                       : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                               end)
                               : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                           | _ => returnm None
                           end)
                           : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                       end)
                       : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
                   | _ => returnm None
                   end)
                   : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
               end)
               : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
           | _ => returnm None
           end)
           : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
       end)
       : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)))
    else returnm None)
    : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5))).

Definition _s3329_ (_s3330_ : string) : M (option ((rop * mword 5 * mword 5 * mword 5))) :=
   (match _s3330_ with
    | _s3331_ =>
       (rtype_mnemonic_matches_prefix _s3331_) >>= fun w__0 : option ((rop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s3332_ _) =>
           (match (string_drop _s3331_ _s3332_) with
            | _s3333_ =>
               (spc_matches_prefix _s3333_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s3334_ _) =>
                   (match (string_drop _s3333_ _s3334_) with
                    | _s3335_ =>
                       (reg_name_matches_prefix _s3335_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s3336_ _) =>
                           (match (string_drop _s3335_ _s3336_) with
                            | _s3337_ =>
                               (sep_matches_prefix _s3337_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s3338_ _) =>
                                   (match (string_drop _s3337_ _s3338_) with
                                    | _s3339_ =>
                                       (reg_name_matches_prefix _s3339_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s3340_ _) =>
                                           (match (string_drop _s3339_ _s3340_) with
                                            | _s3341_ =>
                                               (sep_matches_prefix _s3341_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s3342_ _) =>
                                                   (match (string_drop _s3341_ _s3342_) with
                                                    | _s3343_ =>
                                                       (reg_name_matches_prefix _s3343_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s3344_ _) =>
                                                                   let p0_ :=
                                                                     string_drop _s3343_ _s3344_ in
                                                                   if generic_eq p0_ "" then
                                                                     Some (op, rd, rs1, rs2)
                                                                   else None
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((rop * mword 5 * mword 5 * mword 5)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((rop * mword 5 * mword 5 * mword 5)))
                                            end)
                                            : M (option ((rop * mword 5 * mword 5 * mword 5)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((rop * mword 5 * mword 5 * mword 5)))
                                    end)
                                    : M (option ((rop * mword 5 * mword 5 * mword 5)))
                                | _ => returnm None
                                end)
                                : M (option ((rop * mword 5 * mword 5 * mword 5)))
                            end)
                            : M (option ((rop * mword 5 * mword 5 * mword 5)))
                        | _ => returnm None
                        end)
                        : M (option ((rop * mword 5 * mword 5 * mword 5)))
                    end)
                    : M (option ((rop * mword 5 * mword 5 * mword 5)))
                | _ => returnm None
                end)
                : M (option ((rop * mword 5 * mword 5 * mword 5)))
            end)
            : M (option ((rop * mword 5 * mword 5 * mword 5)))
        | _ => returnm None
        end)
        : M (option ((rop * mword 5 * mword 5 * mword 5)))
    end)
    : M (option ((rop * mword 5 * mword 5 * mword 5))).

Definition _s3312_ (_s3313_ : string) : M (option ((sop * mword 5 * mword 5 * mword 6))) :=
   (match _s3313_ with
    | _s3314_ =>
       (shiftiop_mnemonic_matches_prefix _s3314_) >>= fun w__0 : option ((sop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s3315_ _) =>
           (match (string_drop _s3314_ _s3315_) with
            | _s3316_ =>
               (spc_matches_prefix _s3316_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s3317_ _) =>
                   (match (string_drop _s3316_ _s3317_) with
                    | _s3318_ =>
                       (reg_name_matches_prefix _s3318_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s3319_ _) =>
                           (match (string_drop _s3318_ _s3319_) with
                            | _s3320_ =>
                               (sep_matches_prefix _s3320_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s3321_ _) =>
                                   (match (string_drop _s3320_ _s3321_) with
                                    | _s3322_ =>
                                       (reg_name_matches_prefix _s3322_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s3323_ _) =>
                                           (match (string_drop _s3322_ _s3323_) with
                                            | _s3324_ =>
                                               (sep_matches_prefix _s3324_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               returnm (match w__5 with
                                                        | Some (tt, existT _ _s3325_ _) =>
                                                           match (string_drop _s3324_ _s3325_) with
                                                           | _s3326_ =>
                                                              match (hex_bits_6_matches_prefix
                                                                       _s3326_) with
                                                              | Some (shamt, existT _ _s3327_ _) =>
                                                                 let p0_ :=
                                                                   string_drop _s3326_ _s3327_ in
                                                                 if generic_eq p0_ "" then
                                                                   Some (op, rd, rs1, shamt)
                                                                 else None
                                                              | _ => None
                                                              end
                                                           end
                                                        | _ => None
                                                        end)
                                            end)
                                            : M (option ((sop * mword 5 * mword 5 * mword 6)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((sop * mword 5 * mword 5 * mword 6)))
                                    end)
                                    : M (option ((sop * mword 5 * mword 5 * mword 6)))
                                | _ => returnm None
                                end)
                                : M (option ((sop * mword 5 * mword 5 * mword 6)))
                            end)
                            : M (option ((sop * mword 5 * mword 5 * mword 6)))
                        | _ => returnm None
                        end)
                        : M (option ((sop * mword 5 * mword 5 * mword 6)))
                    end)
                    : M (option ((sop * mword 5 * mword 5 * mword 6)))
                | _ => returnm None
                end)
                : M (option ((sop * mword 5 * mword 5 * mword 6)))
            end)
            : M (option ((sop * mword 5 * mword 5 * mword 6)))
        | _ => returnm None
        end)
        : M (option ((sop * mword 5 * mword 5 * mword 6)))
    end)
    : M (option ((sop * mword 5 * mword 5 * mword 6))).

Definition _s3295_ (_s3296_ : string) : M (option ((iop * mword 5 * mword 5 * mword 12))) :=
   (match _s3296_ with
    | _s3297_ =>
       (itype_mnemonic_matches_prefix _s3297_) >>= fun w__0 : option ((iop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s3298_ _) =>
           (match (string_drop _s3297_ _s3298_) with
            | _s3299_ =>
               (spc_matches_prefix _s3299_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s3300_ _) =>
                   (match (string_drop _s3299_ _s3300_) with
                    | _s3301_ =>
                       (reg_name_matches_prefix _s3301_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s3302_ _) =>
                           (match (string_drop _s3301_ _s3302_) with
                            | _s3303_ =>
                               (sep_matches_prefix _s3303_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s3304_ _) =>
                                   (match (string_drop _s3303_ _s3304_) with
                                    | _s3305_ =>
                                       (reg_name_matches_prefix _s3305_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s3306_ _) =>
                                           (match (string_drop _s3305_ _s3306_) with
                                            | _s3307_ =>
                                               (sep_matches_prefix _s3307_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               returnm (match w__5 with
                                                        | Some (tt, existT _ _s3308_ _) =>
                                                           match (string_drop _s3307_ _s3308_) with
                                                           | _s3309_ =>
                                                              match (hex_bits_12_matches_prefix
                                                                       _s3309_) with
                                                              | Some (imm, existT _ _s3310_ _) =>
                                                                 let p0_ :=
                                                                   string_drop _s3309_ _s3310_ in
                                                                 if generic_eq p0_ "" then
                                                                   Some (op, rd, rs1, imm)
                                                                 else None
                                                              | _ => None
                                                              end
                                                           end
                                                        | _ => None
                                                        end)
                                            end)
                                            : M (option ((iop * mword 5 * mword 5 * mword 12)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((iop * mword 5 * mword 5 * mword 12)))
                                    end)
                                    : M (option ((iop * mword 5 * mword 5 * mword 12)))
                                | _ => returnm None
                                end)
                                : M (option ((iop * mword 5 * mword 5 * mword 12)))
                            end)
                            : M (option ((iop * mword 5 * mword 5 * mword 12)))
                        | _ => returnm None
                        end)
                        : M (option ((iop * mword 5 * mword 5 * mword 12)))
                    end)
                    : M (option ((iop * mword 5 * mword 5 * mword 12)))
                | _ => returnm None
                end)
                : M (option ((iop * mword 5 * mword 5 * mword 12)))
            end)
            : M (option ((iop * mword 5 * mword 5 * mword 12)))
        | _ => returnm None
        end)
        : M (option ((iop * mword 5 * mword 5 * mword 12)))
    end)
    : M (option ((iop * mword 5 * mword 5 * mword 12))).

Definition _s3278_ (_s3279_ : string) : M (option ((bop * mword 5 * mword 5 * mword 13))) :=
   (match _s3279_ with
    | _s3280_ =>
       (btype_mnemonic_matches_prefix _s3280_) >>= fun w__0 : option ((bop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s3281_ _) =>
           (match (string_drop _s3280_ _s3281_) with
            | _s3282_ =>
               (spc_matches_prefix _s3282_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s3283_ _) =>
                   (match (string_drop _s3282_ _s3283_) with
                    | _s3284_ =>
                       (reg_name_matches_prefix _s3284_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rs1, existT _ _s3285_ _) =>
                           (match (string_drop _s3284_ _s3285_) with
                            | _s3286_ =>
                               (sep_matches_prefix _s3286_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s3287_ _) =>
                                   (match (string_drop _s3286_ _s3287_) with
                                    | _s3288_ =>
                                       (reg_name_matches_prefix _s3288_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs2, existT _ _s3289_ _) =>
                                           (match (string_drop _s3288_ _s3289_) with
                                            | _s3290_ =>
                                               (sep_matches_prefix _s3290_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               returnm (match w__5 with
                                                        | Some (tt, existT _ _s3291_ _) =>
                                                           match (string_drop _s3290_ _s3291_) with
                                                           | _s3292_ =>
                                                              match (hex_bits_13_matches_prefix
                                                                       _s3292_) with
                                                              | Some (imm, existT _ _s3293_ _) =>
                                                                 let p0_ :=
                                                                   string_drop _s3292_ _s3293_ in
                                                                 if generic_eq p0_ "" then
                                                                   Some (op, rs1, rs2, imm)
                                                                 else None
                                                              | _ => None
                                                              end
                                                           end
                                                        | _ => None
                                                        end)
                                            end)
                                            : M (option ((bop * mword 5 * mword 5 * mword 13)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((bop * mword 5 * mword 5 * mword 13)))
                                    end)
                                    : M (option ((bop * mword 5 * mword 5 * mword 13)))
                                | _ => returnm None
                                end)
                                : M (option ((bop * mword 5 * mword 5 * mword 13)))
                            end)
                            : M (option ((bop * mword 5 * mword 5 * mword 13)))
                        | _ => returnm None
                        end)
                        : M (option ((bop * mword 5 * mword 5 * mword 13)))
                    end)
                    : M (option ((bop * mword 5 * mword 5 * mword 13)))
                | _ => returnm None
                end)
                : M (option ((bop * mword 5 * mword 5 * mword 13)))
            end)
            : M (option ((bop * mword 5 * mword 5 * mword 13)))
        | _ => returnm None
        end)
        : M (option ((bop * mword 5 * mword 5 * mword 13)))
    end)
    : M (option ((bop * mword 5 * mword 5 * mword 13))).

Definition _s3262_ (_s3263_ : string) : M (option ((mword 5 * mword 5 * mword 12))) :=
   let _s3264_ := _s3263_ in
   (if string_startswith _s3264_ "jalr" then
      (match (string_drop _s3264_ (projT1 (string_length "jalr"))) with
       | _s3265_ =>
          (spc_matches_prefix _s3265_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3266_ _) =>
              (match (string_drop _s3265_ _s3266_) with
               | _s3267_ =>
                  (reg_name_matches_prefix _s3267_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s3268_ _) =>
                      (match (string_drop _s3267_ _s3268_) with
                       | _s3269_ =>
                          (sep_matches_prefix _s3269_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s3270_ _) =>
                              (match (string_drop _s3269_ _s3270_) with
                               | _s3271_ =>
                                  (reg_name_matches_prefix _s3271_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rs1, existT _ _s3272_ _) =>
                                      (match (string_drop _s3271_ _s3272_) with
                                       | _s3273_ =>
                                          (sep_matches_prefix _s3273_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s3274_ _) =>
                                                      match (string_drop _s3273_ _s3274_) with
                                                      | _s3275_ =>
                                                         match (hex_bits_12_matches_prefix _s3275_) with
                                                         | Some (imm, existT _ _s3276_ _) =>
                                                            let p0_ := string_drop _s3275_ _s3276_ in
                                                            if generic_eq p0_ "" then
                                                              Some (rd, rs1, imm)
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 5 * mword 5 * mword 12)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 5 * mword 5 * mword 12)))
                               end)
                               : M (option ((mword 5 * mword 5 * mword 12)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 5 * mword 5 * mword 12)))
                       end)
                       : M (option ((mword 5 * mword 5 * mword 12)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 5 * mword 12)))
               end)
               : M (option ((mword 5 * mword 5 * mword 12)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5 * mword 12)))
       end)
       : M (option ((mword 5 * mword 5 * mword 12)))
    else returnm None)
    : M (option ((mword 5 * mword 5 * mword 12))).

Definition _s3250_ (_s3251_ : string) : M (option ((mword 5 * mword 21))) :=
   let _s3252_ := _s3251_ in
   (if string_startswith _s3252_ "jal" then
      (match (string_drop _s3252_ (projT1 (string_length "jal"))) with
       | _s3253_ =>
          (spc_matches_prefix _s3253_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s3254_ _) =>
              (match (string_drop _s3253_ _s3254_) with
               | _s3255_ =>
                  (reg_name_matches_prefix _s3255_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s3256_ _) =>
                      (match (string_drop _s3255_ _s3256_) with
                       | _s3257_ =>
                          (sep_matches_prefix _s3257_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s3258_ _) =>
                                      match (string_drop _s3257_ _s3258_) with
                                      | _s3259_ =>
                                         match (hex_bits_21_matches_prefix _s3259_) with
                                         | Some (imm, existT _ _s3260_ _) =>
                                            let p0_ := string_drop _s3259_ _s3260_ in
                                            if generic_eq p0_ "" then Some (rd, imm)
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 21)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 21)))
               end)
               : M (option ((mword 5 * mword 21)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 21)))
       end)
       : M (option ((mword 5 * mword 21)))
    else returnm None)
    : M (option ((mword 5 * mword 21))).

Definition _s3237_ (_s3238_ : string) : M (option ((uop * mword 5 * mword 20))) :=
   (match _s3238_ with
    | _s3239_ =>
       (utype_mnemonic_matches_prefix _s3239_) >>= fun w__0 : option ((uop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s3240_ _) =>
           (match (string_drop _s3239_ _s3240_) with
            | _s3241_ =>
               (spc_matches_prefix _s3241_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s3242_ _) =>
                   (match (string_drop _s3241_ _s3242_) with
                    | _s3243_ =>
                       (reg_name_matches_prefix _s3243_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s3244_ _) =>
                           (match (string_drop _s3243_ _s3244_) with
                            | _s3245_ =>
                               (sep_matches_prefix _s3245_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               returnm (match w__3 with
                                        | Some (tt, existT _ _s3246_ _) =>
                                           match (string_drop _s3245_ _s3246_) with
                                           | _s3247_ =>
                                              match (hex_bits_20_matches_prefix _s3247_) with
                                              | Some (imm, existT _ _s3248_ _) =>
                                                 let p0_ := string_drop _s3247_ _s3248_ in
                                                 if generic_eq p0_ "" then Some (op, rd, imm)
                                                 else None
                                              | _ => None
                                              end
                                           end
                                        | _ => None
                                        end)
                            end)
                            : M (option ((uop * mword 5 * mword 20)))
                        | _ => returnm None
                        end)
                        : M (option ((uop * mword 5 * mword 20)))
                    end)
                    : M (option ((uop * mword 5 * mword 20)))
                | _ => returnm None
                end)
                : M (option ((uop * mword 5 * mword 20)))
            end)
            : M (option ((uop * mword 5 * mword 20)))
        | _ => returnm None
        end)
        : M (option ((uop * mword 5 * mword 20)))
    end)
    : M (option ((uop * mword 5 * mword 20))).

Definition assembly_backwards_matches (arg_ : string) : M (bool) :=
   let _s3249_ := arg_ in
   (_s3237_ _s3249_) >>= fun w__0 : option ((uop * mword 5 * mword 20)) =>
   (if match w__0 with | Some (op, rd, imm) => true | _ => false end then
      (_s3237_ _s3249_) >>= fun w__1 : option ((uop * mword 5 * mword 20)) =>
      (match w__1 with | Some (op, rd, imm) => returnm true | _ => exit tt  : M (bool) end)
       : M (bool)
    else
      (_s3250_ _s3249_) >>= fun w__4 : option ((mword 5 * mword 21)) =>
      (if match w__4 with | Some (rd, imm) => true | _ => false end then
         (_s3250_ _s3249_) >>= fun w__5 : option ((mword 5 * mword 21)) =>
         (match w__5 with | Some (rd, imm) => returnm true | _ => exit tt  : M (bool) end)
          : M (bool)
       else
         (_s3262_ _s3249_) >>= fun w__8 : option ((mword 5 * mword 5 * mword 12)) =>
         (if match w__8 with | Some (rd, rs1, imm) => true | _ => false end then
            (_s3262_ _s3249_) >>= fun w__9 : option ((mword 5 * mword 5 * mword 12)) =>
            (match w__9 with | Some (rd, rs1, imm) => returnm true | _ => exit tt  : M (bool) end)
             : M (bool)
          else
            (_s3278_ _s3249_) >>= fun w__12 : option ((bop * mword 5 * mword 5 * mword 13)) =>
            (if match w__12 with | Some (op, rs1, rs2, imm) => true | _ => false end then
               (_s3278_ _s3249_) >>= fun w__13 : option ((bop * mword 5 * mword 5 * mword 13)) =>
               (match w__13 with
                | Some (op, rs1, rs2, imm) => returnm true
                | _ => exit tt  : M (bool)
                end)
                : M (bool)
             else
               (_s3295_ _s3249_) >>= fun w__16 : option ((iop * mword 5 * mword 5 * mword 12)) =>
               (if match w__16 with | Some (op, rd, rs1, imm) => true | _ => false end then
                  (_s3295_ _s3249_) >>= fun w__17 : option ((iop * mword 5 * mword 5 * mword 12)) =>
                  (match w__17 with
                   | Some (op, rd, rs1, imm) => returnm true
                   | _ => exit tt  : M (bool)
                   end)
                   : M (bool)
                else
                  (_s3312_ _s3249_) >>= fun w__20 : option ((sop * mword 5 * mword 5 * mword 6)) =>
                  (if match w__20 with | Some (op, rd, rs1, shamt) => true | _ => false end then
                     (_s3312_ _s3249_) >>= fun w__21 : option ((sop * mword 5 * mword 5 * mword 6)) =>
                     (match w__21 with
                      | Some (op, rd, rs1, shamt) => returnm true
                      | _ => exit tt  : M (bool)
                      end)
                      : M (bool)
                   else
                     (_s3329_ _s3249_) >>= fun w__24 : option ((rop * mword 5 * mword 5 * mword 5)) =>
                     (if match w__24 with | Some (op, rd, rs1, rs2) => true | _ => false end then
                        (_s3329_ _s3249_) >>= fun w__25 : option ((rop * mword 5 * mword 5 * mword 5)) =>
                        (match w__25 with
                         | Some (op, rd, rs1, rs2) => returnm true
                         | _ => exit tt  : M (bool)
                         end)
                         : M (bool)
                      else
                        (_s3346_ _s3249_) >>= fun w__28 : option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)) =>
                        (if match w__28 with
                            | Some (size, is_unsigned, aq, rl, rd, imm, rs1) => true
                            | _ => false
                            end then
                           (_s3346_ _s3249_) >>= fun w__29 : option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5)) =>
                           (match w__29 with
                            | Some (size, is_unsigned, aq, rl, rd, imm, rs1) => returnm true
                            | _ => exit tt  : M (bool)
                            end)
                            : M (bool)
                         else
                           (_s3376_ _s3249_) >>= fun w__32 : option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)) =>
                           (if match w__32 with
                               | Some (size, aq, rl, rs2, imm, rs1) => true
                               | _ => false
                               end then
                              (_s3376_ _s3249_) >>= fun w__33 : option ((word_width * bool * bool * mword 5 * mword 12 * mword 5)) =>
                              (match w__33 with
                               | Some (size, aq, rl, rs2, imm, rs1) => returnm true
                               | _ => exit tt  : M (bool)
                               end)
                               : M (bool)
                            else
                              (_s3404_ _s3249_) >>= fun w__36 : option ((mword 5 * mword 5 * mword 12)) =>
                              (if match w__36 with
                                  | Some (rd, rs1, imm) => Z.eqb 64 64
                                  | _ => false
                                  end then
                                 (_s3404_ _s3249_) >>= fun w__37 : option ((mword 5 * mword 5 * mword 12)) =>
                                 (match w__37 with
                                  | Some (rd, rs1, imm) => returnm true
                                  | _ => exit tt  : M (bool)
                                  end)
                                  : M (bool)
                               else
                                 (_s3420_ _s3249_) >>= fun w__40 : option ((sop * mword 5 * mword 5 * mword 5)) =>
                                 (if match w__40 with
                                     | Some (op, rd, rs1, shamt) => Z.eqb 64 64
                                     | _ => false
                                     end then
                                    (_s3420_ _s3249_) >>= fun w__41 : option ((sop * mword 5 * mword 5 * mword 5)) =>
                                    (match w__41 with
                                     | Some (op, rd, rs1, shamt) => returnm true
                                     | _ => exit tt  : M (bool)
                                     end)
                                     : M (bool)
                                  else
                                    (_s3437_ _s3249_) >>= fun w__44 : option ((ropw * mword 5 * mword 5 * mword 5)) =>
                                    (if match w__44 with
                                        | Some (op, rd, rs1, rs2) => Z.eqb 64 64
                                        | _ => false
                                        end then
                                       (_s3437_ _s3249_) >>= fun w__45 : option ((ropw * mword 5 * mword 5 * mword 5)) =>
                                       (match w__45 with
                                        | Some (op, rd, rs1, rs2) => returnm true
                                        | _ => exit tt  : M (bool)
                                        end)
                                        : M (bool)
                                     else
                                       (_s3454_ _s3249_) >>= fun w__48 : option ((sopw * mword 5 * mword 5 * mword 5)) =>
                                       (if match w__48 with
                                           | Some (op, rd, rs1, shamt) => Z.eqb 64 64
                                           | _ => false
                                           end then
                                          (_s3454_ _s3249_) >>= fun w__49 : option ((sopw * mword 5 * mword 5 * mword 5)) =>
                                          (match w__49 with
                                           | Some (op, rd, rs1, shamt) => returnm true
                                           | _ => exit tt  : M (bool)
                                           end)
                                           : M (bool)
                                        else
                                          (_s3471_ _s3249_) >>= fun w__52 : option ((mword 4 * mword 4)) =>
                                          (if match w__52 with
                                              | Some (pred, succ) => true
                                              | _ => false
                                              end then
                                             (_s3471_ _s3249_) >>= fun w__53 : option ((mword 4 * mword 4)) =>
                                             (match w__53 with
                                              | Some (pred, succ) => returnm true
                                              | _ => exit tt  : M (bool)
                                              end)
                                              : M (bool)
                                           else
                                             (_s3483_ _s3249_) >>= fun w__56 : option ((mword 4 * mword 4)) =>
                                             (if match w__56 with
                                                 | Some (pred, succ) => true
                                                 | _ => false
                                                 end then
                                                (_s3483_ _s3249_) >>= fun w__57 : option ((mword 4 * mword 4)) =>
                                                (match w__57 with
                                                 | Some (pred, succ) => returnm true
                                                 | _ => exit tt  : M (bool)
                                                 end)
                                                 : M (bool)
                                              else if generic_eq _s3249_ "fence.i" then returnm true
                                              else if generic_eq _s3249_ "ecall" then returnm true
                                              else if generic_eq _s3249_ "mret" then returnm true
                                              else if generic_eq _s3249_ "sret" then returnm true
                                              else if generic_eq _s3249_ "ebreak" then returnm true
                                              else if generic_eq _s3249_ "wfi" then returnm true
                                              else
                                                (_s3495_ _s3249_) >>= fun w__60 : option ((mword 5 * mword 5)) =>
                                                (if match w__60 with
                                                    | Some (rs1, rs2) => true
                                                    | _ => false
                                                    end then
                                                   (_s3495_ _s3249_) >>= fun w__61 : option ((mword 5 * mword 5)) =>
                                                   (match w__61 with
                                                    | Some (rs1, rs2) => returnm true
                                                    | _ => exit tt  : M (bool)
                                                    end)
                                                    : M (bool)
                                                 else
                                                   (_s3507_ _s3249_) >>= fun w__64 : option ((word_width * bool * bool * mword 5 * mword 5)) =>
                                                   (if match w__64 with
                                                       | Some (size, aq, rl, rd, rs1) => true
                                                       | _ => false
                                                       end then
                                                      (_s3507_ _s3249_) >>= fun w__65 : option ((word_width * bool * bool * mword 5 * mword 5)) =>
                                                      (match w__65 with
                                                       | Some (size, aq, rl, rd, rs1) =>
                                                          returnm true
                                                       | _ => exit tt  : M (bool)
                                                       end)
                                                       : M (bool)
                                                    else
                                                      (_s3525_ _s3249_) >>= fun w__68 : option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)) =>
                                                      (if match w__68 with
                                                          | Some (size, aq, rl, rd, rs1, rs2) =>
                                                             true
                                                          | _ => false
                                                          end then
                                                         (_s3525_ _s3249_) >>= fun w__69 : option ((word_width * bool * bool * mword 5 * mword 5 * mword 5)) =>
                                                         (match w__69 with
                                                          | Some (size, aq, rl, rd, rs1, rs2) =>
                                                             returnm true
                                                          | _ => exit tt  : M (bool)
                                                          end)
                                                          : M (bool)
                                                       else
                                                         (_s3547_ _s3249_) >>= fun w__72 : option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)) =>
                                                         (if match w__72 with
                                                             | Some
                                                               (op, width, aq, rl, rd, rs2, rs1) =>
                                                                true
                                                             | _ => false
                                                             end then
                                                            (_s3547_ _s3249_) >>= fun w__73 : option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5)) =>
                                                            (match w__73 with
                                                             | Some
                                                               (op, width, aq, rl, rd, rs2, rs1) =>
                                                                returnm true
                                                             | _ => exit tt  : M (bool)
                                                             end)
                                                             : M (bool)
                                                          else if generic_eq _s3249_ "c.nop" then
                                                            returnm true
                                                          else
                                                            (_s3573_ _s3249_) >>= fun w__76 : option ((mword 3 * mword 8)) =>
                                                            (if match w__76 with
                                                                | Some (rdc, nzimm) =>
                                                                   neq_vec nzimm (Ox"00"  : mword 8)
                                                                | _ => false
                                                                end then
                                                               (_s3573_ _s3249_) >>= fun w__77 : option ((mword 3 * mword 8)) =>
                                                               (match w__77 with
                                                                | Some (rdc, nzimm) => returnm true
                                                                | _ => exit tt  : M (bool)
                                                                end)
                                                                : M (bool)
                                                             else
                                                               (_s3585_ _s3249_) >>= fun w__80 : option ((mword 3 * mword 3 * mword 5)) =>
                                                               (if match w__80 with
                                                                   | Some (rdc, rsc, uimm) => true
                                                                   | _ => false
                                                                   end then
                                                                  (_s3585_ _s3249_) >>= fun w__81 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                  (match w__81 with
                                                                   | Some (rdc, rsc, uimm) =>
                                                                      returnm true
                                                                   | _ => exit tt  : M (bool)
                                                                   end)
                                                                   : M (bool)
                                                                else
                                                                  (_s3601_ _s3249_) >>= fun w__84 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                  (if match w__84 with
                                                                      | Some (rdc, rsc, uimm) =>
                                                                         Z.eqb 64 64
                                                                      | _ => false
                                                                      end then
                                                                     (_s3601_ _s3249_) >>= fun w__85 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                     (match w__85 with
                                                                      | Some (rdc, rsc, uimm) =>
                                                                         returnm true
                                                                      | _ => exit tt  : M (bool)
                                                                      end)
                                                                      : M (bool)
                                                                   else
                                                                     (_s3617_ _s3249_) >>= fun w__88 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                     (if match w__88 with
                                                                         | Some (rsc1, rsc2, uimm) =>
                                                                            true
                                                                         | _ => false
                                                                         end then
                                                                        (_s3617_ _s3249_) >>= fun w__89 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                        (match w__89 with
                                                                         | Some (rsc1, rsc2, uimm) =>
                                                                            returnm true
                                                                         | _ => exit tt  : M (bool)
                                                                         end)
                                                                         : M (bool)
                                                                      else
                                                                        (_s3633_ _s3249_) >>= fun w__92 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                        (if match w__92 with
                                                                            | Some
                                                                              (rsc1, rsc2, uimm) =>
                                                                               Z.eqb 64 64
                                                                            | _ => false
                                                                            end then
                                                                           (_s3633_ _s3249_) >>= fun w__93 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                           (match w__93 with
                                                                            | Some
                                                                              (rsc1, rsc2, uimm) =>
                                                                               returnm true
                                                                            | _ =>
                                                                               exit tt  : M (bool)
                                                                            end)
                                                                            : M (bool)
                                                                         else
                                                                           (_s3649_ _s3249_) >>= fun w__96 : option ((mword 5 * mword 6)) =>
                                                                           (if match w__96 with
                                                                               | Some (rsd, nzi) =>
                                                                                  andb
                                                                                    (neq_vec nzi
                                                                                       ('b"000000"
                                                                                        : mword 6))
                                                                                    (neq_vec rsd
                                                                                       zreg)
                                                                               | _ => false
                                                                               end then
                                                                              (_s3649_ _s3249_) >>= fun w__97 : option ((mword 5 * mword 6)) =>
                                                                              (match w__97 with
                                                                               | Some (rsd, nzi) =>
                                                                                  returnm true
                                                                               | _ =>
                                                                                  exit tt
                                                                                   : M (bool)
                                                                               end)
                                                                               : M (bool)
                                                                            else
                                                                              (_s3661_ _s3249_) >>= fun w__100 : option (mword 11) =>
                                                                              (if match w__100 with
                                                                                  | Some imm =>
                                                                                     Z.eqb 64 32
                                                                                  | _ => false
                                                                                  end then
                                                                                 (_s3661_ _s3249_) >>= fun w__101 : option (mword 11) =>
                                                                                 (match w__101 with
                                                                                  | Some imm =>
                                                                                     returnm true
                                                                                  | _ =>
                                                                                     exit tt
                                                                                      : M (bool)
                                                                                  end)
                                                                                  : M (bool)
                                                                               else
                                                                                 (_s3669_ _s3249_) >>= fun w__104 : option ((mword 5 * mword 6)) =>
                                                                                 (if match w__104 with
                                                                                     | Some
                                                                                       (rsd, imm) =>
                                                                                        Z.eqb 64 64
                                                                                     | _ => false
                                                                                     end then
                                                                                    (_s3669_ _s3249_) >>= fun w__105 : option ((mword 5 * mword 6)) =>
                                                                                    (match w__105 with
                                                                                     | Some
                                                                                       (rsd, imm) =>
                                                                                        returnm true
                                                                                     | _ =>
                                                                                        exit tt
                                                                                         : M (bool)
                                                                                     end)
                                                                                     : M (bool)
                                                                                  else
                                                                                    (_s3681_ _s3249_) >>= fun w__108 : option ((mword 5 * mword 6)) =>
                                                                                    (if match w__108 with
                                                                                        | Some
                                                                                          (rd, imm) =>
                                                                                           neq_vec
                                                                                             rd zreg
                                                                                        | _ => false
                                                                                        end then
                                                                                       (_s3681_
                                                                                          _s3249_) >>= fun w__109 : option ((mword 5 * mword 6)) =>
                                                                                       (match w__109 with
                                                                                        | Some
                                                                                          (rd, imm) =>
                                                                                           returnm true
                                                                                        | _ =>
                                                                                           exit tt
                                                                                            : M (bool)
                                                                                        end)
                                                                                        : M (bool)
                                                                                     else
                                                                                       (_s3693_
                                                                                          _s3249_) >>= fun w__112 : option (mword 6) =>
                                                                                       (if match w__112 with
                                                                                           | Some
                                                                                             imm =>
                                                                                              neq_vec
                                                                                                imm
                                                                                                ('b"000000"
                                                                                                 : mword 6)
                                                                                           | _ =>
                                                                                              false
                                                                                           end then
                                                                                          (_s3693_
                                                                                             _s3249_) >>= fun w__113 : option (mword 6) =>
                                                                                          (match w__113 with
                                                                                           | Some
                                                                                             imm =>
                                                                                              returnm true
                                                                                           | _ =>
                                                                                              exit tt
                                                                                               : M (bool)
                                                                                           end)
                                                                                           : M (bool)
                                                                                        else
                                                                                          (_s3701_
                                                                                             _s3249_) >>= fun w__116 : option ((mword 5 * mword 6)) =>
                                                                                          (if match w__116 with
                                                                                              | Some
                                                                                                (rd, imm) =>
                                                                                                 andb
                                                                                                   (neq_vec
                                                                                                      rd
                                                                                                      zreg)
                                                                                                   (andb
                                                                                                      (neq_vec
                                                                                                         rd
                                                                                                         sp)
                                                                                                      (neq_vec
                                                                                                         imm
                                                                                                         ('b"000000"
                                                                                                          : mword 6)))
                                                                                              | _ =>
                                                                                                 false
                                                                                              end
                                                                                           then
                                                                                             (_s3701_
                                                                                                _s3249_) >>= fun w__117 : option ((mword 5 * mword 6)) =>
                                                                                             (match w__117 with
                                                                                              | Some
                                                                                                (rd, imm) =>
                                                                                                 returnm true
                                                                                              | _ =>
                                                                                                 exit tt
                                                                                                  : M (bool)
                                                                                              end)
                                                                                              : M (bool)
                                                                                           else
                                                                                             (_s3713_
                                                                                                _s3249_) >>= fun w__120 : option ((mword 3 * mword 6)) =>
                                                                                             (if match w__120 with
                                                                                                 | Some
                                                                                                   (rsd, shamt) =>
                                                                                                    neq_vec
                                                                                                      shamt
                                                                                                      ('b"000000"
                                                                                                       : mword 6)
                                                                                                 | _ =>
                                                                                                    false
                                                                                                 end
                                                                                              then
                                                                                                (_s3713_
                                                                                                   _s3249_) >>= fun w__121 : option ((mword 3 * mword 6)) =>
                                                                                                (match w__121 with
                                                                                                 | Some
                                                                                                   (rsd, shamt) =>
                                                                                                    returnm true
                                                                                                 | _ =>
                                                                                                    exit tt
                                                                                                     : M (bool)
                                                                                                 end)
                                                                                                 : M (bool)
                                                                                              else
                                                                                                (_s3725_
                                                                                                   _s3249_) >>= fun w__124 : option ((mword 3 * mword 6)) =>
                                                                                                (if match w__124 with
                                                                                                    | Some
                                                                                                      (rsd, shamt) =>
                                                                                                       neq_vec
                                                                                                         shamt
                                                                                                         ('b"000000"
                                                                                                          : mword 6)
                                                                                                    | _ =>
                                                                                                       false
                                                                                                    end
                                                                                                 then
                                                                                                   (_s3725_
                                                                                                      _s3249_) >>= fun w__125 : option ((mword 3 * mword 6)) =>
                                                                                                   (match w__125 with
                                                                                                    | Some
                                                                                                      (rsd, shamt) =>
                                                                                                       returnm true
                                                                                                    | _ =>
                                                                                                       exit tt
                                                                                                        : M (bool)
                                                                                                    end)
                                                                                                    : M (bool)
                                                                                                 else
                                                                                                   (_s3737_
                                                                                                      _s3249_) >>= fun w__128 : option ((mword 3 * mword 6)) =>
                                                                                                   (if
                                                                                                      match w__128 with
                                                                                                      | Some
                                                                                                        (rsd, imm) =>
                                                                                                         true
                                                                                                      | _ =>
                                                                                                         false
                                                                                                      end
                                                                                                    then
                                                                                                      (_s3737_
                                                                                                         _s3249_) >>= fun w__129 : option ((mword 3 * mword 6)) =>
                                                                                                      (match w__129 with
                                                                                                       | Some
                                                                                                         (rsd, imm) =>
                                                                                                          returnm true
                                                                                                       | _ =>
                                                                                                          exit tt
                                                                                                           : M (bool)
                                                                                                       end)
                                                                                                       : M (bool)
                                                                                                    else
                                                                                                      (_s3749_
                                                                                                         _s3249_) >>= fun w__132 : option ((mword 3 * mword 3)) =>
                                                                                                      (if
                                                                                                         match w__132 with
                                                                                                         | Some
                                                                                                           (rsd, rs2) =>
                                                                                                            true
                                                                                                         | _ =>
                                                                                                            false
                                                                                                         end
                                                                                                       then
                                                                                                         (_s3749_
                                                                                                            _s3249_) >>= fun w__133 : option ((mword 3 * mword 3)) =>
                                                                                                         (match w__133 with
                                                                                                          | Some
                                                                                                            (rsd, rs2) =>
                                                                                                             returnm true
                                                                                                          | _ =>
                                                                                                             exit tt
                                                                                                              : M (bool)
                                                                                                          end)
                                                                                                          : M (bool)
                                                                                                       else
                                                                                                         (_s3761_
                                                                                                            _s3249_) >>= fun w__136 : option ((mword 3 * mword 3)) =>
                                                                                                         (if
                                                                                                            match w__136 with
                                                                                                            | Some
                                                                                                              (rsd, rs2) =>
                                                                                                               true
                                                                                                            | _ =>
                                                                                                               false
                                                                                                            end
                                                                                                          then
                                                                                                            (_s3761_
                                                                                                               _s3249_) >>= fun w__137 : option ((mword 3 * mword 3)) =>
                                                                                                            (match w__137 with
                                                                                                             | Some
                                                                                                               (rsd, rs2) =>
                                                                                                                returnm true
                                                                                                             | _ =>
                                                                                                                exit tt
                                                                                                                 : M (bool)
                                                                                                             end)
                                                                                                             : M (bool)
                                                                                                          else
                                                                                                            (_s3773_
                                                                                                               _s3249_) >>= fun w__140 : option ((mword 3 * mword 3)) =>
                                                                                                            (if
                                                                                                               match w__140 with
                                                                                                               | Some
                                                                                                                 (rsd, rs2) =>
                                                                                                                  true
                                                                                                               | _ =>
                                                                                                                  false
                                                                                                               end
                                                                                                             then
                                                                                                               (_s3773_
                                                                                                                  _s3249_) >>= fun w__141 : option ((mword 3 * mword 3)) =>
                                                                                                               (match w__141 with
                                                                                                                | Some
                                                                                                                  (rsd, rs2) =>
                                                                                                                   returnm true
                                                                                                                | _ =>
                                                                                                                   exit tt
                                                                                                                    : M (bool)
                                                                                                                end)
                                                                                                                : M (bool)
                                                                                                             else
                                                                                                               (_s3785_
                                                                                                                  _s3249_) >>= fun w__144 : option ((mword 3 * mword 3)) =>
                                                                                                               (if
                                                                                                                  match w__144 with
                                                                                                                  | Some
                                                                                                                    (rsd, rs2) =>
                                                                                                                     true
                                                                                                                  | _ =>
                                                                                                                     false
                                                                                                                  end
                                                                                                                then
                                                                                                                  (_s3785_
                                                                                                                     _s3249_) >>= fun w__145 : option ((mword 3 * mword 3)) =>
                                                                                                                  (match w__145 with
                                                                                                                   | Some
                                                                                                                     (rsd, rs2) =>
                                                                                                                      returnm true
                                                                                                                   | _ =>
                                                                                                                      exit tt
                                                                                                                       : M (bool)
                                                                                                                   end)
                                                                                                                   : M (bool)
                                                                                                                else
                                                                                                                  (_s3797_
                                                                                                                     _s3249_) >>= fun w__148 : option ((mword 3 * mword 3)) =>
                                                                                                                  (if
                                                                                                                     match w__148 with
                                                                                                                     | Some
                                                                                                                       (rsd, rs2) =>
                                                                                                                        Z.eqb
                                                                                                                          64
                                                                                                                          64
                                                                                                                     | _ =>
                                                                                                                        false
                                                                                                                     end
                                                                                                                   then
                                                                                                                     (_s3797_
                                                                                                                        _s3249_) >>= fun w__149 : option ((mword 3 * mword 3)) =>
                                                                                                                     (match w__149 with
                                                                                                                      | Some
                                                                                                                        (rsd, rs2) =>
                                                                                                                         returnm true
                                                                                                                      | _ =>
                                                                                                                         exit tt
                                                                                                                          : M (bool)
                                                                                                                      end)
                                                                                                                      : M (bool)
                                                                                                                   else
                                                                                                                     (_s3809_
                                                                                                                        _s3249_) >>= fun w__152 : option ((mword 3 * mword 3)) =>
                                                                                                                     (if
                                                                                                                        match w__152 with
                                                                                                                        | Some
                                                                                                                          (rsd, rs2) =>
                                                                                                                           Z.eqb
                                                                                                                             64
                                                                                                                             64
                                                                                                                        | _ =>
                                                                                                                           false
                                                                                                                        end
                                                                                                                      then
                                                                                                                        (_s3809_
                                                                                                                           _s3249_) >>= fun w__153 : option ((mword 3 * mword 3)) =>
                                                                                                                        (match w__153 with
                                                                                                                         | Some
                                                                                                                           (rsd, rs2) =>
                                                                                                                            returnm true
                                                                                                                         | _ =>
                                                                                                                            exit tt
                                                                                                                             : M (bool)
                                                                                                                         end)
                                                                                                                         : M (bool)
                                                                                                                      else
                                                                                                                        (_s3821_
                                                                                                                           _s3249_) >>= fun w__156 : option (mword 11) =>
                                                                                                                        (if
                                                                                                                           match w__156 with
                                                                                                                           | Some
                                                                                                                             imm =>
                                                                                                                              true
                                                                                                                           | _ =>
                                                                                                                              false
                                                                                                                           end
                                                                                                                         then
                                                                                                                           (_s3821_
                                                                                                                              _s3249_) >>= fun w__157 : option (mword 11) =>
                                                                                                                           (match w__157 with
                                                                                                                            | Some
                                                                                                                              imm =>
                                                                                                                               returnm true
                                                                                                                            | _ =>
                                                                                                                               exit tt
                                                                                                                                : M (bool)
                                                                                                                            end)
                                                                                                                            : M (bool)
                                                                                                                         else
                                                                                                                           (_s3829_
                                                                                                                              _s3249_) >>= fun w__160 : option ((mword 3 * mword 8)) =>
                                                                                                                           (if
                                                                                                                              match w__160 with
                                                                                                                              | Some
                                                                                                                                (rs, imm) =>
                                                                                                                                 true
                                                                                                                              | _ =>
                                                                                                                                 false
                                                                                                                              end
                                                                                                                            then
                                                                                                                              (_s3829_
                                                                                                                                 _s3249_) >>= fun w__161 : option ((mword 3 * mword 8)) =>
                                                                                                                              (match w__161 with
                                                                                                                               | Some
                                                                                                                                 (rs, imm) =>
                                                                                                                                  returnm true
                                                                                                                               | _ =>
                                                                                                                                  exit tt
                                                                                                                                   : M (bool)
                                                                                                                               end)
                                                                                                                               : M (bool)
                                                                                                                            else
                                                                                                                              (_s3841_
                                                                                                                                 _s3249_) >>= fun w__164 : option ((mword 3 * mword 8)) =>
                                                                                                                              (if
                                                                                                                                 match w__164 with
                                                                                                                                 | Some
                                                                                                                                   (rs, imm) =>
                                                                                                                                    true
                                                                                                                                 | _ =>
                                                                                                                                    false
                                                                                                                                 end
                                                                                                                               then
                                                                                                                                 (_s3841_
                                                                                                                                    _s3249_) >>= fun w__165 : option ((mword 3 * mword 8)) =>
                                                                                                                                 (match w__165 with
                                                                                                                                  | Some
                                                                                                                                    (rs, imm) =>
                                                                                                                                     returnm true
                                                                                                                                  | _ =>
                                                                                                                                     exit tt
                                                                                                                                      : M (bool)
                                                                                                                                  end)
                                                                                                                                  : M (bool)
                                                                                                                               else
                                                                                                                                 (_s3853_
                                                                                                                                    _s3249_) >>= fun w__168 : option ((mword 5 * mword 6)) =>
                                                                                                                                 (if
                                                                                                                                    match w__168 with
                                                                                                                                    | Some
                                                                                                                                      (rsd, shamt) =>
                                                                                                                                       andb
                                                                                                                                         (neq_vec
                                                                                                                                            shamt
                                                                                                                                            ('b"000000"
                                                                                                                                             : mword 6))
                                                                                                                                         (neq_vec
                                                                                                                                            rsd
                                                                                                                                            zreg)
                                                                                                                                    | _ =>
                                                                                                                                       false
                                                                                                                                    end
                                                                                                                                  then
                                                                                                                                    (_s3853_
                                                                                                                                       _s3249_) >>= fun w__169 : option ((mword 5 * mword 6)) =>
                                                                                                                                    (match w__169 with
                                                                                                                                     | Some
                                                                                                                                       (rsd, shamt) =>
                                                                                                                                        returnm true
                                                                                                                                     | _ =>
                                                                                                                                        exit tt
                                                                                                                                         : M (bool)
                                                                                                                                     end)
                                                                                                                                     : M (bool)
                                                                                                                                  else
                                                                                                                                    (_s3865_
                                                                                                                                       _s3249_) >>= fun w__172 : option ((mword 5 * mword 6)) =>
                                                                                                                                    (if
                                                                                                                                       match w__172 with
                                                                                                                                       | Some
                                                                                                                                         (rd, uimm) =>
                                                                                                                                          neq_vec
                                                                                                                                            rd
                                                                                                                                            zreg
                                                                                                                                       | _ =>
                                                                                                                                          false
                                                                                                                                       end
                                                                                                                                     then
                                                                                                                                       (_s3865_
                                                                                                                                          _s3249_) >>= fun w__173 : option ((mword 5 * mword 6)) =>
                                                                                                                                       (match w__173 with
                                                                                                                                        | Some
                                                                                                                                          (rd, uimm) =>
                                                                                                                                           returnm true
                                                                                                                                        | _ =>
                                                                                                                                           exit tt
                                                                                                                                            : M (bool)
                                                                                                                                        end)
                                                                                                                                        : M (bool)
                                                                                                                                     else
                                                                                                                                       (_s3877_
                                                                                                                                          _s3249_) >>= fun w__176 : option ((mword 5 * mword 6)) =>
                                                                                                                                       (if
                                                                                                                                          match w__176 with
                                                                                                                                          | Some
                                                                                                                                            (rd, uimm) =>
                                                                                                                                             andb
                                                                                                                                               (neq_vec
                                                                                                                                                  rd
                                                                                                                                                  zreg)
                                                                                                                                               (Z.eqb
                                                                                                                                                  64
                                                                                                                                                  64)
                                                                                                                                          | _ =>
                                                                                                                                             false
                                                                                                                                          end
                                                                                                                                        then
                                                                                                                                          (_s3877_
                                                                                                                                             _s3249_) >>= fun w__177 : option ((mword 5 * mword 6)) =>
                                                                                                                                          (match w__177 with
                                                                                                                                           | Some
                                                                                                                                             (rd, uimm) =>
                                                                                                                                              returnm true
                                                                                                                                           | _ =>
                                                                                                                                              exit tt
                                                                                                                                               : M (bool)
                                                                                                                                           end)
                                                                                                                                           : M (bool)
                                                                                                                                        else
                                                                                                                                          (_s3889_
                                                                                                                                             _s3249_) >>= fun w__180 : option ((mword 5 * mword 6)) =>
                                                                                                                                          (if
                                                                                                                                             match w__180 with
                                                                                                                                             | Some
                                                                                                                                               (rd, uimm) =>
                                                                                                                                                true
                                                                                                                                             | _ =>
                                                                                                                                                false
                                                                                                                                             end
                                                                                                                                           then
                                                                                                                                             (_s3889_
                                                                                                                                                _s3249_) >>= fun w__181 : option ((mword 5 * mword 6)) =>
                                                                                                                                             (match w__181 with
                                                                                                                                              | Some
                                                                                                                                                (rd, uimm) =>
                                                                                                                                                 returnm true
                                                                                                                                              | _ =>
                                                                                                                                                 exit tt
                                                                                                                                                  : M (bool)
                                                                                                                                              end)
                                                                                                                                              : M (bool)
                                                                                                                                           else
                                                                                                                                             (_s3901_
                                                                                                                                                _s3249_) >>= fun w__184 : option ((mword 5 * mword 6)) =>
                                                                                                                                             (if
                                                                                                                                                match w__184 with
                                                                                                                                                | Some
                                                                                                                                                  (rs2, uimm) =>
                                                                                                                                                   Z.eqb
                                                                                                                                                     64
                                                                                                                                                     64
                                                                                                                                                | _ =>
                                                                                                                                                   false
                                                                                                                                                end
                                                                                                                                              then
                                                                                                                                                (_s3901_
                                                                                                                                                   _s3249_) >>= fun w__185 : option ((mword 5 * mword 6)) =>
                                                                                                                                                (match w__185 with
                                                                                                                                                 | Some
                                                                                                                                                   (rs2, uimm) =>
                                                                                                                                                    returnm true
                                                                                                                                                 | _ =>
                                                                                                                                                    exit tt
                                                                                                                                                     : M (bool)
                                                                                                                                                 end)
                                                                                                                                                 : M (bool)
                                                                                                                                              else
                                                                                                                                                (_s3913_
                                                                                                                                                   _s3249_) >>= fun w__188 : option (mword 5) =>
                                                                                                                                                (if
                                                                                                                                                   match w__188 with
                                                                                                                                                   | Some
                                                                                                                                                     rs1 =>
                                                                                                                                                      neq_vec
                                                                                                                                                        rs1
                                                                                                                                                        zreg
                                                                                                                                                   | _ =>
                                                                                                                                                      false
                                                                                                                                                   end
                                                                                                                                                 then
                                                                                                                                                   (_s3913_
                                                                                                                                                      _s3249_) >>= fun w__189 : option (mword 5) =>
                                                                                                                                                   (match w__189 with
                                                                                                                                                    | Some
                                                                                                                                                      rs1 =>
                                                                                                                                                       returnm true
                                                                                                                                                    | _ =>
                                                                                                                                                       exit tt
                                                                                                                                                        : M (bool)
                                                                                                                                                    end)
                                                                                                                                                    : M (bool)
                                                                                                                                                 else
                                                                                                                                                   (_s3921_
                                                                                                                                                      _s3249_) >>= fun w__192 : option (mword 5) =>
                                                                                                                                                   (if
                                                                                                                                                      match w__192 with
                                                                                                                                                      | Some
                                                                                                                                                        rs1 =>
                                                                                                                                                         neq_vec
                                                                                                                                                           rs1
                                                                                                                                                           zreg
                                                                                                                                                      | _ =>
                                                                                                                                                         false
                                                                                                                                                      end
                                                                                                                                                    then
                                                                                                                                                      (_s3921_
                                                                                                                                                         _s3249_) >>= fun w__193 : option (mword 5) =>
                                                                                                                                                      (match w__193 with
                                                                                                                                                       | Some
                                                                                                                                                         rs1 =>
                                                                                                                                                          returnm true
                                                                                                                                                       | _ =>
                                                                                                                                                          exit tt
                                                                                                                                                           : M (bool)
                                                                                                                                                       end)
                                                                                                                                                       : M (bool)
                                                                                                                                                    else
                                                                                                                                                      (_s3929_
                                                                                                                                                         _s3249_) >>= fun w__196 : option ((mword 5 * mword 5)) =>
                                                                                                                                                      (if
                                                                                                                                                         match w__196 with
                                                                                                                                                         | Some
                                                                                                                                                           (rd, rs2) =>
                                                                                                                                                            andb
                                                                                                                                                              (neq_vec
                                                                                                                                                                 rd
                                                                                                                                                                 zreg)
                                                                                                                                                              (neq_vec
                                                                                                                                                                 rs2
                                                                                                                                                                 zreg)
                                                                                                                                                         | _ =>
                                                                                                                                                            false
                                                                                                                                                         end
                                                                                                                                                       then
                                                                                                                                                         (_s3929_
                                                                                                                                                            _s3249_) >>= fun w__197 : option ((mword 5 * mword 5)) =>
                                                                                                                                                         (match w__197 with
                                                                                                                                                          | Some
                                                                                                                                                            (rd, rs2) =>
                                                                                                                                                             returnm true
                                                                                                                                                          | _ =>
                                                                                                                                                             exit tt
                                                                                                                                                              : M (bool)
                                                                                                                                                          end)
                                                                                                                                                          : M (bool)
                                                                                                                                                       else if
                                                                                                                                                         generic_eq
                                                                                                                                                           _s3249_
                                                                                                                                                           "c.ebreak"
                                                                                                                                                       then
                                                                                                                                                         returnm true
                                                                                                                                                       else
                                                                                                                                                         (_s3941_
                                                                                                                                                            _s3249_) >>= fun w__200 : option ((mword 5 * mword 5)) =>
                                                                                                                                                         (if
                                                                                                                                                            match w__200 with
                                                                                                                                                            | Some
                                                                                                                                                              (rsd, rs2) =>
                                                                                                                                                               andb
                                                                                                                                                                 (neq_vec
                                                                                                                                                                    rsd
                                                                                                                                                                    zreg)
                                                                                                                                                                 (neq_vec
                                                                                                                                                                    rs2
                                                                                                                                                                    zreg)
                                                                                                                                                            | _ =>
                                                                                                                                                               false
                                                                                                                                                            end
                                                                                                                                                          then
                                                                                                                                                            (_s3941_
                                                                                                                                                               _s3249_) >>= fun w__201 : option ((mword 5 * mword 5)) =>
                                                                                                                                                            (match w__201 with
                                                                                                                                                             | Some
                                                                                                                                                               (rsd, rs2) =>
                                                                                                                                                                returnm true
                                                                                                                                                             | _ =>
                                                                                                                                                                exit tt
                                                                                                                                                                 : M (bool)
                                                                                                                                                             end)
                                                                                                                                                             : M (bool)
                                                                                                                                                          else
                                                                                                                                                            (_s3953_
                                                                                                                                                               _s3249_) >>= fun w__204 : option ((bool * bool * bool * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                            (if
                                                                                                                                                               match w__204 with
                                                                                                                                                               | Some
                                                                                                                                                                 (high, signed1, signed2, rd, rs1, rs2) =>
                                                                                                                                                                  true
                                                                                                                                                               | _ =>
                                                                                                                                                                  false
                                                                                                                                                               end
                                                                                                                                                             then
                                                                                                                                                               (_s3953_
                                                                                                                                                                  _s3249_) >>= fun w__205 : option ((bool * bool * bool * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                               (match w__205 with
                                                                                                                                                                | Some
                                                                                                                                                                  (high, signed1, signed2, rd, rs1, rs2) =>
                                                                                                                                                                   returnm true
                                                                                                                                                                | _ =>
                                                                                                                                                                   exit tt
                                                                                                                                                                    : M (bool)
                                                                                                                                                                end)
                                                                                                                                                                : M (bool)
                                                                                                                                                             else
                                                                                                                                                               (_s3970_
                                                                                                                                                                  _s3249_) >>= fun w__208 : option ((bool * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                               (if
                                                                                                                                                                  match w__208 with
                                                                                                                                                                  | Some
                                                                                                                                                                    (s, rd, rs1, rs2) =>
                                                                                                                                                                     true
                                                                                                                                                                  | _ =>
                                                                                                                                                                     false
                                                                                                                                                                  end
                                                                                                                                                                then
                                                                                                                                                                  (_s3970_
                                                                                                                                                                     _s3249_) >>= fun w__209 : option ((bool * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                  (match w__209 with
                                                                                                                                                                   | Some
                                                                                                                                                                     (s, rd, rs1, rs2) =>
                                                                                                                                                                      returnm true
                                                                                                                                                                   | _ =>
                                                                                                                                                                      exit tt
                                                                                                                                                                       : M (bool)
                                                                                                                                                                   end)
                                                                                                                                                                   : M (bool)
                                                                                                                                                                else
                                                                                                                                                                  (_s3988_
                                                                                                                                                                     _s3249_) >>= fun w__212 : option ((bool * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                  (if
                                                                                                                                                                     match w__212 with
                                                                                                                                                                     | Some
                                                                                                                                                                       (s, rd, rs1, rs2) =>
                                                                                                                                                                        true
                                                                                                                                                                     | _ =>
                                                                                                                                                                        false
                                                                                                                                                                     end
                                                                                                                                                                   then
                                                                                                                                                                     (_s3988_
                                                                                                                                                                        _s3249_) >>= fun w__213 : option ((bool * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                     (match w__213 with
                                                                                                                                                                      | Some
                                                                                                                                                                        (s, rd, rs1, rs2) =>
                                                                                                                                                                         returnm true
                                                                                                                                                                      | _ =>
                                                                                                                                                                         exit tt
                                                                                                                                                                          : M (bool)
                                                                                                                                                                      end)
                                                                                                                                                                      : M (bool)
                                                                                                                                                                   else
                                                                                                                                                                     (_s4006_
                                                                                                                                                                        _s3249_) >>= fun w__216 : option ((mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                     (if
                                                                                                                                                                        match w__216 with
                                                                                                                                                                        | Some
                                                                                                                                                                          (rd, rs1, rs2) =>
                                                                                                                                                                           Z.eqb
                                                                                                                                                                             64
                                                                                                                                                                             64
                                                                                                                                                                        | _ =>
                                                                                                                                                                           false
                                                                                                                                                                        end
                                                                                                                                                                      then
                                                                                                                                                                        (_s4006_
                                                                                                                                                                           _s3249_) >>= fun w__217 : option ((mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                        (match w__217 with
                                                                                                                                                                         | Some
                                                                                                                                                                           (rd, rs1, rs2) =>
                                                                                                                                                                            returnm true
                                                                                                                                                                         | _ =>
                                                                                                                                                                            exit tt
                                                                                                                                                                             : M (bool)
                                                                                                                                                                         end)
                                                                                                                                                                         : M (bool)
                                                                                                                                                                      else
                                                                                                                                                                        (_s4022_
                                                                                                                                                                           _s3249_) >>= fun w__220 : option ((bool * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                        (if
                                                                                                                                                                           match w__220 with
                                                                                                                                                                           | Some
                                                                                                                                                                             (s, rd, rs1, rs2) =>
                                                                                                                                                                              Z.eqb
                                                                                                                                                                                64
                                                                                                                                                                                64
                                                                                                                                                                           | _ =>
                                                                                                                                                                              false
                                                                                                                                                                           end
                                                                                                                                                                         then
                                                                                                                                                                           (_s4022_
                                                                                                                                                                              _s3249_) >>= fun w__221 : option ((bool * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                           (match w__221 with
                                                                                                                                                                            | Some
                                                                                                                                                                              (s, rd, rs1, rs2) =>
                                                                                                                                                                               returnm true
                                                                                                                                                                            | _ =>
                                                                                                                                                                               exit tt
                                                                                                                                                                                : M (bool)
                                                                                                                                                                            end)
                                                                                                                                                                            : M (bool)
                                                                                                                                                                         else
                                                                                                                                                                           (_s4041_
                                                                                                                                                                              _s3249_) >>= fun w__224 : option ((bool * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                           (if
                                                                                                                                                                              match w__224 with
                                                                                                                                                                              | Some
                                                                                                                                                                                (s, rd, rs1, rs2) =>
                                                                                                                                                                                 Z.eqb
                                                                                                                                                                                   64
                                                                                                                                                                                   64
                                                                                                                                                                              | _ =>
                                                                                                                                                                                 false
                                                                                                                                                                              end
                                                                                                                                                                            then
                                                                                                                                                                              (_s4041_
                                                                                                                                                                                 _s3249_) >>= fun w__225 : option ((bool * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                              (match w__225 with
                                                                                                                                                                               | Some
                                                                                                                                                                                 (s, rd, rs1, rs2) =>
                                                                                                                                                                                  returnm true
                                                                                                                                                                               | _ =>
                                                                                                                                                                                  exit tt
                                                                                                                                                                                   : M (bool)
                                                                                                                                                                               end)
                                                                                                                                                                               : M (bool)
                                                                                                                                                                            else
                                                                                                                                                                              (_s4060_
                                                                                                                                                                                 _s3249_) >>= fun w__228 : option ((csrop * mword 5 * mword 12 * mword 5)) =>
                                                                                                                                                                              (if
                                                                                                                                                                                 match w__228 with
                                                                                                                                                                                 | Some
                                                                                                                                                                                   (op, rd, csr, rs1) =>
                                                                                                                                                                                    true
                                                                                                                                                                                 | _ =>
                                                                                                                                                                                    false
                                                                                                                                                                                 end
                                                                                                                                                                               then
                                                                                                                                                                                 (_s4060_
                                                                                                                                                                                    _s3249_) >>= fun w__229 : option ((csrop * mword 5 * mword 12 * mword 5)) =>
                                                                                                                                                                                 (match w__229 with
                                                                                                                                                                                  | Some
                                                                                                                                                                                    (op, rd, csr, rs1) =>
                                                                                                                                                                                     returnm true
                                                                                                                                                                                  | _ =>
                                                                                                                                                                                     exit tt
                                                                                                                                                                                      : M (bool)
                                                                                                                                                                                  end)
                                                                                                                                                                                  : M (bool)
                                                                                                                                                                               else
                                                                                                                                                                                 (_s4078_
                                                                                                                                                                                    _s3249_) >>= fun w__232 : option ((csrop * mword 5 * mword 12 * mword 5)) =>
                                                                                                                                                                                 (if
                                                                                                                                                                                    match w__232 with
                                                                                                                                                                                    | Some
                                                                                                                                                                                      (op, rd, csr, rs1) =>
                                                                                                                                                                                       true
                                                                                                                                                                                    | _ =>
                                                                                                                                                                                       false
                                                                                                                                                                                    end
                                                                                                                                                                                  then
                                                                                                                                                                                    (_s4078_
                                                                                                                                                                                       _s3249_) >>= fun w__233 : option ((csrop * mword 5 * mword 12 * mword 5)) =>
                                                                                                                                                                                    (match w__233 with
                                                                                                                                                                                     | Some
                                                                                                                                                                                       (op, rd, csr, rs1) =>
                                                                                                                                                                                        returnm true
                                                                                                                                                                                     | _ =>
                                                                                                                                                                                        exit tt
                                                                                                                                                                                         : M (bool)
                                                                                                                                                                                     end)
                                                                                                                                                                                     : M (bool)
                                                                                                                                                                                  else if
                                                                                                                                                                                    generic_eq
                                                                                                                                                                                      _s3249_
                                                                                                                                                                                      "uret"
                                                                                                                                                                                  then
                                                                                                                                                                                    returnm true
                                                                                                                                                                                  else if
                                                                                                                                                                                    match (_s4095_
                                                                                                                                                                                             _s3249_) with
                                                                                                                                                                                    | Some
                                                                                                                                                                                      imm =>
                                                                                                                                                                                       true
                                                                                                                                                                                    | _ =>
                                                                                                                                                                                       false
                                                                                                                                                                                    end
                                                                                                                                                                                  then
                                                                                                                                                                                    (match (_s4095_
                                                                                                                                                                                              _s3249_) with
                                                                                                                                                                                     | Some
                                                                                                                                                                                       imm =>
                                                                                                                                                                                        returnm true
                                                                                                                                                                                     | _ =>
                                                                                                                                                                                        exit tt
                                                                                                                                                                                         : M (bool)
                                                                                                                                                                                     end)
                                                                                                                                                                                     : M (bool)
                                                                                                                                                                                  else
                                                                                                                                                                                    (_s4101_
                                                                                                                                                                                       _s3249_) >>= fun w__238 : option (mword 5) =>
                                                                                                                                                                                    (if
                                                                                                                                                                                       match w__238 with
                                                                                                                                                                                       | Some
                                                                                                                                                                                         rsd =>
                                                                                                                                                                                          neq_vec
                                                                                                                                                                                            rsd
                                                                                                                                                                                            zreg
                                                                                                                                                                                       | _ =>
                                                                                                                                                                                          false
                                                                                                                                                                                       end
                                                                                                                                                                                     then
                                                                                                                                                                                       (_s4101_
                                                                                                                                                                                          _s3249_) >>= fun w__239 : option (mword 5) =>
                                                                                                                                                                                       (match w__239 with
                                                                                                                                                                                        | Some
                                                                                                                                                                                          rsd =>
                                                                                                                                                                                           returnm true
                                                                                                                                                                                        | _ =>
                                                                                                                                                                                           exit tt
                                                                                                                                                                                            : M (bool)
                                                                                                                                                                                        end)
                                                                                                                                                                                        : M (bool)
                                                                                                                                                                                     else if
                                                                                                                                                                                       match (_s4107_
                                                                                                                                                                                                _s3249_) with
                                                                                                                                                                                       | Some
                                                                                                                                                                                         imm =>
                                                                                                                                                                                          true
                                                                                                                                                                                       | _ =>
                                                                                                                                                                                          false
                                                                                                                                                                                       end
                                                                                                                                                                                     then
                                                                                                                                                                                       (match (_s4107_
                                                                                                                                                                                                 _s3249_) with
                                                                                                                                                                                        | Some
                                                                                                                                                                                          imm =>
                                                                                                                                                                                           returnm true
                                                                                                                                                                                        | _ =>
                                                                                                                                                                                           exit tt
                                                                                                                                                                                            : M (bool)
                                                                                                                                                                                        end)
                                                                                                                                                                                        : M (bool)
                                                                                                                                                                                     else if
                                                                                                                                                                                       match (_s4113_
                                                                                                                                                                                                _s3249_) with
                                                                                                                                                                                       | Some
                                                                                                                                                                                         imm =>
                                                                                                                                                                                          neq_vec
                                                                                                                                                                                            imm
                                                                                                                                                                                            ('b"000000"
                                                                                                                                                                                             : mword 6)
                                                                                                                                                                                       | _ =>
                                                                                                                                                                                          false
                                                                                                                                                                                       end
                                                                                                                                                                                     then
                                                                                                                                                                                       (match (_s4113_
                                                                                                                                                                                                 _s3249_) with
                                                                                                                                                                                        | Some
                                                                                                                                                                                          imm =>
                                                                                                                                                                                           returnm true
                                                                                                                                                                                        | _ =>
                                                                                                                                                                                           exit tt
                                                                                                                                                                                            : M (bool)
                                                                                                                                                                                        end)
                                                                                                                                                                                        : M (bool)
                                                                                                                                                                                     else
                                                                                                                                                                                       (_s4119_
                                                                                                                                                                                          _s3249_) >>= fun w__246 : option (mword 5) =>
                                                                                                                                                                                       (if
                                                                                                                                                                                          match w__246 with
                                                                                                                                                                                          | Some
                                                                                                                                                                                            rs2 =>
                                                                                                                                                                                             neq_vec
                                                                                                                                                                                               rs2
                                                                                                                                                                                               zreg
                                                                                                                                                                                          | _ =>
                                                                                                                                                                                             false
                                                                                                                                                                                          end
                                                                                                                                                                                        then
                                                                                                                                                                                          (_s4119_
                                                                                                                                                                                             _s3249_) >>= fun w__247 : option (mword 5) =>
                                                                                                                                                                                          (match w__247 with
                                                                                                                                                                                           | Some
                                                                                                                                                                                             rs2 =>
                                                                                                                                                                                              returnm true
                                                                                                                                                                                           | _ =>
                                                                                                                                                                                              exit tt
                                                                                                                                                                                               : M (bool)
                                                                                                                                                                                           end)
                                                                                                                                                                                           : M (bool)
                                                                                                                                                                                        else
                                                                                                                                                                                          (_s4125_
                                                                                                                                                                                             _s3249_) >>= fun w__250 : option (mword 5) =>
                                                                                                                                                                                          (if
                                                                                                                                                                                             match w__250 with
                                                                                                                                                                                             | Some
                                                                                                                                                                                               rs2 =>
                                                                                                                                                                                                neq_vec
                                                                                                                                                                                                  rs2
                                                                                                                                                                                                  zreg
                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                false
                                                                                                                                                                                             end
                                                                                                                                                                                           then
                                                                                                                                                                                             (_s4125_
                                                                                                                                                                                                _s3249_) >>= fun w__251 : option (mword 5) =>
                                                                                                                                                                                             (match w__251 with
                                                                                                                                                                                              | Some
                                                                                                                                                                                                rs2 =>
                                                                                                                                                                                                 returnm true
                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                 exit tt
                                                                                                                                                                                                  : M (bool)
                                                                                                                                                                                              end)
                                                                                                                                                                                              : M (bool)
                                                                                                                                                                                           else
                                                                                                                                                                                             (_s4131_
                                                                                                                                                                                                _s3249_) >>= fun w__254 : option ((mword 5 * mword 6)) =>
                                                                                                                                                                                             (if
                                                                                                                                                                                                match w__254 with
                                                                                                                                                                                                | Some
                                                                                                                                                                                                  (rsd, shamt) =>
                                                                                                                                                                                                   orb
                                                                                                                                                                                                     (eq_vec
                                                                                                                                                                                                        shamt
                                                                                                                                                                                                        ('b"000000"
                                                                                                                                                                                                         : mword 6))
                                                                                                                                                                                                     (eq_vec
                                                                                                                                                                                                        rsd
                                                                                                                                                                                                        zreg)
                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                   false
                                                                                                                                                                                                end
                                                                                                                                                                                              then
                                                                                                                                                                                                (_s4131_
                                                                                                                                                                                                   _s3249_) >>= fun w__255 : option ((mword 5 * mword 6)) =>
                                                                                                                                                                                                (match w__255 with
                                                                                                                                                                                                 | Some
                                                                                                                                                                                                   (rsd, shamt) =>
                                                                                                                                                                                                    returnm true
                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                    exit tt
                                                                                                                                                                                                     : M (bool)
                                                                                                                                                                                                 end)
                                                                                                                                                                                                 : M (bool)
                                                                                                                                                                                              else
                                                                                                                                                                                                (_s4140_
                                                                                                                                                                                                   _s3249_) >>= fun w__258 : option (mword 3) =>
                                                                                                                                                                                                (if
                                                                                                                                                                                                   match w__258 with
                                                                                                                                                                                                   | Some
                                                                                                                                                                                                     rsd =>
                                                                                                                                                                                                      true
                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                      false
                                                                                                                                                                                                   end
                                                                                                                                                                                                 then
                                                                                                                                                                                                   (_s4140_
                                                                                                                                                                                                      _s3249_) >>= fun w__259 : option (mword 3) =>
                                                                                                                                                                                                   (match w__259 with
                                                                                                                                                                                                    | Some
                                                                                                                                                                                                      rsd =>
                                                                                                                                                                                                       returnm true
                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                       exit tt
                                                                                                                                                                                                        : M (bool)
                                                                                                                                                                                                    end)
                                                                                                                                                                                                    : M (bool)
                                                                                                                                                                                                 else
                                                                                                                                                                                                   (_s4146_
                                                                                                                                                                                                      _s3249_) >>= fun w__262 : option (mword 3) =>
                                                                                                                                                                                                   (if
                                                                                                                                                                                                      match w__262 with
                                                                                                                                                                                                      | Some
                                                                                                                                                                                                        rsd =>
                                                                                                                                                                                                         true
                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                         false
                                                                                                                                                                                                      end
                                                                                                                                                                                                    then
                                                                                                                                                                                                      (_s4146_
                                                                                                                                                                                                         _s3249_) >>= fun w__263 : option (mword 3) =>
                                                                                                                                                                                                      (match w__263 with
                                                                                                                                                                                                       | Some
                                                                                                                                                                                                         rsd =>
                                                                                                                                                                                                          returnm true
                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                          exit tt
                                                                                                                                                                                                           : M (bool)
                                                                                                                                                                                                       end)
                                                                                                                                                                                                       : M (bool)
                                                                                                                                                                                                    else
                                                                                                                                                                                                      (_s4152_
                                                                                                                                                                                                         _s3249_) >>= fun w__266 : option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)) =>
                                                                                                                                                                                                      (if
                                                                                                                                                                                                         match w__266 with
                                                                                                                                                                                                         | Some
                                                                                                                                                                                                           (pred, succ, rs, rd, fm) =>
                                                                                                                                                                                                            orb
                                                                                                                                                                                                              (andb
                                                                                                                                                                                                                 (neq_vec
                                                                                                                                                                                                                    fm
                                                                                                                                                                                                                    (Ox"0"
                                                                                                                                                                                                                     : mword 4))
                                                                                                                                                                                                                 (neq_vec
                                                                                                                                                                                                                    fm
                                                                                                                                                                                                                    (Ox"8"
                                                                                                                                                                                                                     : mword 4)))
                                                                                                                                                                                                              (orb
                                                                                                                                                                                                                 (neq_vec
                                                                                                                                                                                                                    rs
                                                                                                                                                                                                                    ('b"00000"
                                                                                                                                                                                                                     : mword 5))
                                                                                                                                                                                                                 (neq_vec
                                                                                                                                                                                                                    rd
                                                                                                                                                                                                                    ('b"00000"
                                                                                                                                                                                                                     : mword 5)))
                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                            false
                                                                                                                                                                                                         end
                                                                                                                                                                                                       then
                                                                                                                                                                                                         (_s4152_
                                                                                                                                                                                                            _s3249_) >>= fun w__267 : option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4)) =>
                                                                                                                                                                                                         (match w__267 with
                                                                                                                                                                                                          | Some
                                                                                                                                                                                                            (pred, succ, rs, rd, fm) =>
                                                                                                                                                                                                             returnm true
                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                             exit tt
                                                                                                                                                                                                              : M (bool)
                                                                                                                                                                                                          end)
                                                                                                                                                                                                          : M (bool)
                                                                                                                                                                                                       else
                                                                                                                                                                                                         (_s4170_
                                                                                                                                                                                                            _s3249_) >>= fun w__270 : option ((mword 5 * mword 5 * mword 12)) =>
                                                                                                                                                                                                         (if
                                                                                                                                                                                                            match w__270 with
                                                                                                                                                                                                            | Some
                                                                                                                                                                                                              (rd, rs, imm) =>
                                                                                                                                                                                                               orb
                                                                                                                                                                                                                 (neq_vec
                                                                                                                                                                                                                    imm
                                                                                                                                                                                                                    (Ox"000"
                                                                                                                                                                                                                     : mword 12))
                                                                                                                                                                                                                 (orb
                                                                                                                                                                                                                    (neq_vec
                                                                                                                                                                                                                       rs
                                                                                                                                                                                                                       zreg)
                                                                                                                                                                                                                    (neq_vec
                                                                                                                                                                                                                       rd
                                                                                                                                                                                                                       zreg))
                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                               false
                                                                                                                                                                                                            end
                                                                                                                                                                                                          then
                                                                                                                                                                                                            (_s4170_
                                                                                                                                                                                                               _s3249_) >>= fun w__271 : option ((mword 5 * mword 5 * mword 12)) =>
                                                                                                                                                                                                            (match w__271 with
                                                                                                                                                                                                             | Some
                                                                                                                                                                                                               (rd, rs, imm) =>
                                                                                                                                                                                                                returnm true
                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                exit tt
                                                                                                                                                                                                                 : M (bool)
                                                                                                                                                                                                             end)
                                                                                                                                                                                                             : M (bool)
                                                                                                                                                                                                          else
                                                                                                                                                                                                            (_s4182_
                                                                                                                                                                                                               _s3249_) >>= fun w__274 : option ((word_width * mword 5 * mword 12 * mword 5)) =>
                                                                                                                                                                                                            (if
                                                                                                                                                                                                               match w__274 with
                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                 (width, rd, imm, rs1) =>
                                                                                                                                                                                                                  true
                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                  false
                                                                                                                                                                                                               end
                                                                                                                                                                                                             then
                                                                                                                                                                                                               (_s4182_
                                                                                                                                                                                                                  _s3249_) >>= fun w__275 : option ((word_width * mword 5 * mword 12 * mword 5)) =>
                                                                                                                                                                                                               (match w__275 with
                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                  (width, rd, imm, rs1) =>
                                                                                                                                                                                                                   returnm true
                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                   exit tt
                                                                                                                                                                                                                    : M (bool)
                                                                                                                                                                                                                end)
                                                                                                                                                                                                                : M (bool)
                                                                                                                                                                                                             else
                                                                                                                                                                                                               (_s4206_
                                                                                                                                                                                                                  _s3249_) >>= fun w__278 : option ((word_width * mword 5 * mword 12 * mword 5)) =>
                                                                                                                                                                                                               (if
                                                                                                                                                                                                                  match w__278 with
                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                    (width, rs2, imm, rs1) =>
                                                                                                                                                                                                                     true
                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                     false
                                                                                                                                                                                                                  end
                                                                                                                                                                                                                then
                                                                                                                                                                                                                  (_s4206_
                                                                                                                                                                                                                     _s3249_) >>= fun w__279 : option ((word_width * mword 5 * mword 12 * mword 5)) =>
                                                                                                                                                                                                                  (match w__279 with
                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                     (width, rs2, imm, rs1) =>
                                                                                                                                                                                                                      returnm true
                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                      exit tt
                                                                                                                                                                                                                       : M (bool)
                                                                                                                                                                                                                   end)
                                                                                                                                                                                                                   : M (bool)
                                                                                                                                                                                                                else
                                                                                                                                                                                                                  (_s4230_
                                                                                                                                                                                                                     _s3249_) >>= fun w__282 : option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                  (if
                                                                                                                                                                                                                     match w__282 with
                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                       (op, rd, rs1, rs2, rs3, rm) =>
                                                                                                                                                                                                                        true
                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                        false
                                                                                                                                                                                                                     end
                                                                                                                                                                                                                   then
                                                                                                                                                                                                                     (_s4230_
                                                                                                                                                                                                                        _s3249_) >>= fun w__283 : option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                     (match w__283 with
                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                        (op, rd, rs1, rs2, rs3, rm) =>
                                                                                                                                                                                                                         returnm true
                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                         exit tt
                                                                                                                                                                                                                          : M (bool)
                                                                                                                                                                                                                      end)
                                                                                                                                                                                                                      : M (bool)
                                                                                                                                                                                                                   else
                                                                                                                                                                                                                     (_s4255_
                                                                                                                                                                                                                        _s3249_) >>= fun w__286 : option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                     (if
                                                                                                                                                                                                                        match w__286 with
                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                          (op, rd, rs1, rs2, rm) =>
                                                                                                                                                                                                                           true
                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                           false
                                                                                                                                                                                                                        end
                                                                                                                                                                                                                      then
                                                                                                                                                                                                                        (_s4255_
                                                                                                                                                                                                                           _s3249_) >>= fun w__287 : option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                        (match w__287 with
                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                           (op, rd, rs1, rs2, rm) =>
                                                                                                                                                                                                                            returnm true
                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                            exit tt
                                                                                                                                                                                                                             : M (bool)
                                                                                                                                                                                                                         end)
                                                                                                                                                                                                                         : M (bool)
                                                                                                                                                                                                                      else
                                                                                                                                                                                                                        (_s4276_
                                                                                                                                                                                                                           _s3249_) >>= fun w__290 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                        (if
                                                                                                                                                                                                                           match w__290 with
                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                             (FSQRT_S, rd, rs1, rm) =>
                                                                                                                                                                                                                              true
                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                              false
                                                                                                                                                                                                                           end
                                                                                                                                                                                                                         then
                                                                                                                                                                                                                           (_s4276_
                                                                                                                                                                                                                              _s3249_) >>= fun w__291 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                           (match w__291 with
                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                              (FSQRT_S, rd, rs1, rm) =>
                                                                                                                                                                                                                               returnm true
                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                               exit tt
                                                                                                                                                                                                                                : M (bool)
                                                                                                                                                                                                                            end)
                                                                                                                                                                                                                            : M (bool)
                                                                                                                                                                                                                         else
                                                                                                                                                                                                                           (_s4293_
                                                                                                                                                                                                                              _s3249_) >>= fun w__294 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                           (if
                                                                                                                                                                                                                              match w__294 with
                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                (FCVT_W_S, rd, rs1, rm) =>
                                                                                                                                                                                                                                 true
                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                 false
                                                                                                                                                                                                                              end
                                                                                                                                                                                                                            then
                                                                                                                                                                                                                              (_s4293_
                                                                                                                                                                                                                                 _s3249_) >>= fun w__295 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                              (match w__295 with
                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                 (FCVT_W_S, rd, rs1, rm) =>
                                                                                                                                                                                                                                  returnm true
                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                  exit tt
                                                                                                                                                                                                                                   : M (bool)
                                                                                                                                                                                                                               end)
                                                                                                                                                                                                                               : M (bool)
                                                                                                                                                                                                                            else
                                                                                                                                                                                                                              (_s4310_
                                                                                                                                                                                                                                 _s3249_) >>= fun w__298 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                              (if
                                                                                                                                                                                                                                 match w__298 with
                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                   (FCVT_WU_S, rd, rs1, rm) =>
                                                                                                                                                                                                                                    true
                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                    false
                                                                                                                                                                                                                                 end
                                                                                                                                                                                                                               then
                                                                                                                                                                                                                                 (_s4310_
                                                                                                                                                                                                                                    _s3249_) >>= fun w__299 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                 (match w__299 with
                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                    (FCVT_WU_S, rd, rs1, rm) =>
                                                                                                                                                                                                                                     returnm true
                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                     exit tt
                                                                                                                                                                                                                                      : M (bool)
                                                                                                                                                                                                                                  end)
                                                                                                                                                                                                                                  : M (bool)
                                                                                                                                                                                                                               else
                                                                                                                                                                                                                                 (_s4327_
                                                                                                                                                                                                                                    _s3249_) >>= fun w__302 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                 (if
                                                                                                                                                                                                                                    match w__302 with
                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                      (FCVT_S_W, rd, rs1, rm) =>
                                                                                                                                                                                                                                       true
                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                       false
                                                                                                                                                                                                                                    end
                                                                                                                                                                                                                                  then
                                                                                                                                                                                                                                    (_s4327_
                                                                                                                                                                                                                                       _s3249_) >>= fun w__303 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                    (match w__303 with
                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                       (FCVT_S_W, rd, rs1, rm) =>
                                                                                                                                                                                                                                        returnm true
                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                        exit tt
                                                                                                                                                                                                                                         : M (bool)
                                                                                                                                                                                                                                     end)
                                                                                                                                                                                                                                     : M (bool)
                                                                                                                                                                                                                                  else
                                                                                                                                                                                                                                    (_s4344_
                                                                                                                                                                                                                                       _s3249_) >>= fun w__306 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                    (if
                                                                                                                                                                                                                                       match w__306 with
                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                         (FCVT_S_WU, rd, rs1, rm) =>
                                                                                                                                                                                                                                          true
                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                          false
                                                                                                                                                                                                                                       end
                                                                                                                                                                                                                                     then
                                                                                                                                                                                                                                       (_s4344_
                                                                                                                                                                                                                                          _s3249_) >>= fun w__307 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                       (match w__307 with
                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                          (FCVT_S_WU, rd, rs1, rm) =>
                                                                                                                                                                                                                                           returnm true
                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                           exit tt
                                                                                                                                                                                                                                            : M (bool)
                                                                                                                                                                                                                                        end)
                                                                                                                                                                                                                                        : M (bool)
                                                                                                                                                                                                                                     else
                                                                                                                                                                                                                                       (_s4361_
                                                                                                                                                                                                                                          _s3249_) >>= fun w__310 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                       (if
                                                                                                                                                                                                                                          match w__310 with
                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                            (FCVT_L_S, rd, rs1, rm) =>
                                                                                                                                                                                                                                             true
                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                             false
                                                                                                                                                                                                                                          end
                                                                                                                                                                                                                                        then
                                                                                                                                                                                                                                          (_s4361_
                                                                                                                                                                                                                                             _s3249_) >>= fun w__311 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                          (match w__311 with
                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                             (FCVT_L_S, rd, rs1, rm) =>
                                                                                                                                                                                                                                              returnm true
                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                              exit tt
                                                                                                                                                                                                                                               : M (bool)
                                                                                                                                                                                                                                           end)
                                                                                                                                                                                                                                           : M (bool)
                                                                                                                                                                                                                                        else
                                                                                                                                                                                                                                          (_s4378_
                                                                                                                                                                                                                                             _s3249_) >>= fun w__314 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                          (if
                                                                                                                                                                                                                                             match w__314 with
                                                                                                                                                                                                                                             | Some
                                                                                                                                                                                                                                               (FCVT_LU_S, rd, rs1, rm) =>
                                                                                                                                                                                                                                                true
                                                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                                                false
                                                                                                                                                                                                                                             end
                                                                                                                                                                                                                                           then
                                                                                                                                                                                                                                             (_s4378_
                                                                                                                                                                                                                                                _s3249_) >>= fun w__315 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                             (match w__315 with
                                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                                (FCVT_LU_S, rd, rs1, rm) =>
                                                                                                                                                                                                                                                 returnm true
                                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                                 exit tt
                                                                                                                                                                                                                                                  : M (bool)
                                                                                                                                                                                                                                              end)
                                                                                                                                                                                                                                              : M (bool)
                                                                                                                                                                                                                                           else
                                                                                                                                                                                                                                             (_s4395_
                                                                                                                                                                                                                                                _s3249_) >>= fun w__318 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                             (if
                                                                                                                                                                                                                                                match w__318 with
                                                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                                                  (FCVT_S_L, rd, rs1, rm) =>
                                                                                                                                                                                                                                                   true
                                                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                                                   false
                                                                                                                                                                                                                                                end
                                                                                                                                                                                                                                              then
                                                                                                                                                                                                                                                (_s4395_
                                                                                                                                                                                                                                                   _s3249_) >>= fun w__319 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                (match w__319 with
                                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                                   (FCVT_S_L, rd, rs1, rm) =>
                                                                                                                                                                                                                                                    returnm true
                                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                                    exit tt
                                                                                                                                                                                                                                                     : M (bool)
                                                                                                                                                                                                                                                 end)
                                                                                                                                                                                                                                                 : M (bool)
                                                                                                                                                                                                                                              else
                                                                                                                                                                                                                                                (_s4412_
                                                                                                                                                                                                                                                   _s3249_) >>= fun w__322 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                (if
                                                                                                                                                                                                                                                   match w__322 with
                                                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                                                     (FCVT_S_LU, rd, rs1, rm) =>
                                                                                                                                                                                                                                                      true
                                                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                                                      false
                                                                                                                                                                                                                                                   end
                                                                                                                                                                                                                                                 then
                                                                                                                                                                                                                                                   (_s4412_
                                                                                                                                                                                                                                                      _s3249_) >>= fun w__323 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                   (match w__323 with
                                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                                      (FCVT_S_LU, rd, rs1, rm) =>
                                                                                                                                                                                                                                                       returnm true
                                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                                       exit tt
                                                                                                                                                                                                                                                        : M (bool)
                                                                                                                                                                                                                                                    end)
                                                                                                                                                                                                                                                    : M (bool)
                                                                                                                                                                                                                                                 else
                                                                                                                                                                                                                                                   (_s4429_
                                                                                                                                                                                                                                                      _s3249_) >>= fun w__326 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                   (if
                                                                                                                                                                                                                                                      match w__326 with
                                                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                                                        (FSGNJ_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                         true
                                                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                                                         false
                                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                                    then
                                                                                                                                                                                                                                                      (_s4429_
                                                                                                                                                                                                                                                         _s3249_) >>= fun w__327 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                      (match w__327 with
                                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                                         (FSGNJ_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                          returnm true
                                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                                          exit tt
                                                                                                                                                                                                                                                           : M (bool)
                                                                                                                                                                                                                                                       end)
                                                                                                                                                                                                                                                       : M (bool)
                                                                                                                                                                                                                                                    else
                                                                                                                                                                                                                                                      (_s4446_
                                                                                                                                                                                                                                                         _s3249_) >>= fun w__330 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                      (if
                                                                                                                                                                                                                                                         match w__330 with
                                                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                                                           (FSGNJN_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                            true
                                                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                                                            false
                                                                                                                                                                                                                                                         end
                                                                                                                                                                                                                                                       then
                                                                                                                                                                                                                                                         (_s4446_
                                                                                                                                                                                                                                                            _s3249_) >>= fun w__331 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                         (match w__331 with
                                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                                            (FSGNJN_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                             returnm true
                                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                                             exit tt
                                                                                                                                                                                                                                                              : M (bool)
                                                                                                                                                                                                                                                          end)
                                                                                                                                                                                                                                                          : M (bool)
                                                                                                                                                                                                                                                       else
                                                                                                                                                                                                                                                         (_s4463_
                                                                                                                                                                                                                                                            _s3249_) >>= fun w__334 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                         (if
                                                                                                                                                                                                                                                            match w__334 with
                                                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                                                              (FSGNJX_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                               true
                                                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                                                               false
                                                                                                                                                                                                                                                            end
                                                                                                                                                                                                                                                          then
                                                                                                                                                                                                                                                            (_s4463_
                                                                                                                                                                                                                                                               _s3249_) >>= fun w__335 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                            (match w__335 with
                                                                                                                                                                                                                                                             | Some
                                                                                                                                                                                                                                                               (FSGNJX_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                returnm true
                                                                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                                                                exit tt
                                                                                                                                                                                                                                                                 : M (bool)
                                                                                                                                                                                                                                                             end)
                                                                                                                                                                                                                                                             : M (bool)
                                                                                                                                                                                                                                                          else
                                                                                                                                                                                                                                                            (_s4480_
                                                                                                                                                                                                                                                               _s3249_) >>= fun w__338 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                            (if
                                                                                                                                                                                                                                                               match w__338 with
                                                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                                                 (FMIN_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                  true
                                                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                                                  false
                                                                                                                                                                                                                                                               end
                                                                                                                                                                                                                                                             then
                                                                                                                                                                                                                                                               (_s4480_
                                                                                                                                                                                                                                                                  _s3249_) >>= fun w__339 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                               (match w__339 with
                                                                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                                                                  (FMIN_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                   returnm true
                                                                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                                                                   exit tt
                                                                                                                                                                                                                                                                    : M (bool)
                                                                                                                                                                                                                                                                end)
                                                                                                                                                                                                                                                                : M (bool)
                                                                                                                                                                                                                                                             else
                                                                                                                                                                                                                                                               (_s4497_
                                                                                                                                                                                                                                                                  _s3249_) >>= fun w__342 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                               (if
                                                                                                                                                                                                                                                                  match w__342 with
                                                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                                                    (FMAX_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                     true
                                                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                                                     false
                                                                                                                                                                                                                                                                  end
                                                                                                                                                                                                                                                                then
                                                                                                                                                                                                                                                                  (_s4497_
                                                                                                                                                                                                                                                                     _s3249_) >>= fun w__343 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                  (match w__343 with
                                                                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                                                                     (FMAX_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                      returnm true
                                                                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                                                                      exit tt
                                                                                                                                                                                                                                                                       : M (bool)
                                                                                                                                                                                                                                                                   end)
                                                                                                                                                                                                                                                                   : M (bool)
                                                                                                                                                                                                                                                                else
                                                                                                                                                                                                                                                                  (_s4514_
                                                                                                                                                                                                                                                                     _s3249_) >>= fun w__346 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                  (if
                                                                                                                                                                                                                                                                     match w__346 with
                                                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                                                       (FEQ_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                        true
                                                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                                                        false
                                                                                                                                                                                                                                                                     end
                                                                                                                                                                                                                                                                   then
                                                                                                                                                                                                                                                                     (_s4514_
                                                                                                                                                                                                                                                                        _s3249_) >>= fun w__347 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                     (match w__347 with
                                                                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                                                                        (FEQ_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                         returnm true
                                                                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                                                                         exit tt
                                                                                                                                                                                                                                                                          : M (bool)
                                                                                                                                                                                                                                                                      end)
                                                                                                                                                                                                                                                                      : M (bool)
                                                                                                                                                                                                                                                                   else
                                                                                                                                                                                                                                                                     (_s4531_
                                                                                                                                                                                                                                                                        _s3249_) >>= fun w__350 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                     (if
                                                                                                                                                                                                                                                                        match w__350 with
                                                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                                                          (FLT_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                           true
                                                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                                                           false
                                                                                                                                                                                                                                                                        end
                                                                                                                                                                                                                                                                      then
                                                                                                                                                                                                                                                                        (_s4531_
                                                                                                                                                                                                                                                                           _s3249_) >>= fun w__351 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                        (match w__351 with
                                                                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                                                                           (FLT_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                            returnm true
                                                                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                                                                            exit tt
                                                                                                                                                                                                                                                                             : M (bool)
                                                                                                                                                                                                                                                                         end)
                                                                                                                                                                                                                                                                         : M (bool)
                                                                                                                                                                                                                                                                      else
                                                                                                                                                                                                                                                                        (_s4548_
                                                                                                                                                                                                                                                                           _s3249_) >>= fun w__354 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                        (if
                                                                                                                                                                                                                                                                           match w__354 with
                                                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                                                             (FLE_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                              true
                                                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                                                              false
                                                                                                                                                                                                                                                                           end
                                                                                                                                                                                                                                                                         then
                                                                                                                                                                                                                                                                           (_s4548_
                                                                                                                                                                                                                                                                              _s3249_) >>= fun w__355 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                           (match w__355 with
                                                                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                                                                              (FLE_S, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                               returnm true
                                                                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                                                                               exit tt
                                                                                                                                                                                                                                                                                : M (bool)
                                                                                                                                                                                                                                                                            end)
                                                                                                                                                                                                                                                                            : M (bool)
                                                                                                                                                                                                                                                                         else
                                                                                                                                                                                                                                                                           (_s4565_
                                                                                                                                                                                                                                                                              _s3249_) >>= fun w__358 : option ((f_un_op_S * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                           (if
                                                                                                                                                                                                                                                                              match w__358 with
                                                                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                                                                (FMV_X_W, rd, rs1) =>
                                                                                                                                                                                                                                                                                 true
                                                                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                                                                 false
                                                                                                                                                                                                                                                                              end
                                                                                                                                                                                                                                                                            then
                                                                                                                                                                                                                                                                              (_s4565_
                                                                                                                                                                                                                                                                                 _s3249_) >>= fun w__359 : option ((f_un_op_S * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                              (match w__359 with
                                                                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                                                                 (FMV_X_W, rd, rs1) =>
                                                                                                                                                                                                                                                                                  returnm true
                                                                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                                                                  exit tt
                                                                                                                                                                                                                                                                                   : M (bool)
                                                                                                                                                                                                                                                                               end)
                                                                                                                                                                                                                                                                               : M (bool)
                                                                                                                                                                                                                                                                            else
                                                                                                                                                                                                                                                                              (_s4578_
                                                                                                                                                                                                                                                                                 _s3249_) >>= fun w__362 : option ((f_un_op_S * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                              (if
                                                                                                                                                                                                                                                                                 match w__362 with
                                                                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                                                                   (FMV_W_X, rd, rs1) =>
                                                                                                                                                                                                                                                                                    true
                                                                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                                                                    false
                                                                                                                                                                                                                                                                                 end
                                                                                                                                                                                                                                                                               then
                                                                                                                                                                                                                                                                                 (_s4578_
                                                                                                                                                                                                                                                                                    _s3249_) >>= fun w__363 : option ((f_un_op_S * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                 (match w__363 with
                                                                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                                                                    (FMV_W_X, rd, rs1) =>
                                                                                                                                                                                                                                                                                     returnm true
                                                                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                                                                     exit tt
                                                                                                                                                                                                                                                                                      : M (bool)
                                                                                                                                                                                                                                                                                  end)
                                                                                                                                                                                                                                                                                  : M (bool)
                                                                                                                                                                                                                                                                               else
                                                                                                                                                                                                                                                                                 (_s4591_
                                                                                                                                                                                                                                                                                    _s3249_) >>= fun w__366 : option ((f_un_op_S * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                 (if
                                                                                                                                                                                                                                                                                    match w__366 with
                                                                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                                                                      (FCLASS_S, rd, rs1) =>
                                                                                                                                                                                                                                                                                       true
                                                                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                                                                       false
                                                                                                                                                                                                                                                                                    end
                                                                                                                                                                                                                                                                                  then
                                                                                                                                                                                                                                                                                    (_s4591_
                                                                                                                                                                                                                                                                                       _s3249_) >>= fun w__367 : option ((f_un_op_S * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                    (match w__367 with
                                                                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                                                                       (FCLASS_S, rd, rs1) =>
                                                                                                                                                                                                                                                                                        returnm true
                                                                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                                                                        exit tt
                                                                                                                                                                                                                                                                                         : M (bool)
                                                                                                                                                                                                                                                                                     end)
                                                                                                                                                                                                                                                                                     : M (bool)
                                                                                                                                                                                                                                                                                  else
                                                                                                                                                                                                                                                                                    (_s4604_
                                                                                                                                                                                                                                                                                       _s3249_) >>= fun w__370 : option ((mword 5 * mword 6)) =>
                                                                                                                                                                                                                                                                                    (if
                                                                                                                                                                                                                                                                                       match w__370 with
                                                                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                                                                         (rd, imm) =>
                                                                                                                                                                                                                                                                                          Z.eqb
                                                                                                                                                                                                                                                                                            64
                                                                                                                                                                                                                                                                                            32
                                                                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                                                                          false
                                                                                                                                                                                                                                                                                       end
                                                                                                                                                                                                                                                                                     then
                                                                                                                                                                                                                                                                                       (_s4604_
                                                                                                                                                                                                                                                                                          _s3249_) >>= fun w__371 : option ((mword 5 * mword 6)) =>
                                                                                                                                                                                                                                                                                       (match w__371 with
                                                                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                                                                          (rd, imm) =>
                                                                                                                                                                                                                                                                                           returnm true
                                                                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                                                                           exit tt
                                                                                                                                                                                                                                                                                            : M (bool)
                                                                                                                                                                                                                                                                                        end)
                                                                                                                                                                                                                                                                                        : M (bool)
                                                                                                                                                                                                                                                                                     else
                                                                                                                                                                                                                                                                                       (_s4616_
                                                                                                                                                                                                                                                                                          _s3249_) >>= fun w__374 : option ((mword 5 * mword 6)) =>
                                                                                                                                                                                                                                                                                       (if
                                                                                                                                                                                                                                                                                          match w__374 with
                                                                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                                                                            (rd, uimm) =>
                                                                                                                                                                                                                                                                                             Z.eqb
                                                                                                                                                                                                                                                                                               64
                                                                                                                                                                                                                                                                                               32
                                                                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                                                                             false
                                                                                                                                                                                                                                                                                          end
                                                                                                                                                                                                                                                                                        then
                                                                                                                                                                                                                                                                                          (_s4616_
                                                                                                                                                                                                                                                                                             _s3249_) >>= fun w__375 : option ((mword 5 * mword 6)) =>
                                                                                                                                                                                                                                                                                          (match w__375 with
                                                                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                                                                             (rd, uimm) =>
                                                                                                                                                                                                                                                                                              returnm true
                                                                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                                                                              exit tt
                                                                                                                                                                                                                                                                                               : M (bool)
                                                                                                                                                                                                                                                                                           end)
                                                                                                                                                                                                                                                                                           : M (bool)
                                                                                                                                                                                                                                                                                        else
                                                                                                                                                                                                                                                                                          (_s4628_
                                                                                                                                                                                                                                                                                             _s3249_) >>= fun w__378 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                                                                                                                                                                                                                                          (if
                                                                                                                                                                                                                                                                                             match w__378 with
                                                                                                                                                                                                                                                                                             | Some
                                                                                                                                                                                                                                                                                               (rdc, rsc, uimm) =>
                                                                                                                                                                                                                                                                                                Z.eqb
                                                                                                                                                                                                                                                                                                  64
                                                                                                                                                                                                                                                                                                  32
                                                                                                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                                                                                                false
                                                                                                                                                                                                                                                                                             end
                                                                                                                                                                                                                                                                                           then
                                                                                                                                                                                                                                                                                             (_s4628_
                                                                                                                                                                                                                                                                                                _s3249_) >>= fun w__379 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                                                                                                                                                                                                                                             (match w__379 with
                                                                                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                                                                                (rdc, rsc, uimm) =>
                                                                                                                                                                                                                                                                                                 returnm true
                                                                                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                                                                                 exit tt
                                                                                                                                                                                                                                                                                                  : M (bool)
                                                                                                                                                                                                                                                                                              end)
                                                                                                                                                                                                                                                                                              : M (bool)
                                                                                                                                                                                                                                                                                           else
                                                                                                                                                                                                                                                                                             (_s4644_
                                                                                                                                                                                                                                                                                                _s3249_) >>= fun w__382 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                                                                                                                                                                                                                                             (if
                                                                                                                                                                                                                                                                                                match w__382 with
                                                                                                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                                                                                                  (rsc1, rsc2, uimm) =>
                                                                                                                                                                                                                                                                                                   Z.eqb
                                                                                                                                                                                                                                                                                                     64
                                                                                                                                                                                                                                                                                                     32
                                                                                                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                                                                                                   false
                                                                                                                                                                                                                                                                                                end
                                                                                                                                                                                                                                                                                              then
                                                                                                                                                                                                                                                                                                (_s4644_
                                                                                                                                                                                                                                                                                                   _s3249_) >>= fun w__383 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                                                                                                                                                                                                                                                (match w__383 with
                                                                                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                                                                                   (rsc1, rsc2, uimm) =>
                                                                                                                                                                                                                                                                                                    returnm true
                                                                                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                                                                                    exit tt
                                                                                                                                                                                                                                                                                                     : M (bool)
                                                                                                                                                                                                                                                                                                 end)
                                                                                                                                                                                                                                                                                                 : M (bool)
                                                                                                                                                                                                                                                                                              else
                                                                                                                                                                                                                                                                                                (_s4660_
                                                                                                                                                                                                                                                                                                   _s3249_) >>= fun w__386 : option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                (if
                                                                                                                                                                                                                                                                                                   match w__386 with
                                                                                                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                                                                                                     (op, rd, rs1, rs2, rs3, rm) =>
                                                                                                                                                                                                                                                                                                      true
                                                                                                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                                                                                                      false
                                                                                                                                                                                                                                                                                                   end
                                                                                                                                                                                                                                                                                                 then
                                                                                                                                                                                                                                                                                                   (_s4660_
                                                                                                                                                                                                                                                                                                      _s3249_) >>= fun w__387 : option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                   (match w__387 with
                                                                                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                                                                                      (op, rd, rs1, rs2, rs3, rm) =>
                                                                                                                                                                                                                                                                                                       returnm true
                                                                                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                                                                                       exit tt
                                                                                                                                                                                                                                                                                                        : M (bool)
                                                                                                                                                                                                                                                                                                    end)
                                                                                                                                                                                                                                                                                                    : M (bool)
                                                                                                                                                                                                                                                                                                 else
                                                                                                                                                                                                                                                                                                   (_s4685_
                                                                                                                                                                                                                                                                                                      _s3249_) >>= fun w__390 : option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                   (if
                                                                                                                                                                                                                                                                                                      match w__390 with
                                                                                                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                                                                                                        (op, rd, rs1, rs2, rm) =>
                                                                                                                                                                                                                                                                                                         true
                                                                                                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                                                                                                         false
                                                                                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                                                                                    then
                                                                                                                                                                                                                                                                                                      (_s4685_
                                                                                                                                                                                                                                                                                                         _s3249_) >>= fun w__391 : option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                      (match w__391 with
                                                                                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                                                                                         (op, rd, rs1, rs2, rm) =>
                                                                                                                                                                                                                                                                                                          returnm true
                                                                                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                                                                                          exit tt
                                                                                                                                                                                                                                                                                                           : M (bool)
                                                                                                                                                                                                                                                                                                       end)
                                                                                                                                                                                                                                                                                                       : M (bool)
                                                                                                                                                                                                                                                                                                    else
                                                                                                                                                                                                                                                                                                      (_s4706_
                                                                                                                                                                                                                                                                                                         _s3249_) >>= fun w__394 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                      (if
                                                                                                                                                                                                                                                                                                         match w__394 with
                                                                                                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                                                                                                           (FSQRT_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                            true
                                                                                                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                                                                                                            false
                                                                                                                                                                                                                                                                                                         end
                                                                                                                                                                                                                                                                                                       then
                                                                                                                                                                                                                                                                                                         (_s4706_
                                                                                                                                                                                                                                                                                                            _s3249_) >>= fun w__395 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                         (match w__395 with
                                                                                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                                                                                            (FSQRT_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                             returnm true
                                                                                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                                                                                             exit tt
                                                                                                                                                                                                                                                                                                              : M (bool)
                                                                                                                                                                                                                                                                                                          end)
                                                                                                                                                                                                                                                                                                          : M (bool)
                                                                                                                                                                                                                                                                                                       else
                                                                                                                                                                                                                                                                                                         (_s4723_
                                                                                                                                                                                                                                                                                                            _s3249_) >>= fun w__398 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                         (if
                                                                                                                                                                                                                                                                                                            match w__398 with
                                                                                                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                                                                                                              (FCVT_W_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                               true
                                                                                                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                                                                                                               false
                                                                                                                                                                                                                                                                                                            end
                                                                                                                                                                                                                                                                                                          then
                                                                                                                                                                                                                                                                                                            (_s4723_
                                                                                                                                                                                                                                                                                                               _s3249_) >>= fun w__399 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                            (match w__399 with
                                                                                                                                                                                                                                                                                                             | Some
                                                                                                                                                                                                                                                                                                               (FCVT_W_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                returnm true
                                                                                                                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                                                                                                                exit tt
                                                                                                                                                                                                                                                                                                                 : M (bool)
                                                                                                                                                                                                                                                                                                             end)
                                                                                                                                                                                                                                                                                                             : M (bool)
                                                                                                                                                                                                                                                                                                          else
                                                                                                                                                                                                                                                                                                            (_s4740_
                                                                                                                                                                                                                                                                                                               _s3249_) >>= fun w__402 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                            (if
                                                                                                                                                                                                                                                                                                               match w__402 with
                                                                                                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                                                                                                 (FCVT_WU_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                  true
                                                                                                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                                                                                                  false
                                                                                                                                                                                                                                                                                                               end
                                                                                                                                                                                                                                                                                                             then
                                                                                                                                                                                                                                                                                                               (_s4740_
                                                                                                                                                                                                                                                                                                                  _s3249_) >>= fun w__403 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                               (match w__403 with
                                                                                                                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                                                                                                                  (FCVT_WU_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                   returnm true
                                                                                                                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                                                                                                                   exit tt
                                                                                                                                                                                                                                                                                                                    : M (bool)
                                                                                                                                                                                                                                                                                                                end)
                                                                                                                                                                                                                                                                                                                : M (bool)
                                                                                                                                                                                                                                                                                                             else
                                                                                                                                                                                                                                                                                                               (_s4757_
                                                                                                                                                                                                                                                                                                                  _s3249_) >>= fun w__406 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                               (if
                                                                                                                                                                                                                                                                                                                  match w__406 with
                                                                                                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                                                                                                    (FCVT_D_W, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                     true
                                                                                                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                                                                                                     false
                                                                                                                                                                                                                                                                                                                  end
                                                                                                                                                                                                                                                                                                                then
                                                                                                                                                                                                                                                                                                                  (_s4757_
                                                                                                                                                                                                                                                                                                                     _s3249_) >>= fun w__407 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                  (match w__407 with
                                                                                                                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                                                                                                                     (FCVT_D_W, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                      returnm true
                                                                                                                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                                                                                                                      exit tt
                                                                                                                                                                                                                                                                                                                       : M (bool)
                                                                                                                                                                                                                                                                                                                   end)
                                                                                                                                                                                                                                                                                                                   : M (bool)
                                                                                                                                                                                                                                                                                                                else
                                                                                                                                                                                                                                                                                                                  (_s4774_
                                                                                                                                                                                                                                                                                                                     _s3249_) >>= fun w__410 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                  (if
                                                                                                                                                                                                                                                                                                                     match w__410 with
                                                                                                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                                                                                                       (FCVT_D_WU, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                        true
                                                                                                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                                                                                                        false
                                                                                                                                                                                                                                                                                                                     end
                                                                                                                                                                                                                                                                                                                   then
                                                                                                                                                                                                                                                                                                                     (_s4774_
                                                                                                                                                                                                                                                                                                                        _s3249_) >>= fun w__411 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                     (match w__411 with
                                                                                                                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                                                                                                                        (FCVT_D_WU, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                         returnm true
                                                                                                                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                                                                                                                         exit tt
                                                                                                                                                                                                                                                                                                                          : M (bool)
                                                                                                                                                                                                                                                                                                                      end)
                                                                                                                                                                                                                                                                                                                      : M (bool)
                                                                                                                                                                                                                                                                                                                   else
                                                                                                                                                                                                                                                                                                                     (_s4791_
                                                                                                                                                                                                                                                                                                                        _s3249_) >>= fun w__414 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                     (if
                                                                                                                                                                                                                                                                                                                        match w__414 with
                                                                                                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                                                                                                          (FCVT_L_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                           true
                                                                                                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                                                                                                           false
                                                                                                                                                                                                                                                                                                                        end
                                                                                                                                                                                                                                                                                                                      then
                                                                                                                                                                                                                                                                                                                        (_s4791_
                                                                                                                                                                                                                                                                                                                           _s3249_) >>= fun w__415 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                        (match w__415 with
                                                                                                                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                                                                                                                           (FCVT_L_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                            returnm true
                                                                                                                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                                                                                                                            exit tt
                                                                                                                                                                                                                                                                                                                             : M (bool)
                                                                                                                                                                                                                                                                                                                         end)
                                                                                                                                                                                                                                                                                                                         : M (bool)
                                                                                                                                                                                                                                                                                                                      else
                                                                                                                                                                                                                                                                                                                        (_s4808_
                                                                                                                                                                                                                                                                                                                           _s3249_) >>= fun w__418 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                        (if
                                                                                                                                                                                                                                                                                                                           match w__418 with
                                                                                                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                                                                                                             (FCVT_LU_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                              true
                                                                                                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                                                                                                              false
                                                                                                                                                                                                                                                                                                                           end
                                                                                                                                                                                                                                                                                                                         then
                                                                                                                                                                                                                                                                                                                           (_s4808_
                                                                                                                                                                                                                                                                                                                              _s3249_) >>= fun w__419 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                           (match w__419 with
                                                                                                                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                                                                                                                              (FCVT_LU_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                               returnm true
                                                                                                                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                                                                                                                               exit tt
                                                                                                                                                                                                                                                                                                                                : M (bool)
                                                                                                                                                                                                                                                                                                                            end)
                                                                                                                                                                                                                                                                                                                            : M (bool)
                                                                                                                                                                                                                                                                                                                         else
                                                                                                                                                                                                                                                                                                                           (_s4825_
                                                                                                                                                                                                                                                                                                                              _s3249_) >>= fun w__422 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                           (if
                                                                                                                                                                                                                                                                                                                              match w__422 with
                                                                                                                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                                                                                                                (FCVT_D_L, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                                 true
                                                                                                                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                                                                                                                 false
                                                                                                                                                                                                                                                                                                                              end
                                                                                                                                                                                                                                                                                                                            then
                                                                                                                                                                                                                                                                                                                              (_s4825_
                                                                                                                                                                                                                                                                                                                                 _s3249_) >>= fun w__423 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                              (match w__423 with
                                                                                                                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                                                                                                                 (FCVT_D_L, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                                  returnm true
                                                                                                                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                                                                                                                  exit tt
                                                                                                                                                                                                                                                                                                                                   : M (bool)
                                                                                                                                                                                                                                                                                                                               end)
                                                                                                                                                                                                                                                                                                                               : M (bool)
                                                                                                                                                                                                                                                                                                                            else
                                                                                                                                                                                                                                                                                                                              (_s4842_
                                                                                                                                                                                                                                                                                                                                 _s3249_) >>= fun w__426 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                              (if
                                                                                                                                                                                                                                                                                                                                 match w__426 with
                                                                                                                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                                                                                                                   (FCVT_D_LU, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                                    true
                                                                                                                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                                                                                                                    false
                                                                                                                                                                                                                                                                                                                                 end
                                                                                                                                                                                                                                                                                                                               then
                                                                                                                                                                                                                                                                                                                                 (_s4842_
                                                                                                                                                                                                                                                                                                                                    _s3249_) >>= fun w__427 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                                 (match w__427 with
                                                                                                                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                                                                                                                    (FCVT_D_LU, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                                     returnm true
                                                                                                                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                                                                                                                     exit tt
                                                                                                                                                                                                                                                                                                                                      : M (bool)
                                                                                                                                                                                                                                                                                                                                  end)
                                                                                                                                                                                                                                                                                                                                  : M (bool)
                                                                                                                                                                                                                                                                                                                               else
                                                                                                                                                                                                                                                                                                                                 (_s4859_
                                                                                                                                                                                                                                                                                                                                    _s3249_) >>= fun w__430 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                                 (if
                                                                                                                                                                                                                                                                                                                                    match w__430 with
                                                                                                                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                                                                                                                      (FCVT_S_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                                       true
                                                                                                                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                                                                                                                       false
                                                                                                                                                                                                                                                                                                                                    end
                                                                                                                                                                                                                                                                                                                                  then
                                                                                                                                                                                                                                                                                                                                    (_s4859_
                                                                                                                                                                                                                                                                                                                                       _s3249_) >>= fun w__431 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                                    (match w__431 with
                                                                                                                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                                                                                                                       (FCVT_S_D, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                                        returnm true
                                                                                                                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                                                                                                                        exit tt
                                                                                                                                                                                                                                                                                                                                         : M (bool)
                                                                                                                                                                                                                                                                                                                                     end)
                                                                                                                                                                                                                                                                                                                                     : M (bool)
                                                                                                                                                                                                                                                                                                                                  else
                                                                                                                                                                                                                                                                                                                                    (_s4876_
                                                                                                                                                                                                                                                                                                                                       _s3249_) >>= fun w__434 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                                    (if
                                                                                                                                                                                                                                                                                                                                       match w__434 with
                                                                                                                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                                                                                                                         (FCVT_D_S, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                                          true
                                                                                                                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                                                                                                                          false
                                                                                                                                                                                                                                                                                                                                       end
                                                                                                                                                                                                                                                                                                                                     then
                                                                                                                                                                                                                                                                                                                                       (_s4876_
                                                                                                                                                                                                                                                                                                                                          _s3249_) >>= fun w__435 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode)) =>
                                                                                                                                                                                                                                                                                                                                       (match w__435 with
                                                                                                                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                                                                                                                          (FCVT_D_S, rd, rs1, rm) =>
                                                                                                                                                                                                                                                                                                                                           returnm true
                                                                                                                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                                                                                                                           exit tt
                                                                                                                                                                                                                                                                                                                                            : M (bool)
                                                                                                                                                                                                                                                                                                                                        end)
                                                                                                                                                                                                                                                                                                                                        : M (bool)
                                                                                                                                                                                                                                                                                                                                     else
                                                                                                                                                                                                                                                                                                                                       (_s4893_
                                                                                                                                                                                                                                                                                                                                          _s3249_) >>= fun w__438 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                       (if
                                                                                                                                                                                                                                                                                                                                          match w__438 with
                                                                                                                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                                                                                                                            (FSGNJ_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                             true
                                                                                                                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                                                                                                                             false
                                                                                                                                                                                                                                                                                                                                          end
                                                                                                                                                                                                                                                                                                                                        then
                                                                                                                                                                                                                                                                                                                                          (_s4893_
                                                                                                                                                                                                                                                                                                                                             _s3249_) >>= fun w__439 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                          (match w__439 with
                                                                                                                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                                                                                                                             (FSGNJ_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                              returnm true
                                                                                                                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                                                                                                                              exit tt
                                                                                                                                                                                                                                                                                                                                               : M (bool)
                                                                                                                                                                                                                                                                                                                                           end)
                                                                                                                                                                                                                                                                                                                                           : M (bool)
                                                                                                                                                                                                                                                                                                                                        else
                                                                                                                                                                                                                                                                                                                                          (_s4910_
                                                                                                                                                                                                                                                                                                                                             _s3249_) >>= fun w__442 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                          (if
                                                                                                                                                                                                                                                                                                                                             match w__442 with
                                                                                                                                                                                                                                                                                                                                             | Some
                                                                                                                                                                                                                                                                                                                                               (FSGNJN_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                true
                                                                                                                                                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                                                                                                                                                false
                                                                                                                                                                                                                                                                                                                                             end
                                                                                                                                                                                                                                                                                                                                           then
                                                                                                                                                                                                                                                                                                                                             (_s4910_
                                                                                                                                                                                                                                                                                                                                                _s3249_) >>= fun w__443 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                             (match w__443 with
                                                                                                                                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                                                                                                                                (FSGNJN_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                 returnm true
                                                                                                                                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                                                                                                                                 exit tt
                                                                                                                                                                                                                                                                                                                                                  : M (bool)
                                                                                                                                                                                                                                                                                                                                              end)
                                                                                                                                                                                                                                                                                                                                              : M (bool)
                                                                                                                                                                                                                                                                                                                                           else
                                                                                                                                                                                                                                                                                                                                             (_s4927_
                                                                                                                                                                                                                                                                                                                                                _s3249_) >>= fun w__446 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                             (if
                                                                                                                                                                                                                                                                                                                                                match w__446 with
                                                                                                                                                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                                                                                                                                                  (FSGNJX_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                   true
                                                                                                                                                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                                                                                                                                                   false
                                                                                                                                                                                                                                                                                                                                                end
                                                                                                                                                                                                                                                                                                                                              then
                                                                                                                                                                                                                                                                                                                                                (_s4927_
                                                                                                                                                                                                                                                                                                                                                   _s3249_) >>= fun w__447 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                (match w__447 with
                                                                                                                                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                                                                                                                                   (FSGNJX_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                    returnm true
                                                                                                                                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                                                                                                                                    exit tt
                                                                                                                                                                                                                                                                                                                                                     : M (bool)
                                                                                                                                                                                                                                                                                                                                                 end)
                                                                                                                                                                                                                                                                                                                                                 : M (bool)
                                                                                                                                                                                                                                                                                                                                              else
                                                                                                                                                                                                                                                                                                                                                (_s4944_
                                                                                                                                                                                                                                                                                                                                                   _s3249_) >>= fun w__450 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                (if
                                                                                                                                                                                                                                                                                                                                                   match w__450 with
                                                                                                                                                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                                                                                                                                                     (FMIN_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                      true
                                                                                                                                                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                                                                                                                                                      false
                                                                                                                                                                                                                                                                                                                                                   end
                                                                                                                                                                                                                                                                                                                                                 then
                                                                                                                                                                                                                                                                                                                                                   (_s4944_
                                                                                                                                                                                                                                                                                                                                                      _s3249_) >>= fun w__451 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                   (match w__451 with
                                                                                                                                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                                                                                                                                      (FMIN_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                       returnm true
                                                                                                                                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                                                                                                                                       exit tt
                                                                                                                                                                                                                                                                                                                                                        : M (bool)
                                                                                                                                                                                                                                                                                                                                                    end)
                                                                                                                                                                                                                                                                                                                                                    : M (bool)
                                                                                                                                                                                                                                                                                                                                                 else
                                                                                                                                                                                                                                                                                                                                                   (_s4961_
                                                                                                                                                                                                                                                                                                                                                      _s3249_) >>= fun w__454 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                   (if
                                                                                                                                                                                                                                                                                                                                                      match w__454 with
                                                                                                                                                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                                                                                                                                                        (FMAX_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                         true
                                                                                                                                                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                                                                                                                                                         false
                                                                                                                                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                                                                                                                                    then
                                                                                                                                                                                                                                                                                                                                                      (_s4961_
                                                                                                                                                                                                                                                                                                                                                         _s3249_) >>= fun w__455 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                      (match w__455 with
                                                                                                                                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                                                                                                                                         (FMAX_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                          returnm true
                                                                                                                                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                                                                                                                                          exit tt
                                                                                                                                                                                                                                                                                                                                                           : M (bool)
                                                                                                                                                                                                                                                                                                                                                       end)
                                                                                                                                                                                                                                                                                                                                                       : M (bool)
                                                                                                                                                                                                                                                                                                                                                    else
                                                                                                                                                                                                                                                                                                                                                      (_s4978_
                                                                                                                                                                                                                                                                                                                                                         _s3249_) >>= fun w__458 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                      (if
                                                                                                                                                                                                                                                                                                                                                         match w__458 with
                                                                                                                                                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                                                                                                                                                           (FEQ_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                            true
                                                                                                                                                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                                                                                                                                                            false
                                                                                                                                                                                                                                                                                                                                                         end
                                                                                                                                                                                                                                                                                                                                                       then
                                                                                                                                                                                                                                                                                                                                                         (_s4978_
                                                                                                                                                                                                                                                                                                                                                            _s3249_) >>= fun w__459 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                         (match w__459 with
                                                                                                                                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                                                                                                                                            (FEQ_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                             returnm true
                                                                                                                                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                                                                                                                                             exit tt
                                                                                                                                                                                                                                                                                                                                                              : M (bool)
                                                                                                                                                                                                                                                                                                                                                          end)
                                                                                                                                                                                                                                                                                                                                                          : M (bool)
                                                                                                                                                                                                                                                                                                                                                       else
                                                                                                                                                                                                                                                                                                                                                         (_s4995_
                                                                                                                                                                                                                                                                                                                                                            _s3249_) >>= fun w__462 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                         (if
                                                                                                                                                                                                                                                                                                                                                            match w__462 with
                                                                                                                                                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                                                                                                                                                              (FLT_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                               true
                                                                                                                                                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                                                                                                                                                               false
                                                                                                                                                                                                                                                                                                                                                            end
                                                                                                                                                                                                                                                                                                                                                          then
                                                                                                                                                                                                                                                                                                                                                            (_s4995_
                                                                                                                                                                                                                                                                                                                                                               _s3249_) >>= fun w__463 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                            (match w__463 with
                                                                                                                                                                                                                                                                                                                                                             | Some
                                                                                                                                                                                                                                                                                                                                                               (FLT_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                                returnm true
                                                                                                                                                                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                                                                                                                                                                exit tt
                                                                                                                                                                                                                                                                                                                                                                 : M (bool)
                                                                                                                                                                                                                                                                                                                                                             end)
                                                                                                                                                                                                                                                                                                                                                             : M (bool)
                                                                                                                                                                                                                                                                                                                                                          else
                                                                                                                                                                                                                                                                                                                                                            (_s5012_
                                                                                                                                                                                                                                                                                                                                                               _s3249_) >>= fun w__466 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                            (if
                                                                                                                                                                                                                                                                                                                                                               match w__466 with
                                                                                                                                                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                                                                                                                                                 (FLE_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                                  true
                                                                                                                                                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                                                                                                                                                  false
                                                                                                                                                                                                                                                                                                                                                               end
                                                                                                                                                                                                                                                                                                                                                             then
                                                                                                                                                                                                                                                                                                                                                               (_s5012_
                                                                                                                                                                                                                                                                                                                                                                  _s3249_) >>= fun w__467 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                               (match w__467 with
                                                                                                                                                                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                                                                                                                                                                  (FLE_D, rd, rs1, rs2) =>
                                                                                                                                                                                                                                                                                                                                                                   returnm true
                                                                                                                                                                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                                                                                                                                                                   exit tt
                                                                                                                                                                                                                                                                                                                                                                    : M (bool)
                                                                                                                                                                                                                                                                                                                                                                end)
                                                                                                                                                                                                                                                                                                                                                                : M (bool)
                                                                                                                                                                                                                                                                                                                                                             else
                                                                                                                                                                                                                                                                                                                                                               (_s5029_
                                                                                                                                                                                                                                                                                                                                                                  _s3249_) >>= fun w__470 : option ((f_un_op_D * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                               (if
                                                                                                                                                                                                                                                                                                                                                                  match w__470 with
                                                                                                                                                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                                                                                                                                                    (FMV_X_D, rd, rs1) =>
                                                                                                                                                                                                                                                                                                                                                                     true
                                                                                                                                                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                                                                                                                                                     false
                                                                                                                                                                                                                                                                                                                                                                  end
                                                                                                                                                                                                                                                                                                                                                                then
                                                                                                                                                                                                                                                                                                                                                                  (_s5029_
                                                                                                                                                                                                                                                                                                                                                                     _s3249_) >>= fun w__471 : option ((f_un_op_D * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                                  (match w__471 with
                                                                                                                                                                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                                                                                                                                                                     (FMV_X_D, rd, rs1) =>
                                                                                                                                                                                                                                                                                                                                                                      returnm true
                                                                                                                                                                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                                                                                                                                                                      exit tt
                                                                                                                                                                                                                                                                                                                                                                       : M (bool)
                                                                                                                                                                                                                                                                                                                                                                   end)
                                                                                                                                                                                                                                                                                                                                                                   : M (bool)
                                                                                                                                                                                                                                                                                                                                                                else
                                                                                                                                                                                                                                                                                                                                                                  (_s5042_
                                                                                                                                                                                                                                                                                                                                                                     _s3249_) >>= fun w__474 : option ((f_un_op_D * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                                  (if
                                                                                                                                                                                                                                                                                                                                                                     match w__474 with
                                                                                                                                                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                                                                                                                                                       (FMV_D_X, rd, rs1) =>
                                                                                                                                                                                                                                                                                                                                                                        true
                                                                                                                                                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                                                                                                                                                        false
                                                                                                                                                                                                                                                                                                                                                                     end
                                                                                                                                                                                                                                                                                                                                                                   then
                                                                                                                                                                                                                                                                                                                                                                     (_s5042_
                                                                                                                                                                                                                                                                                                                                                                        _s3249_) >>= fun w__475 : option ((f_un_op_D * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                                     (match w__475 with
                                                                                                                                                                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                                                                                                                                                                        (FMV_D_X, rd, rs1) =>
                                                                                                                                                                                                                                                                                                                                                                         returnm true
                                                                                                                                                                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                                                                                                                                                                         exit tt
                                                                                                                                                                                                                                                                                                                                                                          : M (bool)
                                                                                                                                                                                                                                                                                                                                                                      end)
                                                                                                                                                                                                                                                                                                                                                                      : M (bool)
                                                                                                                                                                                                                                                                                                                                                                   else
                                                                                                                                                                                                                                                                                                                                                                     (_s5055_
                                                                                                                                                                                                                                                                                                                                                                        _s3249_) >>= fun w__478 : option ((f_un_op_D * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                                     (if
                                                                                                                                                                                                                                                                                                                                                                        match w__478 with
                                                                                                                                                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                                                                                                                                                          (FCLASS_D, rd, rs1) =>
                                                                                                                                                                                                                                                                                                                                                                           true
                                                                                                                                                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                                                                                                                                                           false
                                                                                                                                                                                                                                                                                                                                                                        end
                                                                                                                                                                                                                                                                                                                                                                      then
                                                                                                                                                                                                                                                                                                                                                                        (_s5055_
                                                                                                                                                                                                                                                                                                                                                                           _s3249_) >>= fun w__479 : option ((f_un_op_D * mword 5 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                                        (match w__479 with
                                                                                                                                                                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                                                                                                                                                                           (FCLASS_D, rd, rs1) =>
                                                                                                                                                                                                                                                                                                                                                                            returnm true
                                                                                                                                                                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                                                                                                                                                                            exit tt
                                                                                                                                                                                                                                                                                                                                                                             : M (bool)
                                                                                                                                                                                                                                                                                                                                                                         end)
                                                                                                                                                                                                                                                                                                                                                                         : M (bool)
                                                                                                                                                                                                                                                                                                                                                                      else
                                                                                                                                                                                                                                                                                                                                                                        (_s5068_
                                                                                                                                                                                                                                                                                                                                                                           _s3249_) >>= fun w__482 : option ((mword 5 * mword 6)) =>
                                                                                                                                                                                                                                                                                                                                                                        (if
                                                                                                                                                                                                                                                                                                                                                                           match w__482 with
                                                                                                                                                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                                                                                                                                                             (rd, uimm) =>
                                                                                                                                                                                                                                                                                                                                                                              orb
                                                                                                                                                                                                                                                                                                                                                                                (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                   64
                                                                                                                                                                                                                                                                                                                                                                                   32)
                                                                                                                                                                                                                                                                                                                                                                                (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                   64
                                                                                                                                                                                                                                                                                                                                                                                   64)
                                                                                                                                                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                                                                                                                                                              false
                                                                                                                                                                                                                                                                                                                                                                           end
                                                                                                                                                                                                                                                                                                                                                                         then
                                                                                                                                                                                                                                                                                                                                                                           (_s5068_
                                                                                                                                                                                                                                                                                                                                                                              _s3249_) >>= fun w__483 : option ((mword 5 * mword 6)) =>
                                                                                                                                                                                                                                                                                                                                                                           (match w__483 with
                                                                                                                                                                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                                                                                                                                                                              (rd, uimm) =>
                                                                                                                                                                                                                                                                                                                                                                               returnm true
                                                                                                                                                                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                                                                                                                                                                               exit tt
                                                                                                                                                                                                                                                                                                                                                                                : M (bool)
                                                                                                                                                                                                                                                                                                                                                                            end)
                                                                                                                                                                                                                                                                                                                                                                            : M (bool)
                                                                                                                                                                                                                                                                                                                                                                         else
                                                                                                                                                                                                                                                                                                                                                                           (_s5080_
                                                                                                                                                                                                                                                                                                                                                                              _s3249_) >>= fun w__486 : option ((mword 5 * mword 6)) =>
                                                                                                                                                                                                                                                                                                                                                                           (if
                                                                                                                                                                                                                                                                                                                                                                              match w__486 with
                                                                                                                                                                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                                                                                                                                                                (rs2, uimm) =>
                                                                                                                                                                                                                                                                                                                                                                                 orb
                                                                                                                                                                                                                                                                                                                                                                                   (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                      64
                                                                                                                                                                                                                                                                                                                                                                                      32)
                                                                                                                                                                                                                                                                                                                                                                                   (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                      64
                                                                                                                                                                                                                                                                                                                                                                                      64)
                                                                                                                                                                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                                                                                                                                                                 false
                                                                                                                                                                                                                                                                                                                                                                              end
                                                                                                                                                                                                                                                                                                                                                                            then
                                                                                                                                                                                                                                                                                                                                                                              (_s5080_
                                                                                                                                                                                                                                                                                                                                                                                 _s3249_) >>= fun w__487 : option ((mword 5 * mword 6)) =>
                                                                                                                                                                                                                                                                                                                                                                              (match w__487 with
                                                                                                                                                                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                                                                                                                                                                 (rs2, uimm) =>
                                                                                                                                                                                                                                                                                                                                                                                  returnm true
                                                                                                                                                                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                                                                                                                                                                  exit tt
                                                                                                                                                                                                                                                                                                                                                                                   : M (bool)
                                                                                                                                                                                                                                                                                                                                                                               end)
                                                                                                                                                                                                                                                                                                                                                                               : M (bool)
                                                                                                                                                                                                                                                                                                                                                                            else
                                                                                                                                                                                                                                                                                                                                                                              (_s5092_
                                                                                                                                                                                                                                                                                                                                                                                 _s3249_) >>= fun w__490 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                                              (if
                                                                                                                                                                                                                                                                                                                                                                                 match w__490 with
                                                                                                                                                                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                                                                                                                                                                   (rdc, rsc, uimm) =>
                                                                                                                                                                                                                                                                                                                                                                                    orb
                                                                                                                                                                                                                                                                                                                                                                                      (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                         64
                                                                                                                                                                                                                                                                                                                                                                                         32)
                                                                                                                                                                                                                                                                                                                                                                                      (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                         64
                                                                                                                                                                                                                                                                                                                                                                                         64)
                                                                                                                                                                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                                                                                                                                                                    false
                                                                                                                                                                                                                                                                                                                                                                                 end
                                                                                                                                                                                                                                                                                                                                                                               then
                                                                                                                                                                                                                                                                                                                                                                                 (_s5092_
                                                                                                                                                                                                                                                                                                                                                                                    _s3249_) >>= fun w__491 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                                                 (match w__491 with
                                                                                                                                                                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                                                                                                                                                                    (rdc, rsc, uimm) =>
                                                                                                                                                                                                                                                                                                                                                                                     returnm true
                                                                                                                                                                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                                                                                                                                                                     exit tt
                                                                                                                                                                                                                                                                                                                                                                                      : M (bool)
                                                                                                                                                                                                                                                                                                                                                                                  end)
                                                                                                                                                                                                                                                                                                                                                                                  : M (bool)
                                                                                                                                                                                                                                                                                                                                                                               else
                                                                                                                                                                                                                                                                                                                                                                                 (_s5108_
                                                                                                                                                                                                                                                                                                                                                                                    _s3249_) >>= fun w__494 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                                                 (if
                                                                                                                                                                                                                                                                                                                                                                                    match w__494 with
                                                                                                                                                                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                                                                                                                                                                      (rsc1, rsc2, uimm) =>
                                                                                                                                                                                                                                                                                                                                                                                       orb
                                                                                                                                                                                                                                                                                                                                                                                         (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                            64
                                                                                                                                                                                                                                                                                                                                                                                            32)
                                                                                                                                                                                                                                                                                                                                                                                         (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                            64
                                                                                                                                                                                                                                                                                                                                                                                            64)
                                                                                                                                                                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                                                                                                                                                                       false
                                                                                                                                                                                                                                                                                                                                                                                    end
                                                                                                                                                                                                                                                                                                                                                                                  then
                                                                                                                                                                                                                                                                                                                                                                                    (_s5108_
                                                                                                                                                                                                                                                                                                                                                                                       _s3249_) >>= fun w__495 : option ((mword 3 * mword 3 * mword 5)) =>
                                                                                                                                                                                                                                                                                                                                                                                    (match w__495 with
                                                                                                                                                                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                                                                                                                                                                       (rsc1, rsc2, uimm) =>
                                                                                                                                                                                                                                                                                                                                                                                        returnm true
                                                                                                                                                                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                                                                                                                                                                        exit tt
                                                                                                                                                                                                                                                                                                                                                                                         : M (bool)
                                                                                                                                                                                                                                                                                                                                                                                     end)
                                                                                                                                                                                                                                                                                                                                                                                     : M (bool)
                                                                                                                                                                                                                                                                                                                                                                                  else
                                                                                                                                                                                                                                                                                                                                                                                    (_s5124_
                                                                                                                                                                                                                                                                                                                                                                                       _s3249_) >>= fun w__498 : option (mword 32) =>
                                                                                                                                                                                                                                                                                                                                                                                    (if
                                                                                                                                                                                                                                                                                                                                                                                       match w__498 with
                                                                                                                                                                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                                                                                                                                                                         s =>
                                                                                                                                                                                                                                                                                                                                                                                          true
                                                                                                                                                                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                                                                                                                                                                          false
                                                                                                                                                                                                                                                                                                                                                                                       end
                                                                                                                                                                                                                                                                                                                                                                                     then
                                                                                                                                                                                                                                                                                                                                                                                       (_s5124_
                                                                                                                                                                                                                                                                                                                                                                                          _s3249_) >>= fun w__499 : option (mword 32) =>
                                                                                                                                                                                                                                                                                                                                                                                       (match w__499 with
                                                                                                                                                                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                                                                                                                                                                          s =>
                                                                                                                                                                                                                                                                                                                                                                                           returnm true
                                                                                                                                                                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                                                                                                                                                                           exit tt
                                                                                                                                                                                                                                                                                                                                                                                            : M (bool)
                                                                                                                                                                                                                                                                                                                                                                                        end)
                                                                                                                                                                                                                                                                                                                                                                                        : M (bool)
                                                                                                                                                                                                                                                                                                                                                                                     else
                                                                                                                                                                                                                                                                                                                                                                                       (_s5132_
                                                                                                                                                                                                                                                                                                                                                                                          _s3249_) >>= fun w__502 : option (mword 16) =>
                                                                                                                                                                                                                                                                                                                                                                                       (if
                                                                                                                                                                                                                                                                                                                                                                                          match w__502 with
                                                                                                                                                                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                                                                                                                                                                            s =>
                                                                                                                                                                                                                                                                                                                                                                                             true
                                                                                                                                                                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                                                                                                                                                                             false
                                                                                                                                                                                                                                                                                                                                                                                          end
                                                                                                                                                                                                                                                                                                                                                                                        then
                                                                                                                                                                                                                                                                                                                                                                                          (_s5132_
                                                                                                                                                                                                                                                                                                                                                                                             _s3249_) >>= fun w__503 : option (mword 16) =>
                                                                                                                                                                                                                                                                                                                                                                                          (match w__503 with
                                                                                                                                                                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                                                                                                                                                                             s =>
                                                                                                                                                                                                                                                                                                                                                                                              returnm true
                                                                                                                                                                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                                                                                                                                                                              exit tt
                                                                                                                                                                                                                                                                                                                                                                                               : M (bool)
                                                                                                                                                                                                                                                                                                                                                                                           end)
                                                                                                                                                                                                                                                                                                                                                                                           : M (bool)
                                                                                                                                                                                                                                                                                                                                                                                        else
                                                                                                                                                                                                                                                                                                                                                                                          returnm false)
                                                                                                                                                                                                                                                                                                                                                                                        : M (bool))
                                                                                                                                                                                                                                                                                                                                                                                     : M (bool))
                                                                                                                                                                                                                                                                                                                                                                                  : M (bool))
                                                                                                                                                                                                                                                                                                                                                                               : M (bool))
                                                                                                                                                                                                                                                                                                                                                                            : M (bool))
                                                                                                                                                                                                                                                                                                                                                                         : M (bool))
                                                                                                                                                                                                                                                                                                                                                                      : M (bool))
                                                                                                                                                                                                                                                                                                                                                                   : M (bool))
                                                                                                                                                                                                                                                                                                                                                                : M (bool))
                                                                                                                                                                                                                                                                                                                                                             : M (bool))
                                                                                                                                                                                                                                                                                                                                                          : M (bool))
                                                                                                                                                                                                                                                                                                                                                       : M (bool))
                                                                                                                                                                                                                                                                                                                                                    : M (bool))
                                                                                                                                                                                                                                                                                                                                                 : M (bool))
                                                                                                                                                                                                                                                                                                                                              : M (bool))
                                                                                                                                                                                                                                                                                                                                           : M (bool))
                                                                                                                                                                                                                                                                                                                                        : M (bool))
                                                                                                                                                                                                                                                                                                                                     : M (bool))
                                                                                                                                                                                                                                                                                                                                  : M (bool))
                                                                                                                                                                                                                                                                                                                               : M (bool))
                                                                                                                                                                                                                                                                                                                            : M (bool))
                                                                                                                                                                                                                                                                                                                         : M (bool))
                                                                                                                                                                                                                                                                                                                      : M (bool))
                                                                                                                                                                                                                                                                                                                   : M (bool))
                                                                                                                                                                                                                                                                                                                : M (bool))
                                                                                                                                                                                                                                                                                                             : M (bool))
                                                                                                                                                                                                                                                                                                          : M (bool))
                                                                                                                                                                                                                                                                                                       : M (bool))
                                                                                                                                                                                                                                                                                                    : M (bool))
                                                                                                                                                                                                                                                                                                 : M (bool))
                                                                                                                                                                                                                                                                                              : M (bool))
                                                                                                                                                                                                                                                                                           : M (bool))
                                                                                                                                                                                                                                                                                        : M (bool))
                                                                                                                                                                                                                                                                                     : M (bool))
                                                                                                                                                                                                                                                                                  : M (bool))
                                                                                                                                                                                                                                                                               : M (bool))
                                                                                                                                                                                                                                                                            : M (bool))
                                                                                                                                                                                                                                                                         : M (bool))
                                                                                                                                                                                                                                                                      : M (bool))
                                                                                                                                                                                                                                                                   : M (bool))
                                                                                                                                                                                                                                                                : M (bool))
                                                                                                                                                                                                                                                             : M (bool))
                                                                                                                                                                                                                                                          : M (bool))
                                                                                                                                                                                                                                                       : M (bool))
                                                                                                                                                                                                                                                    : M (bool))
                                                                                                                                                                                                                                                 : M (bool))
                                                                                                                                                                                                                                              : M (bool))
                                                                                                                                                                                                                                           : M (bool))
                                                                                                                                                                                                                                        : M (bool))
                                                                                                                                                                                                                                     : M (bool))
                                                                                                                                                                                                                                  : M (bool))
                                                                                                                                                                                                                               : M (bool))
                                                                                                                                                                                                                            : M (bool))
                                                                                                                                                                                                                         : M (bool))
                                                                                                                                                                                                                      : M (bool))
                                                                                                                                                                                                                   : M (bool))
                                                                                                                                                                                                                : M (bool))
                                                                                                                                                                                                             : M (bool))
                                                                                                                                                                                                          : M (bool))
                                                                                                                                                                                                       : M (bool))
                                                                                                                                                                                                    : M (bool))
                                                                                                                                                                                                 : M (bool))
                                                                                                                                                                                              : M (bool))
                                                                                                                                                                                           : M (bool))
                                                                                                                                                                                        : M (bool))
                                                                                                                                                                                     : M (bool))
                                                                                                                                                                                  : M (bool))
                                                                                                                                                                               : M (bool))
                                                                                                                                                                            : M (bool))
                                                                                                                                                                         : M (bool))
                                                                                                                                                                      : M (bool))
                                                                                                                                                                   : M (bool))
                                                                                                                                                                : M (bool))
                                                                                                                                                             : M (bool))
                                                                                                                                                          : M (bool))
                                                                                                                                                       : M (bool))
                                                                                                                                                    : M (bool))
                                                                                                                                                 : M (bool))
                                                                                                                                              : M (bool))
                                                                                                                                           : M (bool))
                                                                                                                                        : M (bool))
                                                                                                                                     : M (bool))
                                                                                                                                  : M (bool))
                                                                                                                               : M (bool))
                                                                                                                            : M (bool))
                                                                                                                         : M (bool))
                                                                                                                      : M (bool))
                                                                                                                   : M (bool))
                                                                                                                : M (bool))
                                                                                                             : M (bool))
                                                                                                          : M (bool))
                                                                                                       : M (bool))
                                                                                                    : M (bool))
                                                                                                 : M (bool))
                                                                                              : M (bool))
                                                                                           : M (bool))
                                                                                        : M (bool))
                                                                                     : M (bool))
                                                                                  : M (bool))
                                                                               : M (bool))
                                                                            : M (bool))
                                                                         : M (bool))
                                                                      : M (bool))
                                                                   : M (bool))
                                                                : M (bool))
                                                             : M (bool))
                                                          : M (bool))
                                                       : M (bool))
                                                    : M (bool))
                                                 : M (bool))
                                              : M (bool))
                                           : M (bool))
                                        : M (bool))
                                     : M (bool))
                                  : M (bool))
                               : M (bool))
                            : M (bool))
                         : M (bool))
                      : M (bool))
                   : M (bool))
                : M (bool))
             : M (bool))
          : M (bool))
       : M (bool))
    : M (bool).

Definition _s7071_ (_s7072_ : string) : M (option ((mword 16 * string))) :=
   let _s7073_ := _s7072_ in
   (if string_startswith _s7073_ "c.illegal" then
      (match (string_drop _s7073_ (projT1 (string_length "c.illegal"))) with
       | _s7074_ =>
          (spc_matches_prefix _s7074_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          returnm (match w__0 with
                   | Some (tt, existT _ _s7075_ _) =>
                      match (string_drop _s7074_ _s7075_) with
                      | _s7076_ =>
                         match (hex_bits_16_matches_prefix _s7076_) with
                         | Some (s, existT _ _s7077_ _) =>
                            match (string_drop _s7076_ _s7077_) with | s_ => Some (s, s_) end
                         | _ => None
                         end
                      end
                   | _ => None
                   end)
       end)
       : M (option ((mword 16 * string)))
    else returnm None)
    : M (option ((mword 16 * string))).

Definition _s7063_ (_s7064_ : string) : M (option ((mword 32 * string))) :=
   let _s7065_ := _s7064_ in
   (if string_startswith _s7065_ "illegal" then
      (match (string_drop _s7065_ (projT1 (string_length "illegal"))) with
       | _s7066_ =>
          (spc_matches_prefix _s7066_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          returnm (match w__0 with
                   | Some (tt, existT _ _s7067_ _) =>
                      match (string_drop _s7066_ _s7067_) with
                      | _s7068_ =>
                         match (hex_bits_32_matches_prefix _s7068_) with
                         | Some (s, existT _ _s7069_ _) =>
                            match (string_drop _s7068_ _s7069_) with | s_ => Some (s, s_) end
                         | _ => None
                         end
                      end
                   | _ => None
                   end)
       end)
       : M (option ((mword 32 * string)))
    else returnm None)
    : M (option ((mword 32 * string))).

Definition _s7047_ (_s7048_ : string) : M (option ((mword 3 * mword 3 * mword 5 * string))) :=
   let _s7049_ := _s7048_ in
   (if string_startswith _s7049_ "c.fsd" then
      (match (string_drop _s7049_ (projT1 (string_length "c.fsd"))) with
       | _s7050_ =>
          (spc_matches_prefix _s7050_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s7051_ _) =>
              (match (string_drop _s7050_ _s7051_) with
               | _s7052_ =>
                  (creg_name_matches_prefix _s7052_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsc1, existT _ _s7053_ _) =>
                      (match (string_drop _s7052_ _s7053_) with
                       | _s7054_ =>
                          (sep_matches_prefix _s7054_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s7055_ _) =>
                              (match (string_drop _s7054_ _s7055_) with
                               | _s7056_ =>
                                  (creg_name_matches_prefix _s7056_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc2, existT _ _s7057_ _) =>
                                      (match (string_drop _s7056_ _s7057_) with
                                       | _s7058_ =>
                                          (sep_matches_prefix _s7058_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s7059_ _) =>
                                                      match (string_drop _s7058_ _s7059_) with
                                                      | _s7060_ =>
                                                         match (hex_bits_8_matches_prefix _s7060_) with
                                                         | Some (v__1482, existT _ _s7061_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1482 2 0)
                                                                 ('b"000"
                                                                  : mword (2 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1482 7 3 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1482 7 3 in
                                                              match (string_drop _s7060_ _s7061_) with
                                                              | s_ => Some (rsc1, rsc2, uimm, s_)
                                                              end
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5 * string)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5 * string)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5 * string)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5 * string)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5 * string)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5 * string))).

Definition _s7031_ (_s7032_ : string) : M (option ((mword 3 * mword 3 * mword 5 * string))) :=
   let _s7033_ := _s7032_ in
   (if string_startswith _s7033_ "c.fld" then
      (match (string_drop _s7033_ (projT1 (string_length "c.fld"))) with
       | _s7034_ =>
          (spc_matches_prefix _s7034_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s7035_ _) =>
              (match (string_drop _s7034_ _s7035_) with
               | _s7036_ =>
                  (creg_name_matches_prefix _s7036_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rdc, existT _ _s7037_ _) =>
                      (match (string_drop _s7036_ _s7037_) with
                       | _s7038_ =>
                          (sep_matches_prefix _s7038_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s7039_ _) =>
                              (match (string_drop _s7038_ _s7039_) with
                               | _s7040_ =>
                                  (creg_name_matches_prefix _s7040_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc, existT _ _s7041_ _) =>
                                      (match (string_drop _s7040_ _s7041_) with
                                       | _s7042_ =>
                                          (sep_matches_prefix _s7042_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s7043_ _) =>
                                                      match (string_drop _s7042_ _s7043_) with
                                                      | _s7044_ =>
                                                         match (hex_bits_8_matches_prefix _s7044_) with
                                                         | Some (v__1484, existT _ _s7045_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1484 2 0)
                                                                 ('b"000"
                                                                  : mword (2 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1484 7 3 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1484 7 3 in
                                                              match (string_drop _s7044_ _s7045_) with
                                                              | s_ => Some (rdc, rsc, uimm, s_)
                                                              end
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5 * string)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5 * string)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5 * string)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5 * string)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5 * string)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5 * string))).

Definition _s7019_ (_s7020_ : string) : M (option ((mword 5 * mword 6 * string))) :=
   let _s7021_ := _s7020_ in
   (if string_startswith _s7021_ "c.fsdsp" then
      (match (string_drop _s7021_ (projT1 (string_length "c.fsdsp"))) with
       | _s7022_ =>
          (spc_matches_prefix _s7022_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s7023_ _) =>
              (match (string_drop _s7022_ _s7023_) with
               | _s7024_ =>
                  (reg_name_matches_prefix _s7024_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rs2, existT _ _s7025_ _) =>
                      (match (string_drop _s7024_ _s7025_) with
                       | _s7026_ =>
                          (sep_matches_prefix _s7026_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s7027_ _) =>
                                      match (string_drop _s7026_ _s7027_) with
                                      | _s7028_ =>
                                         match (hex_bits_6_matches_prefix _s7028_) with
                                         | Some (uimm, existT _ _s7029_ _) =>
                                            match (string_drop _s7028_ _s7029_) with
                                            | s_ => Some (rs2, uimm, s_)
                                            end
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6 * string)))
               end)
               : M (option ((mword 5 * mword 6 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6 * string)))
       end)
       : M (option ((mword 5 * mword 6 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 6 * string))).

Definition _s7007_ (_s7008_ : string) : M (option ((mword 5 * mword 6 * string))) :=
   let _s7009_ := _s7008_ in
   (if string_startswith _s7009_ "c.fldsp" then
      (match (string_drop _s7009_ (projT1 (string_length "c.fldsp"))) with
       | _s7010_ =>
          (spc_matches_prefix _s7010_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s7011_ _) =>
              (match (string_drop _s7010_ _s7011_) with
               | _s7012_ =>
                  (reg_name_matches_prefix _s7012_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s7013_ _) =>
                      (match (string_drop _s7012_ _s7013_) with
                       | _s7014_ =>
                          (sep_matches_prefix _s7014_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s7015_ _) =>
                                      match (string_drop _s7014_ _s7015_) with
                                      | _s7016_ =>
                                         match (hex_bits_6_matches_prefix _s7016_) with
                                         | Some (uimm, existT _ _s7017_ _) =>
                                            match (string_drop _s7016_ _s7017_) with
                                            | s_ => Some (rd, uimm, s_)
                                            end
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6 * string)))
               end)
               : M (option ((mword 5 * mword 6 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6 * string)))
       end)
       : M (option ((mword 5 * mword 6 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 6 * string))).

Definition _s6994_ (_s6995_ : string) : M (option ((f_un_op_D * mword 5 * mword 5 * string))) :=
   (match _s6995_ with
    | _s6996_ =>
       (f_un_type_mnemonic_D_matches_prefix _s6996_) >>= fun w__0 : option ((f_un_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCLASS_D, existT _ _s6997_ _) =>
           (match (string_drop _s6996_ _s6997_) with
            | _s6998_ =>
               (spc_matches_prefix _s6998_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6999_ _) =>
                   (match (string_drop _s6998_ _s6999_) with
                    | _s7000_ =>
                       (reg_name_matches_prefix _s7000_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s7001_ _) =>
                           (match (string_drop _s7000_ _s7001_) with
                            | _s7002_ =>
                               (sep_matches_prefix _s7002_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s7003_ _) =>
                                   (match (string_drop _s7002_ _s7003_) with
                                    | _s7004_ =>
                                       (freg_name_matches_prefix _s7004_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       returnm (match w__4 with
                                                | Some (rs1, existT _ _s7005_ _) =>
                                                   match (string_drop _s7004_ _s7005_) with
                                                   | s_ => Some (FCLASS_D, rd, rs1, s_)
                                                   end
                                                | _ => None
                                                end)
                                    end)
                                    : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_un_op_D * mword 5 * mword 5 * string))).

Definition _s6981_ (_s6982_ : string) : M (option ((f_un_op_D * mword 5 * mword 5 * string))) :=
   (match _s6982_ with
    | _s6983_ =>
       (f_un_type_mnemonic_D_matches_prefix _s6983_) >>= fun w__0 : option ((f_un_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMV_D_X, existT _ _s6984_ _) =>
           (match (string_drop _s6983_ _s6984_) with
            | _s6985_ =>
               (spc_matches_prefix _s6985_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6986_ _) =>
                   (match (string_drop _s6985_ _s6986_) with
                    | _s6987_ =>
                       (freg_name_matches_prefix _s6987_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6988_ _) =>
                           (match (string_drop _s6987_ _s6988_) with
                            | _s6989_ =>
                               (sep_matches_prefix _s6989_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6990_ _) =>
                                   (match (string_drop _s6989_ _s6990_) with
                                    | _s6991_ =>
                                       (reg_name_matches_prefix _s6991_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       returnm (match w__4 with
                                                | Some (rs1, existT _ _s6992_ _) =>
                                                   match (string_drop _s6991_ _s6992_) with
                                                   | s_ => Some (FMV_D_X, rd, rs1, s_)
                                                   end
                                                | _ => None
                                                end)
                                    end)
                                    : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_un_op_D * mword 5 * mword 5 * string))).

Definition _s6968_ (_s6969_ : string) : M (option ((f_un_op_D * mword 5 * mword 5 * string))) :=
   (match _s6969_ with
    | _s6970_ =>
       (f_un_type_mnemonic_D_matches_prefix _s6970_) >>= fun w__0 : option ((f_un_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMV_X_D, existT _ _s6971_ _) =>
           (match (string_drop _s6970_ _s6971_) with
            | _s6972_ =>
               (spc_matches_prefix _s6972_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6973_ _) =>
                   (match (string_drop _s6972_ _s6973_) with
                    | _s6974_ =>
                       (reg_name_matches_prefix _s6974_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6975_ _) =>
                           (match (string_drop _s6974_ _s6975_) with
                            | _s6976_ =>
                               (sep_matches_prefix _s6976_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6977_ _) =>
                                   (match (string_drop _s6976_ _s6977_) with
                                    | _s6978_ =>
                                       (freg_name_matches_prefix _s6978_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       returnm (match w__4 with
                                                | Some (rs1, existT _ _s6979_ _) =>
                                                   match (string_drop _s6978_ _s6979_) with
                                                   | s_ => Some (FMV_X_D, rd, rs1, s_)
                                                   end
                                                | _ => None
                                                end)
                                    end)
                                    : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_op_D * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_un_op_D * mword 5 * mword 5 * string))).

Definition _s6951_ (_s6952_ : string)
: M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s6952_ with
    | _s6953_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s6953_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FLE_D, existT _ _s6954_ _) =>
           (match (string_drop _s6953_ _s6954_) with
            | _s6955_ =>
               (spc_matches_prefix _s6955_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6956_ _) =>
                   (match (string_drop _s6955_ _s6956_) with
                    | _s6957_ =>
                       (reg_name_matches_prefix _s6957_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6958_ _) =>
                           (match (string_drop _s6957_ _s6958_) with
                            | _s6959_ =>
                               (sep_matches_prefix _s6959_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6960_ _) =>
                                   (match (string_drop _s6959_ _s6960_) with
                                    | _s6961_ =>
                                       (freg_name_matches_prefix _s6961_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6962_ _) =>
                                           (match (string_drop _s6961_ _s6962_) with
                                            | _s6963_ =>
                                               (sep_matches_prefix _s6963_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6964_ _) =>
                                                   (match (string_drop _s6963_ _s6964_) with
                                                    | _s6965_ =>
                                                       (freg_name_matches_prefix _s6965_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s6966_ _) =>
                                                                   match (string_drop _s6965_
                                                                            _s6966_) with
                                                                   | s_ =>
                                                                      Some (FLE_D, rd, rs1, rs2, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string))).

Definition _s6934_ (_s6935_ : string)
: M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s6935_ with
    | _s6936_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s6936_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FLT_D, existT _ _s6937_ _) =>
           (match (string_drop _s6936_ _s6937_) with
            | _s6938_ =>
               (spc_matches_prefix _s6938_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6939_ _) =>
                   (match (string_drop _s6938_ _s6939_) with
                    | _s6940_ =>
                       (reg_name_matches_prefix _s6940_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6941_ _) =>
                           (match (string_drop _s6940_ _s6941_) with
                            | _s6942_ =>
                               (sep_matches_prefix _s6942_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6943_ _) =>
                                   (match (string_drop _s6942_ _s6943_) with
                                    | _s6944_ =>
                                       (freg_name_matches_prefix _s6944_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6945_ _) =>
                                           (match (string_drop _s6944_ _s6945_) with
                                            | _s6946_ =>
                                               (sep_matches_prefix _s6946_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6947_ _) =>
                                                   (match (string_drop _s6946_ _s6947_) with
                                                    | _s6948_ =>
                                                       (freg_name_matches_prefix _s6948_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s6949_ _) =>
                                                                   match (string_drop _s6948_
                                                                            _s6949_) with
                                                                   | s_ =>
                                                                      Some (FLT_D, rd, rs1, rs2, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string))).

Definition _s6917_ (_s6918_ : string)
: M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s6918_ with
    | _s6919_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s6919_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FEQ_D, existT _ _s6920_ _) =>
           (match (string_drop _s6919_ _s6920_) with
            | _s6921_ =>
               (spc_matches_prefix _s6921_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6922_ _) =>
                   (match (string_drop _s6921_ _s6922_) with
                    | _s6923_ =>
                       (reg_name_matches_prefix _s6923_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6924_ _) =>
                           (match (string_drop _s6923_ _s6924_) with
                            | _s6925_ =>
                               (sep_matches_prefix _s6925_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6926_ _) =>
                                   (match (string_drop _s6925_ _s6926_) with
                                    | _s6927_ =>
                                       (freg_name_matches_prefix _s6927_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6928_ _) =>
                                           (match (string_drop _s6927_ _s6928_) with
                                            | _s6929_ =>
                                               (sep_matches_prefix _s6929_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6930_ _) =>
                                                   (match (string_drop _s6929_ _s6930_) with
                                                    | _s6931_ =>
                                                       (freg_name_matches_prefix _s6931_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s6932_ _) =>
                                                                   match (string_drop _s6931_
                                                                            _s6932_) with
                                                                   | s_ =>
                                                                      Some (FEQ_D, rd, rs1, rs2, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string))).

Definition _s6900_ (_s6901_ : string)
: M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s6901_ with
    | _s6902_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s6902_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMAX_D, existT _ _s6903_ _) =>
           (match (string_drop _s6902_ _s6903_) with
            | _s6904_ =>
               (spc_matches_prefix _s6904_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6905_ _) =>
                   (match (string_drop _s6904_ _s6905_) with
                    | _s6906_ =>
                       (freg_name_matches_prefix _s6906_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6907_ _) =>
                           (match (string_drop _s6906_ _s6907_) with
                            | _s6908_ =>
                               (sep_matches_prefix _s6908_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6909_ _) =>
                                   (match (string_drop _s6908_ _s6909_) with
                                    | _s6910_ =>
                                       (freg_name_matches_prefix _s6910_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6911_ _) =>
                                           (match (string_drop _s6910_ _s6911_) with
                                            | _s6912_ =>
                                               (sep_matches_prefix _s6912_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6913_ _) =>
                                                   (match (string_drop _s6912_ _s6913_) with
                                                    | _s6914_ =>
                                                       (freg_name_matches_prefix _s6914_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s6915_ _) =>
                                                                   match (string_drop _s6914_
                                                                            _s6915_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FMAX_D, rd, rs1, rs2, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string))).

Definition _s6883_ (_s6884_ : string)
: M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s6884_ with
    | _s6885_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s6885_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMIN_D, existT _ _s6886_ _) =>
           (match (string_drop _s6885_ _s6886_) with
            | _s6887_ =>
               (spc_matches_prefix _s6887_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6888_ _) =>
                   (match (string_drop _s6887_ _s6888_) with
                    | _s6889_ =>
                       (freg_name_matches_prefix _s6889_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6890_ _) =>
                           (match (string_drop _s6889_ _s6890_) with
                            | _s6891_ =>
                               (sep_matches_prefix _s6891_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6892_ _) =>
                                   (match (string_drop _s6891_ _s6892_) with
                                    | _s6893_ =>
                                       (freg_name_matches_prefix _s6893_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6894_ _) =>
                                           (match (string_drop _s6893_ _s6894_) with
                                            | _s6895_ =>
                                               (sep_matches_prefix _s6895_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6896_ _) =>
                                                   (match (string_drop _s6895_ _s6896_) with
                                                    | _s6897_ =>
                                                       (freg_name_matches_prefix _s6897_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s6898_ _) =>
                                                                   match (string_drop _s6897_
                                                                            _s6898_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FMIN_D, rd, rs1, rs2, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string))).

Definition _s6866_ (_s6867_ : string)
: M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s6867_ with
    | _s6868_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s6868_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSGNJX_D, existT _ _s6869_ _) =>
           (match (string_drop _s6868_ _s6869_) with
            | _s6870_ =>
               (spc_matches_prefix _s6870_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6871_ _) =>
                   (match (string_drop _s6870_ _s6871_) with
                    | _s6872_ =>
                       (freg_name_matches_prefix _s6872_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6873_ _) =>
                           (match (string_drop _s6872_ _s6873_) with
                            | _s6874_ =>
                               (sep_matches_prefix _s6874_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6875_ _) =>
                                   (match (string_drop _s6874_ _s6875_) with
                                    | _s6876_ =>
                                       (freg_name_matches_prefix _s6876_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6877_ _) =>
                                           (match (string_drop _s6876_ _s6877_) with
                                            | _s6878_ =>
                                               (sep_matches_prefix _s6878_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6879_ _) =>
                                                   (match (string_drop _s6878_ _s6879_) with
                                                    | _s6880_ =>
                                                       (freg_name_matches_prefix _s6880_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s6881_ _) =>
                                                                   match (string_drop _s6880_
                                                                            _s6881_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FSGNJX_D, rd, rs1, rs2, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string))).

Definition _s6849_ (_s6850_ : string)
: M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s6850_ with
    | _s6851_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s6851_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSGNJN_D, existT _ _s6852_ _) =>
           (match (string_drop _s6851_ _s6852_) with
            | _s6853_ =>
               (spc_matches_prefix _s6853_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6854_ _) =>
                   (match (string_drop _s6853_ _s6854_) with
                    | _s6855_ =>
                       (freg_name_matches_prefix _s6855_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6856_ _) =>
                           (match (string_drop _s6855_ _s6856_) with
                            | _s6857_ =>
                               (sep_matches_prefix _s6857_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6858_ _) =>
                                   (match (string_drop _s6857_ _s6858_) with
                                    | _s6859_ =>
                                       (freg_name_matches_prefix _s6859_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6860_ _) =>
                                           (match (string_drop _s6859_ _s6860_) with
                                            | _s6861_ =>
                                               (sep_matches_prefix _s6861_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6862_ _) =>
                                                   (match (string_drop _s6861_ _s6862_) with
                                                    | _s6863_ =>
                                                       (freg_name_matches_prefix _s6863_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s6864_ _) =>
                                                                   match (string_drop _s6863_
                                                                            _s6864_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FSGNJN_D, rd, rs1, rs2, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string))).

Definition _s6832_ (_s6833_ : string)
: M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s6833_ with
    | _s6834_ =>
       (f_bin_type_mnemonic_D_matches_prefix _s6834_) >>= fun w__0 : option ((f_bin_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSGNJ_D, existT _ _s6835_ _) =>
           (match (string_drop _s6834_ _s6835_) with
            | _s6836_ =>
               (spc_matches_prefix _s6836_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6837_ _) =>
                   (match (string_drop _s6836_ _s6837_) with
                    | _s6838_ =>
                       (freg_name_matches_prefix _s6838_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6839_ _) =>
                           (match (string_drop _s6838_ _s6839_) with
                            | _s6840_ =>
                               (sep_matches_prefix _s6840_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6841_ _) =>
                                   (match (string_drop _s6840_ _s6841_) with
                                    | _s6842_ =>
                                       (freg_name_matches_prefix _s6842_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6843_ _) =>
                                           (match (string_drop _s6842_ _s6843_) with
                                            | _s6844_ =>
                                               (sep_matches_prefix _s6844_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6845_ _) =>
                                                   (match (string_drop _s6844_ _s6845_) with
                                                    | _s6846_ =>
                                                       (freg_name_matches_prefix _s6846_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s6847_ _) =>
                                                                   match (string_drop _s6846_
                                                                            _s6847_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FSGNJ_D, rd, rs1, rs2, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                            end)
                                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string))).

Definition _s6815_ (_s6816_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6816_ with
    | _s6817_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s6817_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_D_S, existT _ _s6818_ _) =>
           (match (string_drop _s6817_ _s6818_) with
            | _s6819_ =>
               (spc_matches_prefix _s6819_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6820_ _) =>
                   (match (string_drop _s6819_ _s6820_) with
                    | _s6821_ =>
                       (freg_name_matches_prefix _s6821_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6822_ _) =>
                           (match (string_drop _s6821_ _s6822_) with
                            | _s6823_ =>
                               (sep_matches_prefix _s6823_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6824_ _) =>
                                   (match (string_drop _s6823_ _s6824_) with
                                    | _s6825_ =>
                                       (freg_name_matches_prefix _s6825_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6826_ _) =>
                                           (match (string_drop _s6825_ _s6826_) with
                                            | _s6827_ =>
                                               (sep_matches_prefix _s6827_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6828_ _) =>
                                                   (match (string_drop _s6827_ _s6828_) with
                                                    | _s6829_ =>
                                                       (frm_mnemonic_matches_prefix _s6829_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s6830_ _) =>
                                                                   match (string_drop _s6829_
                                                                            _s6830_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FCVT_D_S, rd, rs1, rm, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6798_ (_s6799_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6799_ with
    | _s6800_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s6800_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_S_D, existT _ _s6801_ _) =>
           (match (string_drop _s6800_ _s6801_) with
            | _s6802_ =>
               (spc_matches_prefix _s6802_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6803_ _) =>
                   (match (string_drop _s6802_ _s6803_) with
                    | _s6804_ =>
                       (freg_name_matches_prefix _s6804_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6805_ _) =>
                           (match (string_drop _s6804_ _s6805_) with
                            | _s6806_ =>
                               (sep_matches_prefix _s6806_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6807_ _) =>
                                   (match (string_drop _s6806_ _s6807_) with
                                    | _s6808_ =>
                                       (freg_name_matches_prefix _s6808_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6809_ _) =>
                                           (match (string_drop _s6808_ _s6809_) with
                                            | _s6810_ =>
                                               (sep_matches_prefix _s6810_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6811_ _) =>
                                                   (match (string_drop _s6810_ _s6811_) with
                                                    | _s6812_ =>
                                                       (frm_mnemonic_matches_prefix _s6812_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s6813_ _) =>
                                                                   match (string_drop _s6812_
                                                                            _s6813_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FCVT_S_D, rd, rs1, rm, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6781_ (_s6782_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6782_ with
    | _s6783_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s6783_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_D_LU, existT _ _s6784_ _) =>
           (match (string_drop _s6783_ _s6784_) with
            | _s6785_ =>
               (spc_matches_prefix _s6785_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6786_ _) =>
                   (match (string_drop _s6785_ _s6786_) with
                    | _s6787_ =>
                       (freg_name_matches_prefix _s6787_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6788_ _) =>
                           (match (string_drop _s6787_ _s6788_) with
                            | _s6789_ =>
                               (sep_matches_prefix _s6789_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6790_ _) =>
                                   (match (string_drop _s6789_ _s6790_) with
                                    | _s6791_ =>
                                       (reg_name_matches_prefix _s6791_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6792_ _) =>
                                           (match (string_drop _s6791_ _s6792_) with
                                            | _s6793_ =>
                                               (sep_matches_prefix _s6793_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6794_ _) =>
                                                   (match (string_drop _s6793_ _s6794_) with
                                                    | _s6795_ =>
                                                       (frm_mnemonic_matches_prefix _s6795_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s6796_ _) =>
                                                                   match (string_drop _s6795_
                                                                            _s6796_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FCVT_D_LU, rd, rs1, rm, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6764_ (_s6765_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6765_ with
    | _s6766_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s6766_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_D_L, existT _ _s6767_ _) =>
           (match (string_drop _s6766_ _s6767_) with
            | _s6768_ =>
               (spc_matches_prefix _s6768_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6769_ _) =>
                   (match (string_drop _s6768_ _s6769_) with
                    | _s6770_ =>
                       (freg_name_matches_prefix _s6770_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6771_ _) =>
                           (match (string_drop _s6770_ _s6771_) with
                            | _s6772_ =>
                               (sep_matches_prefix _s6772_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6773_ _) =>
                                   (match (string_drop _s6772_ _s6773_) with
                                    | _s6774_ =>
                                       (reg_name_matches_prefix _s6774_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6775_ _) =>
                                           (match (string_drop _s6774_ _s6775_) with
                                            | _s6776_ =>
                                               (sep_matches_prefix _s6776_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6777_ _) =>
                                                   (match (string_drop _s6776_ _s6777_) with
                                                    | _s6778_ =>
                                                       (frm_mnemonic_matches_prefix _s6778_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s6779_ _) =>
                                                                   match (string_drop _s6778_
                                                                            _s6779_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FCVT_D_L, rd, rs1, rm, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6747_ (_s6748_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6748_ with
    | _s6749_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s6749_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_LU_D, existT _ _s6750_ _) =>
           (match (string_drop _s6749_ _s6750_) with
            | _s6751_ =>
               (spc_matches_prefix _s6751_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6752_ _) =>
                   (match (string_drop _s6751_ _s6752_) with
                    | _s6753_ =>
                       (reg_name_matches_prefix _s6753_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6754_ _) =>
                           (match (string_drop _s6753_ _s6754_) with
                            | _s6755_ =>
                               (sep_matches_prefix _s6755_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6756_ _) =>
                                   (match (string_drop _s6755_ _s6756_) with
                                    | _s6757_ =>
                                       (freg_name_matches_prefix _s6757_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6758_ _) =>
                                           (match (string_drop _s6757_ _s6758_) with
                                            | _s6759_ =>
                                               (sep_matches_prefix _s6759_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6760_ _) =>
                                                   (match (string_drop _s6759_ _s6760_) with
                                                    | _s6761_ =>
                                                       (frm_mnemonic_matches_prefix _s6761_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s6762_ _) =>
                                                                   match (string_drop _s6761_
                                                                            _s6762_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FCVT_LU_D, rd, rs1, rm, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6730_ (_s6731_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6731_ with
    | _s6732_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s6732_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_L_D, existT _ _s6733_ _) =>
           (match (string_drop _s6732_ _s6733_) with
            | _s6734_ =>
               (spc_matches_prefix _s6734_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6735_ _) =>
                   (match (string_drop _s6734_ _s6735_) with
                    | _s6736_ =>
                       (reg_name_matches_prefix _s6736_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6737_ _) =>
                           (match (string_drop _s6736_ _s6737_) with
                            | _s6738_ =>
                               (sep_matches_prefix _s6738_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6739_ _) =>
                                   (match (string_drop _s6738_ _s6739_) with
                                    | _s6740_ =>
                                       (freg_name_matches_prefix _s6740_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6741_ _) =>
                                           (match (string_drop _s6740_ _s6741_) with
                                            | _s6742_ =>
                                               (sep_matches_prefix _s6742_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6743_ _) =>
                                                   (match (string_drop _s6742_ _s6743_) with
                                                    | _s6744_ =>
                                                       (frm_mnemonic_matches_prefix _s6744_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s6745_ _) =>
                                                                   match (string_drop _s6744_
                                                                            _s6745_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FCVT_L_D, rd, rs1, rm, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6713_ (_s6714_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6714_ with
    | _s6715_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s6715_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_D_WU, existT _ _s6716_ _) =>
           (match (string_drop _s6715_ _s6716_) with
            | _s6717_ =>
               (spc_matches_prefix _s6717_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6718_ _) =>
                   (match (string_drop _s6717_ _s6718_) with
                    | _s6719_ =>
                       (freg_name_matches_prefix _s6719_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6720_ _) =>
                           (match (string_drop _s6719_ _s6720_) with
                            | _s6721_ =>
                               (sep_matches_prefix _s6721_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6722_ _) =>
                                   (match (string_drop _s6721_ _s6722_) with
                                    | _s6723_ =>
                                       (reg_name_matches_prefix _s6723_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6724_ _) =>
                                           (match (string_drop _s6723_ _s6724_) with
                                            | _s6725_ =>
                                               (sep_matches_prefix _s6725_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6726_ _) =>
                                                   (match (string_drop _s6725_ _s6726_) with
                                                    | _s6727_ =>
                                                       (frm_mnemonic_matches_prefix _s6727_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s6728_ _) =>
                                                                   match (string_drop _s6727_
                                                                            _s6728_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FCVT_D_WU, rd, rs1, rm, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6696_ (_s6697_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6697_ with
    | _s6698_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s6698_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_D_W, existT _ _s6699_ _) =>
           (match (string_drop _s6698_ _s6699_) with
            | _s6700_ =>
               (spc_matches_prefix _s6700_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6701_ _) =>
                   (match (string_drop _s6700_ _s6701_) with
                    | _s6702_ =>
                       (freg_name_matches_prefix _s6702_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6703_ _) =>
                           (match (string_drop _s6702_ _s6703_) with
                            | _s6704_ =>
                               (sep_matches_prefix _s6704_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6705_ _) =>
                                   (match (string_drop _s6704_ _s6705_) with
                                    | _s6706_ =>
                                       (reg_name_matches_prefix _s6706_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6707_ _) =>
                                           (match (string_drop _s6706_ _s6707_) with
                                            | _s6708_ =>
                                               (sep_matches_prefix _s6708_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6709_ _) =>
                                                   (match (string_drop _s6708_ _s6709_) with
                                                    | _s6710_ =>
                                                       (frm_mnemonic_matches_prefix _s6710_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s6711_ _) =>
                                                                   match (string_drop _s6710_
                                                                            _s6711_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FCVT_D_W, rd, rs1, rm, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6679_ (_s6680_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6680_ with
    | _s6681_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s6681_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_WU_D, existT _ _s6682_ _) =>
           (match (string_drop _s6681_ _s6682_) with
            | _s6683_ =>
               (spc_matches_prefix _s6683_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6684_ _) =>
                   (match (string_drop _s6683_ _s6684_) with
                    | _s6685_ =>
                       (reg_name_matches_prefix _s6685_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6686_ _) =>
                           (match (string_drop _s6685_ _s6686_) with
                            | _s6687_ =>
                               (sep_matches_prefix _s6687_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6688_ _) =>
                                   (match (string_drop _s6687_ _s6688_) with
                                    | _s6689_ =>
                                       (freg_name_matches_prefix _s6689_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6690_ _) =>
                                           (match (string_drop _s6689_ _s6690_) with
                                            | _s6691_ =>
                                               (sep_matches_prefix _s6691_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6692_ _) =>
                                                   (match (string_drop _s6691_ _s6692_) with
                                                    | _s6693_ =>
                                                       (frm_mnemonic_matches_prefix _s6693_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s6694_ _) =>
                                                                   match (string_drop _s6693_
                                                                            _s6694_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FCVT_WU_D, rd, rs1, rm, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6662_ (_s6663_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6663_ with
    | _s6664_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s6664_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_W_D, existT _ _s6665_ _) =>
           (match (string_drop _s6664_ _s6665_) with
            | _s6666_ =>
               (spc_matches_prefix _s6666_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6667_ _) =>
                   (match (string_drop _s6666_ _s6667_) with
                    | _s6668_ =>
                       (reg_name_matches_prefix _s6668_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6669_ _) =>
                           (match (string_drop _s6668_ _s6669_) with
                            | _s6670_ =>
                               (sep_matches_prefix _s6670_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6671_ _) =>
                                   (match (string_drop _s6670_ _s6671_) with
                                    | _s6672_ =>
                                       (freg_name_matches_prefix _s6672_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6673_ _) =>
                                           (match (string_drop _s6672_ _s6673_) with
                                            | _s6674_ =>
                                               (sep_matches_prefix _s6674_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6675_ _) =>
                                                   (match (string_drop _s6674_ _s6675_) with
                                                    | _s6676_ =>
                                                       (frm_mnemonic_matches_prefix _s6676_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s6677_ _) =>
                                                                   match (string_drop _s6676_
                                                                            _s6677_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FCVT_W_D, rd, rs1, rm, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6645_ (_s6646_ : string)
: M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6646_ with
    | _s6647_ =>
       (f_un_rm_type_mnemonic_D_matches_prefix _s6647_) >>= fun w__0 : option ((f_un_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSQRT_D, existT _ _s6648_ _) =>
           (match (string_drop _s6647_ _s6648_) with
            | _s6649_ =>
               (spc_matches_prefix _s6649_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6650_ _) =>
                   (match (string_drop _s6649_ _s6650_) with
                    | _s6651_ =>
                       (freg_name_matches_prefix _s6651_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6652_ _) =>
                           (match (string_drop _s6651_ _s6652_) with
                            | _s6653_ =>
                               (sep_matches_prefix _s6653_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6654_ _) =>
                                   (match (string_drop _s6653_ _s6654_) with
                                    | _s6655_ =>
                                       (freg_name_matches_prefix _s6655_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6656_ _) =>
                                           (match (string_drop _s6655_ _s6656_) with
                                            | _s6657_ =>
                                               (sep_matches_prefix _s6657_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6658_ _) =>
                                                   (match (string_drop _s6657_ _s6658_) with
                                                    | _s6659_ =>
                                                       (frm_mnemonic_matches_prefix _s6659_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s6660_ _) =>
                                                                   match (string_drop _s6659_
                                                                            _s6660_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FSQRT_D, rd, rs1, rm, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6624_ (_s6625_ : string)
: M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6625_ with
    | _s6626_ =>
       (f_bin_rm_type_mnemonic_D_matches_prefix _s6626_) >>= fun w__0 : option ((f_bin_rm_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s6627_ _) =>
           (match (string_drop _s6626_ _s6627_) with
            | _s6628_ =>
               (spc_matches_prefix _s6628_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6629_ _) =>
                   (match (string_drop _s6628_ _s6629_) with
                    | _s6630_ =>
                       (freg_name_matches_prefix _s6630_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6631_ _) =>
                           (match (string_drop _s6630_ _s6631_) with
                            | _s6632_ =>
                               (sep_matches_prefix _s6632_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6633_ _) =>
                                   (match (string_drop _s6632_ _s6633_) with
                                    | _s6634_ =>
                                       (freg_name_matches_prefix _s6634_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6635_ _) =>
                                           (match (string_drop _s6634_ _s6635_) with
                                            | _s6636_ =>
                                               (sep_matches_prefix _s6636_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6637_ _) =>
                                                   (match (string_drop _s6636_ _s6637_) with
                                                    | _s6638_ =>
                                                       (freg_name_matches_prefix _s6638_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       (match w__6 with
                                                        | Some (rs2, existT _ _s6639_ _) =>
                                                           (match (string_drop _s6638_ _s6639_) with
                                                            | _s6640_ =>
                                                               (sep_matches_prefix _s6640_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                 0)})) =>
                                                               (match w__7 with
                                                                | Some (tt, existT _ _s6641_ _) =>
                                                                   (match (string_drop _s6640_
                                                                             _s6641_) with
                                                                    | _s6642_ =>
                                                                       (frm_mnemonic_matches_prefix
                                                                          _s6642_) >>= fun w__8 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                                         0)})) =>
                                                                       returnm (match w__8 with
                                                                                | Some
                                                                                  (rm, existT _ _s6643_ _) =>
                                                                                   match (string_drop
                                                                                            _s6642_
                                                                                            _s6643_) with
                                                                                   | s_ =>
                                                                                      Some
                                                                                        (op, rd, rs1, rs2, rm, s_)
                                                                                   end
                                                                                | _ => None
                                                                                end)
                                                                    end)
                                                                    : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                                | _ => returnm None
                                                                end)
                                                                : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                            end)
                                                            : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                        | _ => returnm None
                                                        end)
                                                        : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                    end)
                                                    : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6599_ (_s6600_ : string)
: M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6600_ with
    | _s6601_ =>
       (f_madd_type_mnemonic_D_matches_prefix _s6601_) >>= fun w__0 : option ((f_madd_op_D * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s6602_ _) =>
           (match (string_drop _s6601_ _s6602_) with
            | _s6603_ =>
               (spc_matches_prefix _s6603_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6604_ _) =>
                   (match (string_drop _s6603_ _s6604_) with
                    | _s6605_ =>
                       (freg_name_matches_prefix _s6605_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6606_ _) =>
                           (match (string_drop _s6605_ _s6606_) with
                            | _s6607_ =>
                               (sep_matches_prefix _s6607_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6608_ _) =>
                                   (match (string_drop _s6607_ _s6608_) with
                                    | _s6609_ =>
                                       (freg_name_matches_prefix _s6609_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6610_ _) =>
                                           (match (string_drop _s6609_ _s6610_) with
                                            | _s6611_ =>
                                               (sep_matches_prefix _s6611_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6612_ _) =>
                                                   (match (string_drop _s6611_ _s6612_) with
                                                    | _s6613_ =>
                                                       (freg_name_matches_prefix _s6613_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       (match w__6 with
                                                        | Some (rs2, existT _ _s6614_ _) =>
                                                           (match (string_drop _s6613_ _s6614_) with
                                                            | _s6615_ =>
                                                               (sep_matches_prefix _s6615_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                 0)})) =>
                                                               (match w__7 with
                                                                | Some (tt, existT _ _s6616_ _) =>
                                                                   (match (string_drop _s6615_
                                                                             _s6616_) with
                                                                    | _s6617_ =>
                                                                       (freg_name_matches_prefix
                                                                          _s6617_) >>= fun w__8 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                         0)})) =>
                                                                       (match w__8 with
                                                                        | Some
                                                                          (rs3, existT _ _s6618_ _) =>
                                                                           (match (string_drop
                                                                                     _s6617_ _s6618_) with
                                                                            | _s6619_ =>
                                                                               (sep_matches_prefix
                                                                                  _s6619_) >>= fun w__9 : option ((unit * {n : Z & ArithFact (n >=?
                                                                                 0)})) =>
                                                                               (match w__9 with
                                                                                | Some
                                                                                  (tt, existT _ _s6620_ _) =>
                                                                                   (match (string_drop
                                                                                             _s6619_
                                                                                             _s6620_) with
                                                                                    | _s6621_ =>
                                                                                       (frm_mnemonic_matches_prefix
                                                                                          _s6621_) >>= fun w__10 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                                                         0)})) =>
                                                                                       returnm (match w__10 with
                                                                                                | Some
                                                                                                  (rm, existT _ _s6622_ _) =>
                                                                                                   match (string_drop
                                                                                                            _s6621_
                                                                                                            _s6622_) with
                                                                                                   | s_ =>
                                                                                                      Some
                                                                                                        (op, rd, rs1, rs2, rs3, rm, s_)
                                                                                                   end
                                                                                                | _ =>
                                                                                                   None
                                                                                                end)
                                                                                    end)
                                                                                    : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                                                | _ => returnm None
                                                                                end)
                                                                                : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                                            end)
                                                                            : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                                        | _ => returnm None
                                                                        end)
                                                                        : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                                    end)
                                                                    : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                                | _ => returnm None
                                                                end)
                                                                : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                            end)
                                                            : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                        | _ => returnm None
                                                        end)
                                                        : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                    end)
                                                    : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6583_ (_s6584_ : string) : M (option ((mword 3 * mword 3 * mword 5 * string))) :=
   let _s6585_ := _s6584_ in
   (if string_startswith _s6585_ "c.fsw" then
      (match (string_drop _s6585_ (projT1 (string_length "c.fsw"))) with
       | _s6586_ =>
          (spc_matches_prefix _s6586_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s6587_ _) =>
              (match (string_drop _s6586_ _s6587_) with
               | _s6588_ =>
                  (creg_name_matches_prefix _s6588_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsc1, existT _ _s6589_ _) =>
                      (match (string_drop _s6588_ _s6589_) with
                       | _s6590_ =>
                          (sep_matches_prefix _s6590_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s6591_ _) =>
                              (match (string_drop _s6590_ _s6591_) with
                               | _s6592_ =>
                                  (creg_name_matches_prefix _s6592_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc2, existT _ _s6593_ _) =>
                                      (match (string_drop _s6592_ _s6593_) with
                                       | _s6594_ =>
                                          (sep_matches_prefix _s6594_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s6595_ _) =>
                                                      match (string_drop _s6594_ _s6595_) with
                                                      | _s6596_ =>
                                                         match (hex_bits_7_matches_prefix _s6596_) with
                                                         | Some (v__1486, existT _ _s6597_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1486 1 0)
                                                                 ('b"00"
                                                                  : mword (1 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1486 6 2 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1486 6 2 in
                                                              match (string_drop _s6596_ _s6597_) with
                                                              | s_ => Some (rsc1, rsc2, uimm, s_)
                                                              end
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5 * string)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5 * string)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5 * string)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5 * string)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5 * string)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5 * string))).

Definition _s6567_ (_s6568_ : string) : M (option ((mword 3 * mword 3 * mword 5 * string))) :=
   let _s6569_ := _s6568_ in
   (if string_startswith _s6569_ "c.flw" then
      (match (string_drop _s6569_ (projT1 (string_length "c.flw"))) with
       | _s6570_ =>
          (spc_matches_prefix _s6570_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s6571_ _) =>
              (match (string_drop _s6570_ _s6571_) with
               | _s6572_ =>
                  (creg_name_matches_prefix _s6572_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rdc, existT _ _s6573_ _) =>
                      (match (string_drop _s6572_ _s6573_) with
                       | _s6574_ =>
                          (sep_matches_prefix _s6574_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s6575_ _) =>
                              (match (string_drop _s6574_ _s6575_) with
                               | _s6576_ =>
                                  (creg_name_matches_prefix _s6576_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc, existT _ _s6577_ _) =>
                                      (match (string_drop _s6576_ _s6577_) with
                                       | _s6578_ =>
                                          (sep_matches_prefix _s6578_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s6579_ _) =>
                                                      match (string_drop _s6578_ _s6579_) with
                                                      | _s6580_ =>
                                                         match (hex_bits_7_matches_prefix _s6580_) with
                                                         | Some (v__1488, existT _ _s6581_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1488 1 0)
                                                                 ('b"00"
                                                                  : mword (1 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1488 6 2 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1488 6 2 in
                                                              match (string_drop _s6580_ _s6581_) with
                                                              | s_ => Some (rdc, rsc, uimm, s_)
                                                              end
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5 * string)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5 * string)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5 * string)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5 * string)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5 * string)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5 * string))).

Definition _s6555_ (_s6556_ : string) : M (option ((mword 5 * mword 6 * string))) :=
   let _s6557_ := _s6556_ in
   (if string_startswith _s6557_ "c.fswsp" then
      (match (string_drop _s6557_ (projT1 (string_length "c.fswsp"))) with
       | _s6558_ =>
          (spc_matches_prefix _s6558_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s6559_ _) =>
              (match (string_drop _s6558_ _s6559_) with
               | _s6560_ =>
                  (reg_name_matches_prefix _s6560_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s6561_ _) =>
                      (match (string_drop _s6560_ _s6561_) with
                       | _s6562_ =>
                          (sep_matches_prefix _s6562_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s6563_ _) =>
                                      match (string_drop _s6562_ _s6563_) with
                                      | _s6564_ =>
                                         match (hex_bits_6_matches_prefix _s6564_) with
                                         | Some (uimm, existT _ _s6565_ _) =>
                                            match (string_drop _s6564_ _s6565_) with
                                            | s_ => Some (rd, uimm, s_)
                                            end
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6 * string)))
               end)
               : M (option ((mword 5 * mword 6 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6 * string)))
       end)
       : M (option ((mword 5 * mword 6 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 6 * string))).

Definition _s6543_ (_s6544_ : string) : M (option ((mword 5 * mword 6 * string))) :=
   let _s6545_ := _s6544_ in
   (if string_startswith _s6545_ "c.flwsp" then
      (match (string_drop _s6545_ (projT1 (string_length "c.flwsp"))) with
       | _s6546_ =>
          (spc_matches_prefix _s6546_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s6547_ _) =>
              (match (string_drop _s6546_ _s6547_) with
               | _s6548_ =>
                  (reg_name_matches_prefix _s6548_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s6549_ _) =>
                      (match (string_drop _s6548_ _s6549_) with
                       | _s6550_ =>
                          (sep_matches_prefix _s6550_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s6551_ _) =>
                                      match (string_drop _s6550_ _s6551_) with
                                      | _s6552_ =>
                                         match (hex_bits_6_matches_prefix _s6552_) with
                                         | Some (imm, existT _ _s6553_ _) =>
                                            match (string_drop _s6552_ _s6553_) with
                                            | s_ => Some (rd, imm, s_)
                                            end
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6 * string)))
               end)
               : M (option ((mword 5 * mword 6 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6 * string)))
       end)
       : M (option ((mword 5 * mword 6 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 6 * string))).

Definition _s6530_ (_s6531_ : string) : M (option ((f_un_op_S * mword 5 * mword 5 * string))) :=
   (match _s6531_ with
    | _s6532_ =>
       (f_un_type_mnemonic_S_matches_prefix _s6532_) >>= fun w__0 : option ((f_un_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCLASS_S, existT _ _s6533_ _) =>
           (match (string_drop _s6532_ _s6533_) with
            | _s6534_ =>
               (spc_matches_prefix _s6534_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6535_ _) =>
                   (match (string_drop _s6534_ _s6535_) with
                    | _s6536_ =>
                       (reg_name_matches_prefix _s6536_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6537_ _) =>
                           (match (string_drop _s6536_ _s6537_) with
                            | _s6538_ =>
                               (sep_matches_prefix _s6538_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6539_ _) =>
                                   (match (string_drop _s6538_ _s6539_) with
                                    | _s6540_ =>
                                       (freg_name_matches_prefix _s6540_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       returnm (match w__4 with
                                                | Some (rs1, existT _ _s6541_ _) =>
                                                   match (string_drop _s6540_ _s6541_) with
                                                   | s_ => Some (FCLASS_S, rd, rs1, s_)
                                                   end
                                                | _ => None
                                                end)
                                    end)
                                    : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_un_op_S * mword 5 * mword 5 * string))).

Definition _s6517_ (_s6518_ : string) : M (option ((f_un_op_S * mword 5 * mword 5 * string))) :=
   (match _s6518_ with
    | _s6519_ =>
       (f_un_type_mnemonic_S_matches_prefix _s6519_) >>= fun w__0 : option ((f_un_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMV_W_X, existT _ _s6520_ _) =>
           (match (string_drop _s6519_ _s6520_) with
            | _s6521_ =>
               (spc_matches_prefix _s6521_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6522_ _) =>
                   (match (string_drop _s6521_ _s6522_) with
                    | _s6523_ =>
                       (freg_name_matches_prefix _s6523_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6524_ _) =>
                           (match (string_drop _s6523_ _s6524_) with
                            | _s6525_ =>
                               (sep_matches_prefix _s6525_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6526_ _) =>
                                   (match (string_drop _s6525_ _s6526_) with
                                    | _s6527_ =>
                                       (reg_name_matches_prefix _s6527_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       returnm (match w__4 with
                                                | Some (rs1, existT _ _s6528_ _) =>
                                                   match (string_drop _s6527_ _s6528_) with
                                                   | s_ => Some (FMV_W_X, rd, rs1, s_)
                                                   end
                                                | _ => None
                                                end)
                                    end)
                                    : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_un_op_S * mword 5 * mword 5 * string))).

Definition _s6504_ (_s6505_ : string) : M (option ((f_un_op_S * mword 5 * mword 5 * string))) :=
   (match _s6505_ with
    | _s6506_ =>
       (f_un_type_mnemonic_S_matches_prefix _s6506_) >>= fun w__0 : option ((f_un_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMV_X_W, existT _ _s6507_ _) =>
           (match (string_drop _s6506_ _s6507_) with
            | _s6508_ =>
               (spc_matches_prefix _s6508_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6509_ _) =>
                   (match (string_drop _s6508_ _s6509_) with
                    | _s6510_ =>
                       (reg_name_matches_prefix _s6510_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6511_ _) =>
                           (match (string_drop _s6510_ _s6511_) with
                            | _s6512_ =>
                               (sep_matches_prefix _s6512_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6513_ _) =>
                                   (match (string_drop _s6512_ _s6513_) with
                                    | _s6514_ =>
                                       (freg_name_matches_prefix _s6514_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       returnm (match w__4 with
                                                | Some (rs1, existT _ _s6515_ _) =>
                                                   match (string_drop _s6514_ _s6515_) with
                                                   | s_ => Some (FMV_X_W, rd, rs1, s_)
                                                   end
                                                | _ => None
                                                end)
                                    end)
                                    : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_op_S * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_un_op_S * mword 5 * mword 5 * string))).

Definition _s6487_ (_s6488_ : string)
: M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s6488_ with
    | _s6489_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s6489_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FLE_S, existT _ _s6490_ _) =>
           (match (string_drop _s6489_ _s6490_) with
            | _s6491_ =>
               (spc_matches_prefix _s6491_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6492_ _) =>
                   (match (string_drop _s6491_ _s6492_) with
                    | _s6493_ =>
                       (reg_name_matches_prefix _s6493_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6494_ _) =>
                           (match (string_drop _s6493_ _s6494_) with
                            | _s6495_ =>
                               (sep_matches_prefix _s6495_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6496_ _) =>
                                   (match (string_drop _s6495_ _s6496_) with
                                    | _s6497_ =>
                                       (freg_name_matches_prefix _s6497_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6498_ _) =>
                                           (match (string_drop _s6497_ _s6498_) with
                                            | _s6499_ =>
                                               (sep_matches_prefix _s6499_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6500_ _) =>
                                                   (match (string_drop _s6499_ _s6500_) with
                                                    | _s6501_ =>
                                                       (freg_name_matches_prefix _s6501_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s6502_ _) =>
                                                                   match (string_drop _s6501_
                                                                            _s6502_) with
                                                                   | s_ =>
                                                                      Some (FLE_S, rd, rs1, rs2, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string))).

Definition _s6470_ (_s6471_ : string)
: M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s6471_ with
    | _s6472_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s6472_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FLT_S, existT _ _s6473_ _) =>
           (match (string_drop _s6472_ _s6473_) with
            | _s6474_ =>
               (spc_matches_prefix _s6474_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6475_ _) =>
                   (match (string_drop _s6474_ _s6475_) with
                    | _s6476_ =>
                       (reg_name_matches_prefix _s6476_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6477_ _) =>
                           (match (string_drop _s6476_ _s6477_) with
                            | _s6478_ =>
                               (sep_matches_prefix _s6478_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6479_ _) =>
                                   (match (string_drop _s6478_ _s6479_) with
                                    | _s6480_ =>
                                       (freg_name_matches_prefix _s6480_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6481_ _) =>
                                           (match (string_drop _s6480_ _s6481_) with
                                            | _s6482_ =>
                                               (sep_matches_prefix _s6482_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6483_ _) =>
                                                   (match (string_drop _s6482_ _s6483_) with
                                                    | _s6484_ =>
                                                       (freg_name_matches_prefix _s6484_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s6485_ _) =>
                                                                   match (string_drop _s6484_
                                                                            _s6485_) with
                                                                   | s_ =>
                                                                      Some (FLT_S, rd, rs1, rs2, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string))).

Definition _s6453_ (_s6454_ : string)
: M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s6454_ with
    | _s6455_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s6455_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FEQ_S, existT _ _s6456_ _) =>
           (match (string_drop _s6455_ _s6456_) with
            | _s6457_ =>
               (spc_matches_prefix _s6457_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6458_ _) =>
                   (match (string_drop _s6457_ _s6458_) with
                    | _s6459_ =>
                       (reg_name_matches_prefix _s6459_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6460_ _) =>
                           (match (string_drop _s6459_ _s6460_) with
                            | _s6461_ =>
                               (sep_matches_prefix _s6461_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6462_ _) =>
                                   (match (string_drop _s6461_ _s6462_) with
                                    | _s6463_ =>
                                       (freg_name_matches_prefix _s6463_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6464_ _) =>
                                           (match (string_drop _s6463_ _s6464_) with
                                            | _s6465_ =>
                                               (sep_matches_prefix _s6465_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6466_ _) =>
                                                   (match (string_drop _s6465_ _s6466_) with
                                                    | _s6467_ =>
                                                       (freg_name_matches_prefix _s6467_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s6468_ _) =>
                                                                   match (string_drop _s6467_
                                                                            _s6468_) with
                                                                   | s_ =>
                                                                      Some (FEQ_S, rd, rs1, rs2, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string))).

Definition _s6436_ (_s6437_ : string)
: M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s6437_ with
    | _s6438_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s6438_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMAX_S, existT _ _s6439_ _) =>
           (match (string_drop _s6438_ _s6439_) with
            | _s6440_ =>
               (spc_matches_prefix _s6440_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6441_ _) =>
                   (match (string_drop _s6440_ _s6441_) with
                    | _s6442_ =>
                       (freg_name_matches_prefix _s6442_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6443_ _) =>
                           (match (string_drop _s6442_ _s6443_) with
                            | _s6444_ =>
                               (sep_matches_prefix _s6444_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6445_ _) =>
                                   (match (string_drop _s6444_ _s6445_) with
                                    | _s6446_ =>
                                       (freg_name_matches_prefix _s6446_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6447_ _) =>
                                           (match (string_drop _s6446_ _s6447_) with
                                            | _s6448_ =>
                                               (sep_matches_prefix _s6448_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6449_ _) =>
                                                   (match (string_drop _s6448_ _s6449_) with
                                                    | _s6450_ =>
                                                       (freg_name_matches_prefix _s6450_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s6451_ _) =>
                                                                   match (string_drop _s6450_
                                                                            _s6451_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FMAX_S, rd, rs1, rs2, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string))).

Definition _s6419_ (_s6420_ : string)
: M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s6420_ with
    | _s6421_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s6421_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FMIN_S, existT _ _s6422_ _) =>
           (match (string_drop _s6421_ _s6422_) with
            | _s6423_ =>
               (spc_matches_prefix _s6423_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6424_ _) =>
                   (match (string_drop _s6423_ _s6424_) with
                    | _s6425_ =>
                       (freg_name_matches_prefix _s6425_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6426_ _) =>
                           (match (string_drop _s6425_ _s6426_) with
                            | _s6427_ =>
                               (sep_matches_prefix _s6427_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6428_ _) =>
                                   (match (string_drop _s6427_ _s6428_) with
                                    | _s6429_ =>
                                       (freg_name_matches_prefix _s6429_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6430_ _) =>
                                           (match (string_drop _s6429_ _s6430_) with
                                            | _s6431_ =>
                                               (sep_matches_prefix _s6431_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6432_ _) =>
                                                   (match (string_drop _s6431_ _s6432_) with
                                                    | _s6433_ =>
                                                       (freg_name_matches_prefix _s6433_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s6434_ _) =>
                                                                   match (string_drop _s6433_
                                                                            _s6434_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FMIN_S, rd, rs1, rs2, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string))).

Definition _s6402_ (_s6403_ : string)
: M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s6403_ with
    | _s6404_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s6404_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSGNJX_S, existT _ _s6405_ _) =>
           (match (string_drop _s6404_ _s6405_) with
            | _s6406_ =>
               (spc_matches_prefix _s6406_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6407_ _) =>
                   (match (string_drop _s6406_ _s6407_) with
                    | _s6408_ =>
                       (freg_name_matches_prefix _s6408_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6409_ _) =>
                           (match (string_drop _s6408_ _s6409_) with
                            | _s6410_ =>
                               (sep_matches_prefix _s6410_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6411_ _) =>
                                   (match (string_drop _s6410_ _s6411_) with
                                    | _s6412_ =>
                                       (freg_name_matches_prefix _s6412_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6413_ _) =>
                                           (match (string_drop _s6412_ _s6413_) with
                                            | _s6414_ =>
                                               (sep_matches_prefix _s6414_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6415_ _) =>
                                                   (match (string_drop _s6414_ _s6415_) with
                                                    | _s6416_ =>
                                                       (freg_name_matches_prefix _s6416_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s6417_ _) =>
                                                                   match (string_drop _s6416_
                                                                            _s6417_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FSGNJX_S, rd, rs1, rs2, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string))).

Definition _s6385_ (_s6386_ : string)
: M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s6386_ with
    | _s6387_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s6387_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSGNJN_S, existT _ _s6388_ _) =>
           (match (string_drop _s6387_ _s6388_) with
            | _s6389_ =>
               (spc_matches_prefix _s6389_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6390_ _) =>
                   (match (string_drop _s6389_ _s6390_) with
                    | _s6391_ =>
                       (freg_name_matches_prefix _s6391_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6392_ _) =>
                           (match (string_drop _s6391_ _s6392_) with
                            | _s6393_ =>
                               (sep_matches_prefix _s6393_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6394_ _) =>
                                   (match (string_drop _s6393_ _s6394_) with
                                    | _s6395_ =>
                                       (freg_name_matches_prefix _s6395_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6396_ _) =>
                                           (match (string_drop _s6395_ _s6396_) with
                                            | _s6397_ =>
                                               (sep_matches_prefix _s6397_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6398_ _) =>
                                                   (match (string_drop _s6397_ _s6398_) with
                                                    | _s6399_ =>
                                                       (freg_name_matches_prefix _s6399_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s6400_ _) =>
                                                                   match (string_drop _s6399_
                                                                            _s6400_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FSGNJN_S, rd, rs1, rs2, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string))).

Definition _s6368_ (_s6369_ : string)
: M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s6369_ with
    | _s6370_ =>
       (f_bin_type_mnemonic_S_matches_prefix _s6370_) >>= fun w__0 : option ((f_bin_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSGNJ_S, existT _ _s6371_ _) =>
           (match (string_drop _s6370_ _s6371_) with
            | _s6372_ =>
               (spc_matches_prefix _s6372_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6373_ _) =>
                   (match (string_drop _s6372_ _s6373_) with
                    | _s6374_ =>
                       (freg_name_matches_prefix _s6374_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6375_ _) =>
                           (match (string_drop _s6374_ _s6375_) with
                            | _s6376_ =>
                               (sep_matches_prefix _s6376_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6377_ _) =>
                                   (match (string_drop _s6376_ _s6377_) with
                                    | _s6378_ =>
                                       (freg_name_matches_prefix _s6378_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6379_ _) =>
                                           (match (string_drop _s6378_ _s6379_) with
                                            | _s6380_ =>
                                               (sep_matches_prefix _s6380_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6381_ _) =>
                                                   (match (string_drop _s6380_ _s6381_) with
                                                    | _s6382_ =>
                                                       (freg_name_matches_prefix _s6382_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s6383_ _) =>
                                                                   match (string_drop _s6382_
                                                                            _s6383_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FSGNJ_S, rd, rs1, rs2, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                            end)
                                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string))).

Definition _s6351_ (_s6352_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6352_ with
    | _s6353_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s6353_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_S_LU, existT _ _s6354_ _) =>
           (match (string_drop _s6353_ _s6354_) with
            | _s6355_ =>
               (spc_matches_prefix _s6355_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6356_ _) =>
                   (match (string_drop _s6355_ _s6356_) with
                    | _s6357_ =>
                       (freg_name_matches_prefix _s6357_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6358_ _) =>
                           (match (string_drop _s6357_ _s6358_) with
                            | _s6359_ =>
                               (sep_matches_prefix _s6359_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6360_ _) =>
                                   (match (string_drop _s6359_ _s6360_) with
                                    | _s6361_ =>
                                       (reg_name_matches_prefix _s6361_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6362_ _) =>
                                           (match (string_drop _s6361_ _s6362_) with
                                            | _s6363_ =>
                                               (sep_matches_prefix _s6363_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6364_ _) =>
                                                   (match (string_drop _s6363_ _s6364_) with
                                                    | _s6365_ =>
                                                       (frm_mnemonic_matches_prefix _s6365_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s6366_ _) =>
                                                                   match (string_drop _s6365_
                                                                            _s6366_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FCVT_S_LU, rd, rs1, rm, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6334_ (_s6335_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6335_ with
    | _s6336_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s6336_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_S_L, existT _ _s6337_ _) =>
           (match (string_drop _s6336_ _s6337_) with
            | _s6338_ =>
               (spc_matches_prefix _s6338_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6339_ _) =>
                   (match (string_drop _s6338_ _s6339_) with
                    | _s6340_ =>
                       (freg_name_matches_prefix _s6340_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6341_ _) =>
                           (match (string_drop _s6340_ _s6341_) with
                            | _s6342_ =>
                               (sep_matches_prefix _s6342_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6343_ _) =>
                                   (match (string_drop _s6342_ _s6343_) with
                                    | _s6344_ =>
                                       (reg_name_matches_prefix _s6344_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6345_ _) =>
                                           (match (string_drop _s6344_ _s6345_) with
                                            | _s6346_ =>
                                               (sep_matches_prefix _s6346_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6347_ _) =>
                                                   (match (string_drop _s6346_ _s6347_) with
                                                    | _s6348_ =>
                                                       (frm_mnemonic_matches_prefix _s6348_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s6349_ _) =>
                                                                   match (string_drop _s6348_
                                                                            _s6349_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FCVT_S_L, rd, rs1, rm, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6317_ (_s6318_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6318_ with
    | _s6319_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s6319_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_LU_S, existT _ _s6320_ _) =>
           (match (string_drop _s6319_ _s6320_) with
            | _s6321_ =>
               (spc_matches_prefix _s6321_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6322_ _) =>
                   (match (string_drop _s6321_ _s6322_) with
                    | _s6323_ =>
                       (reg_name_matches_prefix _s6323_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6324_ _) =>
                           (match (string_drop _s6323_ _s6324_) with
                            | _s6325_ =>
                               (sep_matches_prefix _s6325_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6326_ _) =>
                                   (match (string_drop _s6325_ _s6326_) with
                                    | _s6327_ =>
                                       (freg_name_matches_prefix _s6327_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6328_ _) =>
                                           (match (string_drop _s6327_ _s6328_) with
                                            | _s6329_ =>
                                               (sep_matches_prefix _s6329_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6330_ _) =>
                                                   (match (string_drop _s6329_ _s6330_) with
                                                    | _s6331_ =>
                                                       (frm_mnemonic_matches_prefix _s6331_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s6332_ _) =>
                                                                   match (string_drop _s6331_
                                                                            _s6332_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FCVT_LU_S, rd, rs1, rm, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6300_ (_s6301_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6301_ with
    | _s6302_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s6302_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_L_S, existT _ _s6303_ _) =>
           (match (string_drop _s6302_ _s6303_) with
            | _s6304_ =>
               (spc_matches_prefix _s6304_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6305_ _) =>
                   (match (string_drop _s6304_ _s6305_) with
                    | _s6306_ =>
                       (reg_name_matches_prefix _s6306_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6307_ _) =>
                           (match (string_drop _s6306_ _s6307_) with
                            | _s6308_ =>
                               (sep_matches_prefix _s6308_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6309_ _) =>
                                   (match (string_drop _s6308_ _s6309_) with
                                    | _s6310_ =>
                                       (freg_name_matches_prefix _s6310_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6311_ _) =>
                                           (match (string_drop _s6310_ _s6311_) with
                                            | _s6312_ =>
                                               (sep_matches_prefix _s6312_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6313_ _) =>
                                                   (match (string_drop _s6312_ _s6313_) with
                                                    | _s6314_ =>
                                                       (frm_mnemonic_matches_prefix _s6314_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s6315_ _) =>
                                                                   match (string_drop _s6314_
                                                                            _s6315_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FCVT_L_S, rd, rs1, rm, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6283_ (_s6284_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6284_ with
    | _s6285_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s6285_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_S_WU, existT _ _s6286_ _) =>
           (match (string_drop _s6285_ _s6286_) with
            | _s6287_ =>
               (spc_matches_prefix _s6287_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6288_ _) =>
                   (match (string_drop _s6287_ _s6288_) with
                    | _s6289_ =>
                       (freg_name_matches_prefix _s6289_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6290_ _) =>
                           (match (string_drop _s6289_ _s6290_) with
                            | _s6291_ =>
                               (sep_matches_prefix _s6291_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6292_ _) =>
                                   (match (string_drop _s6291_ _s6292_) with
                                    | _s6293_ =>
                                       (reg_name_matches_prefix _s6293_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6294_ _) =>
                                           (match (string_drop _s6293_ _s6294_) with
                                            | _s6295_ =>
                                               (sep_matches_prefix _s6295_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6296_ _) =>
                                                   (match (string_drop _s6295_ _s6296_) with
                                                    | _s6297_ =>
                                                       (frm_mnemonic_matches_prefix _s6297_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s6298_ _) =>
                                                                   match (string_drop _s6297_
                                                                            _s6298_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FCVT_S_WU, rd, rs1, rm, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6266_ (_s6267_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6267_ with
    | _s6268_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s6268_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_S_W, existT _ _s6269_ _) =>
           (match (string_drop _s6268_ _s6269_) with
            | _s6270_ =>
               (spc_matches_prefix _s6270_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6271_ _) =>
                   (match (string_drop _s6270_ _s6271_) with
                    | _s6272_ =>
                       (freg_name_matches_prefix _s6272_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6273_ _) =>
                           (match (string_drop _s6272_ _s6273_) with
                            | _s6274_ =>
                               (sep_matches_prefix _s6274_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6275_ _) =>
                                   (match (string_drop _s6274_ _s6275_) with
                                    | _s6276_ =>
                                       (reg_name_matches_prefix _s6276_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6277_ _) =>
                                           (match (string_drop _s6276_ _s6277_) with
                                            | _s6278_ =>
                                               (sep_matches_prefix _s6278_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6279_ _) =>
                                                   (match (string_drop _s6278_ _s6279_) with
                                                    | _s6280_ =>
                                                       (frm_mnemonic_matches_prefix _s6280_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s6281_ _) =>
                                                                   match (string_drop _s6280_
                                                                            _s6281_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FCVT_S_W, rd, rs1, rm, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6249_ (_s6250_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6250_ with
    | _s6251_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s6251_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_WU_S, existT _ _s6252_ _) =>
           (match (string_drop _s6251_ _s6252_) with
            | _s6253_ =>
               (spc_matches_prefix _s6253_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6254_ _) =>
                   (match (string_drop _s6253_ _s6254_) with
                    | _s6255_ =>
                       (reg_name_matches_prefix _s6255_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6256_ _) =>
                           (match (string_drop _s6255_ _s6256_) with
                            | _s6257_ =>
                               (sep_matches_prefix _s6257_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6258_ _) =>
                                   (match (string_drop _s6257_ _s6258_) with
                                    | _s6259_ =>
                                       (freg_name_matches_prefix _s6259_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6260_ _) =>
                                           (match (string_drop _s6259_ _s6260_) with
                                            | _s6261_ =>
                                               (sep_matches_prefix _s6261_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6262_ _) =>
                                                   (match (string_drop _s6261_ _s6262_) with
                                                    | _s6263_ =>
                                                       (frm_mnemonic_matches_prefix _s6263_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s6264_ _) =>
                                                                   match (string_drop _s6263_
                                                                            _s6264_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FCVT_WU_S, rd, rs1, rm, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6232_ (_s6233_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6233_ with
    | _s6234_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s6234_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FCVT_W_S, existT _ _s6235_ _) =>
           (match (string_drop _s6234_ _s6235_) with
            | _s6236_ =>
               (spc_matches_prefix _s6236_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6237_ _) =>
                   (match (string_drop _s6236_ _s6237_) with
                    | _s6238_ =>
                       (reg_name_matches_prefix _s6238_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6239_ _) =>
                           (match (string_drop _s6238_ _s6239_) with
                            | _s6240_ =>
                               (sep_matches_prefix _s6240_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6241_ _) =>
                                   (match (string_drop _s6240_ _s6241_) with
                                    | _s6242_ =>
                                       (freg_name_matches_prefix _s6242_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6243_ _) =>
                                           (match (string_drop _s6242_ _s6243_) with
                                            | _s6244_ =>
                                               (sep_matches_prefix _s6244_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6245_ _) =>
                                                   (match (string_drop _s6244_ _s6245_) with
                                                    | _s6246_ =>
                                                       (frm_mnemonic_matches_prefix _s6246_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s6247_ _) =>
                                                                   match (string_drop _s6246_
                                                                            _s6247_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FCVT_W_S, rd, rs1, rm, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6215_ (_s6216_ : string)
: M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6216_ with
    | _s6217_ =>
       (f_un_rm_type_mnemonic_S_matches_prefix _s6217_) >>= fun w__0 : option ((f_un_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (FSQRT_S, existT _ _s6218_ _) =>
           (match (string_drop _s6217_ _s6218_) with
            | _s6219_ =>
               (spc_matches_prefix _s6219_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6220_ _) =>
                   (match (string_drop _s6219_ _s6220_) with
                    | _s6221_ =>
                       (freg_name_matches_prefix _s6221_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6222_ _) =>
                           (match (string_drop _s6221_ _s6222_) with
                            | _s6223_ =>
                               (sep_matches_prefix _s6223_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6224_ _) =>
                                   (match (string_drop _s6223_ _s6224_) with
                                    | _s6225_ =>
                                       (freg_name_matches_prefix _s6225_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6226_ _) =>
                                           (match (string_drop _s6225_ _s6226_) with
                                            | _s6227_ =>
                                               (sep_matches_prefix _s6227_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6228_ _) =>
                                                   (match (string_drop _s6227_ _s6228_) with
                                                    | _s6229_ =>
                                                       (frm_mnemonic_matches_prefix _s6229_) >>= fun w__6 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rm, existT _ _s6230_ _) =>
                                                                   match (string_drop _s6229_
                                                                            _s6230_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (FSQRT_S, rd, rs1, rm, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6194_ (_s6195_ : string)
: M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6195_ with
    | _s6196_ =>
       (f_bin_rm_type_mnemonic_S_matches_prefix _s6196_) >>= fun w__0 : option ((f_bin_rm_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s6197_ _) =>
           (match (string_drop _s6196_ _s6197_) with
            | _s6198_ =>
               (spc_matches_prefix _s6198_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6199_ _) =>
                   (match (string_drop _s6198_ _s6199_) with
                    | _s6200_ =>
                       (freg_name_matches_prefix _s6200_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6201_ _) =>
                           (match (string_drop _s6200_ _s6201_) with
                            | _s6202_ =>
                               (sep_matches_prefix _s6202_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6203_ _) =>
                                   (match (string_drop _s6202_ _s6203_) with
                                    | _s6204_ =>
                                       (freg_name_matches_prefix _s6204_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6205_ _) =>
                                           (match (string_drop _s6204_ _s6205_) with
                                            | _s6206_ =>
                                               (sep_matches_prefix _s6206_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6207_ _) =>
                                                   (match (string_drop _s6206_ _s6207_) with
                                                    | _s6208_ =>
                                                       (freg_name_matches_prefix _s6208_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       (match w__6 with
                                                        | Some (rs2, existT _ _s6209_ _) =>
                                                           (match (string_drop _s6208_ _s6209_) with
                                                            | _s6210_ =>
                                                               (sep_matches_prefix _s6210_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                 0)})) =>
                                                               (match w__7 with
                                                                | Some (tt, existT _ _s6211_ _) =>
                                                                   (match (string_drop _s6210_
                                                                             _s6211_) with
                                                                    | _s6212_ =>
                                                                       (frm_mnemonic_matches_prefix
                                                                          _s6212_) >>= fun w__8 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                                         0)})) =>
                                                                       returnm (match w__8 with
                                                                                | Some
                                                                                  (rm, existT _ _s6213_ _) =>
                                                                                   match (string_drop
                                                                                            _s6212_
                                                                                            _s6213_) with
                                                                                   | s_ =>
                                                                                      Some
                                                                                        (op, rd, rs1, rs2, rm, s_)
                                                                                   end
                                                                                | _ => None
                                                                                end)
                                                                    end)
                                                                    : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                                | _ => returnm None
                                                                end)
                                                                : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                            end)
                                                            : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                        | _ => returnm None
                                                        end)
                                                        : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                    end)
                                                    : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6169_ (_s6170_ : string)
: M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string))) :=
   (match _s6170_ with
    | _s6171_ =>
       (f_madd_type_mnemonic_S_matches_prefix _s6171_) >>= fun w__0 : option ((f_madd_op_S * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s6172_ _) =>
           (match (string_drop _s6171_ _s6172_) with
            | _s6173_ =>
               (spc_matches_prefix _s6173_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6174_ _) =>
                   (match (string_drop _s6173_ _s6174_) with
                    | _s6175_ =>
                       (freg_name_matches_prefix _s6175_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6176_ _) =>
                           (match (string_drop _s6175_ _s6176_) with
                            | _s6177_ =>
                               (sep_matches_prefix _s6177_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6178_ _) =>
                                   (match (string_drop _s6177_ _s6178_) with
                                    | _s6179_ =>
                                       (freg_name_matches_prefix _s6179_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s6180_ _) =>
                                           (match (string_drop _s6179_ _s6180_) with
                                            | _s6181_ =>
                                               (sep_matches_prefix _s6181_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6182_ _) =>
                                                   (match (string_drop _s6181_ _s6182_) with
                                                    | _s6183_ =>
                                                       (freg_name_matches_prefix _s6183_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       (match w__6 with
                                                        | Some (rs2, existT _ _s6184_ _) =>
                                                           (match (string_drop _s6183_ _s6184_) with
                                                            | _s6185_ =>
                                                               (sep_matches_prefix _s6185_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                 0)})) =>
                                                               (match w__7 with
                                                                | Some (tt, existT _ _s6186_ _) =>
                                                                   (match (string_drop _s6185_
                                                                             _s6186_) with
                                                                    | _s6187_ =>
                                                                       (freg_name_matches_prefix
                                                                          _s6187_) >>= fun w__8 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                         0)})) =>
                                                                       (match w__8 with
                                                                        | Some
                                                                          (rs3, existT _ _s6188_ _) =>
                                                                           (match (string_drop
                                                                                     _s6187_ _s6188_) with
                                                                            | _s6189_ =>
                                                                               (sep_matches_prefix
                                                                                  _s6189_) >>= fun w__9 : option ((unit * {n : Z & ArithFact (n >=?
                                                                                 0)})) =>
                                                                               (match w__9 with
                                                                                | Some
                                                                                  (tt, existT _ _s6190_ _) =>
                                                                                   (match (string_drop
                                                                                             _s6189_
                                                                                             _s6190_) with
                                                                                    | _s6191_ =>
                                                                                       (frm_mnemonic_matches_prefix
                                                                                          _s6191_) >>= fun w__10 : option ((rounding_mode * {n : Z & ArithFact (n >=?
                                                                                         0)})) =>
                                                                                       returnm (match w__10 with
                                                                                                | Some
                                                                                                  (rm, existT _ _s6192_ _) =>
                                                                                                   match (string_drop
                                                                                                            _s6191_
                                                                                                            _s6192_) with
                                                                                                   | s_ =>
                                                                                                      Some
                                                                                                        (op, rd, rs1, rs2, rs3, rm, s_)
                                                                                                   end
                                                                                                | _ =>
                                                                                                   None
                                                                                                end)
                                                                                    end)
                                                                                    : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                                                | _ => returnm None
                                                                                end)
                                                                                : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                                            end)
                                                                            : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                                        | _ => returnm None
                                                                        end)
                                                                        : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                                    end)
                                                                    : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                                | _ => returnm None
                                                                end)
                                                                : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                            end)
                                                            : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                        | _ => returnm None
                                                        end)
                                                        : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                    end)
                                                    : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                            end)
                                            : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                    end)
                                    : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                                | _ => returnm None
                                end)
                                : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                            end)
                            : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                        | _ => returnm None
                        end)
                        : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                    end)
                    : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
                | _ => returnm None
                end)
                : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
            end)
            : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
        | _ => returnm None
        end)
        : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)))
    end)
    : M (option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string))).

Definition _s6145_ (_s6146_ : string)
: M (option ((word_width * mword 5 * mword 12 * mword 5 * string))) :=
   let _s6147_ := _s6146_ in
   (if string_startswith _s6147_ "fs" then
      (match (string_drop _s6147_ (projT1 (string_length "fs"))) with
       | _s6148_ =>
          (size_mnemonic_matches_prefix _s6148_) >>= fun w__0 : option ((word_width * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (width, existT _ _s6149_ _) =>
              (match (string_drop _s6148_ _s6149_) with
               | _s6150_ =>
                  (spc_matches_prefix _s6150_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (tt, existT _ _s6151_ _) =>
                      (match (string_drop _s6150_ _s6151_) with
                       | _s6152_ =>
                          (freg_name_matches_prefix _s6152_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rs2, existT _ _s6153_ _) =>
                              (match (string_drop _s6152_ _s6153_) with
                               | _s6154_ =>
                                  (sep_matches_prefix _s6154_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s6155_ _) =>
                                      (match (string_drop _s6154_ _s6155_) with
                                       | _s6156_ =>
                                          (match (hex_bits_12_matches_prefix _s6156_) with
                                           | Some (imm, existT _ _s6157_ _) =>
                                              (match (string_drop _s6156_ _s6157_) with
                                               | _s6158_ =>
                                                  (opt_spc_matches_prefix _s6158_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__4 with
                                                   | Some (tt, existT _ _s6159_ _) =>
                                                      let _s6160_ := string_drop _s6158_ _s6159_ in
                                                      (if string_startswith _s6160_ "(" then
                                                         (match (string_drop _s6160_
                                                                   (projT1
                                                                    (string_length "("))) with
                                                          | _s6161_ =>
                                                             (opt_spc_matches_prefix _s6161_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                               0)})) =>
                                                             (match w__5 with
                                                              | Some (tt, existT _ _s6162_ _) =>
                                                                 (match (string_drop _s6161_ _s6162_) with
                                                                  | _s6163_ =>
                                                                     (reg_name_matches_prefix
                                                                        _s6163_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                       0)})) =>
                                                                     (match w__6 with
                                                                      | Some
                                                                        (rs1, existT _ _s6164_ _) =>
                                                                         (match (string_drop _s6163_
                                                                                   _s6164_) with
                                                                          | _s6165_ =>
                                                                             (opt_spc_matches_prefix
                                                                                _s6165_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                               0)})) =>
                                                                             returnm (match w__7 with
                                                                                      | Some
                                                                                        (tt, existT _ _s6166_ _) =>
                                                                                         let _s6167_ :=
                                                                                           string_drop
                                                                                             _s6165_
                                                                                             _s6166_ in
                                                                                         if string_startswith
                                                                                              _s6167_
                                                                                              ")"
                                                                                         then
                                                                                           match (string_drop
                                                                                                    _s6167_
                                                                                                    (projT1
                                                                                                     (string_length
                                                                                                        ")"))) with
                                                                                           | s_ =>
                                                                                              Some
                                                                                                (width, rs2, imm, rs1, s_)
                                                                                           end
                                                                                         else None
                                                                                      | _ => None
                                                                                      end)
                                                                          end)
                                                                          : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                                                                      | _ => returnm None
                                                                      end)
                                                                      : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                                                                  end)
                                                                  : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                                                              | _ => returnm None
                                                              end)
                                                              : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                                                          end)
                                                          : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                                                       else returnm None)
                                                       : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                                               end)
                                               : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                                       end)
                                       : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                               end)
                               : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                       end)
                       : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
               end)
               : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
       end)
       : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
    else returnm None)
    : M (option ((word_width * mword 5 * mword 12 * mword 5 * string))).

Definition _s6121_ (_s6122_ : string)
: M (option ((word_width * mword 5 * mword 12 * mword 5 * string))) :=
   let _s6123_ := _s6122_ in
   (if string_startswith _s6123_ "fl" then
      (match (string_drop _s6123_ (projT1 (string_length "fl"))) with
       | _s6124_ =>
          (size_mnemonic_matches_prefix _s6124_) >>= fun w__0 : option ((word_width * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (width, existT _ _s6125_ _) =>
              (match (string_drop _s6124_ _s6125_) with
               | _s6126_ =>
                  (spc_matches_prefix _s6126_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (tt, existT _ _s6127_ _) =>
                      (match (string_drop _s6126_ _s6127_) with
                       | _s6128_ =>
                          (freg_name_matches_prefix _s6128_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rd, existT _ _s6129_ _) =>
                              (match (string_drop _s6128_ _s6129_) with
                               | _s6130_ =>
                                  (sep_matches_prefix _s6130_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s6131_ _) =>
                                      (match (string_drop _s6130_ _s6131_) with
                                       | _s6132_ =>
                                          (match (hex_bits_12_matches_prefix _s6132_) with
                                           | Some (imm, existT _ _s6133_ _) =>
                                              (match (string_drop _s6132_ _s6133_) with
                                               | _s6134_ =>
                                                  (opt_spc_matches_prefix _s6134_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__4 with
                                                   | Some (tt, existT _ _s6135_ _) =>
                                                      let _s6136_ := string_drop _s6134_ _s6135_ in
                                                      (if string_startswith _s6136_ "(" then
                                                         (match (string_drop _s6136_
                                                                   (projT1
                                                                    (string_length "("))) with
                                                          | _s6137_ =>
                                                             (opt_spc_matches_prefix _s6137_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                               0)})) =>
                                                             (match w__5 with
                                                              | Some (tt, existT _ _s6138_ _) =>
                                                                 (match (string_drop _s6137_ _s6138_) with
                                                                  | _s6139_ =>
                                                                     (reg_name_matches_prefix
                                                                        _s6139_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                       0)})) =>
                                                                     (match w__6 with
                                                                      | Some
                                                                        (rs1, existT _ _s6140_ _) =>
                                                                         (match (string_drop _s6139_
                                                                                   _s6140_) with
                                                                          | _s6141_ =>
                                                                             (opt_spc_matches_prefix
                                                                                _s6141_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                               0)})) =>
                                                                             returnm (match w__7 with
                                                                                      | Some
                                                                                        (tt, existT _ _s6142_ _) =>
                                                                                         let _s6143_ :=
                                                                                           string_drop
                                                                                             _s6141_
                                                                                             _s6142_ in
                                                                                         if string_startswith
                                                                                              _s6143_
                                                                                              ")"
                                                                                         then
                                                                                           match (string_drop
                                                                                                    _s6143_
                                                                                                    (projT1
                                                                                                     (string_length
                                                                                                        ")"))) with
                                                                                           | s_ =>
                                                                                              Some
                                                                                                (width, rd, imm, rs1, s_)
                                                                                           end
                                                                                         else None
                                                                                      | _ => None
                                                                                      end)
                                                                          end)
                                                                          : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                                                                      | _ => returnm None
                                                                      end)
                                                                      : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                                                                  end)
                                                                  : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                                                              | _ => returnm None
                                                              end)
                                                              : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                                                          end)
                                                          : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                                                       else returnm None)
                                                       : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                                               end)
                                               : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                                       end)
                                       : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                               end)
                               : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                       end)
                       : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
               end)
               : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
       end)
       : M (option ((word_width * mword 5 * mword 12 * mword 5 * string)))
    else returnm None)
    : M (option ((word_width * mword 5 * mword 12 * mword 5 * string))).

Definition _s6109_ (_s6110_ : string) : M (option ((mword 5 * mword 5 * mword 12 * string))) :=
   let _s6111_ := _s6110_ in
   (if string_startswith _s6111_ "fence.i.reserved." then
      (match (string_drop _s6111_ (projT1 (string_length "fence.i.reserved."))) with
       | _s6112_ =>
          (reg_name_matches_prefix _s6112_) >>= fun w__0 : option ((mword 5 * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (rd, existT _ _s6113_ _) =>
              let _s6114_ := string_drop _s6112_ _s6113_ in
              (if string_startswith _s6114_ "." then
                 (match (string_drop _s6114_ (projT1 (string_length "."))) with
                  | _s6115_ =>
                     (reg_name_matches_prefix _s6115_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                       0)})) =>
                     returnm (match w__1 with
                              | Some (rs, existT _ _s6116_ _) =>
                                 let _s6117_ := string_drop _s6115_ _s6116_ in
                                 if string_startswith _s6117_ "." then
                                   match (string_drop _s6117_ (projT1 (string_length "."))) with
                                   | _s6118_ =>
                                      match (hex_bits_12_matches_prefix _s6118_) with
                                      | Some (imm, existT _ _s6119_ _) =>
                                         match (string_drop _s6118_ _s6119_) with
                                         | s_ => Some (rd, rs, imm, s_)
                                         end
                                      | _ => None
                                      end
                                   end
                                 else None
                              | _ => None
                              end)
                  end)
                  : M (option ((mword 5 * mword 5 * mword 12 * string)))
               else returnm None)
               : M (option ((mword 5 * mword 5 * mword 12 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5 * mword 12 * string)))
       end)
       : M (option ((mword 5 * mword 5 * mword 12 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 5 * mword 12 * string))).

Definition _s6091_ (_s6092_ : string)
: M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4 * string))) :=
   let _s6093_ := _s6092_ in
   (if string_startswith _s6093_ "fence.reserved." then
      (match (string_drop _s6093_ (projT1 (string_length "fence.reserved."))) with
       | _s6094_ =>
          (fence_bits_matches_prefix _s6094_) >>= fun w__0 : option ((mword 4 * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (pred, existT _ _s6095_ _) =>
              let _s6096_ := string_drop _s6094_ _s6095_ in
              (if string_startswith _s6096_ "." then
                 (match (string_drop _s6096_ (projT1 (string_length "."))) with
                  | _s6097_ =>
                     (fence_bits_matches_prefix _s6097_) >>= fun w__1 : option ((mword 4 * {n : Z & ArithFact (n >=?
                       0)})) =>
                     (match w__1 with
                      | Some (succ, existT _ _s6098_ _) =>
                         let _s6099_ := string_drop _s6097_ _s6098_ in
                         (if string_startswith _s6099_ "." then
                            (match (string_drop _s6099_ (projT1 (string_length "."))) with
                             | _s6100_ =>
                                (reg_name_matches_prefix _s6100_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                  0)})) =>
                                (match w__2 with
                                 | Some (rs, existT _ _s6101_ _) =>
                                    let _s6102_ := string_drop _s6100_ _s6101_ in
                                    (if string_startswith _s6102_ "." then
                                       (match (string_drop _s6102_ (projT1 (string_length "."))) with
                                        | _s6103_ =>
                                           (reg_name_matches_prefix _s6103_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                             0)})) =>
                                           returnm (match w__3 with
                                                    | Some (rd, existT _ _s6104_ _) =>
                                                       let _s6105_ := string_drop _s6103_ _s6104_ in
                                                       if string_startswith _s6105_ "." then
                                                         match (string_drop _s6105_
                                                                  (projT1
                                                                   (string_length "."))) with
                                                         | _s6106_ =>
                                                            match (hex_bits_4_matches_prefix _s6106_) with
                                                            | Some (fm, existT _ _s6107_ _) =>
                                                               match (string_drop _s6106_ _s6107_) with
                                                               | s_ =>
                                                                  Some (pred, succ, rs, rd, fm, s_)
                                                               end
                                                            | _ => None
                                                            end
                                                         end
                                                       else None
                                                    | _ => None
                                                    end)
                                        end)
                                        : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4 * string)))
                                     else returnm None)
                                     : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4 * string)))
                                 | _ => returnm None
                                 end)
                                 : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4 * string)))
                             end)
                             : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4 * string)))
                          else returnm None)
                          : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4 * string)))
                      | _ => returnm None
                      end)
                      : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4 * string)))
                  end)
                  : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4 * string)))
               else returnm None)
               : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4 * string)))
       end)
       : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4 * string)))
    else returnm None)
    : M (option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4 * string))).

Definition _s6085_ (_s6086_ : string) : M (option ((mword 3 * string))) :=
   let _s6087_ := _s6086_ in
   (if string_startswith _s6087_ "c.srai.hint." then
      (match (string_drop _s6087_ (projT1 (string_length "c.srai.hint."))) with
       | _s6088_ =>
          (creg_name_matches_prefix _s6088_) >>= fun w__0 : option ((mword 3 * {n : Z & ArithFact (n >=?
            0)})) =>
          returnm (match w__0 with
                   | Some (rsd, existT _ _s6089_ _) =>
                      match (string_drop _s6088_ _s6089_) with | s_ => Some (rsd, s_) end
                   | _ => None
                   end)
       end)
       : M (option ((mword 3 * string)))
    else returnm None)
    : M (option ((mword 3 * string))).

Definition _s6079_ (_s6080_ : string) : M (option ((mword 3 * string))) :=
   let _s6081_ := _s6080_ in
   (if string_startswith _s6081_ "c.srli.hint." then
      (match (string_drop _s6081_ (projT1 (string_length "c.srli.hint."))) with
       | _s6082_ =>
          (creg_name_matches_prefix _s6082_) >>= fun w__0 : option ((mword 3 * {n : Z & ArithFact (n >=?
            0)})) =>
          returnm (match w__0 with
                   | Some (rsd, existT _ _s6083_ _) =>
                      match (string_drop _s6082_ _s6083_) with | s_ => Some (rsd, s_) end
                   | _ => None
                   end)
       end)
       : M (option ((mword 3 * string)))
    else returnm None)
    : M (option ((mword 3 * string))).

Definition _s6070_ (_s6071_ : string) : M (option ((mword 5 * mword 6 * string))) :=
   let _s6072_ := _s6071_ in
   (if string_startswith _s6072_ "c.slli.hint." then
      (match (string_drop _s6072_ (projT1 (string_length "c.slli.hint."))) with
       | _s6073_ =>
          (reg_name_matches_prefix _s6073_) >>= fun w__0 : option ((mword 5 * {n : Z & ArithFact (n >=?
            0)})) =>
          returnm (match w__0 with
                   | Some (rsd, existT _ _s6074_ _) =>
                      let _s6075_ := string_drop _s6073_ _s6074_ in
                      if string_startswith _s6075_ "." then
                        match (string_drop _s6075_ (projT1 (string_length "."))) with
                        | _s6076_ =>
                           match (hex_bits_6_matches_prefix _s6076_) with
                           | Some (shamt, existT _ _s6077_ _) =>
                              match (string_drop _s6076_ _s6077_) with
                              | s_ => Some (rsd, shamt, s_)
                              end
                           | _ => None
                           end
                        end
                      else None
                   | _ => None
                   end)
       end)
       : M (option ((mword 5 * mword 6 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 6 * string))).

Definition _s6064_ (_s6065_ : string) : M (option ((mword 5 * string))) :=
   let _s6066_ := _s6065_ in
   (if string_startswith _s6066_ "c.add.hint." then
      (match (string_drop _s6066_ (projT1 (string_length "c.add.hint."))) with
       | _s6067_ =>
          (reg_name_matches_prefix _s6067_) >>= fun w__0 : option ((mword 5 * {n : Z & ArithFact (n >=?
            0)})) =>
          returnm (match w__0 with
                   | Some (rs2, existT _ _s6068_ _) =>
                      match (string_drop _s6067_ _s6068_) with | s_ => Some (rs2, s_) end
                   | _ => None
                   end)
       end)
       : M (option ((mword 5 * string)))
    else returnm None)
    : M (option ((mword 5 * string))).

Definition _s6058_ (_s6059_ : string) : M (option ((mword 5 * string))) :=
   let _s6060_ := _s6059_ in
   (if string_startswith _s6060_ "c.mv.hint." then
      (match (string_drop _s6060_ (projT1 (string_length "c.mv.hint."))) with
       | _s6061_ =>
          (reg_name_matches_prefix _s6061_) >>= fun w__0 : option ((mword 5 * {n : Z & ArithFact (n >=?
            0)})) =>
          returnm (match w__0 with
                   | Some (rs2, existT _ _s6062_ _) =>
                      match (string_drop _s6061_ _s6062_) with | s_ => Some (rs2, s_) end
                   | _ => None
                   end)
       end)
       : M (option ((mword 5 * string)))
    else returnm None)
    : M (option ((mword 5 * string))).

Definition _s6052_ (_s6053_ : string) : option ((mword 6 * string)) :=
   let _s6054_ := _s6053_ in
   if string_startswith _s6054_ "c.lui.hint." then
     match (string_drop _s6054_ (projT1 (string_length "c.lui.hint."))) with
     | _s6055_ =>
        match (hex_bits_6_matches_prefix _s6055_) with
        | Some (imm, existT _ _s6056_ _) =>
           match (string_drop _s6055_ _s6056_) with | s_ => Some (imm, s_) end
        | _ => None
        end
     end
   else None.

Definition _s6046_ (_s6047_ : string) : option ((mword 6 * string)) :=
   let _s6048_ := _s6047_ in
   if string_startswith _s6048_ "c.li.hint." then
     match (string_drop _s6048_ (projT1 (string_length "c.li.hint."))) with
     | _s6049_ =>
        match (hex_bits_6_matches_prefix _s6049_) with
        | Some (imm, existT _ _s6050_ _) =>
           match (string_drop _s6049_ _s6050_) with | s_ => Some (imm, s_) end
        | _ => None
        end
     end
   else None.

Definition _s6040_ (_s6041_ : string) : M (option ((mword 5 * string))) :=
   let _s6042_ := _s6041_ in
   (if string_startswith _s6042_ "c.addi.hint." then
      (match (string_drop _s6042_ (projT1 (string_length "c.addi.hint."))) with
       | _s6043_ =>
          (reg_name_matches_prefix _s6043_) >>= fun w__0 : option ((mword 5 * {n : Z & ArithFact (n >=?
            0)})) =>
          returnm (match w__0 with
                   | Some (rsd, existT _ _s6044_ _) =>
                      match (string_drop _s6043_ _s6044_) with | s_ => Some (rsd, s_) end
                   | _ => None
                   end)
       end)
       : M (option ((mword 5 * string)))
    else returnm None)
    : M (option ((mword 5 * string))).

Definition _s6034_ (_s6035_ : string) : option ((mword 6 * string)) :=
   let _s6036_ := _s6035_ in
   if string_startswith _s6036_ "c.nop.hint." then
     match (string_drop _s6036_ (projT1 (string_length "c.nop.hint."))) with
     | _s6037_ =>
        match (hex_bits_6_matches_prefix _s6037_) with
        | Some (imm, existT _ _s6038_ _) =>
           match (string_drop _s6037_ _s6038_) with | s_ => Some (imm, s_) end
        | _ => None
        end
     end
   else None.

Definition _s6030_ (_s6031_ : string) : option string :=
   let _s6032_ := _s6031_ in
   if string_startswith _s6032_ "uret" then
     match (string_drop _s6032_ (projT1 (string_length "uret"))) with | s_ => Some s_ end
   else None.

Definition _s6013_ (_s6014_ : string) : M (option ((csrop * mword 5 * mword 12 * mword 5 * string))) :=
   (match _s6014_ with
    | _s6015_ =>
       (csr_mnemonic_matches_prefix _s6015_) >>= fun w__0 : option ((csrop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s6016_ _) =>
           (match (string_drop _s6015_ _s6016_) with
            | _s6017_ =>
               (spc_matches_prefix _s6017_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s6018_ _) =>
                   (match (string_drop _s6017_ _s6018_) with
                    | _s6019_ =>
                       (reg_name_matches_prefix _s6019_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s6020_ _) =>
                           (match (string_drop _s6019_ _s6020_) with
                            | _s6021_ =>
                               (sep_matches_prefix _s6021_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s6022_ _) =>
                                   (match (string_drop _s6021_ _s6022_) with
                                    | _s6023_ =>
                                       (csr_name_map_matches_prefix _s6023_) >>= fun w__4 : option ((mword 12 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (csr, existT _ _s6024_ _) =>
                                           (match (string_drop _s6023_ _s6024_) with
                                            | _s6025_ =>
                                               (sep_matches_prefix _s6025_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s6026_ _) =>
                                                   (match (string_drop _s6025_ _s6026_) with
                                                    | _s6027_ =>
                                                       (reg_name_matches_prefix _s6027_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs1, existT _ _s6028_ _) =>
                                                                   match (string_drop _s6027_
                                                                            _s6028_) with
                                                                   | s_ =>
                                                                      Some (op, rd, csr, rs1, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
                                            end)
                                            : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
                                    end)
                                    : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
                            end)
                            : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
                    end)
                    : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
            end)
            : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
    end)
    : M (option ((csrop * mword 5 * mword 12 * mword 5 * string))).

Definition _s5995_ (_s5996_ : string) : M (option ((csrop * mword 5 * mword 12 * mword 5 * string))) :=
   (match _s5996_ with
    | _s5997_ =>
       (csr_mnemonic_matches_prefix _s5997_) >>= fun w__0 : option ((csrop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s5998_ _) =>
           let _s5999_ := string_drop _s5997_ _s5998_ in
           (if string_startswith _s5999_ "i" then
              (match (string_drop _s5999_ (projT1 (string_length "i"))) with
               | _s6000_ =>
                  (spc_matches_prefix _s6000_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (tt, existT _ _s6001_ _) =>
                      (match (string_drop _s6000_ _s6001_) with
                       | _s6002_ =>
                          (reg_name_matches_prefix _s6002_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rd, existT _ _s6003_ _) =>
                              (match (string_drop _s6002_ _s6003_) with
                               | _s6004_ =>
                                  (sep_matches_prefix _s6004_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s6005_ _) =>
                                      (match (string_drop _s6004_ _s6005_) with
                                       | _s6006_ =>
                                          (csr_name_map_matches_prefix _s6006_) >>= fun w__4 : option ((mword 12 * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (csr, existT _ _s6007_ _) =>
                                              (match (string_drop _s6006_ _s6007_) with
                                               | _s6008_ =>
                                                  (sep_matches_prefix _s6008_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  returnm (match w__5 with
                                                           | Some (tt, existT _ _s6009_ _) =>
                                                              match (string_drop _s6008_ _s6009_) with
                                                              | _s6010_ =>
                                                                 match (hex_bits_5_matches_prefix
                                                                          _s6010_) with
                                                                 | Some (rs1, existT _ _s6011_ _) =>
                                                                    match (string_drop _s6010_
                                                                             _s6011_) with
                                                                    | s_ =>
                                                                       Some (op, rd, csr, rs1, s_)
                                                                    end
                                                                 | _ => None
                                                                 end
                                                              end
                                                           | _ => None
                                                           end)
                                               end)
                                               : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
                                       end)
                                       : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
                               end)
                               : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
                       end)
                       : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
               end)
               : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
            else returnm None)
            : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((csrop * mword 5 * mword 12 * mword 5 * string)))
    end)
    : M (option ((csrop * mword 5 * mword 12 * mword 5 * string))).

Definition _s5976_ (_s5977_ : string) : M (option ((bool * mword 5 * mword 5 * mword 5 * string))) :=
   let _s5978_ := _s5977_ in
   (if string_startswith _s5978_ "rem" then
      (match (string_drop _s5978_ (projT1 (string_length "rem"))) with
       | _s5979_ =>
          (maybe_not_u_matches_prefix _s5979_) >>= fun w__0 : option ((bool * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (s, existT _ _s5980_ _) =>
              let _s5981_ := string_drop _s5979_ _s5980_ in
              (if string_startswith _s5981_ "w" then
                 (match (string_drop _s5981_ (projT1 (string_length "w"))) with
                  | _s5982_ =>
                     (spc_matches_prefix _s5982_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                       0)})) =>
                     (match w__1 with
                      | Some (tt, existT _ _s5983_ _) =>
                         (match (string_drop _s5982_ _s5983_) with
                          | _s5984_ =>
                             (reg_name_matches_prefix _s5984_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                               0)})) =>
                             (match w__2 with
                              | Some (rd, existT _ _s5985_ _) =>
                                 (match (string_drop _s5984_ _s5985_) with
                                  | _s5986_ =>
                                     (sep_matches_prefix _s5986_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                       0)})) =>
                                     (match w__3 with
                                      | Some (tt, existT _ _s5987_ _) =>
                                         (match (string_drop _s5986_ _s5987_) with
                                          | _s5988_ =>
                                             (reg_name_matches_prefix _s5988_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                               0)})) =>
                                             (match w__4 with
                                              | Some (rs1, existT _ _s5989_ _) =>
                                                 (match (string_drop _s5988_ _s5989_) with
                                                  | _s5990_ =>
                                                     (sep_matches_prefix _s5990_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                       0)})) =>
                                                     (match w__5 with
                                                      | Some (tt, existT _ _s5991_ _) =>
                                                         (match (string_drop _s5990_ _s5991_) with
                                                          | _s5992_ =>
                                                             (reg_name_matches_prefix _s5992_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                               0)})) =>
                                                             returnm (match w__6 with
                                                                      | Some
                                                                        (rs2, existT _ _s5993_ _) =>
                                                                         match (string_drop _s5992_
                                                                                  _s5993_) with
                                                                         | s_ =>
                                                                            Some
                                                                              (s, rd, rs1, rs2, s_)
                                                                         end
                                                                      | _ => None
                                                                      end)
                                                          end)
                                                          : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                                      | _ => returnm None
                                                      end)
                                                      : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                                  end)
                                                  : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                              | _ => returnm None
                                              end)
                                              : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                          end)
                                          : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                      | _ => returnm None
                                      end)
                                      : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                  end)
                                  : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                              | _ => returnm None
                              end)
                              : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                          end)
                          : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                      | _ => returnm None
                      end)
                      : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                  end)
                  : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
               else returnm None)
               : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
       end)
       : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
    else returnm None)
    : M (option ((bool * mword 5 * mword 5 * mword 5 * string))).

Definition _s5957_ (_s5958_ : string) : M (option ((bool * mword 5 * mword 5 * mword 5 * string))) :=
   let _s5959_ := _s5958_ in
   (if string_startswith _s5959_ "div" then
      (match (string_drop _s5959_ (projT1 (string_length "div"))) with
       | _s5960_ =>
          (maybe_not_u_matches_prefix _s5960_) >>= fun w__0 : option ((bool * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (s, existT _ _s5961_ _) =>
              let _s5962_ := string_drop _s5960_ _s5961_ in
              (if string_startswith _s5962_ "w" then
                 (match (string_drop _s5962_ (projT1 (string_length "w"))) with
                  | _s5963_ =>
                     (spc_matches_prefix _s5963_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                       0)})) =>
                     (match w__1 with
                      | Some (tt, existT _ _s5964_ _) =>
                         (match (string_drop _s5963_ _s5964_) with
                          | _s5965_ =>
                             (reg_name_matches_prefix _s5965_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                               0)})) =>
                             (match w__2 with
                              | Some (rd, existT _ _s5966_ _) =>
                                 (match (string_drop _s5965_ _s5966_) with
                                  | _s5967_ =>
                                     (sep_matches_prefix _s5967_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                       0)})) =>
                                     (match w__3 with
                                      | Some (tt, existT _ _s5968_ _) =>
                                         (match (string_drop _s5967_ _s5968_) with
                                          | _s5969_ =>
                                             (reg_name_matches_prefix _s5969_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                               0)})) =>
                                             (match w__4 with
                                              | Some (rs1, existT _ _s5970_ _) =>
                                                 (match (string_drop _s5969_ _s5970_) with
                                                  | _s5971_ =>
                                                     (sep_matches_prefix _s5971_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                       0)})) =>
                                                     (match w__5 with
                                                      | Some (tt, existT _ _s5972_ _) =>
                                                         (match (string_drop _s5971_ _s5972_) with
                                                          | _s5973_ =>
                                                             (reg_name_matches_prefix _s5973_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                               0)})) =>
                                                             returnm (match w__6 with
                                                                      | Some
                                                                        (rs2, existT _ _s5974_ _) =>
                                                                         match (string_drop _s5973_
                                                                                  _s5974_) with
                                                                         | s_ =>
                                                                            Some
                                                                              (s, rd, rs1, rs2, s_)
                                                                         end
                                                                      | _ => None
                                                                      end)
                                                          end)
                                                          : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                                      | _ => returnm None
                                                      end)
                                                      : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                                  end)
                                                  : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                              | _ => returnm None
                                              end)
                                              : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                          end)
                                          : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                      | _ => returnm None
                                      end)
                                      : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                  end)
                                  : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                              | _ => returnm None
                              end)
                              : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                          end)
                          : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                      | _ => returnm None
                      end)
                      : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                  end)
                  : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
               else returnm None)
               : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
       end)
       : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
    else returnm None)
    : M (option ((bool * mword 5 * mword 5 * mword 5 * string))).

Definition _s5941_ (_s5942_ : string) : M (option ((mword 5 * mword 5 * mword 5 * string))) :=
   let _s5943_ := _s5942_ in
   (if string_startswith _s5943_ "mulw" then
      (match (string_drop _s5943_ (projT1 (string_length "mulw"))) with
       | _s5944_ =>
          (spc_matches_prefix _s5944_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5945_ _) =>
              (match (string_drop _s5944_ _s5945_) with
               | _s5946_ =>
                  (reg_name_matches_prefix _s5946_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s5947_ _) =>
                      (match (string_drop _s5946_ _s5947_) with
                       | _s5948_ =>
                          (sep_matches_prefix _s5948_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s5949_ _) =>
                              (match (string_drop _s5948_ _s5949_) with
                               | _s5950_ =>
                                  (reg_name_matches_prefix _s5950_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rs1, existT _ _s5951_ _) =>
                                      (match (string_drop _s5950_ _s5951_) with
                                       | _s5952_ =>
                                          (sep_matches_prefix _s5952_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (tt, existT _ _s5953_ _) =>
                                              (match (string_drop _s5952_ _s5953_) with
                                               | _s5954_ =>
                                                  (reg_name_matches_prefix _s5954_) >>= fun w__5 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  returnm (match w__5 with
                                                           | Some (rs2, existT _ _s5955_ _) =>
                                                              match (string_drop _s5954_ _s5955_) with
                                                              | s_ => Some (rd, rs1, rs2, s_)
                                                              end
                                                           | _ => None
                                                           end)
                                               end)
                                               : M (option ((mword 5 * mword 5 * mword 5 * string)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((mword 5 * mword 5 * mword 5 * string)))
                                       end)
                                       : M (option ((mword 5 * mword 5 * mword 5 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 5 * mword 5 * mword 5 * string)))
                               end)
                               : M (option ((mword 5 * mword 5 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 5 * mword 5 * mword 5 * string)))
                       end)
                       : M (option ((mword 5 * mword 5 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 5 * mword 5 * string)))
               end)
               : M (option ((mword 5 * mword 5 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5 * mword 5 * string)))
       end)
       : M (option ((mword 5 * mword 5 * mword 5 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 5 * mword 5 * string))).

Definition _s5923_ (_s5924_ : string) : M (option ((bool * mword 5 * mword 5 * mword 5 * string))) :=
   let _s5925_ := _s5924_ in
   (if string_startswith _s5925_ "rem" then
      (match (string_drop _s5925_ (projT1 (string_length "rem"))) with
       | _s5926_ =>
          (maybe_not_u_matches_prefix _s5926_) >>= fun w__0 : option ((bool * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (s, existT _ _s5927_ _) =>
              (match (string_drop _s5926_ _s5927_) with
               | _s5928_ =>
                  (spc_matches_prefix _s5928_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (tt, existT _ _s5929_ _) =>
                      (match (string_drop _s5928_ _s5929_) with
                       | _s5930_ =>
                          (reg_name_matches_prefix _s5930_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rd, existT _ _s5931_ _) =>
                              (match (string_drop _s5930_ _s5931_) with
                               | _s5932_ =>
                                  (sep_matches_prefix _s5932_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s5933_ _) =>
                                      (match (string_drop _s5932_ _s5933_) with
                                       | _s5934_ =>
                                          (reg_name_matches_prefix _s5934_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (rs1, existT _ _s5935_ _) =>
                                              (match (string_drop _s5934_ _s5935_) with
                                               | _s5936_ =>
                                                  (sep_matches_prefix _s5936_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (tt, existT _ _s5937_ _) =>
                                                      (match (string_drop _s5936_ _s5937_) with
                                                       | _s5938_ =>
                                                          (reg_name_matches_prefix _s5938_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                            0)})) =>
                                                          returnm (match w__6 with
                                                                   | Some (rs2, existT _ _s5939_ _) =>
                                                                      match (string_drop _s5938_
                                                                               _s5939_) with
                                                                      | s_ =>
                                                                         Some (s, rd, rs1, rs2, s_)
                                                                      end
                                                                   | _ => None
                                                                   end)
                                                       end)
                                                       : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                               end)
                                               : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                       end)
                                       : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                               end)
                               : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                       end)
                       : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
               end)
               : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
       end)
       : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
    else returnm None)
    : M (option ((bool * mword 5 * mword 5 * mword 5 * string))).

Definition _s5905_ (_s5906_ : string) : M (option ((bool * mword 5 * mword 5 * mword 5 * string))) :=
   let _s5907_ := _s5906_ in
   (if string_startswith _s5907_ "div" then
      (match (string_drop _s5907_ (projT1 (string_length "div"))) with
       | _s5908_ =>
          (maybe_not_u_matches_prefix _s5908_) >>= fun w__0 : option ((bool * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (s, existT _ _s5909_ _) =>
              (match (string_drop _s5908_ _s5909_) with
               | _s5910_ =>
                  (spc_matches_prefix _s5910_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (tt, existT _ _s5911_ _) =>
                      (match (string_drop _s5910_ _s5911_) with
                       | _s5912_ =>
                          (reg_name_matches_prefix _s5912_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rd, existT _ _s5913_ _) =>
                              (match (string_drop _s5912_ _s5913_) with
                               | _s5914_ =>
                                  (sep_matches_prefix _s5914_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s5915_ _) =>
                                      (match (string_drop _s5914_ _s5915_) with
                                       | _s5916_ =>
                                          (reg_name_matches_prefix _s5916_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (rs1, existT _ _s5917_ _) =>
                                              (match (string_drop _s5916_ _s5917_) with
                                               | _s5918_ =>
                                                  (sep_matches_prefix _s5918_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (tt, existT _ _s5919_ _) =>
                                                      (match (string_drop _s5918_ _s5919_) with
                                                       | _s5920_ =>
                                                          (reg_name_matches_prefix _s5920_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                            0)})) =>
                                                          returnm (match w__6 with
                                                                   | Some (rs2, existT _ _s5921_ _) =>
                                                                      match (string_drop _s5920_
                                                                               _s5921_) with
                                                                      | s_ =>
                                                                         Some (s, rd, rs1, rs2, s_)
                                                                      end
                                                                   | _ => None
                                                                   end)
                                                       end)
                                                       : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                               end)
                                               : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                       end)
                                       : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                               end)
                               : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                       end)
                       : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
               end)
               : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
       end)
       : M (option ((bool * mword 5 * mword 5 * mword 5 * string)))
    else returnm None)
    : M (option ((bool * mword 5 * mword 5 * mword 5 * string))).

Definition _s5888_ (_s5889_ : string)
: M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s5889_ with
    | _s5890_ =>
       (mul_mnemonic_matches_prefix _s5890_) >>= fun w__0 : option (((bool * bool * bool) * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some ((high, signed1, signed2), existT _ _s5891_ _) =>
           (match (string_drop _s5890_ _s5891_) with
            | _s5892_ =>
               (spc_matches_prefix _s5892_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s5893_ _) =>
                   (match (string_drop _s5892_ _s5893_) with
                    | _s5894_ =>
                       (reg_name_matches_prefix _s5894_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s5895_ _) =>
                           (match (string_drop _s5894_ _s5895_) with
                            | _s5896_ =>
                               (sep_matches_prefix _s5896_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s5897_ _) =>
                                   (match (string_drop _s5896_ _s5897_) with
                                    | _s5898_ =>
                                       (reg_name_matches_prefix _s5898_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s5899_ _) =>
                                           (match (string_drop _s5898_ _s5899_) with
                                            | _s5900_ =>
                                               (sep_matches_prefix _s5900_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s5901_ _) =>
                                                   (match (string_drop _s5900_ _s5901_) with
                                                    | _s5902_ =>
                                                       (reg_name_matches_prefix _s5902_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s5903_ _) =>
                                                                   match (string_drop _s5902_
                                                                            _s5903_) with
                                                                   | s_ =>
                                                                      Some
                                                                        (high, signed1, signed2, rd, rs1, rs2, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                            end)
                                            : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((bool * bool * bool * mword 5 * mword 5 * mword 5 * string))).

Definition _s5876_ (_s5877_ : string) : M (option ((mword 5 * mword 5 * string))) :=
   let _s5878_ := _s5877_ in
   (if string_startswith _s5878_ "c.add" then
      (match (string_drop _s5878_ (projT1 (string_length "c.add"))) with
       | _s5879_ =>
          (spc_matches_prefix _s5879_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5880_ _) =>
              (match (string_drop _s5879_ _s5880_) with
               | _s5881_ =>
                  (reg_name_matches_prefix _s5881_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s5882_ _) =>
                      (match (string_drop _s5881_ _s5882_) with
                       | _s5883_ =>
                          (sep_matches_prefix _s5883_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s5884_ _) =>
                              (match (string_drop _s5883_ _s5884_) with
                               | _s5885_ =>
                                  (reg_name_matches_prefix _s5885_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s5886_ _) =>
                                              match (string_drop _s5885_ _s5886_) with
                                              | s_ => Some (rsd, rs2, s_)
                                              end
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 5 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 5 * mword 5 * string)))
                       end)
                       : M (option ((mword 5 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 5 * string)))
               end)
               : M (option ((mword 5 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5 * string)))
       end)
       : M (option ((mword 5 * mword 5 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 5 * string))).

Definition _s5872_ (_s5873_ : string) : option string :=
   let _s5874_ := _s5873_ in
   if string_startswith _s5874_ "c.ebreak" then
     match (string_drop _s5874_ (projT1 (string_length "c.ebreak"))) with | s_ => Some s_ end
   else None.

Definition _s5860_ (_s5861_ : string) : M (option ((mword 5 * mword 5 * string))) :=
   let _s5862_ := _s5861_ in
   (if string_startswith _s5862_ "c.mv" then
      (match (string_drop _s5862_ (projT1 (string_length "c.mv"))) with
       | _s5863_ =>
          (spc_matches_prefix _s5863_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5864_ _) =>
              (match (string_drop _s5863_ _s5864_) with
               | _s5865_ =>
                  (reg_name_matches_prefix _s5865_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s5866_ _) =>
                      (match (string_drop _s5865_ _s5866_) with
                       | _s5867_ =>
                          (sep_matches_prefix _s5867_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s5868_ _) =>
                              (match (string_drop _s5867_ _s5868_) with
                               | _s5869_ =>
                                  (reg_name_matches_prefix _s5869_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s5870_ _) =>
                                              match (string_drop _s5869_ _s5870_) with
                                              | s_ => Some (rd, rs2, s_)
                                              end
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 5 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 5 * mword 5 * string)))
                       end)
                       : M (option ((mword 5 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 5 * string)))
               end)
               : M (option ((mword 5 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5 * string)))
       end)
       : M (option ((mword 5 * mword 5 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 5 * string))).

Definition _s5852_ (_s5853_ : string) : M (option ((mword 5 * string))) :=
   let _s5854_ := _s5853_ in
   (if string_startswith _s5854_ "c.jalr" then
      (match (string_drop _s5854_ (projT1 (string_length "c.jalr"))) with
       | _s5855_ =>
          (spc_matches_prefix _s5855_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5856_ _) =>
              (match (string_drop _s5855_ _s5856_) with
               | _s5857_ =>
                  (reg_name_matches_prefix _s5857_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  returnm (match w__1 with
                           | Some (rs1, existT _ _s5858_ _) =>
                              match (string_drop _s5857_ _s5858_) with | s_ => Some (rs1, s_) end
                           | _ => None
                           end)
               end)
               : M (option ((mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * string)))
       end)
       : M (option ((mword 5 * string)))
    else returnm None)
    : M (option ((mword 5 * string))).

Definition _s5844_ (_s5845_ : string) : M (option ((mword 5 * string))) :=
   let _s5846_ := _s5845_ in
   (if string_startswith _s5846_ "c.jr" then
      (match (string_drop _s5846_ (projT1 (string_length "c.jr"))) with
       | _s5847_ =>
          (spc_matches_prefix _s5847_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5848_ _) =>
              (match (string_drop _s5847_ _s5848_) with
               | _s5849_ =>
                  (reg_name_matches_prefix _s5849_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  returnm (match w__1 with
                           | Some (rs1, existT _ _s5850_ _) =>
                              match (string_drop _s5849_ _s5850_) with | s_ => Some (rs1, s_) end
                           | _ => None
                           end)
               end)
               : M (option ((mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * string)))
       end)
       : M (option ((mword 5 * string)))
    else returnm None)
    : M (option ((mword 5 * string))).

Definition _s5832_ (_s5833_ : string) : M (option ((mword 5 * mword 6 * string))) :=
   let _s5834_ := _s5833_ in
   (if string_startswith _s5834_ "c.sdsp" then
      (match (string_drop _s5834_ (projT1 (string_length "c.sdsp"))) with
       | _s5835_ =>
          (spc_matches_prefix _s5835_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5836_ _) =>
              (match (string_drop _s5835_ _s5836_) with
               | _s5837_ =>
                  (reg_name_matches_prefix _s5837_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rs2, existT _ _s5838_ _) =>
                      (match (string_drop _s5837_ _s5838_) with
                       | _s5839_ =>
                          (sep_matches_prefix _s5839_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s5840_ _) =>
                                      match (string_drop _s5839_ _s5840_) with
                                      | _s5841_ =>
                                         match (hex_bits_6_matches_prefix _s5841_) with
                                         | Some (uimm, existT _ _s5842_ _) =>
                                            match (string_drop _s5841_ _s5842_) with
                                            | s_ => Some (rs2, uimm, s_)
                                            end
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6 * string)))
               end)
               : M (option ((mword 5 * mword 6 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6 * string)))
       end)
       : M (option ((mword 5 * mword 6 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 6 * string))).

Definition _s5820_ (_s5821_ : string) : M (option ((mword 5 * mword 6 * string))) :=
   let _s5822_ := _s5821_ in
   (if string_startswith _s5822_ "c.swsp" then
      (match (string_drop _s5822_ (projT1 (string_length "c.swsp"))) with
       | _s5823_ =>
          (spc_matches_prefix _s5823_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5824_ _) =>
              (match (string_drop _s5823_ _s5824_) with
               | _s5825_ =>
                  (reg_name_matches_prefix _s5825_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s5826_ _) =>
                      (match (string_drop _s5825_ _s5826_) with
                       | _s5827_ =>
                          (sep_matches_prefix _s5827_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s5828_ _) =>
                                      match (string_drop _s5827_ _s5828_) with
                                      | _s5829_ =>
                                         match (hex_bits_6_matches_prefix _s5829_) with
                                         | Some (uimm, existT _ _s5830_ _) =>
                                            match (string_drop _s5829_ _s5830_) with
                                            | s_ => Some (rd, uimm, s_)
                                            end
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6 * string)))
               end)
               : M (option ((mword 5 * mword 6 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6 * string)))
       end)
       : M (option ((mword 5 * mword 6 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 6 * string))).

Definition _s5808_ (_s5809_ : string) : M (option ((mword 5 * mword 6 * string))) :=
   let _s5810_ := _s5809_ in
   (if string_startswith _s5810_ "c.ldsp" then
      (match (string_drop _s5810_ (projT1 (string_length "c.ldsp"))) with
       | _s5811_ =>
          (spc_matches_prefix _s5811_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5812_ _) =>
              (match (string_drop _s5811_ _s5812_) with
               | _s5813_ =>
                  (reg_name_matches_prefix _s5813_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s5814_ _) =>
                      (match (string_drop _s5813_ _s5814_) with
                       | _s5815_ =>
                          (sep_matches_prefix _s5815_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s5816_ _) =>
                                      match (string_drop _s5815_ _s5816_) with
                                      | _s5817_ =>
                                         match (hex_bits_6_matches_prefix _s5817_) with
                                         | Some (uimm, existT _ _s5818_ _) =>
                                            match (string_drop _s5817_ _s5818_) with
                                            | s_ => Some (rd, uimm, s_)
                                            end
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6 * string)))
               end)
               : M (option ((mword 5 * mword 6 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6 * string)))
       end)
       : M (option ((mword 5 * mword 6 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 6 * string))).

Definition _s5796_ (_s5797_ : string) : M (option ((mword 5 * mword 6 * string))) :=
   let _s5798_ := _s5797_ in
   (if string_startswith _s5798_ "c.lwsp" then
      (match (string_drop _s5798_ (projT1 (string_length "c.lwsp"))) with
       | _s5799_ =>
          (spc_matches_prefix _s5799_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5800_ _) =>
              (match (string_drop _s5799_ _s5800_) with
               | _s5801_ =>
                  (reg_name_matches_prefix _s5801_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s5802_ _) =>
                      (match (string_drop _s5801_ _s5802_) with
                       | _s5803_ =>
                          (sep_matches_prefix _s5803_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s5804_ _) =>
                                      match (string_drop _s5803_ _s5804_) with
                                      | _s5805_ =>
                                         match (hex_bits_6_matches_prefix _s5805_) with
                                         | Some (uimm, existT _ _s5806_ _) =>
                                            match (string_drop _s5805_ _s5806_) with
                                            | s_ => Some (rd, uimm, s_)
                                            end
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6 * string)))
               end)
               : M (option ((mword 5 * mword 6 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6 * string)))
       end)
       : M (option ((mword 5 * mword 6 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 6 * string))).

Definition _s5784_ (_s5785_ : string) : M (option ((mword 5 * mword 6 * string))) :=
   let _s5786_ := _s5785_ in
   (if string_startswith _s5786_ "c.slli" then
      (match (string_drop _s5786_ (projT1 (string_length "c.slli"))) with
       | _s5787_ =>
          (spc_matches_prefix _s5787_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5788_ _) =>
              (match (string_drop _s5787_ _s5788_) with
               | _s5789_ =>
                  (reg_name_matches_prefix _s5789_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s5790_ _) =>
                      (match (string_drop _s5789_ _s5790_) with
                       | _s5791_ =>
                          (sep_matches_prefix _s5791_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s5792_ _) =>
                                      match (string_drop _s5791_ _s5792_) with
                                      | _s5793_ =>
                                         match (hex_bits_6_matches_prefix _s5793_) with
                                         | Some (shamt, existT _ _s5794_ _) =>
                                            match (string_drop _s5793_ _s5794_) with
                                            | s_ => Some (rsd, shamt, s_)
                                            end
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6 * string)))
               end)
               : M (option ((mword 5 * mword 6 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6 * string)))
       end)
       : M (option ((mword 5 * mword 6 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 6 * string))).

Definition _s5772_ (_s5773_ : string) : M (option ((mword 3 * mword 8 * string))) :=
   let _s5774_ := _s5773_ in
   (if string_startswith _s5774_ "c.bnez" then
      (match (string_drop _s5774_ (projT1 (string_length "c.bnez"))) with
       | _s5775_ =>
          (spc_matches_prefix _s5775_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5776_ _) =>
              (match (string_drop _s5775_ _s5776_) with
               | _s5777_ =>
                  (creg_name_matches_prefix _s5777_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rs, existT _ _s5778_ _) =>
                      (match (string_drop _s5777_ _s5778_) with
                       | _s5779_ =>
                          (sep_matches_prefix _s5779_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s5780_ _) =>
                                      match (string_drop _s5779_ _s5780_) with
                                      | _s5781_ =>
                                         match (hex_bits_8_matches_prefix _s5781_) with
                                         | Some (imm, existT _ _s5782_ _) =>
                                            match (string_drop _s5781_ _s5782_) with
                                            | s_ => Some (rs, imm, s_)
                                            end
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 3 * mword 8 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 8 * string)))
               end)
               : M (option ((mword 3 * mword 8 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 8 * string)))
       end)
       : M (option ((mword 3 * mword 8 * string)))
    else returnm None)
    : M (option ((mword 3 * mword 8 * string))).

Definition _s5760_ (_s5761_ : string) : M (option ((mword 3 * mword 8 * string))) :=
   let _s5762_ := _s5761_ in
   (if string_startswith _s5762_ "c.beqz" then
      (match (string_drop _s5762_ (projT1 (string_length "c.beqz"))) with
       | _s5763_ =>
          (spc_matches_prefix _s5763_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5764_ _) =>
              (match (string_drop _s5763_ _s5764_) with
               | _s5765_ =>
                  (creg_name_matches_prefix _s5765_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rs, existT _ _s5766_ _) =>
                      (match (string_drop _s5765_ _s5766_) with
                       | _s5767_ =>
                          (sep_matches_prefix _s5767_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s5768_ _) =>
                                      match (string_drop _s5767_ _s5768_) with
                                      | _s5769_ =>
                                         match (hex_bits_8_matches_prefix _s5769_) with
                                         | Some (imm, existT _ _s5770_ _) =>
                                            match (string_drop _s5769_ _s5770_) with
                                            | s_ => Some (rs, imm, s_)
                                            end
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 3 * mword 8 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 8 * string)))
               end)
               : M (option ((mword 3 * mword 8 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 8 * string)))
       end)
       : M (option ((mword 3 * mword 8 * string)))
    else returnm None)
    : M (option ((mword 3 * mword 8 * string))).

Definition _s5752_ (_s5753_ : string) : M (option ((mword 11 * string))) :=
   let _s5754_ := _s5753_ in
   (if string_startswith _s5754_ "c.j" then
      (match (string_drop _s5754_ (projT1 (string_length "c.j"))) with
       | _s5755_ =>
          (spc_matches_prefix _s5755_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          returnm (match w__0 with
                   | Some (tt, existT _ _s5756_ _) =>
                      match (string_drop _s5755_ _s5756_) with
                      | _s5757_ =>
                         match (hex_bits_11_matches_prefix _s5757_) with
                         | Some (imm, existT _ _s5758_ _) =>
                            match (string_drop _s5757_ _s5758_) with | s_ => Some (imm, s_) end
                         | _ => None
                         end
                      end
                   | _ => None
                   end)
       end)
       : M (option ((mword 11 * string)))
    else returnm None)
    : M (option ((mword 11 * string))).

Definition _s5740_ (_s5741_ : string) : M (option ((mword 3 * mword 3 * string))) :=
   let _s5742_ := _s5741_ in
   (if string_startswith _s5742_ "c.addw" then
      (match (string_drop _s5742_ (projT1 (string_length "c.addw"))) with
       | _s5743_ =>
          (spc_matches_prefix _s5743_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5744_ _) =>
              (match (string_drop _s5743_ _s5744_) with
               | _s5745_ =>
                  (creg_name_matches_prefix _s5745_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s5746_ _) =>
                      (match (string_drop _s5745_ _s5746_) with
                       | _s5747_ =>
                          (sep_matches_prefix _s5747_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s5748_ _) =>
                              (match (string_drop _s5747_ _s5748_) with
                               | _s5749_ =>
                                  (creg_name_matches_prefix _s5749_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s5750_ _) =>
                                              match (string_drop _s5749_ _s5750_) with
                                              | s_ => Some (rsd, rs2, s_)
                                              end
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 3 * mword 3 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * string)))
                       end)
                       : M (option ((mword 3 * mword 3 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * string)))
               end)
               : M (option ((mword 3 * mword 3 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * string)))
       end)
       : M (option ((mword 3 * mword 3 * string)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * string))).

Definition _s5728_ (_s5729_ : string) : M (option ((mword 3 * mword 3 * string))) :=
   let _s5730_ := _s5729_ in
   (if string_startswith _s5730_ "c.subw" then
      (match (string_drop _s5730_ (projT1 (string_length "c.subw"))) with
       | _s5731_ =>
          (spc_matches_prefix _s5731_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5732_ _) =>
              (match (string_drop _s5731_ _s5732_) with
               | _s5733_ =>
                  (creg_name_matches_prefix _s5733_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s5734_ _) =>
                      (match (string_drop _s5733_ _s5734_) with
                       | _s5735_ =>
                          (sep_matches_prefix _s5735_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s5736_ _) =>
                              (match (string_drop _s5735_ _s5736_) with
                               | _s5737_ =>
                                  (creg_name_matches_prefix _s5737_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s5738_ _) =>
                                              match (string_drop _s5737_ _s5738_) with
                                              | s_ => Some (rsd, rs2, s_)
                                              end
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 3 * mword 3 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * string)))
                       end)
                       : M (option ((mword 3 * mword 3 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * string)))
               end)
               : M (option ((mword 3 * mword 3 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * string)))
       end)
       : M (option ((mword 3 * mword 3 * string)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * string))).

Definition _s5716_ (_s5717_ : string) : M (option ((mword 3 * mword 3 * string))) :=
   let _s5718_ := _s5717_ in
   (if string_startswith _s5718_ "c.and" then
      (match (string_drop _s5718_ (projT1 (string_length "c.and"))) with
       | _s5719_ =>
          (spc_matches_prefix _s5719_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5720_ _) =>
              (match (string_drop _s5719_ _s5720_) with
               | _s5721_ =>
                  (creg_name_matches_prefix _s5721_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s5722_ _) =>
                      (match (string_drop _s5721_ _s5722_) with
                       | _s5723_ =>
                          (sep_matches_prefix _s5723_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s5724_ _) =>
                              (match (string_drop _s5723_ _s5724_) with
                               | _s5725_ =>
                                  (creg_name_matches_prefix _s5725_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s5726_ _) =>
                                              match (string_drop _s5725_ _s5726_) with
                                              | s_ => Some (rsd, rs2, s_)
                                              end
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 3 * mword 3 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * string)))
                       end)
                       : M (option ((mword 3 * mword 3 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * string)))
               end)
               : M (option ((mword 3 * mword 3 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * string)))
       end)
       : M (option ((mword 3 * mword 3 * string)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * string))).

Definition _s5704_ (_s5705_ : string) : M (option ((mword 3 * mword 3 * string))) :=
   let _s5706_ := _s5705_ in
   (if string_startswith _s5706_ "c.or" then
      (match (string_drop _s5706_ (projT1 (string_length "c.or"))) with
       | _s5707_ =>
          (spc_matches_prefix _s5707_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5708_ _) =>
              (match (string_drop _s5707_ _s5708_) with
               | _s5709_ =>
                  (creg_name_matches_prefix _s5709_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s5710_ _) =>
                      (match (string_drop _s5709_ _s5710_) with
                       | _s5711_ =>
                          (sep_matches_prefix _s5711_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s5712_ _) =>
                              (match (string_drop _s5711_ _s5712_) with
                               | _s5713_ =>
                                  (creg_name_matches_prefix _s5713_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s5714_ _) =>
                                              match (string_drop _s5713_ _s5714_) with
                                              | s_ => Some (rsd, rs2, s_)
                                              end
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 3 * mword 3 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * string)))
                       end)
                       : M (option ((mword 3 * mword 3 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * string)))
               end)
               : M (option ((mword 3 * mword 3 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * string)))
       end)
       : M (option ((mword 3 * mword 3 * string)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * string))).

Definition _s5692_ (_s5693_ : string) : M (option ((mword 3 * mword 3 * string))) :=
   let _s5694_ := _s5693_ in
   (if string_startswith _s5694_ "c.xor" then
      (match (string_drop _s5694_ (projT1 (string_length "c.xor"))) with
       | _s5695_ =>
          (spc_matches_prefix _s5695_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5696_ _) =>
              (match (string_drop _s5695_ _s5696_) with
               | _s5697_ =>
                  (creg_name_matches_prefix _s5697_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s5698_ _) =>
                      (match (string_drop _s5697_ _s5698_) with
                       | _s5699_ =>
                          (sep_matches_prefix _s5699_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s5700_ _) =>
                              (match (string_drop _s5699_ _s5700_) with
                               | _s5701_ =>
                                  (creg_name_matches_prefix _s5701_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s5702_ _) =>
                                              match (string_drop _s5701_ _s5702_) with
                                              | s_ => Some (rsd, rs2, s_)
                                              end
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 3 * mword 3 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * string)))
                       end)
                       : M (option ((mword 3 * mword 3 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * string)))
               end)
               : M (option ((mword 3 * mword 3 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * string)))
       end)
       : M (option ((mword 3 * mword 3 * string)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * string))).

Definition _s5680_ (_s5681_ : string) : M (option ((mword 3 * mword 3 * string))) :=
   let _s5682_ := _s5681_ in
   (if string_startswith _s5682_ "c.sub" then
      (match (string_drop _s5682_ (projT1 (string_length "c.sub"))) with
       | _s5683_ =>
          (spc_matches_prefix _s5683_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5684_ _) =>
              (match (string_drop _s5683_ _s5684_) with
               | _s5685_ =>
                  (creg_name_matches_prefix _s5685_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s5686_ _) =>
                      (match (string_drop _s5685_ _s5686_) with
                       | _s5687_ =>
                          (sep_matches_prefix _s5687_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s5688_ _) =>
                              (match (string_drop _s5687_ _s5688_) with
                               | _s5689_ =>
                                  (creg_name_matches_prefix _s5689_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s5690_ _) =>
                                              match (string_drop _s5689_ _s5690_) with
                                              | s_ => Some (rsd, rs2, s_)
                                              end
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 3 * mword 3 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * string)))
                       end)
                       : M (option ((mword 3 * mword 3 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * string)))
               end)
               : M (option ((mword 3 * mword 3 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * string)))
       end)
       : M (option ((mword 3 * mword 3 * string)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * string))).

Definition _s5668_ (_s5669_ : string) : M (option ((mword 3 * mword 6 * string))) :=
   let _s5670_ := _s5669_ in
   (if string_startswith _s5670_ "c.andi" then
      (match (string_drop _s5670_ (projT1 (string_length "c.andi"))) with
       | _s5671_ =>
          (spc_matches_prefix _s5671_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5672_ _) =>
              (match (string_drop _s5671_ _s5672_) with
               | _s5673_ =>
                  (creg_name_matches_prefix _s5673_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s5674_ _) =>
                      (match (string_drop _s5673_ _s5674_) with
                       | _s5675_ =>
                          (sep_matches_prefix _s5675_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s5676_ _) =>
                                      match (string_drop _s5675_ _s5676_) with
                                      | _s5677_ =>
                                         match (hex_bits_6_matches_prefix _s5677_) with
                                         | Some (imm, existT _ _s5678_ _) =>
                                            match (string_drop _s5677_ _s5678_) with
                                            | s_ => Some (rsd, imm, s_)
                                            end
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 3 * mword 6 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 6 * string)))
               end)
               : M (option ((mword 3 * mword 6 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 6 * string)))
       end)
       : M (option ((mword 3 * mword 6 * string)))
    else returnm None)
    : M (option ((mword 3 * mword 6 * string))).

Definition _s5656_ (_s5657_ : string) : M (option ((mword 3 * mword 6 * string))) :=
   let _s5658_ := _s5657_ in
   (if string_startswith _s5658_ "c.srai" then
      (match (string_drop _s5658_ (projT1 (string_length "c.srai"))) with
       | _s5659_ =>
          (spc_matches_prefix _s5659_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5660_ _) =>
              (match (string_drop _s5659_ _s5660_) with
               | _s5661_ =>
                  (creg_name_matches_prefix _s5661_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s5662_ _) =>
                      (match (string_drop _s5661_ _s5662_) with
                       | _s5663_ =>
                          (sep_matches_prefix _s5663_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s5664_ _) =>
                                      match (string_drop _s5663_ _s5664_) with
                                      | _s5665_ =>
                                         match (hex_bits_6_matches_prefix _s5665_) with
                                         | Some (shamt, existT _ _s5666_ _) =>
                                            match (string_drop _s5665_ _s5666_) with
                                            | s_ => Some (rsd, shamt, s_)
                                            end
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 3 * mword 6 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 6 * string)))
               end)
               : M (option ((mword 3 * mword 6 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 6 * string)))
       end)
       : M (option ((mword 3 * mword 6 * string)))
    else returnm None)
    : M (option ((mword 3 * mword 6 * string))).

Definition _s5644_ (_s5645_ : string) : M (option ((mword 3 * mword 6 * string))) :=
   let _s5646_ := _s5645_ in
   (if string_startswith _s5646_ "c.srli" then
      (match (string_drop _s5646_ (projT1 (string_length "c.srli"))) with
       | _s5647_ =>
          (spc_matches_prefix _s5647_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5648_ _) =>
              (match (string_drop _s5647_ _s5648_) with
               | _s5649_ =>
                  (creg_name_matches_prefix _s5649_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s5650_ _) =>
                      (match (string_drop _s5649_ _s5650_) with
                       | _s5651_ =>
                          (sep_matches_prefix _s5651_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s5652_ _) =>
                                      match (string_drop _s5651_ _s5652_) with
                                      | _s5653_ =>
                                         match (hex_bits_6_matches_prefix _s5653_) with
                                         | Some (shamt, existT _ _s5654_ _) =>
                                            match (string_drop _s5653_ _s5654_) with
                                            | s_ => Some (rsd, shamt, s_)
                                            end
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 3 * mword 6 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 6 * string)))
               end)
               : M (option ((mword 3 * mword 6 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 6 * string)))
       end)
       : M (option ((mword 3 * mword 6 * string)))
    else returnm None)
    : M (option ((mword 3 * mword 6 * string))).

Definition _s5632_ (_s5633_ : string) : M (option ((mword 5 * mword 6 * string))) :=
   let _s5634_ := _s5633_ in
   (if string_startswith _s5634_ "c.lui" then
      (match (string_drop _s5634_ (projT1 (string_length "c.lui"))) with
       | _s5635_ =>
          (spc_matches_prefix _s5635_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5636_ _) =>
              (match (string_drop _s5635_ _s5636_) with
               | _s5637_ =>
                  (reg_name_matches_prefix _s5637_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s5638_ _) =>
                      (match (string_drop _s5637_ _s5638_) with
                       | _s5639_ =>
                          (sep_matches_prefix _s5639_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s5640_ _) =>
                                      match (string_drop _s5639_ _s5640_) with
                                      | _s5641_ =>
                                         match (hex_bits_6_matches_prefix _s5641_) with
                                         | Some (imm, existT _ _s5642_ _) =>
                                            match (string_drop _s5641_ _s5642_) with
                                            | s_ => Some (rd, imm, s_)
                                            end
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6 * string)))
               end)
               : M (option ((mword 5 * mword 6 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6 * string)))
       end)
       : M (option ((mword 5 * mword 6 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 6 * string))).

Definition _s5624_ (_s5625_ : string) : M (option ((mword 6 * string))) :=
   let _s5626_ := _s5625_ in
   (if string_startswith _s5626_ "c.addi16sp" then
      (match (string_drop _s5626_ (projT1 (string_length "c.addi16sp"))) with
       | _s5627_ =>
          (spc_matches_prefix _s5627_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          returnm (match w__0 with
                   | Some (tt, existT _ _s5628_ _) =>
                      match (string_drop _s5627_ _s5628_) with
                      | _s5629_ =>
                         match (hex_bits_6_matches_prefix _s5629_) with
                         | Some (imm, existT _ _s5630_ _) =>
                            match (string_drop _s5629_ _s5630_) with | s_ => Some (imm, s_) end
                         | _ => None
                         end
                      end
                   | _ => None
                   end)
       end)
       : M (option ((mword 6 * string)))
    else returnm None)
    : M (option ((mword 6 * string))).

Definition _s5612_ (_s5613_ : string) : M (option ((mword 5 * mword 6 * string))) :=
   let _s5614_ := _s5613_ in
   (if string_startswith _s5614_ "c.li" then
      (match (string_drop _s5614_ (projT1 (string_length "c.li"))) with
       | _s5615_ =>
          (spc_matches_prefix _s5615_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5616_ _) =>
              (match (string_drop _s5615_ _s5616_) with
               | _s5617_ =>
                  (reg_name_matches_prefix _s5617_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s5618_ _) =>
                      (match (string_drop _s5617_ _s5618_) with
                       | _s5619_ =>
                          (sep_matches_prefix _s5619_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s5620_ _) =>
                                      match (string_drop _s5619_ _s5620_) with
                                      | _s5621_ =>
                                         match (hex_bits_6_matches_prefix _s5621_) with
                                         | Some (imm, existT _ _s5622_ _) =>
                                            match (string_drop _s5621_ _s5622_) with
                                            | s_ => Some (rd, imm, s_)
                                            end
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6 * string)))
               end)
               : M (option ((mword 5 * mword 6 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6 * string)))
       end)
       : M (option ((mword 5 * mword 6 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 6 * string))).

Definition _s5600_ (_s5601_ : string) : M (option ((mword 5 * mword 6 * string))) :=
   let _s5602_ := _s5601_ in
   (if string_startswith _s5602_ "c.addiw" then
      (match (string_drop _s5602_ (projT1 (string_length "c.addiw"))) with
       | _s5603_ =>
          (spc_matches_prefix _s5603_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5604_ _) =>
              (match (string_drop _s5603_ _s5604_) with
               | _s5605_ =>
                  (reg_name_matches_prefix _s5605_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s5606_ _) =>
                      (match (string_drop _s5605_ _s5606_) with
                       | _s5607_ =>
                          (sep_matches_prefix _s5607_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s5608_ _) =>
                                      match (string_drop _s5607_ _s5608_) with
                                      | _s5609_ =>
                                         match (hex_bits_6_matches_prefix _s5609_) with
                                         | Some (imm, existT _ _s5610_ _) =>
                                            match (string_drop _s5609_ _s5610_) with
                                            | s_ => Some (rsd, imm, s_)
                                            end
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6 * string)))
               end)
               : M (option ((mword 5 * mword 6 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6 * string)))
       end)
       : M (option ((mword 5 * mword 6 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 6 * string))).

Definition _s5592_ (_s5593_ : string) : M (option ((mword 11 * string))) :=
   let _s5594_ := _s5593_ in
   (if string_startswith _s5594_ "c.jal" then
      (match (string_drop _s5594_ (projT1 (string_length "c.jal"))) with
       | _s5595_ =>
          (spc_matches_prefix _s5595_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          returnm (match w__0 with
                   | Some (tt, existT _ _s5596_ _) =>
                      match (string_drop _s5595_ _s5596_) with
                      | _s5597_ =>
                         match (hex_bits_12_matches_prefix _s5597_) with
                         | Some (v__1490, existT _ _s5598_ _) =>
                            if eq_vec (subrange_vec_dec v__1490 0 0) ('b"0"  : mword (0 - 0 + 1))
                            then
                              let imm : mword 11 := subrange_vec_dec v__1490 11 1 in
                              let imm : mword 11 := subrange_vec_dec v__1490 11 1 in
                              match (string_drop _s5597_ _s5598_) with | s_ => Some (imm, s_) end
                            else None
                         | _ => None
                         end
                      end
                   | _ => None
                   end)
       end)
       : M (option ((mword 11 * string)))
    else returnm None)
    : M (option ((mword 11 * string))).

Definition _s5580_ (_s5581_ : string) : M (option ((mword 5 * mword 6 * string))) :=
   let _s5582_ := _s5581_ in
   (if string_startswith _s5582_ "c.addi" then
      (match (string_drop _s5582_ (projT1 (string_length "c.addi"))) with
       | _s5583_ =>
          (spc_matches_prefix _s5583_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5584_ _) =>
              (match (string_drop _s5583_ _s5584_) with
               | _s5585_ =>
                  (reg_name_matches_prefix _s5585_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsd, existT _ _s5586_ _) =>
                      (match (string_drop _s5585_ _s5586_) with
                       | _s5587_ =>
                          (sep_matches_prefix _s5587_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s5588_ _) =>
                                      match (string_drop _s5587_ _s5588_) with
                                      | _s5589_ =>
                                         match (hex_bits_6_matches_prefix _s5589_) with
                                         | Some (nzi, existT _ _s5590_ _) =>
                                            match (string_drop _s5589_ _s5590_) with
                                            | s_ => Some (rsd, nzi, s_)
                                            end
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 6 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 6 * string)))
               end)
               : M (option ((mword 5 * mword 6 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 6 * string)))
       end)
       : M (option ((mword 5 * mword 6 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 6 * string))).

Definition _s5564_ (_s5565_ : string) : M (option ((mword 3 * mword 3 * mword 5 * string))) :=
   let _s5566_ := _s5565_ in
   (if string_startswith _s5566_ "c.sd" then
      (match (string_drop _s5566_ (projT1 (string_length "c.sd"))) with
       | _s5567_ =>
          (spc_matches_prefix _s5567_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5568_ _) =>
              (match (string_drop _s5567_ _s5568_) with
               | _s5569_ =>
                  (creg_name_matches_prefix _s5569_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsc1, existT _ _s5570_ _) =>
                      (match (string_drop _s5569_ _s5570_) with
                       | _s5571_ =>
                          (sep_matches_prefix _s5571_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s5572_ _) =>
                              (match (string_drop _s5571_ _s5572_) with
                               | _s5573_ =>
                                  (creg_name_matches_prefix _s5573_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc2, existT _ _s5574_ _) =>
                                      (match (string_drop _s5573_ _s5574_) with
                                       | _s5575_ =>
                                          (sep_matches_prefix _s5575_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s5576_ _) =>
                                                      match (string_drop _s5575_ _s5576_) with
                                                      | _s5577_ =>
                                                         match (hex_bits_8_matches_prefix _s5577_) with
                                                         | Some (v__1492, existT _ _s5578_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1492 2 0)
                                                                 ('b"000"
                                                                  : mword (2 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1492 7 3 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1492 7 3 in
                                                              match (string_drop _s5577_ _s5578_) with
                                                              | s_ => Some (rsc1, rsc2, uimm, s_)
                                                              end
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5 * string)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5 * string)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5 * string)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5 * string)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5 * string)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5 * string))).

Definition _s5548_ (_s5549_ : string) : M (option ((mword 3 * mword 3 * mword 5 * string))) :=
   let _s5550_ := _s5549_ in
   (if string_startswith _s5550_ "c.sw" then
      (match (string_drop _s5550_ (projT1 (string_length "c.sw"))) with
       | _s5551_ =>
          (spc_matches_prefix _s5551_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5552_ _) =>
              (match (string_drop _s5551_ _s5552_) with
               | _s5553_ =>
                  (creg_name_matches_prefix _s5553_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rsc1, existT _ _s5554_ _) =>
                      (match (string_drop _s5553_ _s5554_) with
                       | _s5555_ =>
                          (sep_matches_prefix _s5555_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s5556_ _) =>
                              (match (string_drop _s5555_ _s5556_) with
                               | _s5557_ =>
                                  (creg_name_matches_prefix _s5557_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc2, existT _ _s5558_ _) =>
                                      (match (string_drop _s5557_ _s5558_) with
                                       | _s5559_ =>
                                          (sep_matches_prefix _s5559_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s5560_ _) =>
                                                      match (string_drop _s5559_ _s5560_) with
                                                      | _s5561_ =>
                                                         match (hex_bits_7_matches_prefix _s5561_) with
                                                         | Some (v__1494, existT _ _s5562_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1494 1 0)
                                                                 ('b"00"
                                                                  : mword (1 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1494 6 2 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1494 6 2 in
                                                              match (string_drop _s5561_ _s5562_) with
                                                              | s_ => Some (rsc1, rsc2, uimm, s_)
                                                              end
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5 * string)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5 * string)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5 * string)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5 * string)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5 * string)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5 * string))).

Definition _s5532_ (_s5533_ : string) : M (option ((mword 3 * mword 3 * mword 5 * string))) :=
   let _s5534_ := _s5533_ in
   (if string_startswith _s5534_ "c.ld" then
      (match (string_drop _s5534_ (projT1 (string_length "c.ld"))) with
       | _s5535_ =>
          (spc_matches_prefix _s5535_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5536_ _) =>
              (match (string_drop _s5535_ _s5536_) with
               | _s5537_ =>
                  (creg_name_matches_prefix _s5537_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rdc, existT _ _s5538_ _) =>
                      (match (string_drop _s5537_ _s5538_) with
                       | _s5539_ =>
                          (sep_matches_prefix _s5539_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s5540_ _) =>
                              (match (string_drop _s5539_ _s5540_) with
                               | _s5541_ =>
                                  (creg_name_matches_prefix _s5541_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc, existT _ _s5542_ _) =>
                                      (match (string_drop _s5541_ _s5542_) with
                                       | _s5543_ =>
                                          (sep_matches_prefix _s5543_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s5544_ _) =>
                                                      match (string_drop _s5543_ _s5544_) with
                                                      | _s5545_ =>
                                                         match (hex_bits_8_matches_prefix _s5545_) with
                                                         | Some (v__1496, existT _ _s5546_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1496 2 0)
                                                                 ('b"000"
                                                                  : mword (2 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1496 7 3 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1496 7 3 in
                                                              match (string_drop _s5545_ _s5546_) with
                                                              | s_ => Some (rdc, rsc, uimm, s_)
                                                              end
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5 * string)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5 * string)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5 * string)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5 * string)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5 * string)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5 * string))).

Definition _s5516_ (_s5517_ : string) : M (option ((mword 3 * mword 3 * mword 5 * string))) :=
   let _s5518_ := _s5517_ in
   (if string_startswith _s5518_ "c.lw" then
      (match (string_drop _s5518_ (projT1 (string_length "c.lw"))) with
       | _s5519_ =>
          (spc_matches_prefix _s5519_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5520_ _) =>
              (match (string_drop _s5519_ _s5520_) with
               | _s5521_ =>
                  (creg_name_matches_prefix _s5521_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rdc, existT _ _s5522_ _) =>
                      (match (string_drop _s5521_ _s5522_) with
                       | _s5523_ =>
                          (sep_matches_prefix _s5523_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s5524_ _) =>
                              (match (string_drop _s5523_ _s5524_) with
                               | _s5525_ =>
                                  (creg_name_matches_prefix _s5525_) >>= fun w__3 : option ((mword 3 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rsc, existT _ _s5526_ _) =>
                                      (match (string_drop _s5525_ _s5526_) with
                                       | _s5527_ =>
                                          (sep_matches_prefix _s5527_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s5528_ _) =>
                                                      match (string_drop _s5527_ _s5528_) with
                                                      | _s5529_ =>
                                                         match (hex_bits_7_matches_prefix _s5529_) with
                                                         | Some (v__1498, existT _ _s5530_ _) =>
                                                            if eq_vec (subrange_vec_dec v__1498 1 0)
                                                                 ('b"00"
                                                                  : mword (1 - 0 + 1)) then
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1498 6 2 in
                                                              let uimm : mword 5 :=
                                                                subrange_vec_dec v__1498 6 2 in
                                                              match (string_drop _s5529_ _s5530_) with
                                                              | s_ => Some (rdc, rsc, uimm, s_)
                                                              end
                                                            else None
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 3 * mword 3 * mword 5 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 3 * mword 3 * mword 5 * string)))
                               end)
                               : M (option ((mword 3 * mword 3 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 3 * mword 3 * mword 5 * string)))
                       end)
                       : M (option ((mword 3 * mword 3 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 3 * mword 5 * string)))
               end)
               : M (option ((mword 3 * mword 3 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 3 * mword 5 * string)))
       end)
       : M (option ((mword 3 * mword 3 * mword 5 * string)))
    else returnm None)
    : M (option ((mword 3 * mword 3 * mword 5 * string))).

Definition _s5504_ (_s5505_ : string) : M (option ((mword 3 * mword 8 * string))) :=
   let _s5506_ := _s5505_ in
   (if string_startswith _s5506_ "c.addi4spn" then
      (match (string_drop _s5506_ (projT1 (string_length "c.addi4spn"))) with
       | _s5507_ =>
          (spc_matches_prefix _s5507_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5508_ _) =>
              (match (string_drop _s5507_ _s5508_) with
               | _s5509_ =>
                  (creg_name_matches_prefix _s5509_) >>= fun w__1 : option ((mword 3 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rdc, existT _ _s5510_ _) =>
                      (match (string_drop _s5509_ _s5510_) with
                       | _s5511_ =>
                          (sep_matches_prefix _s5511_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s5512_ _) =>
                                      match (string_drop _s5511_ _s5512_) with
                                      | _s5513_ =>
                                         match (hex_bits_10_matches_prefix _s5513_) with
                                         | Some (v__1500, existT _ _s5514_ _) =>
                                            if eq_vec (subrange_vec_dec v__1500 1 0)
                                                 ('b"00"
                                                  : mword (1 - 0 + 1)) then
                                              let nzimm : mword 8 := subrange_vec_dec v__1500 9 2 in
                                              let nzimm : mword 8 := subrange_vec_dec v__1500 9 2 in
                                              match (string_drop _s5513_ _s5514_) with
                                              | s_ => Some (rdc, nzimm, s_)
                                              end
                                            else None
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 3 * mword 8 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 3 * mword 8 * string)))
               end)
               : M (option ((mword 3 * mword 8 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 3 * mword 8 * string)))
       end)
       : M (option ((mword 3 * mword 8 * string)))
    else returnm None)
    : M (option ((mword 3 * mword 8 * string))).

Definition _s5500_ (_s5501_ : string) : option string :=
   let _s5502_ := _s5501_ in
   if string_startswith _s5502_ "c.nop" then
     match (string_drop _s5502_ (projT1 (string_length "c.nop"))) with | s_ => Some s_ end
   else None.

Definition _s5474_ (_s5475_ : string)
: M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s5475_ with
    | _s5476_ =>
       (amo_mnemonic_matches_prefix _s5476_) >>= fun w__0 : option ((amoop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s5477_ _) =>
           let _s5478_ := string_drop _s5476_ _s5477_ in
           (if string_startswith _s5478_ "." then
              (match (string_drop _s5478_ (projT1 (string_length "."))) with
               | _s5479_ =>
                  (size_mnemonic_matches_prefix _s5479_) >>= fun w__1 : option ((word_width * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (width, existT _ _s5480_ _) =>
                      (match (string_drop _s5479_ _s5480_) with
                       | _s5481_ =>
                          (maybe_aq_matches_prefix _s5481_) >>= fun w__2 : option ((bool * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (aq, existT _ _s5482_ _) =>
                              (match (string_drop _s5481_ _s5482_) with
                               | _s5483_ =>
                                  (maybe_rl_matches_prefix _s5483_) >>= fun w__3 : option ((bool * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rl, existT _ _s5484_ _) =>
                                      (match (string_drop _s5483_ _s5484_) with
                                       | _s5485_ =>
                                          (spc_matches_prefix _s5485_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (tt, existT _ _s5486_ _) =>
                                              (match (string_drop _s5485_ _s5486_) with
                                               | _s5487_ =>
                                                  (reg_name_matches_prefix _s5487_) >>= fun w__5 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (rd, existT _ _s5488_ _) =>
                                                      (match (string_drop _s5487_ _s5488_) with
                                                       | _s5489_ =>
                                                          (sep_matches_prefix _s5489_) >>= fun w__6 : option ((unit * {n : Z & ArithFact (n >=?
                                                            0)})) =>
                                                          (match w__6 with
                                                           | Some (tt, existT _ _s5490_ _) =>
                                                              (match (string_drop _s5489_ _s5490_) with
                                                               | _s5491_ =>
                                                                  (reg_name_matches_prefix _s5491_) >>= fun w__7 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                    0)})) =>
                                                                  (match w__7 with
                                                                   | Some (rs2, existT _ _s5492_ _) =>
                                                                      (match (string_drop _s5491_
                                                                                _s5492_) with
                                                                       | _s5493_ =>
                                                                          (sep_matches_prefix
                                                                             _s5493_) >>= fun w__8 : option ((unit * {n : Z & ArithFact (n >=?
                                                                            0)})) =>
                                                                          (match w__8 with
                                                                           | Some
                                                                             (tt, existT _ _s5494_ _) =>
                                                                              let _s5495_ :=
                                                                                string_drop _s5493_
                                                                                  _s5494_ in
                                                                              (if string_startswith
                                                                                    _s5495_ "(" then
                                                                                 (match (string_drop
                                                                                           _s5495_
                                                                                           (projT1
                                                                                            (string_length
                                                                                               "("))) with
                                                                                  | _s5496_ =>
                                                                                     (reg_name_matches_prefix
                                                                                        _s5496_) >>= fun w__9 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                                       0)})) =>
                                                                                     returnm (match w__9 with
                                                                                              | Some
                                                                                                (rs1, existT _ _s5497_ _) =>
                                                                                                 let _s5498_ :=
                                                                                                   string_drop
                                                                                                     _s5496_
                                                                                                     _s5497_ in
                                                                                                 if string_startswith
                                                                                                      _s5498_
                                                                                                      ")"
                                                                                                 then
                                                                                                   match (string_drop
                                                                                                            _s5498_
                                                                                                            (projT1
                                                                                                             (string_length
                                                                                                                ")"))) with
                                                                                                   | s_ =>
                                                                                                      Some
                                                                                                        (op, width, aq, rl, rd, rs2, rs1, s_)
                                                                                                   end
                                                                                                 else
                                                                                                   None
                                                                                              | _ =>
                                                                                                 None
                                                                                              end)
                                                                                  end)
                                                                                  : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                                                               else returnm None)
                                                                               : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                                                           | _ => returnm None
                                                                           end)
                                                                           : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                                                       end)
                                                                       : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                                                   | _ => returnm None
                                                                   end)
                                                                   : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                                               end)
                                                               : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                                           | _ => returnm None
                                                           end)
                                                           : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                                       end)
                                                       : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                               end)
                                               : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                       end)
                                       : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                               end)
                               : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                       end)
                       : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
               end)
               : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
            else returnm None)
            : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string))).

Definition _s5452_ (_s5453_ : string)
: M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string))) :=
   let _s5454_ := _s5453_ in
   (if string_startswith _s5454_ "sc." then
      (match (string_drop _s5454_ (projT1 (string_length "sc."))) with
       | _s5455_ =>
          (size_mnemonic_matches_prefix _s5455_) >>= fun w__0 : option ((word_width * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (size, existT _ _s5456_ _) =>
              (match (string_drop _s5455_ _s5456_) with
               | _s5457_ =>
                  (maybe_aq_matches_prefix _s5457_) >>= fun w__1 : option ((bool * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (aq, existT _ _s5458_ _) =>
                      (match (string_drop _s5457_ _s5458_) with
                       | _s5459_ =>
                          (maybe_rl_matches_prefix _s5459_) >>= fun w__2 : option ((bool * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rl, existT _ _s5460_ _) =>
                              (match (string_drop _s5459_ _s5460_) with
                               | _s5461_ =>
                                  (spc_matches_prefix _s5461_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s5462_ _) =>
                                      (match (string_drop _s5461_ _s5462_) with
                                       | _s5463_ =>
                                          (reg_name_matches_prefix _s5463_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (rd, existT _ _s5464_ _) =>
                                              (match (string_drop _s5463_ _s5464_) with
                                               | _s5465_ =>
                                                  (sep_matches_prefix _s5465_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (tt, existT _ _s5466_ _) =>
                                                      (match (string_drop _s5465_ _s5466_) with
                                                       | _s5467_ =>
                                                          (reg_name_matches_prefix _s5467_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                            0)})) =>
                                                          (match w__6 with
                                                           | Some (rs1, existT _ _s5468_ _) =>
                                                              (match (string_drop _s5467_ _s5468_) with
                                                               | _s5469_ =>
                                                                  (sep_matches_prefix _s5469_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                    0)})) =>
                                                                  (match w__7 with
                                                                   | Some (tt, existT _ _s5470_ _) =>
                                                                      (match (string_drop _s5469_
                                                                                _s5470_) with
                                                                       | _s5471_ =>
                                                                          (reg_name_matches_prefix
                                                                             _s5471_) >>= fun w__8 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                            0)})) =>
                                                                          returnm (match w__8 with
                                                                                   | Some
                                                                                     (rs2, existT _ _s5472_ _) =>
                                                                                      match (string_drop
                                                                                               _s5471_
                                                                                               _s5472_) with
                                                                                      | s_ =>
                                                                                         Some
                                                                                           (size, aq, rl, rd, rs1, rs2, s_)
                                                                                      end
                                                                                   | _ => None
                                                                                   end)
                                                                       end)
                                                                       : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                                                   | _ => returnm None
                                                                   end)
                                                                   : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                                               end)
                                                               : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                                           | _ => returnm None
                                                           end)
                                                           : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                                       end)
                                                       : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                               end)
                                               : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                       end)
                                       : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                               end)
                               : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                       end)
                       : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
               end)
               : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
       end)
       : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)))
    else returnm None)
    : M (option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string))).

Definition _s5434_ (_s5435_ : string)
: M (option ((word_width * bool * bool * mword 5 * mword 5 * string))) :=
   let _s5436_ := _s5435_ in
   (if string_startswith _s5436_ "lr." then
      (match (string_drop _s5436_ (projT1 (string_length "lr."))) with
       | _s5437_ =>
          (size_mnemonic_matches_prefix _s5437_) >>= fun w__0 : option ((word_width * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (size, existT _ _s5438_ _) =>
              (match (string_drop _s5437_ _s5438_) with
               | _s5439_ =>
                  (maybe_aq_matches_prefix _s5439_) >>= fun w__1 : option ((bool * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (aq, existT _ _s5440_ _) =>
                      (match (string_drop _s5439_ _s5440_) with
                       | _s5441_ =>
                          (maybe_rl_matches_prefix _s5441_) >>= fun w__2 : option ((bool * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rl, existT _ _s5442_ _) =>
                              (match (string_drop _s5441_ _s5442_) with
                               | _s5443_ =>
                                  (spc_matches_prefix _s5443_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s5444_ _) =>
                                      (match (string_drop _s5443_ _s5444_) with
                                       | _s5445_ =>
                                          (reg_name_matches_prefix _s5445_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (rd, existT _ _s5446_ _) =>
                                              (match (string_drop _s5445_ _s5446_) with
                                               | _s5447_ =>
                                                  (sep_matches_prefix _s5447_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (tt, existT _ _s5448_ _) =>
                                                      (match (string_drop _s5447_ _s5448_) with
                                                       | _s5449_ =>
                                                          (reg_name_matches_prefix _s5449_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                            0)})) =>
                                                          returnm (match w__6 with
                                                                   | Some (rs1, existT _ _s5450_ _) =>
                                                                      match (string_drop _s5449_
                                                                               _s5450_) with
                                                                      | s_ =>
                                                                         Some
                                                                           (size, aq, rl, rd, rs1, s_)
                                                                      end
                                                                   | _ => None
                                                                   end)
                                                       end)
                                                       : M (option ((word_width * bool * bool * mword 5 * mword 5 * string)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((word_width * bool * bool * mword 5 * mword 5 * string)))
                                               end)
                                               : M (option ((word_width * bool * bool * mword 5 * mword 5 * string)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((word_width * bool * bool * mword 5 * mword 5 * string)))
                                       end)
                                       : M (option ((word_width * bool * bool * mword 5 * mword 5 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((word_width * bool * bool * mword 5 * mword 5 * string)))
                               end)
                               : M (option ((word_width * bool * bool * mword 5 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((word_width * bool * bool * mword 5 * mword 5 * string)))
                       end)
                       : M (option ((word_width * bool * bool * mword 5 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((word_width * bool * bool * mword 5 * mword 5 * string)))
               end)
               : M (option ((word_width * bool * bool * mword 5 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((word_width * bool * bool * mword 5 * mword 5 * string)))
       end)
       : M (option ((word_width * bool * bool * mword 5 * mword 5 * string)))
    else returnm None)
    : M (option ((word_width * bool * bool * mword 5 * mword 5 * string))).

Definition _s5422_ (_s5423_ : string) : M (option ((mword 5 * mword 5 * string))) :=
   let _s5424_ := _s5423_ in
   (if string_startswith _s5424_ "sfence.vma" then
      (match (string_drop _s5424_ (projT1 (string_length "sfence.vma"))) with
       | _s5425_ =>
          (spc_matches_prefix _s5425_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5426_ _) =>
              (match (string_drop _s5425_ _s5426_) with
               | _s5427_ =>
                  (reg_name_matches_prefix _s5427_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rs1, existT _ _s5428_ _) =>
                      (match (string_drop _s5427_ _s5428_) with
                       | _s5429_ =>
                          (sep_matches_prefix _s5429_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s5430_ _) =>
                              (match (string_drop _s5429_ _s5430_) with
                               | _s5431_ =>
                                  (reg_name_matches_prefix _s5431_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (rs2, existT _ _s5432_ _) =>
                                              match (string_drop _s5431_ _s5432_) with
                                              | s_ => Some (rs1, rs2, s_)
                                              end
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 5 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 5 * mword 5 * string)))
                       end)
                       : M (option ((mword 5 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 5 * string)))
               end)
               : M (option ((mword 5 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5 * string)))
       end)
       : M (option ((mword 5 * mword 5 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 5 * string))).

Definition _s5418_ (_s5419_ : string) : option string :=
   let _s5420_ := _s5419_ in
   if string_startswith _s5420_ "wfi" then
     match (string_drop _s5420_ (projT1 (string_length "wfi"))) with | s_ => Some s_ end
   else None.

Definition _s5414_ (_s5415_ : string) : option string :=
   let _s5416_ := _s5415_ in
   if string_startswith _s5416_ "ebreak" then
     match (string_drop _s5416_ (projT1 (string_length "ebreak"))) with | s_ => Some s_ end
   else None.

Definition _s5410_ (_s5411_ : string) : option string :=
   let _s5412_ := _s5411_ in
   if string_startswith _s5412_ "sret" then
     match (string_drop _s5412_ (projT1 (string_length "sret"))) with | s_ => Some s_ end
   else None.

Definition _s5406_ (_s5407_ : string) : option string :=
   let _s5408_ := _s5407_ in
   if string_startswith _s5408_ "mret" then
     match (string_drop _s5408_ (projT1 (string_length "mret"))) with | s_ => Some s_ end
   else None.

Definition _s5402_ (_s5403_ : string) : option string :=
   let _s5404_ := _s5403_ in
   if string_startswith _s5404_ "ecall" then
     match (string_drop _s5404_ (projT1 (string_length "ecall"))) with | s_ => Some s_ end
   else None.

Definition _s5398_ (_s5399_ : string) : option string :=
   let _s5400_ := _s5399_ in
   if string_startswith _s5400_ "fence.i" then
     match (string_drop _s5400_ (projT1 (string_length "fence.i"))) with | s_ => Some s_ end
   else None.

Definition _s5386_ (_s5387_ : string) : M (option ((mword 4 * mword 4 * string))) :=
   let _s5388_ := _s5387_ in
   (if string_startswith _s5388_ "fence.tso" then
      (match (string_drop _s5388_ (projT1 (string_length "fence.tso"))) with
       | _s5389_ =>
          (spc_matches_prefix _s5389_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5390_ _) =>
              (match (string_drop _s5389_ _s5390_) with
               | _s5391_ =>
                  (fence_bits_matches_prefix _s5391_) >>= fun w__1 : option ((mword 4 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (pred, existT _ _s5392_ _) =>
                      (match (string_drop _s5391_ _s5392_) with
                       | _s5393_ =>
                          (sep_matches_prefix _s5393_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s5394_ _) =>
                              (match (string_drop _s5393_ _s5394_) with
                               | _s5395_ =>
                                  (fence_bits_matches_prefix _s5395_) >>= fun w__3 : option ((mword 4 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (succ, existT _ _s5396_ _) =>
                                              match (string_drop _s5395_ _s5396_) with
                                              | s_ => Some (pred, succ, s_)
                                              end
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 4 * mword 4 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 4 * mword 4 * string)))
                       end)
                       : M (option ((mword 4 * mword 4 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 4 * mword 4 * string)))
               end)
               : M (option ((mword 4 * mword 4 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 4 * mword 4 * string)))
       end)
       : M (option ((mword 4 * mword 4 * string)))
    else returnm None)
    : M (option ((mword 4 * mword 4 * string))).

Definition _s5374_ (_s5375_ : string) : M (option ((mword 4 * mword 4 * string))) :=
   let _s5376_ := _s5375_ in
   (if string_startswith _s5376_ "fence" then
      (match (string_drop _s5376_ (projT1 (string_length "fence"))) with
       | _s5377_ =>
          (spc_matches_prefix _s5377_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5378_ _) =>
              (match (string_drop _s5377_ _s5378_) with
               | _s5379_ =>
                  (fence_bits_matches_prefix _s5379_) >>= fun w__1 : option ((mword 4 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (pred, existT _ _s5380_ _) =>
                      (match (string_drop _s5379_ _s5380_) with
                       | _s5381_ =>
                          (sep_matches_prefix _s5381_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s5382_ _) =>
                              (match (string_drop _s5381_ _s5382_) with
                               | _s5383_ =>
                                  (fence_bits_matches_prefix _s5383_) >>= fun w__3 : option ((mword 4 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  returnm (match w__3 with
                                           | Some (succ, existT _ _s5384_ _) =>
                                              match (string_drop _s5383_ _s5384_) with
                                              | s_ => Some (pred, succ, s_)
                                              end
                                           | _ => None
                                           end)
                               end)
                               : M (option ((mword 4 * mword 4 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 4 * mword 4 * string)))
                       end)
                       : M (option ((mword 4 * mword 4 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 4 * mword 4 * string)))
               end)
               : M (option ((mword 4 * mword 4 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 4 * mword 4 * string)))
       end)
       : M (option ((mword 4 * mword 4 * string)))
    else returnm None)
    : M (option ((mword 4 * mword 4 * string))).

Definition _s5357_ (_s5358_ : string) : M (option ((sopw * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s5358_ with
    | _s5359_ =>
       (shiftiwop_mnemonic_matches_prefix _s5359_) >>= fun w__0 : option ((sopw * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s5360_ _) =>
           (match (string_drop _s5359_ _s5360_) with
            | _s5361_ =>
               (spc_matches_prefix _s5361_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s5362_ _) =>
                   (match (string_drop _s5361_ _s5362_) with
                    | _s5363_ =>
                       (reg_name_matches_prefix _s5363_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s5364_ _) =>
                           (match (string_drop _s5363_ _s5364_) with
                            | _s5365_ =>
                               (sep_matches_prefix _s5365_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s5366_ _) =>
                                   (match (string_drop _s5365_ _s5366_) with
                                    | _s5367_ =>
                                       (reg_name_matches_prefix _s5367_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s5368_ _) =>
                                           (match (string_drop _s5367_ _s5368_) with
                                            | _s5369_ =>
                                               (sep_matches_prefix _s5369_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               returnm (match w__5 with
                                                        | Some (tt, existT _ _s5370_ _) =>
                                                           match (string_drop _s5369_ _s5370_) with
                                                           | _s5371_ =>
                                                              match (hex_bits_5_matches_prefix
                                                                       _s5371_) with
                                                              | Some (shamt, existT _ _s5372_ _) =>
                                                                 match (string_drop _s5371_ _s5372_) with
                                                                 | s_ =>
                                                                    Some (op, rd, rs1, shamt, s_)
                                                                 end
                                                              | _ => None
                                                              end
                                                           end
                                                        | _ => None
                                                        end)
                                            end)
                                            : M (option ((sopw * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((sopw * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((sopw * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((sopw * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((sopw * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((sopw * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((sopw * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((sopw * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((sopw * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((sopw * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((sopw * mword 5 * mword 5 * mword 5 * string))).

Definition _s5340_ (_s5341_ : string) : M (option ((ropw * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s5341_ with
    | _s5342_ =>
       (rtypew_mnemonic_matches_prefix _s5342_) >>= fun w__0 : option ((ropw * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s5343_ _) =>
           (match (string_drop _s5342_ _s5343_) with
            | _s5344_ =>
               (spc_matches_prefix _s5344_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s5345_ _) =>
                   (match (string_drop _s5344_ _s5345_) with
                    | _s5346_ =>
                       (reg_name_matches_prefix _s5346_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s5347_ _) =>
                           (match (string_drop _s5346_ _s5347_) with
                            | _s5348_ =>
                               (sep_matches_prefix _s5348_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s5349_ _) =>
                                   (match (string_drop _s5348_ _s5349_) with
                                    | _s5350_ =>
                                       (reg_name_matches_prefix _s5350_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s5351_ _) =>
                                           (match (string_drop _s5350_ _s5351_) with
                                            | _s5352_ =>
                                               (sep_matches_prefix _s5352_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s5353_ _) =>
                                                   (match (string_drop _s5352_ _s5353_) with
                                                    | _s5354_ =>
                                                       (reg_name_matches_prefix _s5354_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s5355_ _) =>
                                                                   match (string_drop _s5354_
                                                                            _s5355_) with
                                                                   | s_ =>
                                                                      Some (op, rd, rs1, rs2, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((ropw * mword 5 * mword 5 * mword 5 * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((ropw * mword 5 * mword 5 * mword 5 * string)))
                                            end)
                                            : M (option ((ropw * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((ropw * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((ropw * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((ropw * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((ropw * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((ropw * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((ropw * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((ropw * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((ropw * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((ropw * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((ropw * mword 5 * mword 5 * mword 5 * string))).

Definition _s5323_ (_s5324_ : string) : M (option ((sop * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s5324_ with
    | _s5325_ =>
       (shiftw_mnemonic_matches_prefix _s5325_) >>= fun w__0 : option ((sop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s5326_ _) =>
           (match (string_drop _s5325_ _s5326_) with
            | _s5327_ =>
               (spc_matches_prefix _s5327_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s5328_ _) =>
                   (match (string_drop _s5327_ _s5328_) with
                    | _s5329_ =>
                       (reg_name_matches_prefix _s5329_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s5330_ _) =>
                           (match (string_drop _s5329_ _s5330_) with
                            | _s5331_ =>
                               (sep_matches_prefix _s5331_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s5332_ _) =>
                                   (match (string_drop _s5331_ _s5332_) with
                                    | _s5333_ =>
                                       (reg_name_matches_prefix _s5333_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s5334_ _) =>
                                           (match (string_drop _s5333_ _s5334_) with
                                            | _s5335_ =>
                                               (sep_matches_prefix _s5335_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               returnm (match w__5 with
                                                        | Some (tt, existT _ _s5336_ _) =>
                                                           match (string_drop _s5335_ _s5336_) with
                                                           | _s5337_ =>
                                                              match (hex_bits_5_matches_prefix
                                                                       _s5337_) with
                                                              | Some (shamt, existT _ _s5338_ _) =>
                                                                 match (string_drop _s5337_ _s5338_) with
                                                                 | s_ =>
                                                                    Some (op, rd, rs1, shamt, s_)
                                                                 end
                                                              | _ => None
                                                              end
                                                           end
                                                        | _ => None
                                                        end)
                                            end)
                                            : M (option ((sop * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((sop * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((sop * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((sop * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((sop * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((sop * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((sop * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((sop * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((sop * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((sop * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((sop * mword 5 * mword 5 * mword 5 * string))).

Definition _s5307_ (_s5308_ : string) : M (option ((mword 5 * mword 5 * mword 12 * string))) :=
   let _s5309_ := _s5308_ in
   (if string_startswith _s5309_ "addiw" then
      (match (string_drop _s5309_ (projT1 (string_length "addiw"))) with
       | _s5310_ =>
          (spc_matches_prefix _s5310_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5311_ _) =>
              (match (string_drop _s5310_ _s5311_) with
               | _s5312_ =>
                  (reg_name_matches_prefix _s5312_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s5313_ _) =>
                      (match (string_drop _s5312_ _s5313_) with
                       | _s5314_ =>
                          (sep_matches_prefix _s5314_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s5315_ _) =>
                              (match (string_drop _s5314_ _s5315_) with
                               | _s5316_ =>
                                  (reg_name_matches_prefix _s5316_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rs1, existT _ _s5317_ _) =>
                                      (match (string_drop _s5316_ _s5317_) with
                                       | _s5318_ =>
                                          (sep_matches_prefix _s5318_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s5319_ _) =>
                                                      match (string_drop _s5318_ _s5319_) with
                                                      | _s5320_ =>
                                                         match (hex_bits_12_matches_prefix _s5320_) with
                                                         | Some (imm, existT _ _s5321_ _) =>
                                                            match (string_drop _s5320_ _s5321_) with
                                                            | s_ => Some (rd, rs1, imm, s_)
                                                            end
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 5 * mword 5 * mword 12 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 5 * mword 5 * mword 12 * string)))
                               end)
                               : M (option ((mword 5 * mword 5 * mword 12 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 5 * mword 5 * mword 12 * string)))
                       end)
                       : M (option ((mword 5 * mword 5 * mword 12 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 5 * mword 12 * string)))
               end)
               : M (option ((mword 5 * mword 5 * mword 12 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5 * mword 12 * string)))
       end)
       : M (option ((mword 5 * mword 5 * mword 12 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 5 * mword 12 * string))).

Definition _s5279_ (_s5280_ : string)
: M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string))) :=
   let _s5281_ := _s5280_ in
   (if string_startswith _s5281_ "s" then
      (match (string_drop _s5281_ (projT1 (string_length "s"))) with
       | _s5282_ =>
          (size_mnemonic_matches_prefix _s5282_) >>= fun w__0 : option ((word_width * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (size, existT _ _s5283_ _) =>
              (match (string_drop _s5282_ _s5283_) with
               | _s5284_ =>
                  (maybe_aq_matches_prefix _s5284_) >>= fun w__1 : option ((bool * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (aq, existT _ _s5285_ _) =>
                      (match (string_drop _s5284_ _s5285_) with
                       | _s5286_ =>
                          (maybe_rl_matches_prefix _s5286_) >>= fun w__2 : option ((bool * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (rl, existT _ _s5287_ _) =>
                              (match (string_drop _s5286_ _s5287_) with
                               | _s5288_ =>
                                  (spc_matches_prefix _s5288_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (tt, existT _ _s5289_ _) =>
                                      (match (string_drop _s5288_ _s5289_) with
                                       | _s5290_ =>
                                          (reg_name_matches_prefix _s5290_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (rs2, existT _ _s5291_ _) =>
                                              (match (string_drop _s5290_ _s5291_) with
                                               | _s5292_ =>
                                                  (sep_matches_prefix _s5292_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (tt, existT _ _s5293_ _) =>
                                                      (match (string_drop _s5292_ _s5293_) with
                                                       | _s5294_ =>
                                                          (match (hex_bits_12_matches_prefix _s5294_) with
                                                           | Some (imm, existT _ _s5295_ _) =>
                                                              (match (string_drop _s5294_ _s5295_) with
                                                               | _s5296_ =>
                                                                  (opt_spc_matches_prefix _s5296_) >>= fun w__6 : option ((unit * {n : Z & ArithFact (n >=?
                                                                    0)})) =>
                                                                  (match w__6 with
                                                                   | Some (tt, existT _ _s5297_ _) =>
                                                                      let _s5298_ :=
                                                                        string_drop _s5296_ _s5297_ in
                                                                      (if string_startswith _s5298_
                                                                            "(" then
                                                                         (match (string_drop _s5298_
                                                                                   (projT1
                                                                                    (string_length
                                                                                       "("))) with
                                                                          | _s5299_ =>
                                                                             (opt_spc_matches_prefix
                                                                                _s5299_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                               0)})) =>
                                                                             (match w__7 with
                                                                              | Some
                                                                                (tt, existT _ _s5300_ _) =>
                                                                                 (match (string_drop
                                                                                           _s5299_
                                                                                           _s5300_) with
                                                                                  | _s5301_ =>
                                                                                     (reg_name_matches_prefix
                                                                                        _s5301_) >>= fun w__8 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                                       0)})) =>
                                                                                     (match w__8 with
                                                                                      | Some
                                                                                        (rs1, existT _ _s5302_ _) =>
                                                                                         (match (string_drop
                                                                                                   _s5301_
                                                                                                   _s5302_) with
                                                                                          | _s5303_ =>
                                                                                             (opt_spc_matches_prefix
                                                                                                _s5303_) >>= fun w__9 : option ((unit * {n : Z & ArithFact (n >=?
                                                                                               0)})) =>
                                                                                             returnm (match w__9 with
                                                                                                      | Some
                                                                                                        (tt, existT _ _s5304_ _) =>
                                                                                                         let _s5305_ :=
                                                                                                           string_drop
                                                                                                             _s5303_
                                                                                                             _s5304_ in
                                                                                                         if
                                                                                                           string_startswith
                                                                                                             _s5305_
                                                                                                             ")"
                                                                                                         then
                                                                                                           match (string_drop
                                                                                                                    _s5305_
                                                                                                                    (projT1
                                                                                                                     (string_length
                                                                                                                        ")"))) with
                                                                                                           | s_ =>
                                                                                                              Some
                                                                                                                (size, aq, rl, rs2, imm, rs1, s_)
                                                                                                           end
                                                                                                         else
                                                                                                           None
                                                                                                      | _ =>
                                                                                                         None
                                                                                                      end)
                                                                                          end)
                                                                                          : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                                                      | _ =>
                                                                                         returnm None
                                                                                      end)
                                                                                      : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                                                  end)
                                                                                  : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                                              | _ => returnm None
                                                                              end)
                                                                              : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                                          end)
                                                                          : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                                       else returnm None)
                                                                       : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                                   | _ => returnm None
                                                                   end)
                                                                   : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                               end)
                                                               : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                           | _ => returnm None
                                                           end)
                                                           : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                       end)
                                                       : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                               end)
                                               : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                       end)
                                       : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                               end)
                               : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                       end)
                       : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
               end)
               : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
       end)
       : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)))
    else returnm None)
    : M (option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string))).

Definition _s5249_ (_s5250_ : string)
: M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string))) :=
   let _s5251_ := _s5250_ in
   (if string_startswith _s5251_ "l" then
      (match (string_drop _s5251_ (projT1 (string_length "l"))) with
       | _s5252_ =>
          (size_mnemonic_matches_prefix _s5252_) >>= fun w__0 : option ((word_width * {n : Z & ArithFact (n >=?
            0)})) =>
          (match w__0 with
           | Some (size, existT _ _s5253_ _) =>
              (match (string_drop _s5252_ _s5253_) with
               | _s5254_ =>
                  (maybe_u_matches_prefix _s5254_) >>= fun w__1 : option ((bool * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (is_unsigned, existT _ _s5255_ _) =>
                      (match (string_drop _s5254_ _s5255_) with
                       | _s5256_ =>
                          (maybe_aq_matches_prefix _s5256_) >>= fun w__2 : option ((bool * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (aq, existT _ _s5257_ _) =>
                              (match (string_drop _s5256_ _s5257_) with
                               | _s5258_ =>
                                  (maybe_rl_matches_prefix _s5258_) >>= fun w__3 : option ((bool * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rl, existT _ _s5259_ _) =>
                                      (match (string_drop _s5258_ _s5259_) with
                                       | _s5260_ =>
                                          (spc_matches_prefix _s5260_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          (match w__4 with
                                           | Some (tt, existT _ _s5261_ _) =>
                                              (match (string_drop _s5260_ _s5261_) with
                                               | _s5262_ =>
                                                  (reg_name_matches_prefix _s5262_) >>= fun w__5 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                    0)})) =>
                                                  (match w__5 with
                                                   | Some (rd, existT _ _s5263_ _) =>
                                                      (match (string_drop _s5262_ _s5263_) with
                                                       | _s5264_ =>
                                                          (sep_matches_prefix _s5264_) >>= fun w__6 : option ((unit * {n : Z & ArithFact (n >=?
                                                            0)})) =>
                                                          (match w__6 with
                                                           | Some (tt, existT _ _s5265_ _) =>
                                                              (match (string_drop _s5264_ _s5265_) with
                                                               | _s5266_ =>
                                                                  (match (hex_bits_12_matches_prefix
                                                                            _s5266_) with
                                                                   | Some (imm, existT _ _s5267_ _) =>
                                                                      (match (string_drop _s5266_
                                                                                _s5267_) with
                                                                       | _s5268_ =>
                                                                          (opt_spc_matches_prefix
                                                                             _s5268_) >>= fun w__7 : option ((unit * {n : Z & ArithFact (n >=?
                                                                            0)})) =>
                                                                          (match w__7 with
                                                                           | Some
                                                                             (tt, existT _ _s5269_ _) =>
                                                                              let _s5270_ :=
                                                                                string_drop _s5268_
                                                                                  _s5269_ in
                                                                              (if string_startswith
                                                                                    _s5270_ "(" then
                                                                                 (match (string_drop
                                                                                           _s5270_
                                                                                           (projT1
                                                                                            (string_length
                                                                                               "("))) with
                                                                                  | _s5271_ =>
                                                                                     (opt_spc_matches_prefix
                                                                                        _s5271_) >>= fun w__8 : option ((unit * {n : Z & ArithFact (n >=?
                                                                                       0)})) =>
                                                                                     (match w__8 with
                                                                                      | Some
                                                                                        (tt, existT _ _s5272_ _) =>
                                                                                         (match (string_drop
                                                                                                   _s5271_
                                                                                                   _s5272_) with
                                                                                          | _s5273_ =>
                                                                                             (reg_name_matches_prefix
                                                                                                _s5273_) >>= fun w__9 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                                                               0)})) =>
                                                                                             (match w__9 with
                                                                                              | Some
                                                                                                (rs1, existT _ _s5274_ _) =>
                                                                                                 (match (string_drop
                                                                                                           _s5273_
                                                                                                           _s5274_) with
                                                                                                  | _s5275_ =>
                                                                                                     (opt_spc_matches_prefix
                                                                                                        _s5275_) >>= fun w__10 : option ((unit * {n : Z & ArithFact (n >=?
                                                                                                       0)})) =>
                                                                                                     returnm (match w__10 with
                                                                                                              | Some
                                                                                                                (tt, existT _ _s5276_ _) =>
                                                                                                                 let _s5277_ :=
                                                                                                                   string_drop
                                                                                                                     _s5275_
                                                                                                                     _s5276_ in
                                                                                                                 if
                                                                                                                   string_startswith
                                                                                                                     _s5277_
                                                                                                                     ")"
                                                                                                                 then
                                                                                                                   match (string_drop
                                                                                                                            _s5277_
                                                                                                                            (projT1
                                                                                                                             (string_length
                                                                                                                                ")"))) with
                                                                                                                   | s_ =>
                                                                                                                      Some
                                                                                                                        (size, is_unsigned, aq, rl, rd, imm, rs1, s_)
                                                                                                                   end
                                                                                                                 else
                                                                                                                   None
                                                                                                              | _ =>
                                                                                                                 None
                                                                                                              end)
                                                                                                  end)
                                                                                                  : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                                                              | _ =>
                                                                                                 returnm None
                                                                                              end)
                                                                                              : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                                                          end)
                                                                                          : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                                                      | _ =>
                                                                                         returnm None
                                                                                      end)
                                                                                      : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                                                  end)
                                                                                  : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                                               else returnm None)
                                                                               : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                                           | _ => returnm None
                                                                           end)
                                                                           : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                                       end)
                                                                       : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                                   | _ => returnm None
                                                                   end)
                                                                   : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                               end)
                                                               : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                           | _ => returnm None
                                                           end)
                                                           : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                       end)
                                                       : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                                   | _ => returnm None
                                                   end)
                                                   : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                               end)
                                               : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                           | _ => returnm None
                                           end)
                                           : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                       end)
                                       : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                               end)
                               : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                       end)
                       : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
               end)
               : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
           | _ => returnm None
           end)
           : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
       end)
       : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)))
    else returnm None)
    : M (option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string))).

Definition _s5232_ (_s5233_ : string) : M (option ((rop * mword 5 * mword 5 * mword 5 * string))) :=
   (match _s5233_ with
    | _s5234_ =>
       (rtype_mnemonic_matches_prefix _s5234_) >>= fun w__0 : option ((rop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s5235_ _) =>
           (match (string_drop _s5234_ _s5235_) with
            | _s5236_ =>
               (spc_matches_prefix _s5236_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s5237_ _) =>
                   (match (string_drop _s5236_ _s5237_) with
                    | _s5238_ =>
                       (reg_name_matches_prefix _s5238_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s5239_ _) =>
                           (match (string_drop _s5238_ _s5239_) with
                            | _s5240_ =>
                               (sep_matches_prefix _s5240_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s5241_ _) =>
                                   (match (string_drop _s5240_ _s5241_) with
                                    | _s5242_ =>
                                       (reg_name_matches_prefix _s5242_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s5243_ _) =>
                                           (match (string_drop _s5242_ _s5243_) with
                                            | _s5244_ =>
                                               (sep_matches_prefix _s5244_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               (match w__5 with
                                                | Some (tt, existT _ _s5245_ _) =>
                                                   (match (string_drop _s5244_ _s5245_) with
                                                    | _s5246_ =>
                                                       (reg_name_matches_prefix _s5246_) >>= fun w__6 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                                         0)})) =>
                                                       returnm (match w__6 with
                                                                | Some (rs2, existT _ _s5247_ _) =>
                                                                   match (string_drop _s5246_
                                                                            _s5247_) with
                                                                   | s_ =>
                                                                      Some (op, rd, rs1, rs2, s_)
                                                                   end
                                                                | _ => None
                                                                end)
                                                    end)
                                                    : M (option ((rop * mword 5 * mword 5 * mword 5 * string)))
                                                | _ => returnm None
                                                end)
                                                : M (option ((rop * mword 5 * mword 5 * mword 5 * string)))
                                            end)
                                            : M (option ((rop * mword 5 * mword 5 * mword 5 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((rop * mword 5 * mword 5 * mword 5 * string)))
                                    end)
                                    : M (option ((rop * mword 5 * mword 5 * mword 5 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((rop * mword 5 * mword 5 * mword 5 * string)))
                            end)
                            : M (option ((rop * mword 5 * mword 5 * mword 5 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((rop * mword 5 * mword 5 * mword 5 * string)))
                    end)
                    : M (option ((rop * mword 5 * mword 5 * mword 5 * string)))
                | _ => returnm None
                end)
                : M (option ((rop * mword 5 * mword 5 * mword 5 * string)))
            end)
            : M (option ((rop * mword 5 * mword 5 * mword 5 * string)))
        | _ => returnm None
        end)
        : M (option ((rop * mword 5 * mword 5 * mword 5 * string)))
    end)
    : M (option ((rop * mword 5 * mword 5 * mword 5 * string))).

Definition _s5215_ (_s5216_ : string) : M (option ((sop * mword 5 * mword 5 * mword 6 * string))) :=
   (match _s5216_ with
    | _s5217_ =>
       (shiftiop_mnemonic_matches_prefix _s5217_) >>= fun w__0 : option ((sop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s5218_ _) =>
           (match (string_drop _s5217_ _s5218_) with
            | _s5219_ =>
               (spc_matches_prefix _s5219_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s5220_ _) =>
                   (match (string_drop _s5219_ _s5220_) with
                    | _s5221_ =>
                       (reg_name_matches_prefix _s5221_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s5222_ _) =>
                           (match (string_drop _s5221_ _s5222_) with
                            | _s5223_ =>
                               (sep_matches_prefix _s5223_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s5224_ _) =>
                                   (match (string_drop _s5223_ _s5224_) with
                                    | _s5225_ =>
                                       (reg_name_matches_prefix _s5225_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s5226_ _) =>
                                           (match (string_drop _s5225_ _s5226_) with
                                            | _s5227_ =>
                                               (sep_matches_prefix _s5227_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               returnm (match w__5 with
                                                        | Some (tt, existT _ _s5228_ _) =>
                                                           match (string_drop _s5227_ _s5228_) with
                                                           | _s5229_ =>
                                                              match (hex_bits_6_matches_prefix
                                                                       _s5229_) with
                                                              | Some (shamt, existT _ _s5230_ _) =>
                                                                 match (string_drop _s5229_ _s5230_) with
                                                                 | s_ =>
                                                                    Some (op, rd, rs1, shamt, s_)
                                                                 end
                                                              | _ => None
                                                              end
                                                           end
                                                        | _ => None
                                                        end)
                                            end)
                                            : M (option ((sop * mword 5 * mword 5 * mword 6 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((sop * mword 5 * mword 5 * mword 6 * string)))
                                    end)
                                    : M (option ((sop * mword 5 * mword 5 * mword 6 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((sop * mword 5 * mword 5 * mword 6 * string)))
                            end)
                            : M (option ((sop * mword 5 * mword 5 * mword 6 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((sop * mword 5 * mword 5 * mword 6 * string)))
                    end)
                    : M (option ((sop * mword 5 * mword 5 * mword 6 * string)))
                | _ => returnm None
                end)
                : M (option ((sop * mword 5 * mword 5 * mword 6 * string)))
            end)
            : M (option ((sop * mword 5 * mword 5 * mword 6 * string)))
        | _ => returnm None
        end)
        : M (option ((sop * mword 5 * mword 5 * mword 6 * string)))
    end)
    : M (option ((sop * mword 5 * mword 5 * mword 6 * string))).

Definition _s5198_ (_s5199_ : string) : M (option ((iop * mword 5 * mword 5 * mword 12 * string))) :=
   (match _s5199_ with
    | _s5200_ =>
       (itype_mnemonic_matches_prefix _s5200_) >>= fun w__0 : option ((iop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s5201_ _) =>
           (match (string_drop _s5200_ _s5201_) with
            | _s5202_ =>
               (spc_matches_prefix _s5202_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s5203_ _) =>
                   (match (string_drop _s5202_ _s5203_) with
                    | _s5204_ =>
                       (reg_name_matches_prefix _s5204_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s5205_ _) =>
                           (match (string_drop _s5204_ _s5205_) with
                            | _s5206_ =>
                               (sep_matches_prefix _s5206_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s5207_ _) =>
                                   (match (string_drop _s5206_ _s5207_) with
                                    | _s5208_ =>
                                       (reg_name_matches_prefix _s5208_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs1, existT _ _s5209_ _) =>
                                           (match (string_drop _s5208_ _s5209_) with
                                            | _s5210_ =>
                                               (sep_matches_prefix _s5210_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               returnm (match w__5 with
                                                        | Some (tt, existT _ _s5211_ _) =>
                                                           match (string_drop _s5210_ _s5211_) with
                                                           | _s5212_ =>
                                                              match (hex_bits_12_matches_prefix
                                                                       _s5212_) with
                                                              | Some (imm, existT _ _s5213_ _) =>
                                                                 match (string_drop _s5212_ _s5213_) with
                                                                 | s_ => Some (op, rd, rs1, imm, s_)
                                                                 end
                                                              | _ => None
                                                              end
                                                           end
                                                        | _ => None
                                                        end)
                                            end)
                                            : M (option ((iop * mword 5 * mword 5 * mword 12 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((iop * mword 5 * mword 5 * mword 12 * string)))
                                    end)
                                    : M (option ((iop * mword 5 * mword 5 * mword 12 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((iop * mword 5 * mword 5 * mword 12 * string)))
                            end)
                            : M (option ((iop * mword 5 * mword 5 * mword 12 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((iop * mword 5 * mword 5 * mword 12 * string)))
                    end)
                    : M (option ((iop * mword 5 * mword 5 * mword 12 * string)))
                | _ => returnm None
                end)
                : M (option ((iop * mword 5 * mword 5 * mword 12 * string)))
            end)
            : M (option ((iop * mword 5 * mword 5 * mword 12 * string)))
        | _ => returnm None
        end)
        : M (option ((iop * mword 5 * mword 5 * mword 12 * string)))
    end)
    : M (option ((iop * mword 5 * mword 5 * mword 12 * string))).

Definition _s5181_ (_s5182_ : string) : M (option ((bop * mword 5 * mword 5 * mword 13 * string))) :=
   (match _s5182_ with
    | _s5183_ =>
       (btype_mnemonic_matches_prefix _s5183_) >>= fun w__0 : option ((bop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s5184_ _) =>
           (match (string_drop _s5183_ _s5184_) with
            | _s5185_ =>
               (spc_matches_prefix _s5185_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s5186_ _) =>
                   (match (string_drop _s5185_ _s5186_) with
                    | _s5187_ =>
                       (reg_name_matches_prefix _s5187_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rs1, existT _ _s5188_ _) =>
                           (match (string_drop _s5187_ _s5188_) with
                            | _s5189_ =>
                               (sep_matches_prefix _s5189_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               (match w__3 with
                                | Some (tt, existT _ _s5190_ _) =>
                                   (match (string_drop _s5189_ _s5190_) with
                                    | _s5191_ =>
                                       (reg_name_matches_prefix _s5191_) >>= fun w__4 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                         0)})) =>
                                       (match w__4 with
                                        | Some (rs2, existT _ _s5192_ _) =>
                                           (match (string_drop _s5191_ _s5192_) with
                                            | _s5193_ =>
                                               (sep_matches_prefix _s5193_) >>= fun w__5 : option ((unit * {n : Z & ArithFact (n >=?
                                                 0)})) =>
                                               returnm (match w__5 with
                                                        | Some (tt, existT _ _s5194_ _) =>
                                                           match (string_drop _s5193_ _s5194_) with
                                                           | _s5195_ =>
                                                              match (hex_bits_13_matches_prefix
                                                                       _s5195_) with
                                                              | Some (imm, existT _ _s5196_ _) =>
                                                                 match (string_drop _s5195_ _s5196_) with
                                                                 | s_ =>
                                                                    Some (op, rs1, rs2, imm, s_)
                                                                 end
                                                              | _ => None
                                                              end
                                                           end
                                                        | _ => None
                                                        end)
                                            end)
                                            : M (option ((bop * mword 5 * mword 5 * mword 13 * string)))
                                        | _ => returnm None
                                        end)
                                        : M (option ((bop * mword 5 * mword 5 * mword 13 * string)))
                                    end)
                                    : M (option ((bop * mword 5 * mword 5 * mword 13 * string)))
                                | _ => returnm None
                                end)
                                : M (option ((bop * mword 5 * mword 5 * mword 13 * string)))
                            end)
                            : M (option ((bop * mword 5 * mword 5 * mword 13 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((bop * mword 5 * mword 5 * mword 13 * string)))
                    end)
                    : M (option ((bop * mword 5 * mword 5 * mword 13 * string)))
                | _ => returnm None
                end)
                : M (option ((bop * mword 5 * mword 5 * mword 13 * string)))
            end)
            : M (option ((bop * mword 5 * mword 5 * mword 13 * string)))
        | _ => returnm None
        end)
        : M (option ((bop * mword 5 * mword 5 * mword 13 * string)))
    end)
    : M (option ((bop * mword 5 * mword 5 * mword 13 * string))).

Definition _s5165_ (_s5166_ : string) : M (option ((mword 5 * mword 5 * mword 12 * string))) :=
   let _s5167_ := _s5166_ in
   (if string_startswith _s5167_ "jalr" then
      (match (string_drop _s5167_ (projT1 (string_length "jalr"))) with
       | _s5168_ =>
          (spc_matches_prefix _s5168_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5169_ _) =>
              (match (string_drop _s5168_ _s5169_) with
               | _s5170_ =>
                  (reg_name_matches_prefix _s5170_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s5171_ _) =>
                      (match (string_drop _s5170_ _s5171_) with
                       | _s5172_ =>
                          (sep_matches_prefix _s5172_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          (match w__2 with
                           | Some (tt, existT _ _s5173_ _) =>
                              (match (string_drop _s5172_ _s5173_) with
                               | _s5174_ =>
                                  (reg_name_matches_prefix _s5174_) >>= fun w__3 : option ((mword 5 * {n : Z & ArithFact (n >=?
                                    0)})) =>
                                  (match w__3 with
                                   | Some (rs1, existT _ _s5175_ _) =>
                                      (match (string_drop _s5174_ _s5175_) with
                                       | _s5176_ =>
                                          (sep_matches_prefix _s5176_) >>= fun w__4 : option ((unit * {n : Z & ArithFact (n >=?
                                            0)})) =>
                                          returnm (match w__4 with
                                                   | Some (tt, existT _ _s5177_ _) =>
                                                      match (string_drop _s5176_ _s5177_) with
                                                      | _s5178_ =>
                                                         match (hex_bits_12_matches_prefix _s5178_) with
                                                         | Some (imm, existT _ _s5179_ _) =>
                                                            match (string_drop _s5178_ _s5179_) with
                                                            | s_ => Some (rd, rs1, imm, s_)
                                                            end
                                                         | _ => None
                                                         end
                                                      end
                                                   | _ => None
                                                   end)
                                       end)
                                       : M (option ((mword 5 * mword 5 * mword 12 * string)))
                                   | _ => returnm None
                                   end)
                                   : M (option ((mword 5 * mword 5 * mword 12 * string)))
                               end)
                               : M (option ((mword 5 * mword 5 * mword 12 * string)))
                           | _ => returnm None
                           end)
                           : M (option ((mword 5 * mword 5 * mword 12 * string)))
                       end)
                       : M (option ((mword 5 * mword 5 * mword 12 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 5 * mword 12 * string)))
               end)
               : M (option ((mword 5 * mword 5 * mword 12 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 5 * mword 12 * string)))
       end)
       : M (option ((mword 5 * mword 5 * mword 12 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 5 * mword 12 * string))).

Definition _s5153_ (_s5154_ : string) : M (option ((mword 5 * mword 21 * string))) :=
   let _s5155_ := _s5154_ in
   (if string_startswith _s5155_ "jal" then
      (match (string_drop _s5155_ (projT1 (string_length "jal"))) with
       | _s5156_ =>
          (spc_matches_prefix _s5156_) >>= fun w__0 : option ((unit * {n : Z & ArithFact (n >=? 0)})) =>
          (match w__0 with
           | Some (tt, existT _ _s5157_ _) =>
              (match (string_drop _s5156_ _s5157_) with
               | _s5158_ =>
                  (reg_name_matches_prefix _s5158_) >>= fun w__1 : option ((mword 5 * {n : Z & ArithFact (n >=?
                    0)})) =>
                  (match w__1 with
                   | Some (rd, existT _ _s5159_ _) =>
                      (match (string_drop _s5158_ _s5159_) with
                       | _s5160_ =>
                          (sep_matches_prefix _s5160_) >>= fun w__2 : option ((unit * {n : Z & ArithFact (n >=?
                            0)})) =>
                          returnm (match w__2 with
                                   | Some (tt, existT _ _s5161_ _) =>
                                      match (string_drop _s5160_ _s5161_) with
                                      | _s5162_ =>
                                         match (hex_bits_21_matches_prefix _s5162_) with
                                         | Some (imm, existT _ _s5163_ _) =>
                                            match (string_drop _s5162_ _s5163_) with
                                            | s_ => Some (rd, imm, s_)
                                            end
                                         | _ => None
                                         end
                                      end
                                   | _ => None
                                   end)
                       end)
                       : M (option ((mword 5 * mword 21 * string)))
                   | _ => returnm None
                   end)
                   : M (option ((mword 5 * mword 21 * string)))
               end)
               : M (option ((mword 5 * mword 21 * string)))
           | _ => returnm None
           end)
           : M (option ((mword 5 * mword 21 * string)))
       end)
       : M (option ((mword 5 * mword 21 * string)))
    else returnm None)
    : M (option ((mword 5 * mword 21 * string))).

Definition _s5140_ (_s5141_ : string) : M (option ((uop * mword 5 * mword 20 * string))) :=
   (match _s5141_ with
    | _s5142_ =>
       (utype_mnemonic_matches_prefix _s5142_) >>= fun w__0 : option ((uop * {n : Z & ArithFact (n >=?
         0)})) =>
       (match w__0 with
        | Some (op, existT _ _s5143_ _) =>
           (match (string_drop _s5142_ _s5143_) with
            | _s5144_ =>
               (spc_matches_prefix _s5144_) >>= fun w__1 : option ((unit * {n : Z & ArithFact (n >=?
                 0)})) =>
               (match w__1 with
                | Some (tt, existT _ _s5145_ _) =>
                   (match (string_drop _s5144_ _s5145_) with
                    | _s5146_ =>
                       (reg_name_matches_prefix _s5146_) >>= fun w__2 : option ((mword 5 * {n : Z & ArithFact (n >=?
                         0)})) =>
                       (match w__2 with
                        | Some (rd, existT _ _s5147_ _) =>
                           (match (string_drop _s5146_ _s5147_) with
                            | _s5148_ =>
                               (sep_matches_prefix _s5148_) >>= fun w__3 : option ((unit * {n : Z & ArithFact (n >=?
                                 0)})) =>
                               returnm (match w__3 with
                                        | Some (tt, existT _ _s5149_ _) =>
                                           match (string_drop _s5148_ _s5149_) with
                                           | _s5150_ =>
                                              match (hex_bits_20_matches_prefix _s5150_) with
                                              | Some (imm, existT _ _s5151_ _) =>
                                                 match (string_drop _s5150_ _s5151_) with
                                                 | s_ => Some (op, rd, imm, s_)
                                                 end
                                              | _ => None
                                              end
                                           end
                                        | _ => None
                                        end)
                            end)
                            : M (option ((uop * mword 5 * mword 20 * string)))
                        | _ => returnm None
                        end)
                        : M (option ((uop * mword 5 * mword 20 * string)))
                    end)
                    : M (option ((uop * mword 5 * mword 20 * string)))
                | _ => returnm None
                end)
                : M (option ((uop * mword 5 * mword 20 * string)))
            end)
            : M (option ((uop * mword 5 * mword 20 * string)))
        | _ => returnm None
        end)
        : M (option ((uop * mword 5 * mword 20 * string)))
    end)
    : M (option ((uop * mword 5 * mword 20 * string))).

Definition assembly_matches_prefix (arg_ : string)
: M (option ((ast * {n : Z & ArithFact (n >=? 0)}))) :=
   let _s5152_ := arg_ in
   (_s5140_ _s5152_) >>= fun w__0 : option ((uop * mword 5 * mword 20 * string)) =>
   (if match w__0 with | Some (op, rd, imm, s_) => true | _ => false end then
      (_s5140_ _s5152_) >>= fun w__1 : option ((uop * mword 5 * mword 20 * string)) =>
      (match w__1 with
       | Some (op, rd, imm, s_) =>
          returnm (Some
                     (UTYPE (imm, rd, op), build_ex
                     (projT1
                      (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
       | _ => exit tt  : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
       end)
       : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
    else
      (_s5153_ _s5152_) >>= fun w__4 : option ((mword 5 * mword 21 * string)) =>
      (if match w__4 with | Some (rd, imm, s_) => true | _ => false end then
         (_s5153_ _s5152_) >>= fun w__5 : option ((mword 5 * mword 21 * string)) =>
         (match w__5 with
          | Some (rd, imm, s_) =>
             returnm (Some
                        (RISCV_JAL (imm, rd), build_ex
                        (projT1
                         (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
          | _ => exit tt  : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
          end)
          : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
       else
         (_s5165_ _s5152_) >>= fun w__8 : option ((mword 5 * mword 5 * mword 12 * string)) =>
         (if match w__8 with | Some (rd, rs1, imm, s_) => true | _ => false end then
            (_s5165_ _s5152_) >>= fun w__9 : option ((mword 5 * mword 5 * mword 12 * string)) =>
            (match w__9 with
             | Some (rd, rs1, imm, s_) =>
                returnm (Some
                           (RISCV_JALR (imm, rs1, rd), build_ex
                           (projT1
                            (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
             | _ => exit tt  : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
             end)
             : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
          else
            (_s5181_ _s5152_) >>= fun w__12 : option ((bop * mword 5 * mword 5 * mword 13 * string)) =>
            (if match w__12 with | Some (op, rs1, rs2, imm, s_) => true | _ => false end then
               (_s5181_ _s5152_) >>= fun w__13 : option ((bop * mword 5 * mword 5 * mword 13 * string)) =>
               (match w__13 with
                | Some (op, rs1, rs2, imm, s_) =>
                   returnm (Some
                              (BTYPE (imm, rs2, rs1, op), build_ex
                              (projT1
                               (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
                | _ => exit tt  : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                end)
                : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
             else
               (_s5198_ _s5152_) >>= fun w__16 : option ((iop * mword 5 * mword 5 * mword 12 * string)) =>
               (if match w__16 with | Some (op, rd, rs1, imm, s_) => true | _ => false end then
                  (_s5198_ _s5152_) >>= fun w__17 : option ((iop * mword 5 * mword 5 * mword 12 * string)) =>
                  (match w__17 with
                   | Some (op, rd, rs1, imm, s_) =>
                      returnm (Some
                                 (ITYPE (imm, rs1, rd, op), build_ex
                                 (projT1
                                  (sub_nat (projT1 (string_length arg_)) (projT1 (string_length s_))))))
                   | _ => exit tt  : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                   end)
                   : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                else
                  (_s5215_ _s5152_) >>= fun w__20 : option ((sop * mword 5 * mword 5 * mword 6 * string)) =>
                  (if match w__20 with | Some (op, rd, rs1, shamt, s_) => true | _ => false end then
                     (_s5215_ _s5152_) >>= fun w__21 : option ((sop * mword 5 * mword 5 * mword 6 * string)) =>
                     (match w__21 with
                      | Some (op, rd, rs1, shamt, s_) =>
                         returnm (Some
                                    (SHIFTIOP (shamt, rs1, rd, op), build_ex
                                    (projT1
                                     (sub_nat (projT1 (string_length arg_))
                                        (projT1
                                         (string_length s_))))))
                      | _ => exit tt  : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                      end)
                      : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                   else
                     (_s5232_ _s5152_) >>= fun w__24 : option ((rop * mword 5 * mword 5 * mword 5 * string)) =>
                     (if match w__24 with | Some (op, rd, rs1, rs2, s_) => true | _ => false end
                      then
                        (_s5232_ _s5152_) >>= fun w__25 : option ((rop * mword 5 * mword 5 * mword 5 * string)) =>
                        (match w__25 with
                         | Some (op, rd, rs1, rs2, s_) =>
                            returnm (Some
                                       (RTYPE (rs2, rs1, rd, op), build_ex
                                       (projT1
                                        (sub_nat (projT1 (string_length arg_))
                                           (projT1
                                            (string_length s_))))))
                         | _ => exit tt  : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                         end)
                         : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                      else
                        (_s5249_ _s5152_) >>= fun w__28 : option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)) =>
                        (if match w__28 with
                            | Some (size, is_unsigned, aq, rl, rd, imm, rs1, s_) => true
                            | _ => false
                            end then
                           (_s5249_ _s5152_) >>= fun w__29 : option ((word_width * bool * bool * bool * mword 5 * mword 12 * mword 5 * string)) =>
                           (match w__29 with
                            | Some (size, is_unsigned, aq, rl, rd, imm, rs1, s_) =>
                               returnm (Some
                                          (LOAD (imm, rs1, rd, is_unsigned, size, aq, rl), build_ex
                                          (projT1
                                           (sub_nat (projT1 (string_length arg_))
                                              (projT1
                                               (string_length s_))))))
                            | _ => exit tt  : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                            end)
                            : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                         else
                           (_s5279_ _s5152_) >>= fun w__32 : option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)) =>
                           (if match w__32 with
                               | Some (size, aq, rl, rs2, imm, rs1, s_) => true
                               | _ => false
                               end then
                              (_s5279_ _s5152_) >>= fun w__33 : option ((word_width * bool * bool * mword 5 * mword 12 * mword 5 * string)) =>
                              (match w__33 with
                               | Some (size, aq, rl, rs2, imm, rs1, s_) =>
                                  returnm (Some
                                             (STORE (imm, rs2, rs1, size, aq, rl), build_ex
                                             (projT1
                                              (sub_nat (projT1 (string_length arg_))
                                                 (projT1
                                                  (string_length s_))))))
                               | _ => exit tt  : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                               end)
                               : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                            else
                              (_s5307_ _s5152_) >>= fun w__36 : option ((mword 5 * mword 5 * mword 12 * string)) =>
                              (if match w__36 with
                                  | Some (rd, rs1, imm, s_) => Z.eqb 64 64
                                  | _ => false
                                  end then
                                 (_s5307_ _s5152_) >>= fun w__37 : option ((mword 5 * mword 5 * mword 12 * string)) =>
                                 (match w__37 with
                                  | Some (rd, rs1, imm, s_) =>
                                     returnm (Some
                                                (ADDIW (imm, rs1, rd), build_ex
                                                (projT1
                                                 (sub_nat (projT1 (string_length arg_))
                                                    (projT1
                                                     (string_length s_))))))
                                  | _ =>
                                     exit tt  : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                  end)
                                  : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                               else
                                 (_s5323_ _s5152_) >>= fun w__40 : option ((sop * mword 5 * mword 5 * mword 5 * string)) =>
                                 (if match w__40 with
                                     | Some (op, rd, rs1, shamt, s_) => Z.eqb 64 64
                                     | _ => false
                                     end then
                                    (_s5323_ _s5152_) >>= fun w__41 : option ((sop * mword 5 * mword 5 * mword 5 * string)) =>
                                    (match w__41 with
                                     | Some (op, rd, rs1, shamt, s_) =>
                                        returnm (Some
                                                   (SHIFTW (shamt, rs1, rd, op), build_ex
                                                   (projT1
                                                    (sub_nat (projT1 (string_length arg_))
                                                       (projT1
                                                        (string_length s_))))))
                                     | _ =>
                                        exit tt
                                         : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                     end)
                                     : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                  else
                                    (_s5340_ _s5152_) >>= fun w__44 : option ((ropw * mword 5 * mword 5 * mword 5 * string)) =>
                                    (if match w__44 with
                                        | Some (op, rd, rs1, rs2, s_) => Z.eqb 64 64
                                        | _ => false
                                        end then
                                       (_s5340_ _s5152_) >>= fun w__45 : option ((ropw * mword 5 * mword 5 * mword 5 * string)) =>
                                       (match w__45 with
                                        | Some (op, rd, rs1, rs2, s_) =>
                                           returnm (Some
                                                      (RTYPEW (rs2, rs1, rd, op), build_ex
                                                      (projT1
                                                       (sub_nat (projT1 (string_length arg_))
                                                          (projT1
                                                           (string_length s_))))))
                                        | _ =>
                                           exit tt
                                            : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                        end)
                                        : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                     else
                                       (_s5357_ _s5152_) >>= fun w__48 : option ((sopw * mword 5 * mword 5 * mword 5 * string)) =>
                                       (if match w__48 with
                                           | Some (op, rd, rs1, shamt, s_) => Z.eqb 64 64
                                           | _ => false
                                           end then
                                          (_s5357_ _s5152_) >>= fun w__49 : option ((sopw * mword 5 * mword 5 * mword 5 * string)) =>
                                          (match w__49 with
                                           | Some (op, rd, rs1, shamt, s_) =>
                                              returnm (Some
                                                         (SHIFTIWOP (shamt, rs1, rd, op), build_ex
                                                         (projT1
                                                          (sub_nat (projT1 (string_length arg_))
                                                             (projT1
                                                              (string_length s_))))))
                                           | _ =>
                                              exit tt
                                               : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                           end)
                                           : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                        else
                                          (_s5374_ _s5152_) >>= fun w__52 : option ((mword 4 * mword 4 * string)) =>
                                          (if match w__52 with
                                              | Some (pred, succ, s_) => true
                                              | _ => false
                                              end then
                                             (_s5374_ _s5152_) >>= fun w__53 : option ((mword 4 * mword 4 * string)) =>
                                             (match w__53 with
                                              | Some (pred, succ, s_) =>
                                                 returnm (Some
                                                            (FENCE (pred, succ), build_ex
                                                            (projT1
                                                             (sub_nat (projT1 (string_length arg_))
                                                                (projT1
                                                                 (string_length s_))))))
                                              | _ =>
                                                 exit tt
                                                  : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                              end)
                                              : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                           else
                                             (_s5386_ _s5152_) >>= fun w__56 : option ((mword 4 * mword 4 * string)) =>
                                             (if match w__56 with
                                                 | Some (pred, succ, s_) => true
                                                 | _ => false
                                                 end then
                                                (_s5386_ _s5152_) >>= fun w__57 : option ((mword 4 * mword 4 * string)) =>
                                                (match w__57 with
                                                 | Some (pred, succ, s_) =>
                                                    returnm (Some
                                                               (FENCE_TSO (pred, succ), build_ex
                                                               (projT1
                                                                (sub_nat
                                                                   (projT1
                                                                    (string_length arg_))
                                                                   (projT1
                                                                    (string_length s_))))))
                                                 | _ =>
                                                    exit tt
                                                     : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                                 end)
                                                 : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                              else if match (_s5398_ _s5152_) with
                                                      | Some s_ => true
                                                      | _ => false
                                                      end then
                                                (match (_s5398_ _s5152_) with
                                                 | Some s_ =>
                                                    returnm (Some
                                                               (FENCEI tt, build_ex
                                                               (projT1
                                                                (sub_nat
                                                                   (projT1
                                                                    (string_length arg_))
                                                                   (projT1
                                                                    (string_length s_))))))
                                                 | _ =>
                                                    exit tt
                                                     : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                                 end)
                                                 : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                              else if match (_s5402_ _s5152_) with
                                                      | Some s_ => true
                                                      | _ => false
                                                      end then
                                                (match (_s5402_ _s5152_) with
                                                 | Some s_ =>
                                                    returnm (Some
                                                               (ECALL tt, build_ex
                                                               (projT1
                                                                (sub_nat
                                                                   (projT1
                                                                    (string_length arg_))
                                                                   (projT1
                                                                    (string_length s_))))))
                                                 | _ =>
                                                    exit tt
                                                     : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                                 end)
                                                 : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                              else if match (_s5406_ _s5152_) with
                                                      | Some s_ => true
                                                      | _ => false
                                                      end then
                                                (match (_s5406_ _s5152_) with
                                                 | Some s_ =>
                                                    returnm (Some
                                                               (MRET tt, build_ex
                                                               (projT1
                                                                (sub_nat
                                                                   (projT1
                                                                    (string_length arg_))
                                                                   (projT1
                                                                    (string_length s_))))))
                                                 | _ =>
                                                    exit tt
                                                     : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                                 end)
                                                 : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                              else if match (_s5410_ _s5152_) with
                                                      | Some s_ => true
                                                      | _ => false
                                                      end then
                                                (match (_s5410_ _s5152_) with
                                                 | Some s_ =>
                                                    returnm (Some
                                                               (SRET tt, build_ex
                                                               (projT1
                                                                (sub_nat
                                                                   (projT1
                                                                    (string_length arg_))
                                                                   (projT1
                                                                    (string_length s_))))))
                                                 | _ =>
                                                    exit tt
                                                     : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                                 end)
                                                 : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                              else if match (_s5414_ _s5152_) with
                                                      | Some s_ => true
                                                      | _ => false
                                                      end then
                                                (match (_s5414_ _s5152_) with
                                                 | Some s_ =>
                                                    returnm (Some
                                                               (EBREAK tt, build_ex
                                                               (projT1
                                                                (sub_nat
                                                                   (projT1
                                                                    (string_length arg_))
                                                                   (projT1
                                                                    (string_length s_))))))
                                                 | _ =>
                                                    exit tt
                                                     : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                                 end)
                                                 : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                              else if match (_s5418_ _s5152_) with
                                                      | Some s_ => true
                                                      | _ => false
                                                      end then
                                                (match (_s5418_ _s5152_) with
                                                 | Some s_ =>
                                                    returnm (Some
                                                               (WFI tt, build_ex
                                                               (projT1
                                                                (sub_nat
                                                                   (projT1
                                                                    (string_length arg_))
                                                                   (projT1
                                                                    (string_length s_))))))
                                                 | _ =>
                                                    exit tt
                                                     : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                                 end)
                                                 : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                              else
                                                (_s5422_ _s5152_) >>= fun w__72 : option ((mword 5 * mword 5 * string)) =>
                                                (if match w__72 with
                                                    | Some (rs1, rs2, s_) => true
                                                    | _ => false
                                                    end then
                                                   (_s5422_ _s5152_) >>= fun w__73 : option ((mword 5 * mword 5 * string)) =>
                                                   (match w__73 with
                                                    | Some (rs1, rs2, s_) =>
                                                       returnm (Some
                                                                  (SFENCE_VMA (rs1, rs2), build_ex
                                                                  (projT1
                                                                   (sub_nat
                                                                      (projT1
                                                                       (string_length arg_))
                                                                      (projT1
                                                                       (string_length s_))))))
                                                    | _ =>
                                                       exit tt
                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                         0)})))
                                                    end)
                                                    : M (option ((ast * {n : Z & ArithFact (n >=? 0)})))
                                                 else
                                                   (_s5434_ _s5152_) >>= fun w__76 : option ((word_width * bool * bool * mword 5 * mword 5 * string)) =>
                                                   (if match w__76 with
                                                       | Some (size, aq, rl, rd, rs1, s_) => true
                                                       | _ => false
                                                       end then
                                                      (_s5434_ _s5152_) >>= fun w__77 : option ((word_width * bool * bool * mword 5 * mword 5 * string)) =>
                                                      (match w__77 with
                                                       | Some (size, aq, rl, rd, rs1, s_) =>
                                                          returnm (Some
                                                                     (LOADRES
                                                                        (aq, rl, rs1, size, rd), build_ex
                                                                     (projT1
                                                                      (sub_nat
                                                                         (projT1
                                                                          (string_length arg_))
                                                                         (projT1
                                                                          (string_length s_))))))
                                                       | _ =>
                                                          exit tt
                                                           : M (option ((ast * {n : Z & ArithFact (n >=?
                                                            0)})))
                                                       end)
                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                        0)})))
                                                    else
                                                      (_s5452_ _s5152_) >>= fun w__80 : option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)) =>
                                                      (if match w__80 with
                                                          | Some (size, aq, rl, rd, rs1, rs2, s_) =>
                                                             true
                                                          | _ => false
                                                          end then
                                                         (_s5452_ _s5152_) >>= fun w__81 : option ((word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)) =>
                                                         (match w__81 with
                                                          | Some (size, aq, rl, rd, rs1, rs2, s_) =>
                                                             returnm (Some
                                                                        (STORECON
                                                                           (aq, rl, rs2, rs1, size, rd), build_ex
                                                                        (projT1
                                                                         (sub_nat
                                                                            (projT1
                                                                             (string_length arg_))
                                                                            (projT1
                                                                             (string_length s_))))))
                                                          | _ =>
                                                             exit tt
                                                              : M (option ((ast * {n : Z & ArithFact (n >=?
                                                               0)})))
                                                          end)
                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                           0)})))
                                                       else
                                                         (_s5474_ _s5152_) >>= fun w__84 : option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)) =>
                                                         (if match w__84 with
                                                             | Some
                                                               (op, width, aq, rl, rd, rs2, rs1, s_) =>
                                                                true
                                                             | _ => false
                                                             end then
                                                            (_s5474_ _s5152_) >>= fun w__85 : option ((amoop * word_width * bool * bool * mword 5 * mword 5 * mword 5 * string)) =>
                                                            (match w__85 with
                                                             | Some
                                                               (op, width, aq, rl, rd, rs2, rs1, s_) =>
                                                                returnm (Some
                                                                           (AMO
                                                                              (op, aq, rl, rs2, rs1, width, rd), build_ex
                                                                           (projT1
                                                                            (sub_nat
                                                                               (projT1
                                                                                (string_length arg_))
                                                                               (projT1
                                                                                (string_length s_))))))
                                                             | _ =>
                                                                exit tt
                                                                 : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                  0)})))
                                                             end)
                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                              0)})))
                                                          else if match (_s5500_ _s5152_) with
                                                                  | Some s_ => true
                                                                  | _ => false
                                                                  end then
                                                            (match (_s5500_ _s5152_) with
                                                             | Some s_ =>
                                                                returnm (Some
                                                                           (C_NOP tt, build_ex
                                                                           (projT1
                                                                            (sub_nat
                                                                               (projT1
                                                                                (string_length arg_))
                                                                               (projT1
                                                                                (string_length s_))))))
                                                             | _ =>
                                                                exit tt
                                                                 : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                  0)})))
                                                             end)
                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                              0)})))
                                                          else
                                                            (_s5504_ _s5152_) >>= fun w__90 : option ((mword 3 * mword 8 * string)) =>
                                                            (if match w__90 with
                                                                | Some (rdc, nzimm, s_) =>
                                                                   neq_vec nzimm (Ox"00"  : mword 8)
                                                                | _ => false
                                                                end then
                                                               (_s5504_ _s5152_) >>= fun w__91 : option ((mword 3 * mword 8 * string)) =>
                                                               (match w__91 with
                                                                | Some (rdc, nzimm, s_) =>
                                                                   returnm (Some
                                                                              (C_ADDI4SPN
                                                                                 (rdc, nzimm), build_ex
                                                                              (projT1
                                                                               (sub_nat
                                                                                  (projT1
                                                                                   (string_length
                                                                                      arg_))
                                                                                  (projT1
                                                                                   (string_length s_))))))
                                                                | _ =>
                                                                   exit tt
                                                                    : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                     0)})))
                                                                end)
                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                 0)})))
                                                             else
                                                               (_s5516_ _s5152_) >>= fun w__94 : option ((mword 3 * mword 3 * mword 5 * string)) =>
                                                               (if match w__94 with
                                                                   | Some (rdc, rsc, uimm, s_) =>
                                                                      true
                                                                   | _ => false
                                                                   end then
                                                                  (_s5516_ _s5152_) >>= fun w__95 : option ((mword 3 * mword 3 * mword 5 * string)) =>
                                                                  (match w__95 with
                                                                   | Some (rdc, rsc, uimm, s_) =>
                                                                      returnm (Some
                                                                                 (C_LW
                                                                                    (uimm, rsc, rdc), build_ex
                                                                                 (projT1
                                                                                  (sub_nat
                                                                                     (projT1
                                                                                      (string_length
                                                                                         arg_))
                                                                                     (projT1
                                                                                      (string_length
                                                                                         s_))))))
                                                                   | _ =>
                                                                      exit tt
                                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                        0)})))
                                                                   end)
                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                    0)})))
                                                                else
                                                                  (_s5532_ _s5152_) >>= fun w__98 : option ((mword 3 * mword 3 * mword 5 * string)) =>
                                                                  (if match w__98 with
                                                                      | Some (rdc, rsc, uimm, s_) =>
                                                                         Z.eqb 64 64
                                                                      | _ => false
                                                                      end then
                                                                     (_s5532_ _s5152_) >>= fun w__99 : option ((mword 3 * mword 3 * mword 5 * string)) =>
                                                                     (match w__99 with
                                                                      | Some (rdc, rsc, uimm, s_) =>
                                                                         returnm (Some
                                                                                    (C_LD
                                                                                       (uimm, rsc, rdc), build_ex
                                                                                    (projT1
                                                                                     (sub_nat
                                                                                        (projT1
                                                                                         (string_length
                                                                                            arg_))
                                                                                        (projT1
                                                                                         (string_length
                                                                                            s_))))))
                                                                      | _ =>
                                                                         exit tt
                                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                           0)})))
                                                                      end)
                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                       0)})))
                                                                   else
                                                                     (_s5548_ _s5152_) >>= fun w__102 : option ((mword 3 * mword 3 * mword 5 * string)) =>
                                                                     (if match w__102 with
                                                                         | Some
                                                                           (rsc1, rsc2, uimm, s_) =>
                                                                            true
                                                                         | _ => false
                                                                         end then
                                                                        (_s5548_ _s5152_) >>= fun w__103 : option ((mword 3 * mword 3 * mword 5 * string)) =>
                                                                        (match w__103 with
                                                                         | Some
                                                                           (rsc1, rsc2, uimm, s_) =>
                                                                            returnm (Some
                                                                                       (C_SW
                                                                                          (uimm, rsc1, rsc2), build_ex
                                                                                       (projT1
                                                                                        (sub_nat
                                                                                           (projT1
                                                                                            (string_length
                                                                                               arg_))
                                                                                           (projT1
                                                                                            (string_length
                                                                                               s_))))))
                                                                         | _ =>
                                                                            exit tt
                                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                              0)})))
                                                                         end)
                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                          0)})))
                                                                      else
                                                                        (_s5564_ _s5152_) >>= fun w__106 : option ((mword 3 * mword 3 * mword 5 * string)) =>
                                                                        (if match w__106 with
                                                                            | Some
                                                                              (rsc1, rsc2, uimm, s_) =>
                                                                               Z.eqb 64 64
                                                                            | _ => false
                                                                            end then
                                                                           (_s5564_ _s5152_) >>= fun w__107 : option ((mword 3 * mword 3 * mword 5 * string)) =>
                                                                           (match w__107 with
                                                                            | Some
                                                                              (rsc1, rsc2, uimm, s_) =>
                                                                               returnm (Some
                                                                                          (C_SD
                                                                                             (uimm, rsc1, rsc2), build_ex
                                                                                          (projT1
                                                                                           (sub_nat
                                                                                              (projT1
                                                                                               (string_length
                                                                                                  arg_))
                                                                                              (projT1
                                                                                               (string_length
                                                                                                  s_))))))
                                                                            | _ =>
                                                                               exit tt
                                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                 0)})))
                                                                            end)
                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                             0)})))
                                                                         else
                                                                           (_s5580_ _s5152_) >>= fun w__110 : option ((mword 5 * mword 6 * string)) =>
                                                                           (if match w__110 with
                                                                               | Some (rsd, nzi, s_) =>
                                                                                  andb
                                                                                    (neq_vec nzi
                                                                                       ('b"000000"
                                                                                        : mword 6))
                                                                                    (neq_vec rsd
                                                                                       zreg)
                                                                               | _ => false
                                                                               end then
                                                                              (_s5580_ _s5152_) >>= fun w__111 : option ((mword 5 * mword 6 * string)) =>
                                                                              (match w__111 with
                                                                               | Some (rsd, nzi, s_) =>
                                                                                  returnm (Some
                                                                                             (C_ADDI
                                                                                                (nzi, rsd), build_ex
                                                                                             (projT1
                                                                                              (sub_nat
                                                                                                 (projT1
                                                                                                  (string_length
                                                                                                     arg_))
                                                                                                 (projT1
                                                                                                  (string_length
                                                                                                     s_))))))
                                                                               | _ =>
                                                                                  exit tt
                                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                    0)})))
                                                                               end)
                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                0)})))
                                                                            else
                                                                              (_s5592_ _s5152_) >>= fun w__114 : option ((mword 11 * string)) =>
                                                                              (if match w__114 with
                                                                                  | Some (imm, s_) =>
                                                                                     Z.eqb 64 32
                                                                                  | _ => false
                                                                                  end then
                                                                                 (_s5592_ _s5152_) >>= fun w__115 : option ((mword 11 * string)) =>
                                                                                 (match w__115 with
                                                                                  | Some (imm, s_) =>
                                                                                     returnm (Some
                                                                                                (C_JAL
                                                                                                   imm, build_ex
                                                                                                (projT1
                                                                                                 (sub_nat
                                                                                                    (projT1
                                                                                                     (string_length
                                                                                                        arg_))
                                                                                                    (projT1
                                                                                                     (string_length
                                                                                                        s_))))))
                                                                                  | _ =>
                                                                                     exit tt
                                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                       0)})))
                                                                                  end)
                                                                                  : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                   0)})))
                                                                               else
                                                                                 (_s5600_ _s5152_) >>= fun w__118 : option ((mword 5 * mword 6 * string)) =>
                                                                                 (if match w__118 with
                                                                                     | Some
                                                                                       (rsd, imm, s_) =>
                                                                                        Z.eqb 64 64
                                                                                     | _ => false
                                                                                     end then
                                                                                    (_s5600_ _s5152_) >>= fun w__119 : option ((mword 5 * mword 6 * string)) =>
                                                                                    (match w__119 with
                                                                                     | Some
                                                                                       (rsd, imm, s_) =>
                                                                                        returnm (Some
                                                                                                   (C_ADDIW
                                                                                                      (imm, rsd), build_ex
                                                                                                   (projT1
                                                                                                    (sub_nat
                                                                                                       (projT1
                                                                                                        (string_length
                                                                                                           arg_))
                                                                                                       (projT1
                                                                                                        (string_length
                                                                                                           s_))))))
                                                                                     | _ =>
                                                                                        exit tt
                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                          0)})))
                                                                                     end)
                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                      0)})))
                                                                                  else
                                                                                    (_s5612_ _s5152_) >>= fun w__122 : option ((mword 5 * mword 6 * string)) =>
                                                                                    (if match w__122 with
                                                                                        | Some
                                                                                          (rd, imm, s_) =>
                                                                                           neq_vec
                                                                                             rd zreg
                                                                                        | _ => false
                                                                                        end then
                                                                                       (_s5612_
                                                                                          _s5152_) >>= fun w__123 : option ((mword 5 * mword 6 * string)) =>
                                                                                       (match w__123 with
                                                                                        | Some
                                                                                          (rd, imm, s_) =>
                                                                                           returnm (Some
                                                                                                      (C_LI
                                                                                                         (imm, rd), build_ex
                                                                                                      (projT1
                                                                                                       (sub_nat
                                                                                                          (projT1
                                                                                                           (string_length
                                                                                                              arg_))
                                                                                                          (projT1
                                                                                                           (string_length
                                                                                                              s_))))))
                                                                                        | _ =>
                                                                                           exit tt
                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                             0)})))
                                                                                        end)
                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                         0)})))
                                                                                     else
                                                                                       (_s5624_
                                                                                          _s5152_) >>= fun w__126 : option ((mword 6 * string)) =>
                                                                                       (if match w__126 with
                                                                                           | Some
                                                                                             (imm, s_) =>
                                                                                              neq_vec
                                                                                                imm
                                                                                                ('b"000000"
                                                                                                 : mword 6)
                                                                                           | _ =>
                                                                                              false
                                                                                           end then
                                                                                          (_s5624_
                                                                                             _s5152_) >>= fun w__127 : option ((mword 6 * string)) =>
                                                                                          (match w__127 with
                                                                                           | Some
                                                                                             (imm, s_) =>
                                                                                              returnm (Some
                                                                                                         (C_ADDI16SP
                                                                                                            imm, build_ex
                                                                                                         (projT1
                                                                                                          (sub_nat
                                                                                                             (projT1
                                                                                                              (string_length
                                                                                                                 arg_))
                                                                                                             (projT1
                                                                                                              (string_length
                                                                                                                 s_))))))
                                                                                           | _ =>
                                                                                              exit tt
                                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                0)})))
                                                                                           end)
                                                                                           : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                            0)})))
                                                                                        else
                                                                                          (_s5632_
                                                                                             _s5152_) >>= fun w__130 : option ((mword 5 * mword 6 * string)) =>
                                                                                          (if match w__130 with
                                                                                              | Some
                                                                                                (rd, imm, s_) =>
                                                                                                 andb
                                                                                                   (neq_vec
                                                                                                      rd
                                                                                                      zreg)
                                                                                                   (andb
                                                                                                      (neq_vec
                                                                                                         rd
                                                                                                         sp)
                                                                                                      (neq_vec
                                                                                                         imm
                                                                                                         ('b"000000"
                                                                                                          : mword 6)))
                                                                                              | _ =>
                                                                                                 false
                                                                                              end
                                                                                           then
                                                                                             (_s5632_
                                                                                                _s5152_) >>= fun w__131 : option ((mword 5 * mword 6 * string)) =>
                                                                                             (match w__131 with
                                                                                              | Some
                                                                                                (rd, imm, s_) =>
                                                                                                 returnm (Some
                                                                                                            (C_LUI
                                                                                                               (imm, rd), build_ex
                                                                                                            (projT1
                                                                                                             (sub_nat
                                                                                                                (projT1
                                                                                                                 (string_length
                                                                                                                    arg_))
                                                                                                                (projT1
                                                                                                                 (string_length
                                                                                                                    s_))))))
                                                                                              | _ =>
                                                                                                 exit tt
                                                                                                  : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                   0)})))
                                                                                              end)
                                                                                              : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                               0)})))
                                                                                           else
                                                                                             (_s5644_
                                                                                                _s5152_) >>= fun w__134 : option ((mword 3 * mword 6 * string)) =>
                                                                                             (if match w__134 with
                                                                                                 | Some
                                                                                                   (rsd, shamt, s_) =>
                                                                                                    neq_vec
                                                                                                      shamt
                                                                                                      ('b"000000"
                                                                                                       : mword 6)
                                                                                                 | _ =>
                                                                                                    false
                                                                                                 end
                                                                                              then
                                                                                                (_s5644_
                                                                                                   _s5152_) >>= fun w__135 : option ((mword 3 * mword 6 * string)) =>
                                                                                                (match w__135 with
                                                                                                 | Some
                                                                                                   (rsd, shamt, s_) =>
                                                                                                    returnm (Some
                                                                                                               (C_SRLI
                                                                                                                  (shamt, rsd), build_ex
                                                                                                               (projT1
                                                                                                                (sub_nat
                                                                                                                   (projT1
                                                                                                                    (string_length
                                                                                                                       arg_))
                                                                                                                   (projT1
                                                                                                                    (string_length
                                                                                                                       s_))))))
                                                                                                 | _ =>
                                                                                                    exit tt
                                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                      0)})))
                                                                                                 end)
                                                                                                 : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                  0)})))
                                                                                              else
                                                                                                (_s5656_
                                                                                                   _s5152_) >>= fun w__138 : option ((mword 3 * mword 6 * string)) =>
                                                                                                (if match w__138 with
                                                                                                    | Some
                                                                                                      (rsd, shamt, s_) =>
                                                                                                       neq_vec
                                                                                                         shamt
                                                                                                         ('b"000000"
                                                                                                          : mword 6)
                                                                                                    | _ =>
                                                                                                       false
                                                                                                    end
                                                                                                 then
                                                                                                   (_s5656_
                                                                                                      _s5152_) >>= fun w__139 : option ((mword 3 * mword 6 * string)) =>
                                                                                                   (match w__139 with
                                                                                                    | Some
                                                                                                      (rsd, shamt, s_) =>
                                                                                                       returnm (Some
                                                                                                                  (C_SRAI
                                                                                                                     (shamt, rsd), build_ex
                                                                                                                  (projT1
                                                                                                                   (sub_nat
                                                                                                                      (projT1
                                                                                                                       (string_length
                                                                                                                          arg_))
                                                                                                                      (projT1
                                                                                                                       (string_length
                                                                                                                          s_))))))
                                                                                                    | _ =>
                                                                                                       exit tt
                                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                         0)})))
                                                                                                    end)
                                                                                                    : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                     0)})))
                                                                                                 else
                                                                                                   (_s5668_
                                                                                                      _s5152_) >>= fun w__142 : option ((mword 3 * mword 6 * string)) =>
                                                                                                   (if
                                                                                                      match w__142 with
                                                                                                      | Some
                                                                                                        (rsd, imm, s_) =>
                                                                                                         true
                                                                                                      | _ =>
                                                                                                         false
                                                                                                      end
                                                                                                    then
                                                                                                      (_s5668_
                                                                                                         _s5152_) >>= fun w__143 : option ((mword 3 * mword 6 * string)) =>
                                                                                                      (match w__143 with
                                                                                                       | Some
                                                                                                         (rsd, imm, s_) =>
                                                                                                          returnm (Some
                                                                                                                     (C_ANDI
                                                                                                                        (imm, rsd), build_ex
                                                                                                                     (projT1
                                                                                                                      (sub_nat
                                                                                                                         (projT1
                                                                                                                          (string_length
                                                                                                                             arg_))
                                                                                                                         (projT1
                                                                                                                          (string_length
                                                                                                                             s_))))))
                                                                                                       | _ =>
                                                                                                          exit tt
                                                                                                           : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                            0)})))
                                                                                                       end)
                                                                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                        0)})))
                                                                                                    else
                                                                                                      (_s5680_
                                                                                                         _s5152_) >>= fun w__146 : option ((mword 3 * mword 3 * string)) =>
                                                                                                      (if
                                                                                                         match w__146 with
                                                                                                         | Some
                                                                                                           (rsd, rs2, s_) =>
                                                                                                            true
                                                                                                         | _ =>
                                                                                                            false
                                                                                                         end
                                                                                                       then
                                                                                                         (_s5680_
                                                                                                            _s5152_) >>= fun w__147 : option ((mword 3 * mword 3 * string)) =>
                                                                                                         (match w__147 with
                                                                                                          | Some
                                                                                                            (rsd, rs2, s_) =>
                                                                                                             returnm (Some
                                                                                                                        (C_SUB
                                                                                                                           (rsd, rs2), build_ex
                                                                                                                        (projT1
                                                                                                                         (sub_nat
                                                                                                                            (projT1
                                                                                                                             (string_length
                                                                                                                                arg_))
                                                                                                                            (projT1
                                                                                                                             (string_length
                                                                                                                                s_))))))
                                                                                                          | _ =>
                                                                                                             exit tt
                                                                                                              : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                               0)})))
                                                                                                          end)
                                                                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                           0)})))
                                                                                                       else
                                                                                                         (_s5692_
                                                                                                            _s5152_) >>= fun w__150 : option ((mword 3 * mword 3 * string)) =>
                                                                                                         (if
                                                                                                            match w__150 with
                                                                                                            | Some
                                                                                                              (rsd, rs2, s_) =>
                                                                                                               true
                                                                                                            | _ =>
                                                                                                               false
                                                                                                            end
                                                                                                          then
                                                                                                            (_s5692_
                                                                                                               _s5152_) >>= fun w__151 : option ((mword 3 * mword 3 * string)) =>
                                                                                                            (match w__151 with
                                                                                                             | Some
                                                                                                               (rsd, rs2, s_) =>
                                                                                                                returnm (Some
                                                                                                                           (C_XOR
                                                                                                                              (rsd, rs2), build_ex
                                                                                                                           (projT1
                                                                                                                            (sub_nat
                                                                                                                               (projT1
                                                                                                                                (string_length
                                                                                                                                   arg_))
                                                                                                                               (projT1
                                                                                                                                (string_length
                                                                                                                                   s_))))))
                                                                                                             | _ =>
                                                                                                                exit tt
                                                                                                                 : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                  0)})))
                                                                                                             end)
                                                                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                              0)})))
                                                                                                          else
                                                                                                            (_s5704_
                                                                                                               _s5152_) >>= fun w__154 : option ((mword 3 * mword 3 * string)) =>
                                                                                                            (if
                                                                                                               match w__154 with
                                                                                                               | Some
                                                                                                                 (rsd, rs2, s_) =>
                                                                                                                  true
                                                                                                               | _ =>
                                                                                                                  false
                                                                                                               end
                                                                                                             then
                                                                                                               (_s5704_
                                                                                                                  _s5152_) >>= fun w__155 : option ((mword 3 * mword 3 * string)) =>
                                                                                                               (match w__155 with
                                                                                                                | Some
                                                                                                                  (rsd, rs2, s_) =>
                                                                                                                   returnm (Some
                                                                                                                              (C_OR
                                                                                                                                 (rsd, rs2), build_ex
                                                                                                                              (projT1
                                                                                                                               (sub_nat
                                                                                                                                  (projT1
                                                                                                                                   (string_length
                                                                                                                                      arg_))
                                                                                                                                  (projT1
                                                                                                                                   (string_length
                                                                                                                                      s_))))))
                                                                                                                | _ =>
                                                                                                                   exit tt
                                                                                                                    : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                     0)})))
                                                                                                                end)
                                                                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                 0)})))
                                                                                                             else
                                                                                                               (_s5716_
                                                                                                                  _s5152_) >>= fun w__158 : option ((mword 3 * mword 3 * string)) =>
                                                                                                               (if
                                                                                                                  match w__158 with
                                                                                                                  | Some
                                                                                                                    (rsd, rs2, s_) =>
                                                                                                                     true
                                                                                                                  | _ =>
                                                                                                                     false
                                                                                                                  end
                                                                                                                then
                                                                                                                  (_s5716_
                                                                                                                     _s5152_) >>= fun w__159 : option ((mword 3 * mword 3 * string)) =>
                                                                                                                  (match w__159 with
                                                                                                                   | Some
                                                                                                                     (rsd, rs2, s_) =>
                                                                                                                      returnm (Some
                                                                                                                                 (C_AND
                                                                                                                                    (rsd, rs2), build_ex
                                                                                                                                 (projT1
                                                                                                                                  (sub_nat
                                                                                                                                     (projT1
                                                                                                                                      (string_length
                                                                                                                                         arg_))
                                                                                                                                     (projT1
                                                                                                                                      (string_length
                                                                                                                                         s_))))))
                                                                                                                   | _ =>
                                                                                                                      exit tt
                                                                                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                        0)})))
                                                                                                                   end)
                                                                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                    0)})))
                                                                                                                else
                                                                                                                  (_s5728_
                                                                                                                     _s5152_) >>= fun w__162 : option ((mword 3 * mword 3 * string)) =>
                                                                                                                  (if
                                                                                                                     match w__162 with
                                                                                                                     | Some
                                                                                                                       (rsd, rs2, s_) =>
                                                                                                                        Z.eqb
                                                                                                                          64
                                                                                                                          64
                                                                                                                     | _ =>
                                                                                                                        false
                                                                                                                     end
                                                                                                                   then
                                                                                                                     (_s5728_
                                                                                                                        _s5152_) >>= fun w__163 : option ((mword 3 * mword 3 * string)) =>
                                                                                                                     (match w__163 with
                                                                                                                      | Some
                                                                                                                        (rsd, rs2, s_) =>
                                                                                                                         returnm (Some
                                                                                                                                    (C_SUBW
                                                                                                                                       (rsd, rs2), build_ex
                                                                                                                                    (projT1
                                                                                                                                     (sub_nat
                                                                                                                                        (projT1
                                                                                                                                         (string_length
                                                                                                                                            arg_))
                                                                                                                                        (projT1
                                                                                                                                         (string_length
                                                                                                                                            s_))))))
                                                                                                                      | _ =>
                                                                                                                         exit tt
                                                                                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                           0)})))
                                                                                                                      end)
                                                                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                       0)})))
                                                                                                                   else
                                                                                                                     (_s5740_
                                                                                                                        _s5152_) >>= fun w__166 : option ((mword 3 * mword 3 * string)) =>
                                                                                                                     (if
                                                                                                                        match w__166 with
                                                                                                                        | Some
                                                                                                                          (rsd, rs2, s_) =>
                                                                                                                           Z.eqb
                                                                                                                             64
                                                                                                                             64
                                                                                                                        | _ =>
                                                                                                                           false
                                                                                                                        end
                                                                                                                      then
                                                                                                                        (_s5740_
                                                                                                                           _s5152_) >>= fun w__167 : option ((mword 3 * mword 3 * string)) =>
                                                                                                                        (match w__167 with
                                                                                                                         | Some
                                                                                                                           (rsd, rs2, s_) =>
                                                                                                                            returnm (Some
                                                                                                                                       (C_ADDW
                                                                                                                                          (rsd, rs2), build_ex
                                                                                                                                       (projT1
                                                                                                                                        (sub_nat
                                                                                                                                           (projT1
                                                                                                                                            (string_length
                                                                                                                                               arg_))
                                                                                                                                           (projT1
                                                                                                                                            (string_length
                                                                                                                                               s_))))))
                                                                                                                         | _ =>
                                                                                                                            exit tt
                                                                                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                              0)})))
                                                                                                                         end)
                                                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                          0)})))
                                                                                                                      else
                                                                                                                        (_s5752_
                                                                                                                           _s5152_) >>= fun w__170 : option ((mword 11 * string)) =>
                                                                                                                        (if
                                                                                                                           match w__170 with
                                                                                                                           | Some
                                                                                                                             (imm, s_) =>
                                                                                                                              true
                                                                                                                           | _ =>
                                                                                                                              false
                                                                                                                           end
                                                                                                                         then
                                                                                                                           (_s5752_
                                                                                                                              _s5152_) >>= fun w__171 : option ((mword 11 * string)) =>
                                                                                                                           (match w__171 with
                                                                                                                            | Some
                                                                                                                              (imm, s_) =>
                                                                                                                               returnm (Some
                                                                                                                                          (C_J
                                                                                                                                             imm, build_ex
                                                                                                                                          (projT1
                                                                                                                                           (sub_nat
                                                                                                                                              (projT1
                                                                                                                                               (string_length
                                                                                                                                                  arg_))
                                                                                                                                              (projT1
                                                                                                                                               (string_length
                                                                                                                                                  s_))))))
                                                                                                                            | _ =>
                                                                                                                               exit tt
                                                                                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                 0)})))
                                                                                                                            end)
                                                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                             0)})))
                                                                                                                         else
                                                                                                                           (_s5760_
                                                                                                                              _s5152_) >>= fun w__174 : option ((mword 3 * mword 8 * string)) =>
                                                                                                                           (if
                                                                                                                              match w__174 with
                                                                                                                              | Some
                                                                                                                                (rs, imm, s_) =>
                                                                                                                                 true
                                                                                                                              | _ =>
                                                                                                                                 false
                                                                                                                              end
                                                                                                                            then
                                                                                                                              (_s5760_
                                                                                                                                 _s5152_) >>= fun w__175 : option ((mword 3 * mword 8 * string)) =>
                                                                                                                              (match w__175 with
                                                                                                                               | Some
                                                                                                                                 (rs, imm, s_) =>
                                                                                                                                  returnm (Some
                                                                                                                                             (C_BEQZ
                                                                                                                                                (imm, rs), build_ex
                                                                                                                                             (projT1
                                                                                                                                              (sub_nat
                                                                                                                                                 (projT1
                                                                                                                                                  (string_length
                                                                                                                                                     arg_))
                                                                                                                                                 (projT1
                                                                                                                                                  (string_length
                                                                                                                                                     s_))))))
                                                                                                                               | _ =>
                                                                                                                                  exit tt
                                                                                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                    0)})))
                                                                                                                               end)
                                                                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                0)})))
                                                                                                                            else
                                                                                                                              (_s5772_
                                                                                                                                 _s5152_) >>= fun w__178 : option ((mword 3 * mword 8 * string)) =>
                                                                                                                              (if
                                                                                                                                 match w__178 with
                                                                                                                                 | Some
                                                                                                                                   (rs, imm, s_) =>
                                                                                                                                    true
                                                                                                                                 | _ =>
                                                                                                                                    false
                                                                                                                                 end
                                                                                                                               then
                                                                                                                                 (_s5772_
                                                                                                                                    _s5152_) >>= fun w__179 : option ((mword 3 * mword 8 * string)) =>
                                                                                                                                 (match w__179 with
                                                                                                                                  | Some
                                                                                                                                    (rs, imm, s_) =>
                                                                                                                                     returnm (Some
                                                                                                                                                (C_BNEZ
                                                                                                                                                   (imm, rs), build_ex
                                                                                                                                                (projT1
                                                                                                                                                 (sub_nat
                                                                                                                                                    (projT1
                                                                                                                                                     (string_length
                                                                                                                                                        arg_))
                                                                                                                                                    (projT1
                                                                                                                                                     (string_length
                                                                                                                                                        s_))))))
                                                                                                                                  | _ =>
                                                                                                                                     exit tt
                                                                                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                       0)})))
                                                                                                                                  end)
                                                                                                                                  : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                   0)})))
                                                                                                                               else
                                                                                                                                 (_s5784_
                                                                                                                                    _s5152_) >>= fun w__182 : option ((mword 5 * mword 6 * string)) =>
                                                                                                                                 (if
                                                                                                                                    match w__182 with
                                                                                                                                    | Some
                                                                                                                                      (rsd, shamt, s_) =>
                                                                                                                                       andb
                                                                                                                                         (neq_vec
                                                                                                                                            shamt
                                                                                                                                            ('b"000000"
                                                                                                                                             : mword 6))
                                                                                                                                         (neq_vec
                                                                                                                                            rsd
                                                                                                                                            zreg)
                                                                                                                                    | _ =>
                                                                                                                                       false
                                                                                                                                    end
                                                                                                                                  then
                                                                                                                                    (_s5784_
                                                                                                                                       _s5152_) >>= fun w__183 : option ((mword 5 * mword 6 * string)) =>
                                                                                                                                    (match w__183 with
                                                                                                                                     | Some
                                                                                                                                       (rsd, shamt, s_) =>
                                                                                                                                        returnm (Some
                                                                                                                                                   (C_SLLI
                                                                                                                                                      (shamt, rsd), build_ex
                                                                                                                                                   (projT1
                                                                                                                                                    (sub_nat
                                                                                                                                                       (projT1
                                                                                                                                                        (string_length
                                                                                                                                                           arg_))
                                                                                                                                                       (projT1
                                                                                                                                                        (string_length
                                                                                                                                                           s_))))))
                                                                                                                                     | _ =>
                                                                                                                                        exit tt
                                                                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                          0)})))
                                                                                                                                     end)
                                                                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                      0)})))
                                                                                                                                  else
                                                                                                                                    (_s5796_
                                                                                                                                       _s5152_) >>= fun w__186 : option ((mword 5 * mword 6 * string)) =>
                                                                                                                                    (if
                                                                                                                                       match w__186 with
                                                                                                                                       | Some
                                                                                                                                         (rd, uimm, s_) =>
                                                                                                                                          neq_vec
                                                                                                                                            rd
                                                                                                                                            zreg
                                                                                                                                       | _ =>
                                                                                                                                          false
                                                                                                                                       end
                                                                                                                                     then
                                                                                                                                       (_s5796_
                                                                                                                                          _s5152_) >>= fun w__187 : option ((mword 5 * mword 6 * string)) =>
                                                                                                                                       (match w__187 with
                                                                                                                                        | Some
                                                                                                                                          (rd, uimm, s_) =>
                                                                                                                                           returnm (Some
                                                                                                                                                      (C_LWSP
                                                                                                                                                         (uimm, rd), build_ex
                                                                                                                                                      (projT1
                                                                                                                                                       (sub_nat
                                                                                                                                                          (projT1
                                                                                                                                                           (string_length
                                                                                                                                                              arg_))
                                                                                                                                                          (projT1
                                                                                                                                                           (string_length
                                                                                                                                                              s_))))))
                                                                                                                                        | _ =>
                                                                                                                                           exit tt
                                                                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                             0)})))
                                                                                                                                        end)
                                                                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                         0)})))
                                                                                                                                     else
                                                                                                                                       (_s5808_
                                                                                                                                          _s5152_) >>= fun w__190 : option ((mword 5 * mword 6 * string)) =>
                                                                                                                                       (if
                                                                                                                                          match w__190 with
                                                                                                                                          | Some
                                                                                                                                            (rd, uimm, s_) =>
                                                                                                                                             andb
                                                                                                                                               (neq_vec
                                                                                                                                                  rd
                                                                                                                                                  zreg)
                                                                                                                                               (Z.eqb
                                                                                                                                                  64
                                                                                                                                                  64)
                                                                                                                                          | _ =>
                                                                                                                                             false
                                                                                                                                          end
                                                                                                                                        then
                                                                                                                                          (_s5808_
                                                                                                                                             _s5152_) >>= fun w__191 : option ((mword 5 * mword 6 * string)) =>
                                                                                                                                          (match w__191 with
                                                                                                                                           | Some
                                                                                                                                             (rd, uimm, s_) =>
                                                                                                                                              returnm (Some
                                                                                                                                                         (C_LDSP
                                                                                                                                                            (uimm, rd), build_ex
                                                                                                                                                         (projT1
                                                                                                                                                          (sub_nat
                                                                                                                                                             (projT1
                                                                                                                                                              (string_length
                                                                                                                                                                 arg_))
                                                                                                                                                             (projT1
                                                                                                                                                              (string_length
                                                                                                                                                                 s_))))))
                                                                                                                                           | _ =>
                                                                                                                                              exit tt
                                                                                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                0)})))
                                                                                                                                           end)
                                                                                                                                           : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                            0)})))
                                                                                                                                        else
                                                                                                                                          (_s5820_
                                                                                                                                             _s5152_) >>= fun w__194 : option ((mword 5 * mword 6 * string)) =>
                                                                                                                                          (if
                                                                                                                                             match w__194 with
                                                                                                                                             | Some
                                                                                                                                               (rd, uimm, s_) =>
                                                                                                                                                true
                                                                                                                                             | _ =>
                                                                                                                                                false
                                                                                                                                             end
                                                                                                                                           then
                                                                                                                                             (_s5820_
                                                                                                                                                _s5152_) >>= fun w__195 : option ((mword 5 * mword 6 * string)) =>
                                                                                                                                             (match w__195 with
                                                                                                                                              | Some
                                                                                                                                                (rd, uimm, s_) =>
                                                                                                                                                 returnm (Some
                                                                                                                                                            (C_SWSP
                                                                                                                                                               (uimm, rd), build_ex
                                                                                                                                                            (projT1
                                                                                                                                                             (sub_nat
                                                                                                                                                                (projT1
                                                                                                                                                                 (string_length
                                                                                                                                                                    arg_))
                                                                                                                                                                (projT1
                                                                                                                                                                 (string_length
                                                                                                                                                                    s_))))))
                                                                                                                                              | _ =>
                                                                                                                                                 exit tt
                                                                                                                                                  : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                   0)})))
                                                                                                                                              end)
                                                                                                                                              : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                               0)})))
                                                                                                                                           else
                                                                                                                                             (_s5832_
                                                                                                                                                _s5152_) >>= fun w__198 : option ((mword 5 * mword 6 * string)) =>
                                                                                                                                             (if
                                                                                                                                                match w__198 with
                                                                                                                                                | Some
                                                                                                                                                  (rs2, uimm, s_) =>
                                                                                                                                                   Z.eqb
                                                                                                                                                     64
                                                                                                                                                     64
                                                                                                                                                | _ =>
                                                                                                                                                   false
                                                                                                                                                end
                                                                                                                                              then
                                                                                                                                                (_s5832_
                                                                                                                                                   _s5152_) >>= fun w__199 : option ((mword 5 * mword 6 * string)) =>
                                                                                                                                                (match w__199 with
                                                                                                                                                 | Some
                                                                                                                                                   (rs2, uimm, s_) =>
                                                                                                                                                    returnm (Some
                                                                                                                                                               (C_SDSP
                                                                                                                                                                  (uimm, rs2), build_ex
                                                                                                                                                               (projT1
                                                                                                                                                                (sub_nat
                                                                                                                                                                   (projT1
                                                                                                                                                                    (string_length
                                                                                                                                                                       arg_))
                                                                                                                                                                   (projT1
                                                                                                                                                                    (string_length
                                                                                                                                                                       s_))))))
                                                                                                                                                 | _ =>
                                                                                                                                                    exit tt
                                                                                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                      0)})))
                                                                                                                                                 end)
                                                                                                                                                 : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                  0)})))
                                                                                                                                              else
                                                                                                                                                (_s5844_
                                                                                                                                                   _s5152_) >>= fun w__202 : option ((mword 5 * string)) =>
                                                                                                                                                (if
                                                                                                                                                   match w__202 with
                                                                                                                                                   | Some
                                                                                                                                                     (rs1, s_) =>
                                                                                                                                                      neq_vec
                                                                                                                                                        rs1
                                                                                                                                                        zreg
                                                                                                                                                   | _ =>
                                                                                                                                                      false
                                                                                                                                                   end
                                                                                                                                                 then
                                                                                                                                                   (_s5844_
                                                                                                                                                      _s5152_) >>= fun w__203 : option ((mword 5 * string)) =>
                                                                                                                                                   (match w__203 with
                                                                                                                                                    | Some
                                                                                                                                                      (rs1, s_) =>
                                                                                                                                                       returnm (Some
                                                                                                                                                                  (C_JR
                                                                                                                                                                     rs1, build_ex
                                                                                                                                                                  (projT1
                                                                                                                                                                   (sub_nat
                                                                                                                                                                      (projT1
                                                                                                                                                                       (string_length
                                                                                                                                                                          arg_))
                                                                                                                                                                      (projT1
                                                                                                                                                                       (string_length
                                                                                                                                                                          s_))))))
                                                                                                                                                    | _ =>
                                                                                                                                                       exit tt
                                                                                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                         0)})))
                                                                                                                                                    end)
                                                                                                                                                    : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                     0)})))
                                                                                                                                                 else
                                                                                                                                                   (_s5852_
                                                                                                                                                      _s5152_) >>= fun w__206 : option ((mword 5 * string)) =>
                                                                                                                                                   (if
                                                                                                                                                      match w__206 with
                                                                                                                                                      | Some
                                                                                                                                                        (rs1, s_) =>
                                                                                                                                                         neq_vec
                                                                                                                                                           rs1
                                                                                                                                                           zreg
                                                                                                                                                      | _ =>
                                                                                                                                                         false
                                                                                                                                                      end
                                                                                                                                                    then
                                                                                                                                                      (_s5852_
                                                                                                                                                         _s5152_) >>= fun w__207 : option ((mword 5 * string)) =>
                                                                                                                                                      (match w__207 with
                                                                                                                                                       | Some
                                                                                                                                                         (rs1, s_) =>
                                                                                                                                                          returnm (Some
                                                                                                                                                                     (C_JALR
                                                                                                                                                                        rs1, build_ex
                                                                                                                                                                     (projT1
                                                                                                                                                                      (sub_nat
                                                                                                                                                                         (projT1
                                                                                                                                                                          (string_length
                                                                                                                                                                             arg_))
                                                                                                                                                                         (projT1
                                                                                                                                                                          (string_length
                                                                                                                                                                             s_))))))
                                                                                                                                                       | _ =>
                                                                                                                                                          exit tt
                                                                                                                                                           : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                            0)})))
                                                                                                                                                       end)
                                                                                                                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                        0)})))
                                                                                                                                                    else
                                                                                                                                                      (_s5860_
                                                                                                                                                         _s5152_) >>= fun w__210 : option ((mword 5 * mword 5 * string)) =>
                                                                                                                                                      (if
                                                                                                                                                         match w__210 with
                                                                                                                                                         | Some
                                                                                                                                                           (rd, rs2, s_) =>
                                                                                                                                                            andb
                                                                                                                                                              (neq_vec
                                                                                                                                                                 rd
                                                                                                                                                                 zreg)
                                                                                                                                                              (neq_vec
                                                                                                                                                                 rs2
                                                                                                                                                                 zreg)
                                                                                                                                                         | _ =>
                                                                                                                                                            false
                                                                                                                                                         end
                                                                                                                                                       then
                                                                                                                                                         (_s5860_
                                                                                                                                                            _s5152_) >>= fun w__211 : option ((mword 5 * mword 5 * string)) =>
                                                                                                                                                         (match w__211 with
                                                                                                                                                          | Some
                                                                                                                                                            (rd, rs2, s_) =>
                                                                                                                                                             returnm (Some
                                                                                                                                                                        (C_MV
                                                                                                                                                                           (rd, rs2), build_ex
                                                                                                                                                                        (projT1
                                                                                                                                                                         (sub_nat
                                                                                                                                                                            (projT1
                                                                                                                                                                             (string_length
                                                                                                                                                                                arg_))
                                                                                                                                                                            (projT1
                                                                                                                                                                             (string_length
                                                                                                                                                                                s_))))))
                                                                                                                                                          | _ =>
                                                                                                                                                             exit tt
                                                                                                                                                              : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                               0)})))
                                                                                                                                                          end)
                                                                                                                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                           0)})))
                                                                                                                                                       else if
                                                                                                                                                         match (_s5872_
                                                                                                                                                                  _s5152_) with
                                                                                                                                                         | Some
                                                                                                                                                           s_ =>
                                                                                                                                                            true
                                                                                                                                                         | _ =>
                                                                                                                                                            false
                                                                                                                                                         end
                                                                                                                                                       then
                                                                                                                                                         (match (_s5872_
                                                                                                                                                                   _s5152_) with
                                                                                                                                                          | Some
                                                                                                                                                            s_ =>
                                                                                                                                                             returnm (Some
                                                                                                                                                                        (C_EBREAK
                                                                                                                                                                           tt, build_ex
                                                                                                                                                                        (projT1
                                                                                                                                                                         (sub_nat
                                                                                                                                                                            (projT1
                                                                                                                                                                             (string_length
                                                                                                                                                                                arg_))
                                                                                                                                                                            (projT1
                                                                                                                                                                             (string_length
                                                                                                                                                                                s_))))))
                                                                                                                                                          | _ =>
                                                                                                                                                             exit tt
                                                                                                                                                              : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                               0)})))
                                                                                                                                                          end)
                                                                                                                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                           0)})))
                                                                                                                                                       else
                                                                                                                                                         (_s5876_
                                                                                                                                                            _s5152_) >>= fun w__216 : option ((mword 5 * mword 5 * string)) =>
                                                                                                                                                         (if
                                                                                                                                                            match w__216 with
                                                                                                                                                            | Some
                                                                                                                                                              (rsd, rs2, s_) =>
                                                                                                                                                               andb
                                                                                                                                                                 (neq_vec
                                                                                                                                                                    rsd
                                                                                                                                                                    zreg)
                                                                                                                                                                 (neq_vec
                                                                                                                                                                    rs2
                                                                                                                                                                    zreg)
                                                                                                                                                            | _ =>
                                                                                                                                                               false
                                                                                                                                                            end
                                                                                                                                                          then
                                                                                                                                                            (_s5876_
                                                                                                                                                               _s5152_) >>= fun w__217 : option ((mword 5 * mword 5 * string)) =>
                                                                                                                                                            (match w__217 with
                                                                                                                                                             | Some
                                                                                                                                                               (rsd, rs2, s_) =>
                                                                                                                                                                returnm (Some
                                                                                                                                                                           (C_ADD
                                                                                                                                                                              (rsd, rs2), build_ex
                                                                                                                                                                           (projT1
                                                                                                                                                                            (sub_nat
                                                                                                                                                                               (projT1
                                                                                                                                                                                (string_length
                                                                                                                                                                                   arg_))
                                                                                                                                                                               (projT1
                                                                                                                                                                                (string_length
                                                                                                                                                                                   s_))))))
                                                                                                                                                             | _ =>
                                                                                                                                                                exit tt
                                                                                                                                                                 : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                  0)})))
                                                                                                                                                             end)
                                                                                                                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                              0)})))
                                                                                                                                                          else
                                                                                                                                                            (_s5888_
                                                                                                                                                               _s5152_) >>= fun w__220 : option ((bool * bool * bool * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                            (if
                                                                                                                                                               match w__220 with
                                                                                                                                                               | Some
                                                                                                                                                                 (high, signed1, signed2, rd, rs1, rs2, s_) =>
                                                                                                                                                                  true
                                                                                                                                                               | _ =>
                                                                                                                                                                  false
                                                                                                                                                               end
                                                                                                                                                             then
                                                                                                                                                               (_s5888_
                                                                                                                                                                  _s5152_) >>= fun w__221 : option ((bool * bool * bool * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                               (match w__221 with
                                                                                                                                                                | Some
                                                                                                                                                                  (high, signed1, signed2, rd, rs1, rs2, s_) =>
                                                                                                                                                                   returnm (Some
                                                                                                                                                                              (MUL
                                                                                                                                                                                 (rs2, rs1, rd, high, signed1, signed2), build_ex
                                                                                                                                                                              (projT1
                                                                                                                                                                               (sub_nat
                                                                                                                                                                                  (projT1
                                                                                                                                                                                   (string_length
                                                                                                                                                                                      arg_))
                                                                                                                                                                                  (projT1
                                                                                                                                                                                   (string_length
                                                                                                                                                                                      s_))))))
                                                                                                                                                                | _ =>
                                                                                                                                                                   exit tt
                                                                                                                                                                    : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                     0)})))
                                                                                                                                                                end)
                                                                                                                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                 0)})))
                                                                                                                                                             else
                                                                                                                                                               (_s5905_
                                                                                                                                                                  _s5152_) >>= fun w__224 : option ((bool * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                               (if
                                                                                                                                                                  match w__224 with
                                                                                                                                                                  | Some
                                                                                                                                                                    (s, rd, rs1, rs2, s_) =>
                                                                                                                                                                     true
                                                                                                                                                                  | _ =>
                                                                                                                                                                     false
                                                                                                                                                                  end
                                                                                                                                                                then
                                                                                                                                                                  (_s5905_
                                                                                                                                                                     _s5152_) >>= fun w__225 : option ((bool * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                  (match w__225 with
                                                                                                                                                                   | Some
                                                                                                                                                                     (s, rd, rs1, rs2, s_) =>
                                                                                                                                                                      returnm (Some
                                                                                                                                                                                 (DIV
                                                                                                                                                                                    (rs2, rs1, rd, s), build_ex
                                                                                                                                                                                 (projT1
                                                                                                                                                                                  (sub_nat
                                                                                                                                                                                     (projT1
                                                                                                                                                                                      (string_length
                                                                                                                                                                                         arg_))
                                                                                                                                                                                     (projT1
                                                                                                                                                                                      (string_length
                                                                                                                                                                                         s_))))))
                                                                                                                                                                   | _ =>
                                                                                                                                                                      exit tt
                                                                                                                                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                        0)})))
                                                                                                                                                                   end)
                                                                                                                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                    0)})))
                                                                                                                                                                else
                                                                                                                                                                  (_s5923_
                                                                                                                                                                     _s5152_) >>= fun w__228 : option ((bool * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                  (if
                                                                                                                                                                     match w__228 with
                                                                                                                                                                     | Some
                                                                                                                                                                       (s, rd, rs1, rs2, s_) =>
                                                                                                                                                                        true
                                                                                                                                                                     | _ =>
                                                                                                                                                                        false
                                                                                                                                                                     end
                                                                                                                                                                   then
                                                                                                                                                                     (_s5923_
                                                                                                                                                                        _s5152_) >>= fun w__229 : option ((bool * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                     (match w__229 with
                                                                                                                                                                      | Some
                                                                                                                                                                        (s, rd, rs1, rs2, s_) =>
                                                                                                                                                                         returnm (Some
                                                                                                                                                                                    (REM
                                                                                                                                                                                       (rs2, rs1, rd, s), build_ex
                                                                                                                                                                                    (projT1
                                                                                                                                                                                     (sub_nat
                                                                                                                                                                                        (projT1
                                                                                                                                                                                         (string_length
                                                                                                                                                                                            arg_))
                                                                                                                                                                                        (projT1
                                                                                                                                                                                         (string_length
                                                                                                                                                                                            s_))))))
                                                                                                                                                                      | _ =>
                                                                                                                                                                         exit tt
                                                                                                                                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                           0)})))
                                                                                                                                                                      end)
                                                                                                                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                       0)})))
                                                                                                                                                                   else
                                                                                                                                                                     (_s5941_
                                                                                                                                                                        _s5152_) >>= fun w__232 : option ((mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                     (if
                                                                                                                                                                        match w__232 with
                                                                                                                                                                        | Some
                                                                                                                                                                          (rd, rs1, rs2, s_) =>
                                                                                                                                                                           Z.eqb
                                                                                                                                                                             64
                                                                                                                                                                             64
                                                                                                                                                                        | _ =>
                                                                                                                                                                           false
                                                                                                                                                                        end
                                                                                                                                                                      then
                                                                                                                                                                        (_s5941_
                                                                                                                                                                           _s5152_) >>= fun w__233 : option ((mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                        (match w__233 with
                                                                                                                                                                         | Some
                                                                                                                                                                           (rd, rs1, rs2, s_) =>
                                                                                                                                                                            returnm (Some
                                                                                                                                                                                       (MULW
                                                                                                                                                                                          (rs2, rs1, rd), build_ex
                                                                                                                                                                                       (projT1
                                                                                                                                                                                        (sub_nat
                                                                                                                                                                                           (projT1
                                                                                                                                                                                            (string_length
                                                                                                                                                                                               arg_))
                                                                                                                                                                                           (projT1
                                                                                                                                                                                            (string_length
                                                                                                                                                                                               s_))))))
                                                                                                                                                                         | _ =>
                                                                                                                                                                            exit tt
                                                                                                                                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                              0)})))
                                                                                                                                                                         end)
                                                                                                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                          0)})))
                                                                                                                                                                      else
                                                                                                                                                                        (_s5957_
                                                                                                                                                                           _s5152_) >>= fun w__236 : option ((bool * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                        (if
                                                                                                                                                                           match w__236 with
                                                                                                                                                                           | Some
                                                                                                                                                                             (s, rd, rs1, rs2, s_) =>
                                                                                                                                                                              Z.eqb
                                                                                                                                                                                64
                                                                                                                                                                                64
                                                                                                                                                                           | _ =>
                                                                                                                                                                              false
                                                                                                                                                                           end
                                                                                                                                                                         then
                                                                                                                                                                           (_s5957_
                                                                                                                                                                              _s5152_) >>= fun w__237 : option ((bool * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                           (match w__237 with
                                                                                                                                                                            | Some
                                                                                                                                                                              (s, rd, rs1, rs2, s_) =>
                                                                                                                                                                               returnm (Some
                                                                                                                                                                                          (DIVW
                                                                                                                                                                                             (rs2, rs1, rd, s), build_ex
                                                                                                                                                                                          (projT1
                                                                                                                                                                                           (sub_nat
                                                                                                                                                                                              (projT1
                                                                                                                                                                                               (string_length
                                                                                                                                                                                                  arg_))
                                                                                                                                                                                              (projT1
                                                                                                                                                                                               (string_length
                                                                                                                                                                                                  s_))))))
                                                                                                                                                                            | _ =>
                                                                                                                                                                               exit tt
                                                                                                                                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                 0)})))
                                                                                                                                                                            end)
                                                                                                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                             0)})))
                                                                                                                                                                         else
                                                                                                                                                                           (_s5976_
                                                                                                                                                                              _s5152_) >>= fun w__240 : option ((bool * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                           (if
                                                                                                                                                                              match w__240 with
                                                                                                                                                                              | Some
                                                                                                                                                                                (s, rd, rs1, rs2, s_) =>
                                                                                                                                                                                 Z.eqb
                                                                                                                                                                                   64
                                                                                                                                                                                   64
                                                                                                                                                                              | _ =>
                                                                                                                                                                                 false
                                                                                                                                                                              end
                                                                                                                                                                            then
                                                                                                                                                                              (_s5976_
                                                                                                                                                                                 _s5152_) >>= fun w__241 : option ((bool * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                              (match w__241 with
                                                                                                                                                                               | Some
                                                                                                                                                                                 (s, rd, rs1, rs2, s_) =>
                                                                                                                                                                                  returnm (Some
                                                                                                                                                                                             (REMW
                                                                                                                                                                                                (rs2, rs1, rd, s), build_ex
                                                                                                                                                                                             (projT1
                                                                                                                                                                                              (sub_nat
                                                                                                                                                                                                 (projT1
                                                                                                                                                                                                  (string_length
                                                                                                                                                                                                     arg_))
                                                                                                                                                                                                 (projT1
                                                                                                                                                                                                  (string_length
                                                                                                                                                                                                     s_))))))
                                                                                                                                                                               | _ =>
                                                                                                                                                                                  exit tt
                                                                                                                                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                    0)})))
                                                                                                                                                                               end)
                                                                                                                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                0)})))
                                                                                                                                                                            else
                                                                                                                                                                              (_s5995_
                                                                                                                                                                                 _s5152_) >>= fun w__244 : option ((csrop * mword 5 * mword 12 * mword 5 * string)) =>
                                                                                                                                                                              (if
                                                                                                                                                                                 match w__244 with
                                                                                                                                                                                 | Some
                                                                                                                                                                                   (op, rd, csr, rs1, s_) =>
                                                                                                                                                                                    true
                                                                                                                                                                                 | _ =>
                                                                                                                                                                                    false
                                                                                                                                                                                 end
                                                                                                                                                                               then
                                                                                                                                                                                 (_s5995_
                                                                                                                                                                                    _s5152_) >>= fun w__245 : option ((csrop * mword 5 * mword 12 * mword 5 * string)) =>
                                                                                                                                                                                 (match w__245 with
                                                                                                                                                                                  | Some
                                                                                                                                                                                    (op, rd, csr, rs1, s_) =>
                                                                                                                                                                                     returnm (Some
                                                                                                                                                                                                (CSR
                                                                                                                                                                                                   (csr, rs1, rd, true, op), build_ex
                                                                                                                                                                                                (projT1
                                                                                                                                                                                                 (sub_nat
                                                                                                                                                                                                    (projT1
                                                                                                                                                                                                     (string_length
                                                                                                                                                                                                        arg_))
                                                                                                                                                                                                    (projT1
                                                                                                                                                                                                     (string_length
                                                                                                                                                                                                        s_))))))
                                                                                                                                                                                  | _ =>
                                                                                                                                                                                     exit tt
                                                                                                                                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                       0)})))
                                                                                                                                                                                  end)
                                                                                                                                                                                  : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                   0)})))
                                                                                                                                                                               else
                                                                                                                                                                                 (_s6013_
                                                                                                                                                                                    _s5152_) >>= fun w__248 : option ((csrop * mword 5 * mword 12 * mword 5 * string)) =>
                                                                                                                                                                                 (if
                                                                                                                                                                                    match w__248 with
                                                                                                                                                                                    | Some
                                                                                                                                                                                      (op, rd, csr, rs1, s_) =>
                                                                                                                                                                                       true
                                                                                                                                                                                    | _ =>
                                                                                                                                                                                       false
                                                                                                                                                                                    end
                                                                                                                                                                                  then
                                                                                                                                                                                    (_s6013_
                                                                                                                                                                                       _s5152_) >>= fun w__249 : option ((csrop * mword 5 * mword 12 * mword 5 * string)) =>
                                                                                                                                                                                    (match w__249 with
                                                                                                                                                                                     | Some
                                                                                                                                                                                       (op, rd, csr, rs1, s_) =>
                                                                                                                                                                                        returnm (Some
                                                                                                                                                                                                   (CSR
                                                                                                                                                                                                      (csr, rs1, rd, false, op), build_ex
                                                                                                                                                                                                   (projT1
                                                                                                                                                                                                    (sub_nat
                                                                                                                                                                                                       (projT1
                                                                                                                                                                                                        (string_length
                                                                                                                                                                                                           arg_))
                                                                                                                                                                                                       (projT1
                                                                                                                                                                                                        (string_length
                                                                                                                                                                                                           s_))))))
                                                                                                                                                                                     | _ =>
                                                                                                                                                                                        exit tt
                                                                                                                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                          0)})))
                                                                                                                                                                                     end)
                                                                                                                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                      0)})))
                                                                                                                                                                                  else if
                                                                                                                                                                                    match (_s6030_
                                                                                                                                                                                             _s5152_) with
                                                                                                                                                                                    | Some
                                                                                                                                                                                      s_ =>
                                                                                                                                                                                       true
                                                                                                                                                                                    | _ =>
                                                                                                                                                                                       false
                                                                                                                                                                                    end
                                                                                                                                                                                  then
                                                                                                                                                                                    (match (_s6030_
                                                                                                                                                                                              _s5152_) with
                                                                                                                                                                                     | Some
                                                                                                                                                                                       s_ =>
                                                                                                                                                                                        returnm (Some
                                                                                                                                                                                                   (URET
                                                                                                                                                                                                      tt, build_ex
                                                                                                                                                                                                   (projT1
                                                                                                                                                                                                    (sub_nat
                                                                                                                                                                                                       (projT1
                                                                                                                                                                                                        (string_length
                                                                                                                                                                                                           arg_))
                                                                                                                                                                                                       (projT1
                                                                                                                                                                                                        (string_length
                                                                                                                                                                                                           s_))))))
                                                                                                                                                                                     | _ =>
                                                                                                                                                                                        exit tt
                                                                                                                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                          0)})))
                                                                                                                                                                                     end)
                                                                                                                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                      0)})))
                                                                                                                                                                                  else if
                                                                                                                                                                                    match (_s6034_
                                                                                                                                                                                             _s5152_) with
                                                                                                                                                                                    | Some
                                                                                                                                                                                      (imm, s_) =>
                                                                                                                                                                                       true
                                                                                                                                                                                    | _ =>
                                                                                                                                                                                       false
                                                                                                                                                                                    end
                                                                                                                                                                                  then
                                                                                                                                                                                    (match (_s6034_
                                                                                                                                                                                              _s5152_) with
                                                                                                                                                                                     | Some
                                                                                                                                                                                       (imm, s_) =>
                                                                                                                                                                                        returnm (Some
                                                                                                                                                                                                   (C_NOP_HINT
                                                                                                                                                                                                      imm, build_ex
                                                                                                                                                                                                   (projT1
                                                                                                                                                                                                    (sub_nat
                                                                                                                                                                                                       (projT1
                                                                                                                                                                                                        (string_length
                                                                                                                                                                                                           arg_))
                                                                                                                                                                                                       (projT1
                                                                                                                                                                                                        (string_length
                                                                                                                                                                                                           s_))))))
                                                                                                                                                                                     | _ =>
                                                                                                                                                                                        exit tt
                                                                                                                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                          0)})))
                                                                                                                                                                                     end)
                                                                                                                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                      0)})))
                                                                                                                                                                                  else
                                                                                                                                                                                    (_s6040_
                                                                                                                                                                                       _s5152_) >>= fun w__256 : option ((mword 5 * string)) =>
                                                                                                                                                                                    (if
                                                                                                                                                                                       match w__256 with
                                                                                                                                                                                       | Some
                                                                                                                                                                                         (rsd, s_) =>
                                                                                                                                                                                          neq_vec
                                                                                                                                                                                            rsd
                                                                                                                                                                                            zreg
                                                                                                                                                                                       | _ =>
                                                                                                                                                                                          false
                                                                                                                                                                                       end
                                                                                                                                                                                     then
                                                                                                                                                                                       (_s6040_
                                                                                                                                                                                          _s5152_) >>= fun w__257 : option ((mword 5 * string)) =>
                                                                                                                                                                                       (match w__257 with
                                                                                                                                                                                        | Some
                                                                                                                                                                                          (rsd, s_) =>
                                                                                                                                                                                           returnm (Some
                                                                                                                                                                                                      (C_ADDI_HINT
                                                                                                                                                                                                         rsd, build_ex
                                                                                                                                                                                                      (projT1
                                                                                                                                                                                                       (sub_nat
                                                                                                                                                                                                          (projT1
                                                                                                                                                                                                           (string_length
                                                                                                                                                                                                              arg_))
                                                                                                                                                                                                          (projT1
                                                                                                                                                                                                           (string_length
                                                                                                                                                                                                              s_))))))
                                                                                                                                                                                        | _ =>
                                                                                                                                                                                           exit tt
                                                                                                                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                             0)})))
                                                                                                                                                                                        end)
                                                                                                                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                         0)})))
                                                                                                                                                                                     else if
                                                                                                                                                                                       match (_s6046_
                                                                                                                                                                                                _s5152_) with
                                                                                                                                                                                       | Some
                                                                                                                                                                                         (imm, s_) =>
                                                                                                                                                                                          true
                                                                                                                                                                                       | _ =>
                                                                                                                                                                                          false
                                                                                                                                                                                       end
                                                                                                                                                                                     then
                                                                                                                                                                                       (match (_s6046_
                                                                                                                                                                                                 _s5152_) with
                                                                                                                                                                                        | Some
                                                                                                                                                                                          (imm, s_) =>
                                                                                                                                                                                           returnm (Some
                                                                                                                                                                                                      (C_LI_HINT
                                                                                                                                                                                                         imm, build_ex
                                                                                                                                                                                                      (projT1
                                                                                                                                                                                                       (sub_nat
                                                                                                                                                                                                          (projT1
                                                                                                                                                                                                           (string_length
                                                                                                                                                                                                              arg_))
                                                                                                                                                                                                          (projT1
                                                                                                                                                                                                           (string_length
                                                                                                                                                                                                              s_))))))
                                                                                                                                                                                        | _ =>
                                                                                                                                                                                           exit tt
                                                                                                                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                             0)})))
                                                                                                                                                                                        end)
                                                                                                                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                         0)})))
                                                                                                                                                                                     else if
                                                                                                                                                                                       match (_s6052_
                                                                                                                                                                                                _s5152_) with
                                                                                                                                                                                       | Some
                                                                                                                                                                                         (imm, s_) =>
                                                                                                                                                                                          neq_vec
                                                                                                                                                                                            imm
                                                                                                                                                                                            ('b"000000"
                                                                                                                                                                                             : mword 6)
                                                                                                                                                                                       | _ =>
                                                                                                                                                                                          false
                                                                                                                                                                                       end
                                                                                                                                                                                     then
                                                                                                                                                                                       (match (_s6052_
                                                                                                                                                                                                 _s5152_) with
                                                                                                                                                                                        | Some
                                                                                                                                                                                          (imm, s_) =>
                                                                                                                                                                                           returnm (Some
                                                                                                                                                                                                      (C_LUI_HINT
                                                                                                                                                                                                         imm, build_ex
                                                                                                                                                                                                      (projT1
                                                                                                                                                                                                       (sub_nat
                                                                                                                                                                                                          (projT1
                                                                                                                                                                                                           (string_length
                                                                                                                                                                                                              arg_))
                                                                                                                                                                                                          (projT1
                                                                                                                                                                                                           (string_length
                                                                                                                                                                                                              s_))))))
                                                                                                                                                                                        | _ =>
                                                                                                                                                                                           exit tt
                                                                                                                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                             0)})))
                                                                                                                                                                                        end)
                                                                                                                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                         0)})))
                                                                                                                                                                                     else
                                                                                                                                                                                       (_s6058_
                                                                                                                                                                                          _s5152_) >>= fun w__264 : option ((mword 5 * string)) =>
                                                                                                                                                                                       (if
                                                                                                                                                                                          match w__264 with
                                                                                                                                                                                          | Some
                                                                                                                                                                                            (rs2, s_) =>
                                                                                                                                                                                             neq_vec
                                                                                                                                                                                               rs2
                                                                                                                                                                                               zreg
                                                                                                                                                                                          | _ =>
                                                                                                                                                                                             false
                                                                                                                                                                                          end
                                                                                                                                                                                        then
                                                                                                                                                                                          (_s6058_
                                                                                                                                                                                             _s5152_) >>= fun w__265 : option ((mword 5 * string)) =>
                                                                                                                                                                                          (match w__265 with
                                                                                                                                                                                           | Some
                                                                                                                                                                                             (rs2, s_) =>
                                                                                                                                                                                              returnm (Some
                                                                                                                                                                                                         (C_MV_HINT
                                                                                                                                                                                                            rs2, build_ex
                                                                                                                                                                                                         (projT1
                                                                                                                                                                                                          (sub_nat
                                                                                                                                                                                                             (projT1
                                                                                                                                                                                                              (string_length
                                                                                                                                                                                                                 arg_))
                                                                                                                                                                                                             (projT1
                                                                                                                                                                                                              (string_length
                                                                                                                                                                                                                 s_))))))
                                                                                                                                                                                           | _ =>
                                                                                                                                                                                              exit tt
                                                                                                                                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                0)})))
                                                                                                                                                                                           end)
                                                                                                                                                                                           : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                            0)})))
                                                                                                                                                                                        else
                                                                                                                                                                                          (_s6064_
                                                                                                                                                                                             _s5152_) >>= fun w__268 : option ((mword 5 * string)) =>
                                                                                                                                                                                          (if
                                                                                                                                                                                             match w__268 with
                                                                                                                                                                                             | Some
                                                                                                                                                                                               (rs2, s_) =>
                                                                                                                                                                                                neq_vec
                                                                                                                                                                                                  rs2
                                                                                                                                                                                                  zreg
                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                false
                                                                                                                                                                                             end
                                                                                                                                                                                           then
                                                                                                                                                                                             (_s6064_
                                                                                                                                                                                                _s5152_) >>= fun w__269 : option ((mword 5 * string)) =>
                                                                                                                                                                                             (match w__269 with
                                                                                                                                                                                              | Some
                                                                                                                                                                                                (rs2, s_) =>
                                                                                                                                                                                                 returnm (Some
                                                                                                                                                                                                            (C_ADD_HINT
                                                                                                                                                                                                               rs2, build_ex
                                                                                                                                                                                                            (projT1
                                                                                                                                                                                                             (sub_nat
                                                                                                                                                                                                                (projT1
                                                                                                                                                                                                                 (string_length
                                                                                                                                                                                                                    arg_))
                                                                                                                                                                                                                (projT1
                                                                                                                                                                                                                 (string_length
                                                                                                                                                                                                                    s_))))))
                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                 exit tt
                                                                                                                                                                                                  : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                   0)})))
                                                                                                                                                                                              end)
                                                                                                                                                                                              : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                               0)})))
                                                                                                                                                                                           else
                                                                                                                                                                                             (_s6070_
                                                                                                                                                                                                _s5152_) >>= fun w__272 : option ((mword 5 * mword 6 * string)) =>
                                                                                                                                                                                             (if
                                                                                                                                                                                                match w__272 with
                                                                                                                                                                                                | Some
                                                                                                                                                                                                  (rsd, shamt, s_) =>
                                                                                                                                                                                                   orb
                                                                                                                                                                                                     (eq_vec
                                                                                                                                                                                                        shamt
                                                                                                                                                                                                        ('b"000000"
                                                                                                                                                                                                         : mword 6))
                                                                                                                                                                                                     (eq_vec
                                                                                                                                                                                                        rsd
                                                                                                                                                                                                        zreg)
                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                   false
                                                                                                                                                                                                end
                                                                                                                                                                                              then
                                                                                                                                                                                                (_s6070_
                                                                                                                                                                                                   _s5152_) >>= fun w__273 : option ((mword 5 * mword 6 * string)) =>
                                                                                                                                                                                                (match w__273 with
                                                                                                                                                                                                 | Some
                                                                                                                                                                                                   (rsd, shamt, s_) =>
                                                                                                                                                                                                    returnm (Some
                                                                                                                                                                                                               (C_SLLI_HINT
                                                                                                                                                                                                                  (shamt, rsd), build_ex
                                                                                                                                                                                                               (projT1
                                                                                                                                                                                                                (sub_nat
                                                                                                                                                                                                                   (projT1
                                                                                                                                                                                                                    (string_length
                                                                                                                                                                                                                       arg_))
                                                                                                                                                                                                                   (projT1
                                                                                                                                                                                                                    (string_length
                                                                                                                                                                                                                       s_))))))
                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                    exit tt
                                                                                                                                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                      0)})))
                                                                                                                                                                                                 end)
                                                                                                                                                                                                 : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                  0)})))
                                                                                                                                                                                              else
                                                                                                                                                                                                (_s6079_
                                                                                                                                                                                                   _s5152_) >>= fun w__276 : option ((mword 3 * string)) =>
                                                                                                                                                                                                (if
                                                                                                                                                                                                   match w__276 with
                                                                                                                                                                                                   | Some
                                                                                                                                                                                                     (rsd, s_) =>
                                                                                                                                                                                                      true
                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                      false
                                                                                                                                                                                                   end
                                                                                                                                                                                                 then
                                                                                                                                                                                                   (_s6079_
                                                                                                                                                                                                      _s5152_) >>= fun w__277 : option ((mword 3 * string)) =>
                                                                                                                                                                                                   (match w__277 with
                                                                                                                                                                                                    | Some
                                                                                                                                                                                                      (rsd, s_) =>
                                                                                                                                                                                                       returnm (Some
                                                                                                                                                                                                                  (C_SRLI_HINT
                                                                                                                                                                                                                     rsd, build_ex
                                                                                                                                                                                                                  (projT1
                                                                                                                                                                                                                   (sub_nat
                                                                                                                                                                                                                      (projT1
                                                                                                                                                                                                                       (string_length
                                                                                                                                                                                                                          arg_))
                                                                                                                                                                                                                      (projT1
                                                                                                                                                                                                                       (string_length
                                                                                                                                                                                                                          s_))))))
                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                       exit tt
                                                                                                                                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                         0)})))
                                                                                                                                                                                                    end)
                                                                                                                                                                                                    : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                     0)})))
                                                                                                                                                                                                 else
                                                                                                                                                                                                   (_s6085_
                                                                                                                                                                                                      _s5152_) >>= fun w__280 : option ((mword 3 * string)) =>
                                                                                                                                                                                                   (if
                                                                                                                                                                                                      match w__280 with
                                                                                                                                                                                                      | Some
                                                                                                                                                                                                        (rsd, s_) =>
                                                                                                                                                                                                         true
                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                         false
                                                                                                                                                                                                      end
                                                                                                                                                                                                    then
                                                                                                                                                                                                      (_s6085_
                                                                                                                                                                                                         _s5152_) >>= fun w__281 : option ((mword 3 * string)) =>
                                                                                                                                                                                                      (match w__281 with
                                                                                                                                                                                                       | Some
                                                                                                                                                                                                         (rsd, s_) =>
                                                                                                                                                                                                          returnm (Some
                                                                                                                                                                                                                     (C_SRAI_HINT
                                                                                                                                                                                                                        rsd, build_ex
                                                                                                                                                                                                                     (projT1
                                                                                                                                                                                                                      (sub_nat
                                                                                                                                                                                                                         (projT1
                                                                                                                                                                                                                          (string_length
                                                                                                                                                                                                                             arg_))
                                                                                                                                                                                                                         (projT1
                                                                                                                                                                                                                          (string_length
                                                                                                                                                                                                                             s_))))))
                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                          exit tt
                                                                                                                                                                                                           : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                            0)})))
                                                                                                                                                                                                       end)
                                                                                                                                                                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                        0)})))
                                                                                                                                                                                                    else
                                                                                                                                                                                                      (_s6091_
                                                                                                                                                                                                         _s5152_) >>= fun w__284 : option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4 * string)) =>
                                                                                                                                                                                                      (if
                                                                                                                                                                                                         match w__284 with
                                                                                                                                                                                                         | Some
                                                                                                                                                                                                           (pred, succ, rs, rd, fm, s_) =>
                                                                                                                                                                                                            orb
                                                                                                                                                                                                              (andb
                                                                                                                                                                                                                 (neq_vec
                                                                                                                                                                                                                    fm
                                                                                                                                                                                                                    (Ox"0"
                                                                                                                                                                                                                     : mword 4))
                                                                                                                                                                                                                 (neq_vec
                                                                                                                                                                                                                    fm
                                                                                                                                                                                                                    (Ox"8"
                                                                                                                                                                                                                     : mword 4)))
                                                                                                                                                                                                              (orb
                                                                                                                                                                                                                 (neq_vec
                                                                                                                                                                                                                    rs
                                                                                                                                                                                                                    ('b"00000"
                                                                                                                                                                                                                     : mword 5))
                                                                                                                                                                                                                 (neq_vec
                                                                                                                                                                                                                    rd
                                                                                                                                                                                                                    ('b"00000"
                                                                                                                                                                                                                     : mword 5)))
                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                            false
                                                                                                                                                                                                         end
                                                                                                                                                                                                       then
                                                                                                                                                                                                         (_s6091_
                                                                                                                                                                                                            _s5152_) >>= fun w__285 : option ((mword 4 * mword 4 * mword 5 * mword 5 * mword 4 * string)) =>
                                                                                                                                                                                                         (match w__285 with
                                                                                                                                                                                                          | Some
                                                                                                                                                                                                            (pred, succ, rs, rd, fm, s_) =>
                                                                                                                                                                                                             returnm (Some
                                                                                                                                                                                                                        (FENCE_RESERVED
                                                                                                                                                                                                                           (fm, pred, succ, rs, rd), build_ex
                                                                                                                                                                                                                        (projT1
                                                                                                                                                                                                                         (sub_nat
                                                                                                                                                                                                                            (projT1
                                                                                                                                                                                                                             (string_length
                                                                                                                                                                                                                                arg_))
                                                                                                                                                                                                                            (projT1
                                                                                                                                                                                                                             (string_length
                                                                                                                                                                                                                                s_))))))
                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                             exit tt
                                                                                                                                                                                                              : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                               0)})))
                                                                                                                                                                                                          end)
                                                                                                                                                                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                           0)})))
                                                                                                                                                                                                       else
                                                                                                                                                                                                         (_s6109_
                                                                                                                                                                                                            _s5152_) >>= fun w__288 : option ((mword 5 * mword 5 * mword 12 * string)) =>
                                                                                                                                                                                                         (if
                                                                                                                                                                                                            match w__288 with
                                                                                                                                                                                                            | Some
                                                                                                                                                                                                              (rd, rs, imm, s_) =>
                                                                                                                                                                                                               orb
                                                                                                                                                                                                                 (neq_vec
                                                                                                                                                                                                                    imm
                                                                                                                                                                                                                    (Ox"000"
                                                                                                                                                                                                                     : mword 12))
                                                                                                                                                                                                                 (orb
                                                                                                                                                                                                                    (neq_vec
                                                                                                                                                                                                                       rs
                                                                                                                                                                                                                       zreg)
                                                                                                                                                                                                                    (neq_vec
                                                                                                                                                                                                                       rd
                                                                                                                                                                                                                       zreg))
                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                               false
                                                                                                                                                                                                            end
                                                                                                                                                                                                          then
                                                                                                                                                                                                            (_s6109_
                                                                                                                                                                                                               _s5152_) >>= fun w__289 : option ((mword 5 * mword 5 * mword 12 * string)) =>
                                                                                                                                                                                                            (match w__289 with
                                                                                                                                                                                                             | Some
                                                                                                                                                                                                               (rd, rs, imm, s_) =>
                                                                                                                                                                                                                returnm (Some
                                                                                                                                                                                                                           (FENCEI_RESERVED
                                                                                                                                                                                                                              (imm, rs, rd), build_ex
                                                                                                                                                                                                                           (projT1
                                                                                                                                                                                                                            (sub_nat
                                                                                                                                                                                                                               (projT1
                                                                                                                                                                                                                                (string_length
                                                                                                                                                                                                                                   arg_))
                                                                                                                                                                                                                               (projT1
                                                                                                                                                                                                                                (string_length
                                                                                                                                                                                                                                   s_))))))
                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                exit tt
                                                                                                                                                                                                                 : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                  0)})))
                                                                                                                                                                                                             end)
                                                                                                                                                                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                              0)})))
                                                                                                                                                                                                          else
                                                                                                                                                                                                            (_s6121_
                                                                                                                                                                                                               _s5152_) >>= fun w__292 : option ((word_width * mword 5 * mword 12 * mword 5 * string)) =>
                                                                                                                                                                                                            (if
                                                                                                                                                                                                               match w__292 with
                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                 (width, rd, imm, rs1, s_) =>
                                                                                                                                                                                                                  true
                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                  false
                                                                                                                                                                                                               end
                                                                                                                                                                                                             then
                                                                                                                                                                                                               (_s6121_
                                                                                                                                                                                                                  _s5152_) >>= fun w__293 : option ((word_width * mword 5 * mword 12 * mword 5 * string)) =>
                                                                                                                                                                                                               (match w__293 with
                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                  (width, rd, imm, rs1, s_) =>
                                                                                                                                                                                                                   returnm (Some
                                                                                                                                                                                                                              (LOAD_FP
                                                                                                                                                                                                                                 (imm, rs1, rd, width), build_ex
                                                                                                                                                                                                                              (projT1
                                                                                                                                                                                                                               (sub_nat
                                                                                                                                                                                                                                  (projT1
                                                                                                                                                                                                                                   (string_length
                                                                                                                                                                                                                                      arg_))
                                                                                                                                                                                                                                  (projT1
                                                                                                                                                                                                                                   (string_length
                                                                                                                                                                                                                                      s_))))))
                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                   exit tt
                                                                                                                                                                                                                    : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                     0)})))
                                                                                                                                                                                                                end)
                                                                                                                                                                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                 0)})))
                                                                                                                                                                                                             else
                                                                                                                                                                                                               (_s6145_
                                                                                                                                                                                                                  _s5152_) >>= fun w__296 : option ((word_width * mword 5 * mword 12 * mword 5 * string)) =>
                                                                                                                                                                                                               (if
                                                                                                                                                                                                                  match w__296 with
                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                    (width, rs2, imm, rs1, s_) =>
                                                                                                                                                                                                                     true
                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                     false
                                                                                                                                                                                                                  end
                                                                                                                                                                                                                then
                                                                                                                                                                                                                  (_s6145_
                                                                                                                                                                                                                     _s5152_) >>= fun w__297 : option ((word_width * mword 5 * mword 12 * mword 5 * string)) =>
                                                                                                                                                                                                                  (match w__297 with
                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                     (width, rs2, imm, rs1, s_) =>
                                                                                                                                                                                                                      returnm (Some
                                                                                                                                                                                                                                 (STORE_FP
                                                                                                                                                                                                                                    (imm, rs2, rs1, width), build_ex
                                                                                                                                                                                                                                 (projT1
                                                                                                                                                                                                                                  (sub_nat
                                                                                                                                                                                                                                     (projT1
                                                                                                                                                                                                                                      (string_length
                                                                                                                                                                                                                                         arg_))
                                                                                                                                                                                                                                     (projT1
                                                                                                                                                                                                                                      (string_length
                                                                                                                                                                                                                                         s_))))))
                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                      exit tt
                                                                                                                                                                                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                        0)})))
                                                                                                                                                                                                                   end)
                                                                                                                                                                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                    0)})))
                                                                                                                                                                                                                else
                                                                                                                                                                                                                  (_s6169_
                                                                                                                                                                                                                     _s5152_) >>= fun w__300 : option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                  (if
                                                                                                                                                                                                                     match w__300 with
                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                       (op, rd, rs1, rs2, rs3, rm, s_) =>
                                                                                                                                                                                                                        true
                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                        false
                                                                                                                                                                                                                     end
                                                                                                                                                                                                                   then
                                                                                                                                                                                                                     (_s6169_
                                                                                                                                                                                                                        _s5152_) >>= fun w__301 : option ((f_madd_op_S * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                     (match w__301 with
                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                        (op, rd, rs1, rs2, rs3, rm, s_) =>
                                                                                                                                                                                                                         returnm (Some
                                                                                                                                                                                                                                    (F_MADD_TYPE_S
                                                                                                                                                                                                                                       (rs3, rs2, rs1, rm, rd, op), build_ex
                                                                                                                                                                                                                                    (projT1
                                                                                                                                                                                                                                     (sub_nat
                                                                                                                                                                                                                                        (projT1
                                                                                                                                                                                                                                         (string_length
                                                                                                                                                                                                                                            arg_))
                                                                                                                                                                                                                                        (projT1
                                                                                                                                                                                                                                         (string_length
                                                                                                                                                                                                                                            s_))))))
                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                         exit tt
                                                                                                                                                                                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                           0)})))
                                                                                                                                                                                                                      end)
                                                                                                                                                                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                       0)})))
                                                                                                                                                                                                                   else
                                                                                                                                                                                                                     (_s6194_
                                                                                                                                                                                                                        _s5152_) >>= fun w__304 : option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                     (if
                                                                                                                                                                                                                        match w__304 with
                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                          (op, rd, rs1, rs2, rm, s_) =>
                                                                                                                                                                                                                           true
                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                           false
                                                                                                                                                                                                                        end
                                                                                                                                                                                                                      then
                                                                                                                                                                                                                        (_s6194_
                                                                                                                                                                                                                           _s5152_) >>= fun w__305 : option ((f_bin_rm_op_S * mword 5 * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                        (match w__305 with
                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                           (op, rd, rs1, rs2, rm, s_) =>
                                                                                                                                                                                                                            returnm (Some
                                                                                                                                                                                                                                       (F_BIN_RM_TYPE_S
                                                                                                                                                                                                                                          (rs2, rs1, rm, rd, op), build_ex
                                                                                                                                                                                                                                       (projT1
                                                                                                                                                                                                                                        (sub_nat
                                                                                                                                                                                                                                           (projT1
                                                                                                                                                                                                                                            (string_length
                                                                                                                                                                                                                                               arg_))
                                                                                                                                                                                                                                           (projT1
                                                                                                                                                                                                                                            (string_length
                                                                                                                                                                                                                                               s_))))))
                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                            exit tt
                                                                                                                                                                                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                              0)})))
                                                                                                                                                                                                                         end)
                                                                                                                                                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                          0)})))
                                                                                                                                                                                                                      else
                                                                                                                                                                                                                        (_s6215_
                                                                                                                                                                                                                           _s5152_) >>= fun w__308 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                        (if
                                                                                                                                                                                                                           match w__308 with
                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                             (FSQRT_S, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                              true
                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                              false
                                                                                                                                                                                                                           end
                                                                                                                                                                                                                         then
                                                                                                                                                                                                                           (_s6215_
                                                                                                                                                                                                                              _s5152_) >>= fun w__309 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                           (match w__309 with
                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                              (FSQRT_S, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                               returnm (Some
                                                                                                                                                                                                                                          (F_UN_RM_TYPE_S
                                                                                                                                                                                                                                             (rs1, rm, rd, FSQRT_S), build_ex
                                                                                                                                                                                                                                          (projT1
                                                                                                                                                                                                                                           (sub_nat
                                                                                                                                                                                                                                              (projT1
                                                                                                                                                                                                                                               (string_length
                                                                                                                                                                                                                                                  arg_))
                                                                                                                                                                                                                                              (projT1
                                                                                                                                                                                                                                               (string_length
                                                                                                                                                                                                                                                  s_))))))
                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                               exit tt
                                                                                                                                                                                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                 0)})))
                                                                                                                                                                                                                            end)
                                                                                                                                                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                             0)})))
                                                                                                                                                                                                                         else
                                                                                                                                                                                                                           (_s6232_
                                                                                                                                                                                                                              _s5152_) >>= fun w__312 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                           (if
                                                                                                                                                                                                                              match w__312 with
                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                (FCVT_W_S, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                 true
                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                 false
                                                                                                                                                                                                                              end
                                                                                                                                                                                                                            then
                                                                                                                                                                                                                              (_s6232_
                                                                                                                                                                                                                                 _s5152_) >>= fun w__313 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                              (match w__313 with
                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                 (FCVT_W_S, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                  returnm (Some
                                                                                                                                                                                                                                             (F_UN_RM_TYPE_S
                                                                                                                                                                                                                                                (rs1, rm, rd, FCVT_W_S), build_ex
                                                                                                                                                                                                                                             (projT1
                                                                                                                                                                                                                                              (sub_nat
                                                                                                                                                                                                                                                 (projT1
                                                                                                                                                                                                                                                  (string_length
                                                                                                                                                                                                                                                     arg_))
                                                                                                                                                                                                                                                 (projT1
                                                                                                                                                                                                                                                  (string_length
                                                                                                                                                                                                                                                     s_))))))
                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                  exit tt
                                                                                                                                                                                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                    0)})))
                                                                                                                                                                                                                               end)
                                                                                                                                                                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                0)})))
                                                                                                                                                                                                                            else
                                                                                                                                                                                                                              (_s6249_
                                                                                                                                                                                                                                 _s5152_) >>= fun w__316 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                              (if
                                                                                                                                                                                                                                 match w__316 with
                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                   (FCVT_WU_S, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                    true
                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                    false
                                                                                                                                                                                                                                 end
                                                                                                                                                                                                                               then
                                                                                                                                                                                                                                 (_s6249_
                                                                                                                                                                                                                                    _s5152_) >>= fun w__317 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                 (match w__317 with
                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                    (FCVT_WU_S, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                     returnm (Some
                                                                                                                                                                                                                                                (F_UN_RM_TYPE_S
                                                                                                                                                                                                                                                   (rs1, rm, rd, FCVT_WU_S), build_ex
                                                                                                                                                                                                                                                (projT1
                                                                                                                                                                                                                                                 (sub_nat
                                                                                                                                                                                                                                                    (projT1
                                                                                                                                                                                                                                                     (string_length
                                                                                                                                                                                                                                                        arg_))
                                                                                                                                                                                                                                                    (projT1
                                                                                                                                                                                                                                                     (string_length
                                                                                                                                                                                                                                                        s_))))))
                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                     exit tt
                                                                                                                                                                                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                       0)})))
                                                                                                                                                                                                                                  end)
                                                                                                                                                                                                                                  : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                   0)})))
                                                                                                                                                                                                                               else
                                                                                                                                                                                                                                 (_s6266_
                                                                                                                                                                                                                                    _s5152_) >>= fun w__320 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                 (if
                                                                                                                                                                                                                                    match w__320 with
                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                      (FCVT_S_W, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                       true
                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                       false
                                                                                                                                                                                                                                    end
                                                                                                                                                                                                                                  then
                                                                                                                                                                                                                                    (_s6266_
                                                                                                                                                                                                                                       _s5152_) >>= fun w__321 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                    (match w__321 with
                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                       (FCVT_S_W, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                        returnm (Some
                                                                                                                                                                                                                                                   (F_UN_RM_TYPE_S
                                                                                                                                                                                                                                                      (rs1, rm, rd, FCVT_S_W), build_ex
                                                                                                                                                                                                                                                   (projT1
                                                                                                                                                                                                                                                    (sub_nat
                                                                                                                                                                                                                                                       (projT1
                                                                                                                                                                                                                                                        (string_length
                                                                                                                                                                                                                                                           arg_))
                                                                                                                                                                                                                                                       (projT1
                                                                                                                                                                                                                                                        (string_length
                                                                                                                                                                                                                                                           s_))))))
                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                        exit tt
                                                                                                                                                                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                          0)})))
                                                                                                                                                                                                                                     end)
                                                                                                                                                                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                      0)})))
                                                                                                                                                                                                                                  else
                                                                                                                                                                                                                                    (_s6283_
                                                                                                                                                                                                                                       _s5152_) >>= fun w__324 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                    (if
                                                                                                                                                                                                                                       match w__324 with
                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                         (FCVT_S_WU, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                          true
                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                          false
                                                                                                                                                                                                                                       end
                                                                                                                                                                                                                                     then
                                                                                                                                                                                                                                       (_s6283_
                                                                                                                                                                                                                                          _s5152_) >>= fun w__325 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                       (match w__325 with
                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                          (FCVT_S_WU, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                           returnm (Some
                                                                                                                                                                                                                                                      (F_UN_RM_TYPE_S
                                                                                                                                                                                                                                                         (rs1, rm, rd, FCVT_S_WU), build_ex
                                                                                                                                                                                                                                                      (projT1
                                                                                                                                                                                                                                                       (sub_nat
                                                                                                                                                                                                                                                          (projT1
                                                                                                                                                                                                                                                           (string_length
                                                                                                                                                                                                                                                              arg_))
                                                                                                                                                                                                                                                          (projT1
                                                                                                                                                                                                                                                           (string_length
                                                                                                                                                                                                                                                              s_))))))
                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                           exit tt
                                                                                                                                                                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                             0)})))
                                                                                                                                                                                                                                        end)
                                                                                                                                                                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                         0)})))
                                                                                                                                                                                                                                     else
                                                                                                                                                                                                                                       (_s6300_
                                                                                                                                                                                                                                          _s5152_) >>= fun w__328 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                       (if
                                                                                                                                                                                                                                          match w__328 with
                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                            (FCVT_L_S, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                             true
                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                             false
                                                                                                                                                                                                                                          end
                                                                                                                                                                                                                                        then
                                                                                                                                                                                                                                          (_s6300_
                                                                                                                                                                                                                                             _s5152_) >>= fun w__329 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                          (match w__329 with
                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                             (FCVT_L_S, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                              returnm (Some
                                                                                                                                                                                                                                                         (F_UN_RM_TYPE_S
                                                                                                                                                                                                                                                            (rs1, rm, rd, FCVT_L_S), build_ex
                                                                                                                                                                                                                                                         (projT1
                                                                                                                                                                                                                                                          (sub_nat
                                                                                                                                                                                                                                                             (projT1
                                                                                                                                                                                                                                                              (string_length
                                                                                                                                                                                                                                                                 arg_))
                                                                                                                                                                                                                                                             (projT1
                                                                                                                                                                                                                                                              (string_length
                                                                                                                                                                                                                                                                 s_))))))
                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                              exit tt
                                                                                                                                                                                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                0)})))
                                                                                                                                                                                                                                           end)
                                                                                                                                                                                                                                           : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                            0)})))
                                                                                                                                                                                                                                        else
                                                                                                                                                                                                                                          (_s6317_
                                                                                                                                                                                                                                             _s5152_) >>= fun w__332 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                          (if
                                                                                                                                                                                                                                             match w__332 with
                                                                                                                                                                                                                                             | Some
                                                                                                                                                                                                                                               (FCVT_LU_S, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                true
                                                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                                                false
                                                                                                                                                                                                                                             end
                                                                                                                                                                                                                                           then
                                                                                                                                                                                                                                             (_s6317_
                                                                                                                                                                                                                                                _s5152_) >>= fun w__333 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                             (match w__333 with
                                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                                (FCVT_LU_S, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                 returnm (Some
                                                                                                                                                                                                                                                            (F_UN_RM_TYPE_S
                                                                                                                                                                                                                                                               (rs1, rm, rd, FCVT_LU_S), build_ex
                                                                                                                                                                                                                                                            (projT1
                                                                                                                                                                                                                                                             (sub_nat
                                                                                                                                                                                                                                                                (projT1
                                                                                                                                                                                                                                                                 (string_length
                                                                                                                                                                                                                                                                    arg_))
                                                                                                                                                                                                                                                                (projT1
                                                                                                                                                                                                                                                                 (string_length
                                                                                                                                                                                                                                                                    s_))))))
                                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                                 exit tt
                                                                                                                                                                                                                                                  : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                   0)})))
                                                                                                                                                                                                                                              end)
                                                                                                                                                                                                                                              : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                               0)})))
                                                                                                                                                                                                                                           else
                                                                                                                                                                                                                                             (_s6334_
                                                                                                                                                                                                                                                _s5152_) >>= fun w__336 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                             (if
                                                                                                                                                                                                                                                match w__336 with
                                                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                                                  (FCVT_S_L, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                   true
                                                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                                                   false
                                                                                                                                                                                                                                                end
                                                                                                                                                                                                                                              then
                                                                                                                                                                                                                                                (_s6334_
                                                                                                                                                                                                                                                   _s5152_) >>= fun w__337 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                (match w__337 with
                                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                                   (FCVT_S_L, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                    returnm (Some
                                                                                                                                                                                                                                                               (F_UN_RM_TYPE_S
                                                                                                                                                                                                                                                                  (rs1, rm, rd, FCVT_S_L), build_ex
                                                                                                                                                                                                                                                               (projT1
                                                                                                                                                                                                                                                                (sub_nat
                                                                                                                                                                                                                                                                   (projT1
                                                                                                                                                                                                                                                                    (string_length
                                                                                                                                                                                                                                                                       arg_))
                                                                                                                                                                                                                                                                   (projT1
                                                                                                                                                                                                                                                                    (string_length
                                                                                                                                                                                                                                                                       s_))))))
                                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                                    exit tt
                                                                                                                                                                                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                      0)})))
                                                                                                                                                                                                                                                 end)
                                                                                                                                                                                                                                                 : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                  0)})))
                                                                                                                                                                                                                                              else
                                                                                                                                                                                                                                                (_s6351_
                                                                                                                                                                                                                                                   _s5152_) >>= fun w__340 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                (if
                                                                                                                                                                                                                                                   match w__340 with
                                                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                                                     (FCVT_S_LU, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                      true
                                                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                                                      false
                                                                                                                                                                                                                                                   end
                                                                                                                                                                                                                                                 then
                                                                                                                                                                                                                                                   (_s6351_
                                                                                                                                                                                                                                                      _s5152_) >>= fun w__341 : option ((f_un_rm_op_S * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                   (match w__341 with
                                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                                      (FCVT_S_LU, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                       returnm (Some
                                                                                                                                                                                                                                                                  (F_UN_RM_TYPE_S
                                                                                                                                                                                                                                                                     (rs1, rm, rd, FCVT_S_LU), build_ex
                                                                                                                                                                                                                                                                  (projT1
                                                                                                                                                                                                                                                                   (sub_nat
                                                                                                                                                                                                                                                                      (projT1
                                                                                                                                                                                                                                                                       (string_length
                                                                                                                                                                                                                                                                          arg_))
                                                                                                                                                                                                                                                                      (projT1
                                                                                                                                                                                                                                                                       (string_length
                                                                                                                                                                                                                                                                          s_))))))
                                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                                       exit tt
                                                                                                                                                                                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                         0)})))
                                                                                                                                                                                                                                                    end)
                                                                                                                                                                                                                                                    : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                     0)})))
                                                                                                                                                                                                                                                 else
                                                                                                                                                                                                                                                   (_s6368_
                                                                                                                                                                                                                                                      _s5152_) >>= fun w__344 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                   (if
                                                                                                                                                                                                                                                      match w__344 with
                                                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                                                        (FSGNJ_S, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                         true
                                                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                                                         false
                                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                                    then
                                                                                                                                                                                                                                                      (_s6368_
                                                                                                                                                                                                                                                         _s5152_) >>= fun w__345 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                      (match w__345 with
                                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                                         (FSGNJ_S, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                          returnm (Some
                                                                                                                                                                                                                                                                     (F_BIN_TYPE_S
                                                                                                                                                                                                                                                                        (rs2, rs1, rd, FSGNJ_S), build_ex
                                                                                                                                                                                                                                                                     (projT1
                                                                                                                                                                                                                                                                      (sub_nat
                                                                                                                                                                                                                                                                         (projT1
                                                                                                                                                                                                                                                                          (string_length
                                                                                                                                                                                                                                                                             arg_))
                                                                                                                                                                                                                                                                         (projT1
                                                                                                                                                                                                                                                                          (string_length
                                                                                                                                                                                                                                                                             s_))))))
                                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                                          exit tt
                                                                                                                                                                                                                                                           : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                            0)})))
                                                                                                                                                                                                                                                       end)
                                                                                                                                                                                                                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                        0)})))
                                                                                                                                                                                                                                                    else
                                                                                                                                                                                                                                                      (_s6385_
                                                                                                                                                                                                                                                         _s5152_) >>= fun w__348 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                      (if
                                                                                                                                                                                                                                                         match w__348 with
                                                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                                                           (FSGNJN_S, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                            true
                                                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                                                            false
                                                                                                                                                                                                                                                         end
                                                                                                                                                                                                                                                       then
                                                                                                                                                                                                                                                         (_s6385_
                                                                                                                                                                                                                                                            _s5152_) >>= fun w__349 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                         (match w__349 with
                                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                                            (FSGNJN_S, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                             returnm (Some
                                                                                                                                                                                                                                                                        (F_BIN_TYPE_S
                                                                                                                                                                                                                                                                           (rs2, rs1, rd, FSGNJN_S), build_ex
                                                                                                                                                                                                                                                                        (projT1
                                                                                                                                                                                                                                                                         (sub_nat
                                                                                                                                                                                                                                                                            (projT1
                                                                                                                                                                                                                                                                             (string_length
                                                                                                                                                                                                                                                                                arg_))
                                                                                                                                                                                                                                                                            (projT1
                                                                                                                                                                                                                                                                             (string_length
                                                                                                                                                                                                                                                                                s_))))))
                                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                                             exit tt
                                                                                                                                                                                                                                                              : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                               0)})))
                                                                                                                                                                                                                                                          end)
                                                                                                                                                                                                                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                           0)})))
                                                                                                                                                                                                                                                       else
                                                                                                                                                                                                                                                         (_s6402_
                                                                                                                                                                                                                                                            _s5152_) >>= fun w__352 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                         (if
                                                                                                                                                                                                                                                            match w__352 with
                                                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                                                              (FSGNJX_S, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                               true
                                                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                                                               false
                                                                                                                                                                                                                                                            end
                                                                                                                                                                                                                                                          then
                                                                                                                                                                                                                                                            (_s6402_
                                                                                                                                                                                                                                                               _s5152_) >>= fun w__353 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                            (match w__353 with
                                                                                                                                                                                                                                                             | Some
                                                                                                                                                                                                                                                               (FSGNJX_S, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                returnm (Some
                                                                                                                                                                                                                                                                           (F_BIN_TYPE_S
                                                                                                                                                                                                                                                                              (rs2, rs1, rd, FSGNJX_S), build_ex
                                                                                                                                                                                                                                                                           (projT1
                                                                                                                                                                                                                                                                            (sub_nat
                                                                                                                                                                                                                                                                               (projT1
                                                                                                                                                                                                                                                                                (string_length
                                                                                                                                                                                                                                                                                   arg_))
                                                                                                                                                                                                                                                                               (projT1
                                                                                                                                                                                                                                                                                (string_length
                                                                                                                                                                                                                                                                                   s_))))))
                                                                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                                                                exit tt
                                                                                                                                                                                                                                                                 : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                  0)})))
                                                                                                                                                                                                                                                             end)
                                                                                                                                                                                                                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                              0)})))
                                                                                                                                                                                                                                                          else
                                                                                                                                                                                                                                                            (_s6419_
                                                                                                                                                                                                                                                               _s5152_) >>= fun w__356 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                            (if
                                                                                                                                                                                                                                                               match w__356 with
                                                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                                                 (FMIN_S, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                  true
                                                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                                                  false
                                                                                                                                                                                                                                                               end
                                                                                                                                                                                                                                                             then
                                                                                                                                                                                                                                                               (_s6419_
                                                                                                                                                                                                                                                                  _s5152_) >>= fun w__357 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                               (match w__357 with
                                                                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                                                                  (FMIN_S, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                   returnm (Some
                                                                                                                                                                                                                                                                              (F_BIN_TYPE_S
                                                                                                                                                                                                                                                                                 (rs2, rs1, rd, FMIN_S), build_ex
                                                                                                                                                                                                                                                                              (projT1
                                                                                                                                                                                                                                                                               (sub_nat
                                                                                                                                                                                                                                                                                  (projT1
                                                                                                                                                                                                                                                                                   (string_length
                                                                                                                                                                                                                                                                                      arg_))
                                                                                                                                                                                                                                                                                  (projT1
                                                                                                                                                                                                                                                                                   (string_length
                                                                                                                                                                                                                                                                                      s_))))))
                                                                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                                                                   exit tt
                                                                                                                                                                                                                                                                    : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                     0)})))
                                                                                                                                                                                                                                                                end)
                                                                                                                                                                                                                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                 0)})))
                                                                                                                                                                                                                                                             else
                                                                                                                                                                                                                                                               (_s6436_
                                                                                                                                                                                                                                                                  _s5152_) >>= fun w__360 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                               (if
                                                                                                                                                                                                                                                                  match w__360 with
                                                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                                                    (FMAX_S, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                     true
                                                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                                                     false
                                                                                                                                                                                                                                                                  end
                                                                                                                                                                                                                                                                then
                                                                                                                                                                                                                                                                  (_s6436_
                                                                                                                                                                                                                                                                     _s5152_) >>= fun w__361 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                  (match w__361 with
                                                                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                                                                     (FMAX_S, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                      returnm (Some
                                                                                                                                                                                                                                                                                 (F_BIN_TYPE_S
                                                                                                                                                                                                                                                                                    (rs2, rs1, rd, FMAX_S), build_ex
                                                                                                                                                                                                                                                                                 (projT1
                                                                                                                                                                                                                                                                                  (sub_nat
                                                                                                                                                                                                                                                                                     (projT1
                                                                                                                                                                                                                                                                                      (string_length
                                                                                                                                                                                                                                                                                         arg_))
                                                                                                                                                                                                                                                                                     (projT1
                                                                                                                                                                                                                                                                                      (string_length
                                                                                                                                                                                                                                                                                         s_))))))
                                                                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                                                                      exit tt
                                                                                                                                                                                                                                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                        0)})))
                                                                                                                                                                                                                                                                   end)
                                                                                                                                                                                                                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                    0)})))
                                                                                                                                                                                                                                                                else
                                                                                                                                                                                                                                                                  (_s6453_
                                                                                                                                                                                                                                                                     _s5152_) >>= fun w__364 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                  (if
                                                                                                                                                                                                                                                                     match w__364 with
                                                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                                                       (FEQ_S, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                        true
                                                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                                                        false
                                                                                                                                                                                                                                                                     end
                                                                                                                                                                                                                                                                   then
                                                                                                                                                                                                                                                                     (_s6453_
                                                                                                                                                                                                                                                                        _s5152_) >>= fun w__365 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                     (match w__365 with
                                                                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                                                                        (FEQ_S, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                         returnm (Some
                                                                                                                                                                                                                                                                                    (F_BIN_TYPE_S
                                                                                                                                                                                                                                                                                       (rs2, rs1, rd, FEQ_S), build_ex
                                                                                                                                                                                                                                                                                    (projT1
                                                                                                                                                                                                                                                                                     (sub_nat
                                                                                                                                                                                                                                                                                        (projT1
                                                                                                                                                                                                                                                                                         (string_length
                                                                                                                                                                                                                                                                                            arg_))
                                                                                                                                                                                                                                                                                        (projT1
                                                                                                                                                                                                                                                                                         (string_length
                                                                                                                                                                                                                                                                                            s_))))))
                                                                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                                                                         exit tt
                                                                                                                                                                                                                                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                           0)})))
                                                                                                                                                                                                                                                                      end)
                                                                                                                                                                                                                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                       0)})))
                                                                                                                                                                                                                                                                   else
                                                                                                                                                                                                                                                                     (_s6470_
                                                                                                                                                                                                                                                                        _s5152_) >>= fun w__368 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                     (if
                                                                                                                                                                                                                                                                        match w__368 with
                                                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                                                          (FLT_S, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                           true
                                                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                                                           false
                                                                                                                                                                                                                                                                        end
                                                                                                                                                                                                                                                                      then
                                                                                                                                                                                                                                                                        (_s6470_
                                                                                                                                                                                                                                                                           _s5152_) >>= fun w__369 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                        (match w__369 with
                                                                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                                                                           (FLT_S, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                            returnm (Some
                                                                                                                                                                                                                                                                                       (F_BIN_TYPE_S
                                                                                                                                                                                                                                                                                          (rs2, rs1, rd, FLT_S), build_ex
                                                                                                                                                                                                                                                                                       (projT1
                                                                                                                                                                                                                                                                                        (sub_nat
                                                                                                                                                                                                                                                                                           (projT1
                                                                                                                                                                                                                                                                                            (string_length
                                                                                                                                                                                                                                                                                               arg_))
                                                                                                                                                                                                                                                                                           (projT1
                                                                                                                                                                                                                                                                                            (string_length
                                                                                                                                                                                                                                                                                               s_))))))
                                                                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                                                                            exit tt
                                                                                                                                                                                                                                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                              0)})))
                                                                                                                                                                                                                                                                         end)
                                                                                                                                                                                                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                          0)})))
                                                                                                                                                                                                                                                                      else
                                                                                                                                                                                                                                                                        (_s6487_
                                                                                                                                                                                                                                                                           _s5152_) >>= fun w__372 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                        (if
                                                                                                                                                                                                                                                                           match w__372 with
                                                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                                                             (FLE_S, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                              true
                                                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                                                              false
                                                                                                                                                                                                                                                                           end
                                                                                                                                                                                                                                                                         then
                                                                                                                                                                                                                                                                           (_s6487_
                                                                                                                                                                                                                                                                              _s5152_) >>= fun w__373 : option ((f_bin_op_S * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                           (match w__373 with
                                                                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                                                                              (FLE_S, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                               returnm (Some
                                                                                                                                                                                                                                                                                          (F_BIN_TYPE_S
                                                                                                                                                                                                                                                                                             (rs2, rs1, rd, FLE_S), build_ex
                                                                                                                                                                                                                                                                                          (projT1
                                                                                                                                                                                                                                                                                           (sub_nat
                                                                                                                                                                                                                                                                                              (projT1
                                                                                                                                                                                                                                                                                               (string_length
                                                                                                                                                                                                                                                                                                  arg_))
                                                                                                                                                                                                                                                                                              (projT1
                                                                                                                                                                                                                                                                                               (string_length
                                                                                                                                                                                                                                                                                                  s_))))))
                                                                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                                                                               exit tt
                                                                                                                                                                                                                                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                 0)})))
                                                                                                                                                                                                                                                                            end)
                                                                                                                                                                                                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                             0)})))
                                                                                                                                                                                                                                                                         else
                                                                                                                                                                                                                                                                           (_s6504_
                                                                                                                                                                                                                                                                              _s5152_) >>= fun w__376 : option ((f_un_op_S * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                           (if
                                                                                                                                                                                                                                                                              match w__376 with
                                                                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                                                                (FMV_X_W, rd, rs1, s_) =>
                                                                                                                                                                                                                                                                                 true
                                                                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                                                                 false
                                                                                                                                                                                                                                                                              end
                                                                                                                                                                                                                                                                            then
                                                                                                                                                                                                                                                                              (_s6504_
                                                                                                                                                                                                                                                                                 _s5152_) >>= fun w__377 : option ((f_un_op_S * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                              (match w__377 with
                                                                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                                                                 (FMV_X_W, rd, rs1, s_) =>
                                                                                                                                                                                                                                                                                  returnm (Some
                                                                                                                                                                                                                                                                                             (F_UN_TYPE_S
                                                                                                                                                                                                                                                                                                (rs1, rd, FMV_X_W), build_ex
                                                                                                                                                                                                                                                                                             (projT1
                                                                                                                                                                                                                                                                                              (sub_nat
                                                                                                                                                                                                                                                                                                 (projT1
                                                                                                                                                                                                                                                                                                  (string_length
                                                                                                                                                                                                                                                                                                     arg_))
                                                                                                                                                                                                                                                                                                 (projT1
                                                                                                                                                                                                                                                                                                  (string_length
                                                                                                                                                                                                                                                                                                     s_))))))
                                                                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                                                                  exit tt
                                                                                                                                                                                                                                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                    0)})))
                                                                                                                                                                                                                                                                               end)
                                                                                                                                                                                                                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                0)})))
                                                                                                                                                                                                                                                                            else
                                                                                                                                                                                                                                                                              (_s6517_
                                                                                                                                                                                                                                                                                 _s5152_) >>= fun w__380 : option ((f_un_op_S * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                              (if
                                                                                                                                                                                                                                                                                 match w__380 with
                                                                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                                                                   (FMV_W_X, rd, rs1, s_) =>
                                                                                                                                                                                                                                                                                    true
                                                                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                                                                    false
                                                                                                                                                                                                                                                                                 end
                                                                                                                                                                                                                                                                               then
                                                                                                                                                                                                                                                                                 (_s6517_
                                                                                                                                                                                                                                                                                    _s5152_) >>= fun w__381 : option ((f_un_op_S * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                 (match w__381 with
                                                                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                                                                    (FMV_W_X, rd, rs1, s_) =>
                                                                                                                                                                                                                                                                                     returnm (Some
                                                                                                                                                                                                                                                                                                (F_UN_TYPE_S
                                                                                                                                                                                                                                                                                                   (rs1, rd, FMV_W_X), build_ex
                                                                                                                                                                                                                                                                                                (projT1
                                                                                                                                                                                                                                                                                                 (sub_nat
                                                                                                                                                                                                                                                                                                    (projT1
                                                                                                                                                                                                                                                                                                     (string_length
                                                                                                                                                                                                                                                                                                        arg_))
                                                                                                                                                                                                                                                                                                    (projT1
                                                                                                                                                                                                                                                                                                     (string_length
                                                                                                                                                                                                                                                                                                        s_))))))
                                                                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                                                                     exit tt
                                                                                                                                                                                                                                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                       0)})))
                                                                                                                                                                                                                                                                                  end)
                                                                                                                                                                                                                                                                                  : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                   0)})))
                                                                                                                                                                                                                                                                               else
                                                                                                                                                                                                                                                                                 (_s6530_
                                                                                                                                                                                                                                                                                    _s5152_) >>= fun w__384 : option ((f_un_op_S * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                 (if
                                                                                                                                                                                                                                                                                    match w__384 with
                                                                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                                                                      (FCLASS_S, rd, rs1, s_) =>
                                                                                                                                                                                                                                                                                       true
                                                                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                                                                       false
                                                                                                                                                                                                                                                                                    end
                                                                                                                                                                                                                                                                                  then
                                                                                                                                                                                                                                                                                    (_s6530_
                                                                                                                                                                                                                                                                                       _s5152_) >>= fun w__385 : option ((f_un_op_S * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                    (match w__385 with
                                                                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                                                                       (FCLASS_S, rd, rs1, s_) =>
                                                                                                                                                                                                                                                                                        returnm (Some
                                                                                                                                                                                                                                                                                                   (F_UN_TYPE_S
                                                                                                                                                                                                                                                                                                      (rs1, rd, FCLASS_S), build_ex
                                                                                                                                                                                                                                                                                                   (projT1
                                                                                                                                                                                                                                                                                                    (sub_nat
                                                                                                                                                                                                                                                                                                       (projT1
                                                                                                                                                                                                                                                                                                        (string_length
                                                                                                                                                                                                                                                                                                           arg_))
                                                                                                                                                                                                                                                                                                       (projT1
                                                                                                                                                                                                                                                                                                        (string_length
                                                                                                                                                                                                                                                                                                           s_))))))
                                                                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                                                                        exit tt
                                                                                                                                                                                                                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                          0)})))
                                                                                                                                                                                                                                                                                     end)
                                                                                                                                                                                                                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                      0)})))
                                                                                                                                                                                                                                                                                  else
                                                                                                                                                                                                                                                                                    (_s6543_
                                                                                                                                                                                                                                                                                       _s5152_) >>= fun w__388 : option ((mword 5 * mword 6 * string)) =>
                                                                                                                                                                                                                                                                                    (if
                                                                                                                                                                                                                                                                                       match w__388 with
                                                                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                                                                         (rd, imm, s_) =>
                                                                                                                                                                                                                                                                                          Z.eqb
                                                                                                                                                                                                                                                                                            64
                                                                                                                                                                                                                                                                                            32
                                                                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                                                                          false
                                                                                                                                                                                                                                                                                       end
                                                                                                                                                                                                                                                                                     then
                                                                                                                                                                                                                                                                                       (_s6543_
                                                                                                                                                                                                                                                                                          _s5152_) >>= fun w__389 : option ((mword 5 * mword 6 * string)) =>
                                                                                                                                                                                                                                                                                       (match w__389 with
                                                                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                                                                          (rd, imm, s_) =>
                                                                                                                                                                                                                                                                                           returnm (Some
                                                                                                                                                                                                                                                                                                      (C_FLWSP
                                                                                                                                                                                                                                                                                                         (imm, rd), build_ex
                                                                                                                                                                                                                                                                                                      (projT1
                                                                                                                                                                                                                                                                                                       (sub_nat
                                                                                                                                                                                                                                                                                                          (projT1
                                                                                                                                                                                                                                                                                                           (string_length
                                                                                                                                                                                                                                                                                                              arg_))
                                                                                                                                                                                                                                                                                                          (projT1
                                                                                                                                                                                                                                                                                                           (string_length
                                                                                                                                                                                                                                                                                                              s_))))))
                                                                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                                                                           exit tt
                                                                                                                                                                                                                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                             0)})))
                                                                                                                                                                                                                                                                                        end)
                                                                                                                                                                                                                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                         0)})))
                                                                                                                                                                                                                                                                                     else
                                                                                                                                                                                                                                                                                       (_s6555_
                                                                                                                                                                                                                                                                                          _s5152_) >>= fun w__392 : option ((mword 5 * mword 6 * string)) =>
                                                                                                                                                                                                                                                                                       (if
                                                                                                                                                                                                                                                                                          match w__392 with
                                                                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                                                                            (rd, uimm, s_) =>
                                                                                                                                                                                                                                                                                             Z.eqb
                                                                                                                                                                                                                                                                                               64
                                                                                                                                                                                                                                                                                               32
                                                                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                                                                             false
                                                                                                                                                                                                                                                                                          end
                                                                                                                                                                                                                                                                                        then
                                                                                                                                                                                                                                                                                          (_s6555_
                                                                                                                                                                                                                                                                                             _s5152_) >>= fun w__393 : option ((mword 5 * mword 6 * string)) =>
                                                                                                                                                                                                                                                                                          (match w__393 with
                                                                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                                                                             (rd, uimm, s_) =>
                                                                                                                                                                                                                                                                                              returnm (Some
                                                                                                                                                                                                                                                                                                         (C_FSWSP
                                                                                                                                                                                                                                                                                                            (uimm, rd), build_ex
                                                                                                                                                                                                                                                                                                         (projT1
                                                                                                                                                                                                                                                                                                          (sub_nat
                                                                                                                                                                                                                                                                                                             (projT1
                                                                                                                                                                                                                                                                                                              (string_length
                                                                                                                                                                                                                                                                                                                 arg_))
                                                                                                                                                                                                                                                                                                             (projT1
                                                                                                                                                                                                                                                                                                              (string_length
                                                                                                                                                                                                                                                                                                                 s_))))))
                                                                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                                                                              exit tt
                                                                                                                                                                                                                                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                0)})))
                                                                                                                                                                                                                                                                                           end)
                                                                                                                                                                                                                                                                                           : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                            0)})))
                                                                                                                                                                                                                                                                                        else
                                                                                                                                                                                                                                                                                          (_s6567_
                                                                                                                                                                                                                                                                                             _s5152_) >>= fun w__396 : option ((mword 3 * mword 3 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                          (if
                                                                                                                                                                                                                                                                                             match w__396 with
                                                                                                                                                                                                                                                                                             | Some
                                                                                                                                                                                                                                                                                               (rdc, rsc, uimm, s_) =>
                                                                                                                                                                                                                                                                                                Z.eqb
                                                                                                                                                                                                                                                                                                  64
                                                                                                                                                                                                                                                                                                  32
                                                                                                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                                                                                                false
                                                                                                                                                                                                                                                                                             end
                                                                                                                                                                                                                                                                                           then
                                                                                                                                                                                                                                                                                             (_s6567_
                                                                                                                                                                                                                                                                                                _s5152_) >>= fun w__397 : option ((mword 3 * mword 3 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                             (match w__397 with
                                                                                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                                                                                (rdc, rsc, uimm, s_) =>
                                                                                                                                                                                                                                                                                                 returnm (Some
                                                                                                                                                                                                                                                                                                            (C_FLW
                                                                                                                                                                                                                                                                                                               (uimm, rsc, rdc), build_ex
                                                                                                                                                                                                                                                                                                            (projT1
                                                                                                                                                                                                                                                                                                             (sub_nat
                                                                                                                                                                                                                                                                                                                (projT1
                                                                                                                                                                                                                                                                                                                 (string_length
                                                                                                                                                                                                                                                                                                                    arg_))
                                                                                                                                                                                                                                                                                                                (projT1
                                                                                                                                                                                                                                                                                                                 (string_length
                                                                                                                                                                                                                                                                                                                    s_))))))
                                                                                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                                                                                 exit tt
                                                                                                                                                                                                                                                                                                  : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                   0)})))
                                                                                                                                                                                                                                                                                              end)
                                                                                                                                                                                                                                                                                              : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                               0)})))
                                                                                                                                                                                                                                                                                           else
                                                                                                                                                                                                                                                                                             (_s6583_
                                                                                                                                                                                                                                                                                                _s5152_) >>= fun w__400 : option ((mword 3 * mword 3 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                             (if
                                                                                                                                                                                                                                                                                                match w__400 with
                                                                                                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                                                                                                  (rsc1, rsc2, uimm, s_) =>
                                                                                                                                                                                                                                                                                                   Z.eqb
                                                                                                                                                                                                                                                                                                     64
                                                                                                                                                                                                                                                                                                     32
                                                                                                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                                                                                                   false
                                                                                                                                                                                                                                                                                                end
                                                                                                                                                                                                                                                                                              then
                                                                                                                                                                                                                                                                                                (_s6583_
                                                                                                                                                                                                                                                                                                   _s5152_) >>= fun w__401 : option ((mword 3 * mword 3 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                (match w__401 with
                                                                                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                                                                                   (rsc1, rsc2, uimm, s_) =>
                                                                                                                                                                                                                                                                                                    returnm (Some
                                                                                                                                                                                                                                                                                                               (C_FSW
                                                                                                                                                                                                                                                                                                                  (uimm, rsc1, rsc2), build_ex
                                                                                                                                                                                                                                                                                                               (projT1
                                                                                                                                                                                                                                                                                                                (sub_nat
                                                                                                                                                                                                                                                                                                                   (projT1
                                                                                                                                                                                                                                                                                                                    (string_length
                                                                                                                                                                                                                                                                                                                       arg_))
                                                                                                                                                                                                                                                                                                                   (projT1
                                                                                                                                                                                                                                                                                                                    (string_length
                                                                                                                                                                                                                                                                                                                       s_))))))
                                                                                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                                                                                    exit tt
                                                                                                                                                                                                                                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                      0)})))
                                                                                                                                                                                                                                                                                                 end)
                                                                                                                                                                                                                                                                                                 : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                  0)})))
                                                                                                                                                                                                                                                                                              else
                                                                                                                                                                                                                                                                                                (_s6599_
                                                                                                                                                                                                                                                                                                   _s5152_) >>= fun w__404 : option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                (if
                                                                                                                                                                                                                                                                                                   match w__404 with
                                                                                                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                                                                                                     (op, rd, rs1, rs2, rs3, rm, s_) =>
                                                                                                                                                                                                                                                                                                      true
                                                                                                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                                                                                                      false
                                                                                                                                                                                                                                                                                                   end
                                                                                                                                                                                                                                                                                                 then
                                                                                                                                                                                                                                                                                                   (_s6599_
                                                                                                                                                                                                                                                                                                      _s5152_) >>= fun w__405 : option ((f_madd_op_D * mword 5 * mword 5 * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                   (match w__405 with
                                                                                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                                                                                      (op, rd, rs1, rs2, rs3, rm, s_) =>
                                                                                                                                                                                                                                                                                                       returnm (Some
                                                                                                                                                                                                                                                                                                                  (F_MADD_TYPE_D
                                                                                                                                                                                                                                                                                                                     (rs3, rs2, rs1, rm, rd, op), build_ex
                                                                                                                                                                                                                                                                                                                  (projT1
                                                                                                                                                                                                                                                                                                                   (sub_nat
                                                                                                                                                                                                                                                                                                                      (projT1
                                                                                                                                                                                                                                                                                                                       (string_length
                                                                                                                                                                                                                                                                                                                          arg_))
                                                                                                                                                                                                                                                                                                                      (projT1
                                                                                                                                                                                                                                                                                                                       (string_length
                                                                                                                                                                                                                                                                                                                          s_))))))
                                                                                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                                                                                       exit tt
                                                                                                                                                                                                                                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                         0)})))
                                                                                                                                                                                                                                                                                                    end)
                                                                                                                                                                                                                                                                                                    : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                     0)})))
                                                                                                                                                                                                                                                                                                 else
                                                                                                                                                                                                                                                                                                   (_s6624_
                                                                                                                                                                                                                                                                                                      _s5152_) >>= fun w__408 : option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                   (if
                                                                                                                                                                                                                                                                                                      match w__408 with
                                                                                                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                                                                                                        (op, rd, rs1, rs2, rm, s_) =>
                                                                                                                                                                                                                                                                                                         true
                                                                                                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                                                                                                         false
                                                                                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                                                                                    then
                                                                                                                                                                                                                                                                                                      (_s6624_
                                                                                                                                                                                                                                                                                                         _s5152_) >>= fun w__409 : option ((f_bin_rm_op_D * mword 5 * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                      (match w__409 with
                                                                                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                                                                                         (op, rd, rs1, rs2, rm, s_) =>
                                                                                                                                                                                                                                                                                                          returnm (Some
                                                                                                                                                                                                                                                                                                                     (F_BIN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                        (rs2, rs1, rm, rd, op), build_ex
                                                                                                                                                                                                                                                                                                                     (projT1
                                                                                                                                                                                                                                                                                                                      (sub_nat
                                                                                                                                                                                                                                                                                                                         (projT1
                                                                                                                                                                                                                                                                                                                          (string_length
                                                                                                                                                                                                                                                                                                                             arg_))
                                                                                                                                                                                                                                                                                                                         (projT1
                                                                                                                                                                                                                                                                                                                          (string_length
                                                                                                                                                                                                                                                                                                                             s_))))))
                                                                                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                                                                                          exit tt
                                                                                                                                                                                                                                                                                                           : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                            0)})))
                                                                                                                                                                                                                                                                                                       end)
                                                                                                                                                                                                                                                                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                        0)})))
                                                                                                                                                                                                                                                                                                    else
                                                                                                                                                                                                                                                                                                      (_s6645_
                                                                                                                                                                                                                                                                                                         _s5152_) >>= fun w__412 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                      (if
                                                                                                                                                                                                                                                                                                         match w__412 with
                                                                                                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                                                                                                           (FSQRT_D, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                            true
                                                                                                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                                                                                                            false
                                                                                                                                                                                                                                                                                                         end
                                                                                                                                                                                                                                                                                                       then
                                                                                                                                                                                                                                                                                                         (_s6645_
                                                                                                                                                                                                                                                                                                            _s5152_) >>= fun w__413 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                         (match w__413 with
                                                                                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                                                                                            (FSQRT_D, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                             returnm (Some
                                                                                                                                                                                                                                                                                                                        (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                           (rs1, rm, rd, FSQRT_D), build_ex
                                                                                                                                                                                                                                                                                                                        (projT1
                                                                                                                                                                                                                                                                                                                         (sub_nat
                                                                                                                                                                                                                                                                                                                            (projT1
                                                                                                                                                                                                                                                                                                                             (string_length
                                                                                                                                                                                                                                                                                                                                arg_))
                                                                                                                                                                                                                                                                                                                            (projT1
                                                                                                                                                                                                                                                                                                                             (string_length
                                                                                                                                                                                                                                                                                                                                s_))))))
                                                                                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                                                                                             exit tt
                                                                                                                                                                                                                                                                                                              : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                               0)})))
                                                                                                                                                                                                                                                                                                          end)
                                                                                                                                                                                                                                                                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                           0)})))
                                                                                                                                                                                                                                                                                                       else
                                                                                                                                                                                                                                                                                                         (_s6662_
                                                                                                                                                                                                                                                                                                            _s5152_) >>= fun w__416 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                         (if
                                                                                                                                                                                                                                                                                                            match w__416 with
                                                                                                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                                                                                                              (FCVT_W_D, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                               true
                                                                                                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                                                                                                               false
                                                                                                                                                                                                                                                                                                            end
                                                                                                                                                                                                                                                                                                          then
                                                                                                                                                                                                                                                                                                            (_s6662_
                                                                                                                                                                                                                                                                                                               _s5152_) >>= fun w__417 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                            (match w__417 with
                                                                                                                                                                                                                                                                                                             | Some
                                                                                                                                                                                                                                                                                                               (FCVT_W_D, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                                returnm (Some
                                                                                                                                                                                                                                                                                                                           (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                              (rs1, rm, rd, FCVT_W_D), build_ex
                                                                                                                                                                                                                                                                                                                           (projT1
                                                                                                                                                                                                                                                                                                                            (sub_nat
                                                                                                                                                                                                                                                                                                                               (projT1
                                                                                                                                                                                                                                                                                                                                (string_length
                                                                                                                                                                                                                                                                                                                                   arg_))
                                                                                                                                                                                                                                                                                                                               (projT1
                                                                                                                                                                                                                                                                                                                                (string_length
                                                                                                                                                                                                                                                                                                                                   s_))))))
                                                                                                                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                                                                                                                exit tt
                                                                                                                                                                                                                                                                                                                 : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                  0)})))
                                                                                                                                                                                                                                                                                                             end)
                                                                                                                                                                                                                                                                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                              0)})))
                                                                                                                                                                                                                                                                                                          else
                                                                                                                                                                                                                                                                                                            (_s6679_
                                                                                                                                                                                                                                                                                                               _s5152_) >>= fun w__420 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                            (if
                                                                                                                                                                                                                                                                                                               match w__420 with
                                                                                                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                                                                                                 (FCVT_WU_D, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                                  true
                                                                                                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                                                                                                  false
                                                                                                                                                                                                                                                                                                               end
                                                                                                                                                                                                                                                                                                             then
                                                                                                                                                                                                                                                                                                               (_s6679_
                                                                                                                                                                                                                                                                                                                  _s5152_) >>= fun w__421 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                               (match w__421 with
                                                                                                                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                                                                                                                  (FCVT_WU_D, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                                   returnm (Some
                                                                                                                                                                                                                                                                                                                              (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                                 (rs1, rm, rd, FCVT_WU_D), build_ex
                                                                                                                                                                                                                                                                                                                              (projT1
                                                                                                                                                                                                                                                                                                                               (sub_nat
                                                                                                                                                                                                                                                                                                                                  (projT1
                                                                                                                                                                                                                                                                                                                                   (string_length
                                                                                                                                                                                                                                                                                                                                      arg_))
                                                                                                                                                                                                                                                                                                                                  (projT1
                                                                                                                                                                                                                                                                                                                                   (string_length
                                                                                                                                                                                                                                                                                                                                      s_))))))
                                                                                                                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                                                                                                                   exit tt
                                                                                                                                                                                                                                                                                                                    : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                     0)})))
                                                                                                                                                                                                                                                                                                                end)
                                                                                                                                                                                                                                                                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                 0)})))
                                                                                                                                                                                                                                                                                                             else
                                                                                                                                                                                                                                                                                                               (_s6696_
                                                                                                                                                                                                                                                                                                                  _s5152_) >>= fun w__424 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                               (if
                                                                                                                                                                                                                                                                                                                  match w__424 with
                                                                                                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                                                                                                    (FCVT_D_W, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                                     true
                                                                                                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                                                                                                     false
                                                                                                                                                                                                                                                                                                                  end
                                                                                                                                                                                                                                                                                                                then
                                                                                                                                                                                                                                                                                                                  (_s6696_
                                                                                                                                                                                                                                                                                                                     _s5152_) >>= fun w__425 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                                  (match w__425 with
                                                                                                                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                                                                                                                     (FCVT_D_W, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                                      returnm (Some
                                                                                                                                                                                                                                                                                                                                 (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                                    (rs1, rm, rd, FCVT_D_W), build_ex
                                                                                                                                                                                                                                                                                                                                 (projT1
                                                                                                                                                                                                                                                                                                                                  (sub_nat
                                                                                                                                                                                                                                                                                                                                     (projT1
                                                                                                                                                                                                                                                                                                                                      (string_length
                                                                                                                                                                                                                                                                                                                                         arg_))
                                                                                                                                                                                                                                                                                                                                     (projT1
                                                                                                                                                                                                                                                                                                                                      (string_length
                                                                                                                                                                                                                                                                                                                                         s_))))))
                                                                                                                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                                                                                                                      exit tt
                                                                                                                                                                                                                                                                                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                        0)})))
                                                                                                                                                                                                                                                                                                                   end)
                                                                                                                                                                                                                                                                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                    0)})))
                                                                                                                                                                                                                                                                                                                else
                                                                                                                                                                                                                                                                                                                  (_s6713_
                                                                                                                                                                                                                                                                                                                     _s5152_) >>= fun w__428 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                                  (if
                                                                                                                                                                                                                                                                                                                     match w__428 with
                                                                                                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                                                                                                       (FCVT_D_WU, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                                        true
                                                                                                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                                                                                                        false
                                                                                                                                                                                                                                                                                                                     end
                                                                                                                                                                                                                                                                                                                   then
                                                                                                                                                                                                                                                                                                                     (_s6713_
                                                                                                                                                                                                                                                                                                                        _s5152_) >>= fun w__429 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                                     (match w__429 with
                                                                                                                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                                                                                                                        (FCVT_D_WU, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                                         returnm (Some
                                                                                                                                                                                                                                                                                                                                    (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                                       (rs1, rm, rd, FCVT_D_WU), build_ex
                                                                                                                                                                                                                                                                                                                                    (projT1
                                                                                                                                                                                                                                                                                                                                     (sub_nat
                                                                                                                                                                                                                                                                                                                                        (projT1
                                                                                                                                                                                                                                                                                                                                         (string_length
                                                                                                                                                                                                                                                                                                                                            arg_))
                                                                                                                                                                                                                                                                                                                                        (projT1
                                                                                                                                                                                                                                                                                                                                         (string_length
                                                                                                                                                                                                                                                                                                                                            s_))))))
                                                                                                                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                                                                                                                         exit tt
                                                                                                                                                                                                                                                                                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                           0)})))
                                                                                                                                                                                                                                                                                                                      end)
                                                                                                                                                                                                                                                                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                       0)})))
                                                                                                                                                                                                                                                                                                                   else
                                                                                                                                                                                                                                                                                                                     (_s6730_
                                                                                                                                                                                                                                                                                                                        _s5152_) >>= fun w__432 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                                     (if
                                                                                                                                                                                                                                                                                                                        match w__432 with
                                                                                                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                                                                                                          (FCVT_L_D, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                                           true
                                                                                                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                                                                                                           false
                                                                                                                                                                                                                                                                                                                        end
                                                                                                                                                                                                                                                                                                                      then
                                                                                                                                                                                                                                                                                                                        (_s6730_
                                                                                                                                                                                                                                                                                                                           _s5152_) >>= fun w__433 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                                        (match w__433 with
                                                                                                                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                                                                                                                           (FCVT_L_D, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                                            returnm (Some
                                                                                                                                                                                                                                                                                                                                       (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                                          (rs1, rm, rd, FCVT_L_D), build_ex
                                                                                                                                                                                                                                                                                                                                       (projT1
                                                                                                                                                                                                                                                                                                                                        (sub_nat
                                                                                                                                                                                                                                                                                                                                           (projT1
                                                                                                                                                                                                                                                                                                                                            (string_length
                                                                                                                                                                                                                                                                                                                                               arg_))
                                                                                                                                                                                                                                                                                                                                           (projT1
                                                                                                                                                                                                                                                                                                                                            (string_length
                                                                                                                                                                                                                                                                                                                                               s_))))))
                                                                                                                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                                                                                                                            exit tt
                                                                                                                                                                                                                                                                                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                              0)})))
                                                                                                                                                                                                                                                                                                                         end)
                                                                                                                                                                                                                                                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                          0)})))
                                                                                                                                                                                                                                                                                                                      else
                                                                                                                                                                                                                                                                                                                        (_s6747_
                                                                                                                                                                                                                                                                                                                           _s5152_) >>= fun w__436 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                                        (if
                                                                                                                                                                                                                                                                                                                           match w__436 with
                                                                                                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                                                                                                             (FCVT_LU_D, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                                              true
                                                                                                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                                                                                                              false
                                                                                                                                                                                                                                                                                                                           end
                                                                                                                                                                                                                                                                                                                         then
                                                                                                                                                                                                                                                                                                                           (_s6747_
                                                                                                                                                                                                                                                                                                                              _s5152_) >>= fun w__437 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                                           (match w__437 with
                                                                                                                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                                                                                                                              (FCVT_LU_D, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                                               returnm (Some
                                                                                                                                                                                                                                                                                                                                          (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                                             (rs1, rm, rd, FCVT_LU_D), build_ex
                                                                                                                                                                                                                                                                                                                                          (projT1
                                                                                                                                                                                                                                                                                                                                           (sub_nat
                                                                                                                                                                                                                                                                                                                                              (projT1
                                                                                                                                                                                                                                                                                                                                               (string_length
                                                                                                                                                                                                                                                                                                                                                  arg_))
                                                                                                                                                                                                                                                                                                                                              (projT1
                                                                                                                                                                                                                                                                                                                                               (string_length
                                                                                                                                                                                                                                                                                                                                                  s_))))))
                                                                                                                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                                                                                                                               exit tt
                                                                                                                                                                                                                                                                                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                 0)})))
                                                                                                                                                                                                                                                                                                                            end)
                                                                                                                                                                                                                                                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                             0)})))
                                                                                                                                                                                                                                                                                                                         else
                                                                                                                                                                                                                                                                                                                           (_s6764_
                                                                                                                                                                                                                                                                                                                              _s5152_) >>= fun w__440 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                                           (if
                                                                                                                                                                                                                                                                                                                              match w__440 with
                                                                                                                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                                                                                                                (FCVT_D_L, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                                                 true
                                                                                                                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                                                                                                                 false
                                                                                                                                                                                                                                                                                                                              end
                                                                                                                                                                                                                                                                                                                            then
                                                                                                                                                                                                                                                                                                                              (_s6764_
                                                                                                                                                                                                                                                                                                                                 _s5152_) >>= fun w__441 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                                              (match w__441 with
                                                                                                                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                                                                                                                 (FCVT_D_L, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                                                  returnm (Some
                                                                                                                                                                                                                                                                                                                                             (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                                                (rs1, rm, rd, FCVT_D_L), build_ex
                                                                                                                                                                                                                                                                                                                                             (projT1
                                                                                                                                                                                                                                                                                                                                              (sub_nat
                                                                                                                                                                                                                                                                                                                                                 (projT1
                                                                                                                                                                                                                                                                                                                                                  (string_length
                                                                                                                                                                                                                                                                                                                                                     arg_))
                                                                                                                                                                                                                                                                                                                                                 (projT1
                                                                                                                                                                                                                                                                                                                                                  (string_length
                                                                                                                                                                                                                                                                                                                                                     s_))))))
                                                                                                                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                                                                                                                  exit tt
                                                                                                                                                                                                                                                                                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                    0)})))
                                                                                                                                                                                                                                                                                                                               end)
                                                                                                                                                                                                                                                                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                0)})))
                                                                                                                                                                                                                                                                                                                            else
                                                                                                                                                                                                                                                                                                                              (_s6781_
                                                                                                                                                                                                                                                                                                                                 _s5152_) >>= fun w__444 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                                              (if
                                                                                                                                                                                                                                                                                                                                 match w__444 with
                                                                                                                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                                                                                                                   (FCVT_D_LU, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                                                    true
                                                                                                                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                                                                                                                    false
                                                                                                                                                                                                                                                                                                                                 end
                                                                                                                                                                                                                                                                                                                               then
                                                                                                                                                                                                                                                                                                                                 (_s6781_
                                                                                                                                                                                                                                                                                                                                    _s5152_) >>= fun w__445 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                                                 (match w__445 with
                                                                                                                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                                                                                                                    (FCVT_D_LU, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                                                     returnm (Some
                                                                                                                                                                                                                                                                                                                                                (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                                                   (rs1, rm, rd, FCVT_D_LU), build_ex
                                                                                                                                                                                                                                                                                                                                                (projT1
                                                                                                                                                                                                                                                                                                                                                 (sub_nat
                                                                                                                                                                                                                                                                                                                                                    (projT1
                                                                                                                                                                                                                                                                                                                                                     (string_length
                                                                                                                                                                                                                                                                                                                                                        arg_))
                                                                                                                                                                                                                                                                                                                                                    (projT1
                                                                                                                                                                                                                                                                                                                                                     (string_length
                                                                                                                                                                                                                                                                                                                                                        s_))))))
                                                                                                                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                                                                                                                     exit tt
                                                                                                                                                                                                                                                                                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                       0)})))
                                                                                                                                                                                                                                                                                                                                  end)
                                                                                                                                                                                                                                                                                                                                  : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                   0)})))
                                                                                                                                                                                                                                                                                                                               else
                                                                                                                                                                                                                                                                                                                                 (_s6798_
                                                                                                                                                                                                                                                                                                                                    _s5152_) >>= fun w__448 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                                                 (if
                                                                                                                                                                                                                                                                                                                                    match w__448 with
                                                                                                                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                                                                                                                      (FCVT_S_D, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                                                       true
                                                                                                                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                                                                                                                       false
                                                                                                                                                                                                                                                                                                                                    end
                                                                                                                                                                                                                                                                                                                                  then
                                                                                                                                                                                                                                                                                                                                    (_s6798_
                                                                                                                                                                                                                                                                                                                                       _s5152_) >>= fun w__449 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                                                    (match w__449 with
                                                                                                                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                                                                                                                       (FCVT_S_D, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                                                        returnm (Some
                                                                                                                                                                                                                                                                                                                                                   (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                                                      (rs1, rm, rd, FCVT_S_D), build_ex
                                                                                                                                                                                                                                                                                                                                                   (projT1
                                                                                                                                                                                                                                                                                                                                                    (sub_nat
                                                                                                                                                                                                                                                                                                                                                       (projT1
                                                                                                                                                                                                                                                                                                                                                        (string_length
                                                                                                                                                                                                                                                                                                                                                           arg_))
                                                                                                                                                                                                                                                                                                                                                       (projT1
                                                                                                                                                                                                                                                                                                                                                        (string_length
                                                                                                                                                                                                                                                                                                                                                           s_))))))
                                                                                                                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                                                                                                                        exit tt
                                                                                                                                                                                                                                                                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                          0)})))
                                                                                                                                                                                                                                                                                                                                     end)
                                                                                                                                                                                                                                                                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                      0)})))
                                                                                                                                                                                                                                                                                                                                  else
                                                                                                                                                                                                                                                                                                                                    (_s6815_
                                                                                                                                                                                                                                                                                                                                       _s5152_) >>= fun w__452 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                                                    (if
                                                                                                                                                                                                                                                                                                                                       match w__452 with
                                                                                                                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                                                                                                                         (FCVT_D_S, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                                                          true
                                                                                                                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                                                                                                                          false
                                                                                                                                                                                                                                                                                                                                       end
                                                                                                                                                                                                                                                                                                                                     then
                                                                                                                                                                                                                                                                                                                                       (_s6815_
                                                                                                                                                                                                                                                                                                                                          _s5152_) >>= fun w__453 : option ((f_un_rm_op_D * mword 5 * mword 5 * rounding_mode * string)) =>
                                                                                                                                                                                                                                                                                                                                       (match w__453 with
                                                                                                                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                                                                                                                          (FCVT_D_S, rd, rs1, rm, s_) =>
                                                                                                                                                                                                                                                                                                                                           returnm (Some
                                                                                                                                                                                                                                                                                                                                                      (F_UN_RM_TYPE_D
                                                                                                                                                                                                                                                                                                                                                         (rs1, rm, rd, FCVT_D_S), build_ex
                                                                                                                                                                                                                                                                                                                                                      (projT1
                                                                                                                                                                                                                                                                                                                                                       (sub_nat
                                                                                                                                                                                                                                                                                                                                                          (projT1
                                                                                                                                                                                                                                                                                                                                                           (string_length
                                                                                                                                                                                                                                                                                                                                                              arg_))
                                                                                                                                                                                                                                                                                                                                                          (projT1
                                                                                                                                                                                                                                                                                                                                                           (string_length
                                                                                                                                                                                                                                                                                                                                                              s_))))))
                                                                                                                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                                                                                                                           exit tt
                                                                                                                                                                                                                                                                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                             0)})))
                                                                                                                                                                                                                                                                                                                                        end)
                                                                                                                                                                                                                                                                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                         0)})))
                                                                                                                                                                                                                                                                                                                                     else
                                                                                                                                                                                                                                                                                                                                       (_s6832_
                                                                                                                                                                                                                                                                                                                                          _s5152_) >>= fun w__456 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                       (if
                                                                                                                                                                                                                                                                                                                                          match w__456 with
                                                                                                                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                                                                                                                            (FSGNJ_D, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                                                                                             true
                                                                                                                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                                                                                                                             false
                                                                                                                                                                                                                                                                                                                                          end
                                                                                                                                                                                                                                                                                                                                        then
                                                                                                                                                                                                                                                                                                                                          (_s6832_
                                                                                                                                                                                                                                                                                                                                             _s5152_) >>= fun w__457 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                          (match w__457 with
                                                                                                                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                                                                                                                             (FSGNJ_D, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                                                                                              returnm (Some
                                                                                                                                                                                                                                                                                                                                                         (F_BIN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                            (rs2, rs1, rd, FSGNJ_D), build_ex
                                                                                                                                                                                                                                                                                                                                                         (projT1
                                                                                                                                                                                                                                                                                                                                                          (sub_nat
                                                                                                                                                                                                                                                                                                                                                             (projT1
                                                                                                                                                                                                                                                                                                                                                              (string_length
                                                                                                                                                                                                                                                                                                                                                                 arg_))
                                                                                                                                                                                                                                                                                                                                                             (projT1
                                                                                                                                                                                                                                                                                                                                                              (string_length
                                                                                                                                                                                                                                                                                                                                                                 s_))))))
                                                                                                                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                                                                                                                              exit tt
                                                                                                                                                                                                                                                                                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                0)})))
                                                                                                                                                                                                                                                                                                                                           end)
                                                                                                                                                                                                                                                                                                                                           : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                            0)})))
                                                                                                                                                                                                                                                                                                                                        else
                                                                                                                                                                                                                                                                                                                                          (_s6849_
                                                                                                                                                                                                                                                                                                                                             _s5152_) >>= fun w__460 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                          (if
                                                                                                                                                                                                                                                                                                                                             match w__460 with
                                                                                                                                                                                                                                                                                                                                             | Some
                                                                                                                                                                                                                                                                                                                                               (FSGNJN_D, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                                                                                                true
                                                                                                                                                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                                                                                                                                                false
                                                                                                                                                                                                                                                                                                                                             end
                                                                                                                                                                                                                                                                                                                                           then
                                                                                                                                                                                                                                                                                                                                             (_s6849_
                                                                                                                                                                                                                                                                                                                                                _s5152_) >>= fun w__461 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                             (match w__461 with
                                                                                                                                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                                                                                                                                (FSGNJN_D, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                                                                                                 returnm (Some
                                                                                                                                                                                                                                                                                                                                                            (F_BIN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                               (rs2, rs1, rd, FSGNJN_D), build_ex
                                                                                                                                                                                                                                                                                                                                                            (projT1
                                                                                                                                                                                                                                                                                                                                                             (sub_nat
                                                                                                                                                                                                                                                                                                                                                                (projT1
                                                                                                                                                                                                                                                                                                                                                                 (string_length
                                                                                                                                                                                                                                                                                                                                                                    arg_))
                                                                                                                                                                                                                                                                                                                                                                (projT1
                                                                                                                                                                                                                                                                                                                                                                 (string_length
                                                                                                                                                                                                                                                                                                                                                                    s_))))))
                                                                                                                                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                                                                                                                                 exit tt
                                                                                                                                                                                                                                                                                                                                                  : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                   0)})))
                                                                                                                                                                                                                                                                                                                                              end)
                                                                                                                                                                                                                                                                                                                                              : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                               0)})))
                                                                                                                                                                                                                                                                                                                                           else
                                                                                                                                                                                                                                                                                                                                             (_s6866_
                                                                                                                                                                                                                                                                                                                                                _s5152_) >>= fun w__464 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                             (if
                                                                                                                                                                                                                                                                                                                                                match w__464 with
                                                                                                                                                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                                                                                                                                                  (FSGNJX_D, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                                                                                                   true
                                                                                                                                                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                                                                                                                                                   false
                                                                                                                                                                                                                                                                                                                                                end
                                                                                                                                                                                                                                                                                                                                              then
                                                                                                                                                                                                                                                                                                                                                (_s6866_
                                                                                                                                                                                                                                                                                                                                                   _s5152_) >>= fun w__465 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                (match w__465 with
                                                                                                                                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                                                                                                                                   (FSGNJX_D, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                                                                                                    returnm (Some
                                                                                                                                                                                                                                                                                                                                                               (F_BIN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                                  (rs2, rs1, rd, FSGNJX_D), build_ex
                                                                                                                                                                                                                                                                                                                                                               (projT1
                                                                                                                                                                                                                                                                                                                                                                (sub_nat
                                                                                                                                                                                                                                                                                                                                                                   (projT1
                                                                                                                                                                                                                                                                                                                                                                    (string_length
                                                                                                                                                                                                                                                                                                                                                                       arg_))
                                                                                                                                                                                                                                                                                                                                                                   (projT1
                                                                                                                                                                                                                                                                                                                                                                    (string_length
                                                                                                                                                                                                                                                                                                                                                                       s_))))))
                                                                                                                                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                                                                                                                                    exit tt
                                                                                                                                                                                                                                                                                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                      0)})))
                                                                                                                                                                                                                                                                                                                                                 end)
                                                                                                                                                                                                                                                                                                                                                 : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                  0)})))
                                                                                                                                                                                                                                                                                                                                              else
                                                                                                                                                                                                                                                                                                                                                (_s6883_
                                                                                                                                                                                                                                                                                                                                                   _s5152_) >>= fun w__468 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                (if
                                                                                                                                                                                                                                                                                                                                                   match w__468 with
                                                                                                                                                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                                                                                                                                                     (FMIN_D, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                                                                                                      true
                                                                                                                                                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                                                                                                                                                      false
                                                                                                                                                                                                                                                                                                                                                   end
                                                                                                                                                                                                                                                                                                                                                 then
                                                                                                                                                                                                                                                                                                                                                   (_s6883_
                                                                                                                                                                                                                                                                                                                                                      _s5152_) >>= fun w__469 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                   (match w__469 with
                                                                                                                                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                                                                                                                                      (FMIN_D, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                                                                                                       returnm (Some
                                                                                                                                                                                                                                                                                                                                                                  (F_BIN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                                     (rs2, rs1, rd, FMIN_D), build_ex
                                                                                                                                                                                                                                                                                                                                                                  (projT1
                                                                                                                                                                                                                                                                                                                                                                   (sub_nat
                                                                                                                                                                                                                                                                                                                                                                      (projT1
                                                                                                                                                                                                                                                                                                                                                                       (string_length
                                                                                                                                                                                                                                                                                                                                                                          arg_))
                                                                                                                                                                                                                                                                                                                                                                      (projT1
                                                                                                                                                                                                                                                                                                                                                                       (string_length
                                                                                                                                                                                                                                                                                                                                                                          s_))))))
                                                                                                                                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                                                                                                                                       exit tt
                                                                                                                                                                                                                                                                                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                         0)})))
                                                                                                                                                                                                                                                                                                                                                    end)
                                                                                                                                                                                                                                                                                                                                                    : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                     0)})))
                                                                                                                                                                                                                                                                                                                                                 else
                                                                                                                                                                                                                                                                                                                                                   (_s6900_
                                                                                                                                                                                                                                                                                                                                                      _s5152_) >>= fun w__472 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                   (if
                                                                                                                                                                                                                                                                                                                                                      match w__472 with
                                                                                                                                                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                                                                                                                                                        (FMAX_D, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                                                                                                         true
                                                                                                                                                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                                                                                                                                                         false
                                                                                                                                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                                                                                                                                    then
                                                                                                                                                                                                                                                                                                                                                      (_s6900_
                                                                                                                                                                                                                                                                                                                                                         _s5152_) >>= fun w__473 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                      (match w__473 with
                                                                                                                                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                                                                                                                                         (FMAX_D, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                                                                                                          returnm (Some
                                                                                                                                                                                                                                                                                                                                                                     (F_BIN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                                        (rs2, rs1, rd, FMAX_D), build_ex
                                                                                                                                                                                                                                                                                                                                                                     (projT1
                                                                                                                                                                                                                                                                                                                                                                      (sub_nat
                                                                                                                                                                                                                                                                                                                                                                         (projT1
                                                                                                                                                                                                                                                                                                                                                                          (string_length
                                                                                                                                                                                                                                                                                                                                                                             arg_))
                                                                                                                                                                                                                                                                                                                                                                         (projT1
                                                                                                                                                                                                                                                                                                                                                                          (string_length
                                                                                                                                                                                                                                                                                                                                                                             s_))))))
                                                                                                                                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                                                                                                                                          exit tt
                                                                                                                                                                                                                                                                                                                                                           : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                            0)})))
                                                                                                                                                                                                                                                                                                                                                       end)
                                                                                                                                                                                                                                                                                                                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                        0)})))
                                                                                                                                                                                                                                                                                                                                                    else
                                                                                                                                                                                                                                                                                                                                                      (_s6917_
                                                                                                                                                                                                                                                                                                                                                         _s5152_) >>= fun w__476 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                      (if
                                                                                                                                                                                                                                                                                                                                                         match w__476 with
                                                                                                                                                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                                                                                                                                                           (FEQ_D, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                                                                                                            true
                                                                                                                                                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                                                                                                                                                            false
                                                                                                                                                                                                                                                                                                                                                         end
                                                                                                                                                                                                                                                                                                                                                       then
                                                                                                                                                                                                                                                                                                                                                         (_s6917_
                                                                                                                                                                                                                                                                                                                                                            _s5152_) >>= fun w__477 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                         (match w__477 with
                                                                                                                                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                                                                                                                                            (FEQ_D, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                                                                                                             returnm (Some
                                                                                                                                                                                                                                                                                                                                                                        (F_BIN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                                           (rs2, rs1, rd, FEQ_D), build_ex
                                                                                                                                                                                                                                                                                                                                                                        (projT1
                                                                                                                                                                                                                                                                                                                                                                         (sub_nat
                                                                                                                                                                                                                                                                                                                                                                            (projT1
                                                                                                                                                                                                                                                                                                                                                                             (string_length
                                                                                                                                                                                                                                                                                                                                                                                arg_))
                                                                                                                                                                                                                                                                                                                                                                            (projT1
                                                                                                                                                                                                                                                                                                                                                                             (string_length
                                                                                                                                                                                                                                                                                                                                                                                s_))))))
                                                                                                                                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                                                                                                                                             exit tt
                                                                                                                                                                                                                                                                                                                                                              : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                               0)})))
                                                                                                                                                                                                                                                                                                                                                          end)
                                                                                                                                                                                                                                                                                                                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                           0)})))
                                                                                                                                                                                                                                                                                                                                                       else
                                                                                                                                                                                                                                                                                                                                                         (_s6934_
                                                                                                                                                                                                                                                                                                                                                            _s5152_) >>= fun w__480 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                         (if
                                                                                                                                                                                                                                                                                                                                                            match w__480 with
                                                                                                                                                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                                                                                                                                                              (FLT_D, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                                                                                                               true
                                                                                                                                                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                                                                                                                                                               false
                                                                                                                                                                                                                                                                                                                                                            end
                                                                                                                                                                                                                                                                                                                                                          then
                                                                                                                                                                                                                                                                                                                                                            (_s6934_
                                                                                                                                                                                                                                                                                                                                                               _s5152_) >>= fun w__481 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                            (match w__481 with
                                                                                                                                                                                                                                                                                                                                                             | Some
                                                                                                                                                                                                                                                                                                                                                               (FLT_D, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                                                                                                                returnm (Some
                                                                                                                                                                                                                                                                                                                                                                           (F_BIN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                                              (rs2, rs1, rd, FLT_D), build_ex
                                                                                                                                                                                                                                                                                                                                                                           (projT1
                                                                                                                                                                                                                                                                                                                                                                            (sub_nat
                                                                                                                                                                                                                                                                                                                                                                               (projT1
                                                                                                                                                                                                                                                                                                                                                                                (string_length
                                                                                                                                                                                                                                                                                                                                                                                   arg_))
                                                                                                                                                                                                                                                                                                                                                                               (projT1
                                                                                                                                                                                                                                                                                                                                                                                (string_length
                                                                                                                                                                                                                                                                                                                                                                                   s_))))))
                                                                                                                                                                                                                                                                                                                                                             | _ =>
                                                                                                                                                                                                                                                                                                                                                                exit tt
                                                                                                                                                                                                                                                                                                                                                                 : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                  0)})))
                                                                                                                                                                                                                                                                                                                                                             end)
                                                                                                                                                                                                                                                                                                                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                              0)})))
                                                                                                                                                                                                                                                                                                                                                          else
                                                                                                                                                                                                                                                                                                                                                            (_s6951_
                                                                                                                                                                                                                                                                                                                                                               _s5152_) >>= fun w__484 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                            (if
                                                                                                                                                                                                                                                                                                                                                               match w__484 with
                                                                                                                                                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                                                                                                                                                 (FLE_D, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                                                                                                                  true
                                                                                                                                                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                                                                                                                                                  false
                                                                                                                                                                                                                                                                                                                                                               end
                                                                                                                                                                                                                                                                                                                                                             then
                                                                                                                                                                                                                                                                                                                                                               (_s6951_
                                                                                                                                                                                                                                                                                                                                                                  _s5152_) >>= fun w__485 : option ((f_bin_op_D * mword 5 * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                               (match w__485 with
                                                                                                                                                                                                                                                                                                                                                                | Some
                                                                                                                                                                                                                                                                                                                                                                  (FLE_D, rd, rs1, rs2, s_) =>
                                                                                                                                                                                                                                                                                                                                                                   returnm (Some
                                                                                                                                                                                                                                                                                                                                                                              (F_BIN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                                                 (rs2, rs1, rd, FLE_D), build_ex
                                                                                                                                                                                                                                                                                                                                                                              (projT1
                                                                                                                                                                                                                                                                                                                                                                               (sub_nat
                                                                                                                                                                                                                                                                                                                                                                                  (projT1
                                                                                                                                                                                                                                                                                                                                                                                   (string_length
                                                                                                                                                                                                                                                                                                                                                                                      arg_))
                                                                                                                                                                                                                                                                                                                                                                                  (projT1
                                                                                                                                                                                                                                                                                                                                                                                   (string_length
                                                                                                                                                                                                                                                                                                                                                                                      s_))))))
                                                                                                                                                                                                                                                                                                                                                                | _ =>
                                                                                                                                                                                                                                                                                                                                                                   exit tt
                                                                                                                                                                                                                                                                                                                                                                    : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                     0)})))
                                                                                                                                                                                                                                                                                                                                                                end)
                                                                                                                                                                                                                                                                                                                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                 0)})))
                                                                                                                                                                                                                                                                                                                                                             else
                                                                                                                                                                                                                                                                                                                                                               (_s6968_
                                                                                                                                                                                                                                                                                                                                                                  _s5152_) >>= fun w__488 : option ((f_un_op_D * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                               (if
                                                                                                                                                                                                                                                                                                                                                                  match w__488 with
                                                                                                                                                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                                                                                                                                                    (FMV_X_D, rd, rs1, s_) =>
                                                                                                                                                                                                                                                                                                                                                                     true
                                                                                                                                                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                                                                                                                                                     false
                                                                                                                                                                                                                                                                                                                                                                  end
                                                                                                                                                                                                                                                                                                                                                                then
                                                                                                                                                                                                                                                                                                                                                                  (_s6968_
                                                                                                                                                                                                                                                                                                                                                                     _s5152_) >>= fun w__489 : option ((f_un_op_D * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                                  (match w__489 with
                                                                                                                                                                                                                                                                                                                                                                   | Some
                                                                                                                                                                                                                                                                                                                                                                     (FMV_X_D, rd, rs1, s_) =>
                                                                                                                                                                                                                                                                                                                                                                      returnm (Some
                                                                                                                                                                                                                                                                                                                                                                                 (F_UN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                                                    (rs1, rd, FMV_X_D), build_ex
                                                                                                                                                                                                                                                                                                                                                                                 (projT1
                                                                                                                                                                                                                                                                                                                                                                                  (sub_nat
                                                                                                                                                                                                                                                                                                                                                                                     (projT1
                                                                                                                                                                                                                                                                                                                                                                                      (string_length
                                                                                                                                                                                                                                                                                                                                                                                         arg_))
                                                                                                                                                                                                                                                                                                                                                                                     (projT1
                                                                                                                                                                                                                                                                                                                                                                                      (string_length
                                                                                                                                                                                                                                                                                                                                                                                         s_))))))
                                                                                                                                                                                                                                                                                                                                                                   | _ =>
                                                                                                                                                                                                                                                                                                                                                                      exit tt
                                                                                                                                                                                                                                                                                                                                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                        0)})))
                                                                                                                                                                                                                                                                                                                                                                   end)
                                                                                                                                                                                                                                                                                                                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                    0)})))
                                                                                                                                                                                                                                                                                                                                                                else
                                                                                                                                                                                                                                                                                                                                                                  (_s6981_
                                                                                                                                                                                                                                                                                                                                                                     _s5152_) >>= fun w__492 : option ((f_un_op_D * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                                  (if
                                                                                                                                                                                                                                                                                                                                                                     match w__492 with
                                                                                                                                                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                                                                                                                                                       (FMV_D_X, rd, rs1, s_) =>
                                                                                                                                                                                                                                                                                                                                                                        true
                                                                                                                                                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                                                                                                                                                        false
                                                                                                                                                                                                                                                                                                                                                                     end
                                                                                                                                                                                                                                                                                                                                                                   then
                                                                                                                                                                                                                                                                                                                                                                     (_s6981_
                                                                                                                                                                                                                                                                                                                                                                        _s5152_) >>= fun w__493 : option ((f_un_op_D * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                                     (match w__493 with
                                                                                                                                                                                                                                                                                                                                                                      | Some
                                                                                                                                                                                                                                                                                                                                                                        (FMV_D_X, rd, rs1, s_) =>
                                                                                                                                                                                                                                                                                                                                                                         returnm (Some
                                                                                                                                                                                                                                                                                                                                                                                    (F_UN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                                                       (rs1, rd, FMV_D_X), build_ex
                                                                                                                                                                                                                                                                                                                                                                                    (projT1
                                                                                                                                                                                                                                                                                                                                                                                     (sub_nat
                                                                                                                                                                                                                                                                                                                                                                                        (projT1
                                                                                                                                                                                                                                                                                                                                                                                         (string_length
                                                                                                                                                                                                                                                                                                                                                                                            arg_))
                                                                                                                                                                                                                                                                                                                                                                                        (projT1
                                                                                                                                                                                                                                                                                                                                                                                         (string_length
                                                                                                                                                                                                                                                                                                                                                                                            s_))))))
                                                                                                                                                                                                                                                                                                                                                                      | _ =>
                                                                                                                                                                                                                                                                                                                                                                         exit tt
                                                                                                                                                                                                                                                                                                                                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                           0)})))
                                                                                                                                                                                                                                                                                                                                                                      end)
                                                                                                                                                                                                                                                                                                                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                       0)})))
                                                                                                                                                                                                                                                                                                                                                                   else
                                                                                                                                                                                                                                                                                                                                                                     (_s6994_
                                                                                                                                                                                                                                                                                                                                                                        _s5152_) >>= fun w__496 : option ((f_un_op_D * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                                     (if
                                                                                                                                                                                                                                                                                                                                                                        match w__496 with
                                                                                                                                                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                                                                                                                                                          (FCLASS_D, rd, rs1, s_) =>
                                                                                                                                                                                                                                                                                                                                                                           true
                                                                                                                                                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                                                                                                                                                           false
                                                                                                                                                                                                                                                                                                                                                                        end
                                                                                                                                                                                                                                                                                                                                                                      then
                                                                                                                                                                                                                                                                                                                                                                        (_s6994_
                                                                                                                                                                                                                                                                                                                                                                           _s5152_) >>= fun w__497 : option ((f_un_op_D * mword 5 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                                        (match w__497 with
                                                                                                                                                                                                                                                                                                                                                                         | Some
                                                                                                                                                                                                                                                                                                                                                                           (FCLASS_D, rd, rs1, s_) =>
                                                                                                                                                                                                                                                                                                                                                                            returnm (Some
                                                                                                                                                                                                                                                                                                                                                                                       (F_UN_TYPE_D
                                                                                                                                                                                                                                                                                                                                                                                          (rs1, rd, FCLASS_D), build_ex
                                                                                                                                                                                                                                                                                                                                                                                       (projT1
                                                                                                                                                                                                                                                                                                                                                                                        (sub_nat
                                                                                                                                                                                                                                                                                                                                                                                           (projT1
                                                                                                                                                                                                                                                                                                                                                                                            (string_length
                                                                                                                                                                                                                                                                                                                                                                                               arg_))
                                                                                                                                                                                                                                                                                                                                                                                           (projT1
                                                                                                                                                                                                                                                                                                                                                                                            (string_length
                                                                                                                                                                                                                                                                                                                                                                                               s_))))))
                                                                                                                                                                                                                                                                                                                                                                         | _ =>
                                                                                                                                                                                                                                                                                                                                                                            exit tt
                                                                                                                                                                                                                                                                                                                                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                              0)})))
                                                                                                                                                                                                                                                                                                                                                                         end)
                                                                                                                                                                                                                                                                                                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                          0)})))
                                                                                                                                                                                                                                                                                                                                                                      else
                                                                                                                                                                                                                                                                                                                                                                        (_s7007_
                                                                                                                                                                                                                                                                                                                                                                           _s5152_) >>= fun w__500 : option ((mword 5 * mword 6 * string)) =>
                                                                                                                                                                                                                                                                                                                                                                        (if
                                                                                                                                                                                                                                                                                                                                                                           match w__500 with
                                                                                                                                                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                                                                                                                                                             (rd, uimm, s_) =>
                                                                                                                                                                                                                                                                                                                                                                              orb
                                                                                                                                                                                                                                                                                                                                                                                (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                   64
                                                                                                                                                                                                                                                                                                                                                                                   32)
                                                                                                                                                                                                                                                                                                                                                                                (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                   64
                                                                                                                                                                                                                                                                                                                                                                                   64)
                                                                                                                                                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                                                                                                                                                              false
                                                                                                                                                                                                                                                                                                                                                                           end
                                                                                                                                                                                                                                                                                                                                                                         then
                                                                                                                                                                                                                                                                                                                                                                           (_s7007_
                                                                                                                                                                                                                                                                                                                                                                              _s5152_) >>= fun w__501 : option ((mword 5 * mword 6 * string)) =>
                                                                                                                                                                                                                                                                                                                                                                           (match w__501 with
                                                                                                                                                                                                                                                                                                                                                                            | Some
                                                                                                                                                                                                                                                                                                                                                                              (rd, uimm, s_) =>
                                                                                                                                                                                                                                                                                                                                                                               returnm (Some
                                                                                                                                                                                                                                                                                                                                                                                          (C_FLDSP
                                                                                                                                                                                                                                                                                                                                                                                             (uimm, rd), build_ex
                                                                                                                                                                                                                                                                                                                                                                                          (projT1
                                                                                                                                                                                                                                                                                                                                                                                           (sub_nat
                                                                                                                                                                                                                                                                                                                                                                                              (projT1
                                                                                                                                                                                                                                                                                                                                                                                               (string_length
                                                                                                                                                                                                                                                                                                                                                                                                  arg_))
                                                                                                                                                                                                                                                                                                                                                                                              (projT1
                                                                                                                                                                                                                                                                                                                                                                                               (string_length
                                                                                                                                                                                                                                                                                                                                                                                                  s_))))))
                                                                                                                                                                                                                                                                                                                                                                            | _ =>
                                                                                                                                                                                                                                                                                                                                                                               exit tt
                                                                                                                                                                                                                                                                                                                                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                                 0)})))
                                                                                                                                                                                                                                                                                                                                                                            end)
                                                                                                                                                                                                                                                                                                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                             0)})))
                                                                                                                                                                                                                                                                                                                                                                         else
                                                                                                                                                                                                                                                                                                                                                                           (_s7019_
                                                                                                                                                                                                                                                                                                                                                                              _s5152_) >>= fun w__504 : option ((mword 5 * mword 6 * string)) =>
                                                                                                                                                                                                                                                                                                                                                                           (if
                                                                                                                                                                                                                                                                                                                                                                              match w__504 with
                                                                                                                                                                                                                                                                                                                                                                              | Some
                                                                                                                                                                                                                                                                                                                                                                                (rs2, uimm, s_) =>
                                                                                                                                                                                                                                                                                                                                                                                 orb
                                                                                                                                                                                                                                                                                                                                                                                   (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                      64
                                                                                                                                                                                                                                                                                                                                                                                      32)
                                                                                                                                                                                                                                                                                                                                                                                   (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                      64
                                                                                                                                                                                                                                                                                                                                                                                      64)
                                                                                                                                                                                                                                                                                                                                                                              | _ =>
                                                                                                                                                                                                                                                                                                                                                                                 false
                                                                                                                                                                                                                                                                                                                                                                              end
                                                                                                                                                                                                                                                                                                                                                                            then
                                                                                                                                                                                                                                                                                                                                                                              (_s7019_
                                                                                                                                                                                                                                                                                                                                                                                 _s5152_) >>= fun w__505 : option ((mword 5 * mword 6 * string)) =>
                                                                                                                                                                                                                                                                                                                                                                              (match w__505 with
                                                                                                                                                                                                                                                                                                                                                                               | Some
                                                                                                                                                                                                                                                                                                                                                                                 (rs2, uimm, s_) =>
                                                                                                                                                                                                                                                                                                                                                                                  returnm (Some
                                                                                                                                                                                                                                                                                                                                                                                             (C_FSDSP
                                                                                                                                                                                                                                                                                                                                                                                                (uimm, rs2), build_ex
                                                                                                                                                                                                                                                                                                                                                                                             (projT1
                                                                                                                                                                                                                                                                                                                                                                                              (sub_nat
                                                                                                                                                                                                                                                                                                                                                                                                 (projT1
                                                                                                                                                                                                                                                                                                                                                                                                  (string_length
                                                                                                                                                                                                                                                                                                                                                                                                     arg_))
                                                                                                                                                                                                                                                                                                                                                                                                 (projT1
                                                                                                                                                                                                                                                                                                                                                                                                  (string_length
                                                                                                                                                                                                                                                                                                                                                                                                     s_))))))
                                                                                                                                                                                                                                                                                                                                                                               | _ =>
                                                                                                                                                                                                                                                                                                                                                                                  exit tt
                                                                                                                                                                                                                                                                                                                                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                                    0)})))
                                                                                                                                                                                                                                                                                                                                                                               end)
                                                                                                                                                                                                                                                                                                                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                                0)})))
                                                                                                                                                                                                                                                                                                                                                                            else
                                                                                                                                                                                                                                                                                                                                                                              (_s7031_
                                                                                                                                                                                                                                                                                                                                                                                 _s5152_) >>= fun w__508 : option ((mword 3 * mword 3 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                                              (if
                                                                                                                                                                                                                                                                                                                                                                                 match w__508 with
                                                                                                                                                                                                                                                                                                                                                                                 | Some
                                                                                                                                                                                                                                                                                                                                                                                   (rdc, rsc, uimm, s_) =>
                                                                                                                                                                                                                                                                                                                                                                                    orb
                                                                                                                                                                                                                                                                                                                                                                                      (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                         64
                                                                                                                                                                                                                                                                                                                                                                                         32)
                                                                                                                                                                                                                                                                                                                                                                                      (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                         64
                                                                                                                                                                                                                                                                                                                                                                                         64)
                                                                                                                                                                                                                                                                                                                                                                                 | _ =>
                                                                                                                                                                                                                                                                                                                                                                                    false
                                                                                                                                                                                                                                                                                                                                                                                 end
                                                                                                                                                                                                                                                                                                                                                                               then
                                                                                                                                                                                                                                                                                                                                                                                 (_s7031_
                                                                                                                                                                                                                                                                                                                                                                                    _s5152_) >>= fun w__509 : option ((mword 3 * mword 3 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                                                 (match w__509 with
                                                                                                                                                                                                                                                                                                                                                                                  | Some
                                                                                                                                                                                                                                                                                                                                                                                    (rdc, rsc, uimm, s_) =>
                                                                                                                                                                                                                                                                                                                                                                                     returnm (Some
                                                                                                                                                                                                                                                                                                                                                                                                (C_FLD
                                                                                                                                                                                                                                                                                                                                                                                                   (uimm, rsc, rdc), build_ex
                                                                                                                                                                                                                                                                                                                                                                                                (projT1
                                                                                                                                                                                                                                                                                                                                                                                                 (sub_nat
                                                                                                                                                                                                                                                                                                                                                                                                    (projT1
                                                                                                                                                                                                                                                                                                                                                                                                     (string_length
                                                                                                                                                                                                                                                                                                                                                                                                        arg_))
                                                                                                                                                                                                                                                                                                                                                                                                    (projT1
                                                                                                                                                                                                                                                                                                                                                                                                     (string_length
                                                                                                                                                                                                                                                                                                                                                                                                        s_))))))
                                                                                                                                                                                                                                                                                                                                                                                  | _ =>
                                                                                                                                                                                                                                                                                                                                                                                     exit tt
                                                                                                                                                                                                                                                                                                                                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                                       0)})))
                                                                                                                                                                                                                                                                                                                                                                                  end)
                                                                                                                                                                                                                                                                                                                                                                                  : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                                   0)})))
                                                                                                                                                                                                                                                                                                                                                                               else
                                                                                                                                                                                                                                                                                                                                                                                 (_s7047_
                                                                                                                                                                                                                                                                                                                                                                                    _s5152_) >>= fun w__512 : option ((mword 3 * mword 3 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                                                 (if
                                                                                                                                                                                                                                                                                                                                                                                    match w__512 with
                                                                                                                                                                                                                                                                                                                                                                                    | Some
                                                                                                                                                                                                                                                                                                                                                                                      (rsc1, rsc2, uimm, s_) =>
                                                                                                                                                                                                                                                                                                                                                                                       orb
                                                                                                                                                                                                                                                                                                                                                                                         (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                            64
                                                                                                                                                                                                                                                                                                                                                                                            32)
                                                                                                                                                                                                                                                                                                                                                                                         (Z.eqb
                                                                                                                                                                                                                                                                                                                                                                                            64
                                                                                                                                                                                                                                                                                                                                                                                            64)
                                                                                                                                                                                                                                                                                                                                                                                    | _ =>
                                                                                                                                                                                                                                                                                                                                                                                       false
                                                                                                                                                                                                                                                                                                                                                                                    end
                                                                                                                                                                                                                                                                                                                                                                                  then
                                                                                                                                                                                                                                                                                                                                                                                    (_s7047_
                                                                                                                                                                                                                                                                                                                                                                                       _s5152_) >>= fun w__513 : option ((mword 3 * mword 3 * mword 5 * string)) =>
                                                                                                                                                                                                                                                                                                                                                                                    (match w__513 with
                                                                                                                                                                                                                                                                                                                                                                                     | Some
                                                                                                                                                                                                                                                                                                                                                                                       (rsc1, rsc2, uimm, s_) =>
                                                                                                                                                                                                                                                                                                                                                                                        returnm (Some
                                                                                                                                                                                                                                                                                                                                                                                                   (C_FSD
                                                                                                                                                                                                                                                                                                                                                                                                      (uimm, rsc1, rsc2), build_ex
                                                                                                                                                                                                                                                                                                                                                                                                   (projT1
                                                                                                                                                                                                                                                                                                                                                                                                    (sub_nat
                                                                                                                                                                                                                                                                                                                                                                                                       (projT1
                                                                                                                                                                                                                                                                                                                                                                                                        (string_length
                                                                                                                                                                                                                                                                                                                                                                                                           arg_))
                                                                                                                                                                                                                                                                                                                                                                                                       (projT1
                                                                                                                                                                                                                                                                                                                                                                                                        (string_length
                                                                                                                                                                                                                                                                                                                                                                                                           s_))))))
                                                                                                                                                                                                                                                                                                                                                                                     | _ =>
                                                                                                                                                                                                                                                                                                                                                                                        exit tt
                                                                                                                                                                                                                                                                                                                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                                          0)})))
                                                                                                                                                                                                                                                                                                                                                                                     end)
                                                                                                                                                                                                                                                                                                                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                                      0)})))
                                                                                                                                                                                                                                                                                                                                                                                  else
                                                                                                                                                                                                                                                                                                                                                                                    (_s7063_
                                                                                                                                                                                                                                                                                                                                                                                       _s5152_) >>= fun w__516 : option ((mword 32 * string)) =>
                                                                                                                                                                                                                                                                                                                                                                                    (if
                                                                                                                                                                                                                                                                                                                                                                                       match w__516 with
                                                                                                                                                                                                                                                                                                                                                                                       | Some
                                                                                                                                                                                                                                                                                                                                                                                         (s, s_) =>
                                                                                                                                                                                                                                                                                                                                                                                          true
                                                                                                                                                                                                                                                                                                                                                                                       | _ =>
                                                                                                                                                                                                                                                                                                                                                                                          false
                                                                                                                                                                                                                                                                                                                                                                                       end
                                                                                                                                                                                                                                                                                                                                                                                     then
                                                                                                                                                                                                                                                                                                                                                                                       (_s7063_
                                                                                                                                                                                                                                                                                                                                                                                          _s5152_) >>= fun w__517 : option ((mword 32 * string)) =>
                                                                                                                                                                                                                                                                                                                                                                                       (match w__517 with
                                                                                                                                                                                                                                                                                                                                                                                        | Some
                                                                                                                                                                                                                                                                                                                                                                                          (s, s_) =>
                                                                                                                                                                                                                                                                                                                                                                                           returnm (Some
                                                                                                                                                                                                                                                                                                                                                                                                      (ILLEGAL
                                                                                                                                                                                                                                                                                                                                                                                                         s, build_ex
                                                                                                                                                                                                                                                                                                                                                                                                      (projT1
                                                                                                                                                                                                                                                                                                                                                                                                       (sub_nat
                                                                                                                                                                                                                                                                                                                                                                                                          (projT1
                                                                                                                                                                                                                                                                                                                                                                                                           (string_length
                                                                                                                                                                                                                                                                                                                                                                                                              arg_))
                                                                                                                                                                                                                                                                                                                                                                                                          (projT1
                                                                                                                                                                                                                                                                                                                                                                                                           (string_length
                                                                                                                                                                                                                                                                                                                                                                                                              s_))))))
                                                                                                                                                                                                                                                                                                                                                                                        | _ =>
                                                                                                                                                                                                                                                                                                                                                                                           exit tt
                                                                                                                                                                                                                                                                                                                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                                             0)})))
                                                                                                                                                                                                                                                                                                                                                                                        end)
                                                                                                                                                                                                                                                                                                                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                                         0)})))
                                                                                                                                                                                                                                                                                                                                                                                     else
                                                                                                                                                                                                                                                                                                                                                                                       (_s7071_
                                                                                                                                                                                                                                                                                                                                                                                          _s5152_) >>= fun w__520 : option ((mword 16 * string)) =>
                                                                                                                                                                                                                                                                                                                                                                                       (if
                                                                                                                                                                                                                                                                                                                                                                                          match w__520 with
                                                                                                                                                                                                                                                                                                                                                                                          | Some
                                                                                                                                                                                                                                                                                                                                                                                            (s, s_) =>
                                                                                                                                                                                                                                                                                                                                                                                             true
                                                                                                                                                                                                                                                                                                                                                                                          | _ =>
                                                                                                                                                                                                                                                                                                                                                                                             false
                                                                                                                                                                                                                                                                                                                                                                                          end
                                                                                                                                                                                                                                                                                                                                                                                        then
                                                                                                                                                                                                                                                                                                                                                                                          (_s7071_
                                                                                                                                                                                                                                                                                                                                                                                             _s5152_) >>= fun w__521 : option ((mword 16 * string)) =>
                                                                                                                                                                                                                                                                                                                                                                                          (match w__521 with
                                                                                                                                                                                                                                                                                                                                                                                           | Some
                                                                                                                                                                                                                                                                                                                                                                                             (s, s_) =>
                                                                                                                                                                                                                                                                                                                                                                                              returnm (Some
                                                                                                                                                                                                                                                                                                                                                                                                         (C_ILLEGAL
                                                                                                                                                                                                                                                                                                                                                                                                            s, build_ex
                                                                                                                                                                                                                                                                                                                                                                                                         (projT1
                                                                                                                                                                                                                                                                                                                                                                                                          (sub_nat
                                                                                                                                                                                                                                                                                                                                                                                                             (projT1
                                                                                                                                                                                                                                                                                                                                                                                                              (string_length
                                                                                                                                                                                                                                                                                                                                                                                                                 arg_))
                                                                                                                                                                                                                                                                                                                                                                                                             (projT1
                                                                                                                                                                                                                                                                                                                                                                                                              (string_length
                                                                                                                                                                                                                                                                                                                                                                                                                 s_))))))
                                                                                                                                                                                                                                                                                                                                                                                           | _ =>
                                                                                                                                                                                                                                                                                                                                                                                              exit tt
                                                                                                                                                                                                                                                                                                                                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                                                0)})))
                                                                                                                                                                                                                                                                                                                                                                                           end)
                                                                                                                                                                                                                                                                                                                                                                                           : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                                            0)})))
                                                                                                                                                                                                                                                                                                                                                                                        else
                                                                                                                                                                                                                                                                                                                                                                                          returnm None)
                                                                                                                                                                                                                                                                                                                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                                         0)}))))
                                                                                                                                                                                                                                                                                                                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                                      0)}))))
                                                                                                                                                                                                                                                                                                                                                                                  : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                                   0)}))))
                                                                                                                                                                                                                                                                                                                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                                0)}))))
                                                                                                                                                                                                                                                                                                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                             0)}))))
                                                                                                                                                                                                                                                                                                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                          0)}))))
                                                                                                                                                                                                                                                                                                                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                       0)}))))
                                                                                                                                                                                                                                                                                                                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                    0)}))))
                                                                                                                                                                                                                                                                                                                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                                 0)}))))
                                                                                                                                                                                                                                                                                                                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                              0)}))))
                                                                                                                                                                                                                                                                                                                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                           0)}))))
                                                                                                                                                                                                                                                                                                                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                        0)}))))
                                                                                                                                                                                                                                                                                                                                                    : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                     0)}))))
                                                                                                                                                                                                                                                                                                                                                 : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                                  0)}))))
                                                                                                                                                                                                                                                                                                                                              : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                               0)}))))
                                                                                                                                                                                                                                                                                                                                           : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                            0)}))))
                                                                                                                                                                                                                                                                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                         0)}))))
                                                                                                                                                                                                                                                                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                      0)}))))
                                                                                                                                                                                                                                                                                                                                  : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                   0)}))))
                                                                                                                                                                                                                                                                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                                0)}))))
                                                                                                                                                                                                                                                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                             0)}))))
                                                                                                                                                                                                                                                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                          0)}))))
                                                                                                                                                                                                                                                                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                       0)}))))
                                                                                                                                                                                                                                                                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                    0)}))))
                                                                                                                                                                                                                                                                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                                 0)}))))
                                                                                                                                                                                                                                                                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                              0)}))))
                                                                                                                                                                                                                                                                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                           0)}))))
                                                                                                                                                                                                                                                                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                        0)}))))
                                                                                                                                                                                                                                                                                                    : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                     0)}))))
                                                                                                                                                                                                                                                                                                 : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                                  0)}))))
                                                                                                                                                                                                                                                                                              : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                               0)}))))
                                                                                                                                                                                                                                                                                           : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                            0)}))))
                                                                                                                                                                                                                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                         0)}))))
                                                                                                                                                                                                                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                      0)}))))
                                                                                                                                                                                                                                                                                  : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                   0)}))))
                                                                                                                                                                                                                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                                0)}))))
                                                                                                                                                                                                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                             0)}))))
                                                                                                                                                                                                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                          0)}))))
                                                                                                                                                                                                                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                       0)}))))
                                                                                                                                                                                                                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                    0)}))))
                                                                                                                                                                                                                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                                 0)}))))
                                                                                                                                                                                                                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                              0)}))))
                                                                                                                                                                                                                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                           0)}))))
                                                                                                                                                                                                                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                        0)}))))
                                                                                                                                                                                                                                                    : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                     0)}))))
                                                                                                                                                                                                                                                 : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                                  0)}))))
                                                                                                                                                                                                                                              : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                               0)}))))
                                                                                                                                                                                                                                           : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                            0)}))))
                                                                                                                                                                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                         0)}))))
                                                                                                                                                                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                      0)}))))
                                                                                                                                                                                                                                  : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                   0)}))))
                                                                                                                                                                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                                0)}))))
                                                                                                                                                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                             0)}))))
                                                                                                                                                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                          0)}))))
                                                                                                                                                                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                       0)}))))
                                                                                                                                                                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                    0)}))))
                                                                                                                                                                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                                 0)}))))
                                                                                                                                                                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                              0)}))))
                                                                                                                                                                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                           0)}))))
                                                                                                                                                                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                        0)}))))
                                                                                                                                                                                                    : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                     0)}))))
                                                                                                                                                                                                 : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                                  0)}))))
                                                                                                                                                                                              : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                               0)}))))
                                                                                                                                                                                           : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                            0)}))))
                                                                                                                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                         0)}))))
                                                                                                                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                      0)}))))
                                                                                                                                                                                  : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                   0)}))))
                                                                                                                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                                0)}))))
                                                                                                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                             0)}))))
                                                                                                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                          0)}))))
                                                                                                                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                       0)}))))
                                                                                                                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                    0)}))))
                                                                                                                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                                 0)}))))
                                                                                                                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                              0)}))))
                                                                                                                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                           0)}))))
                                                                                                                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                        0)}))))
                                                                                                                                                    : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                     0)}))))
                                                                                                                                                 : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                                  0)}))))
                                                                                                                                              : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                               0)}))))
                                                                                                                                           : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                            0)}))))
                                                                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                         0)}))))
                                                                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                      0)}))))
                                                                                                                                  : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                   0)}))))
                                                                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                                0)}))))
                                                                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                             0)}))))
                                                                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                          0)}))))
                                                                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                       0)}))))
                                                                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                    0)}))))
                                                                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                                 0)}))))
                                                                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                              0)}))))
                                                                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                           0)}))))
                                                                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                        0)}))))
                                                                                                    : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                     0)}))))
                                                                                                 : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                                  0)}))))
                                                                                              : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                               0)}))))
                                                                                           : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                            0)}))))
                                                                                        : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                         0)}))))
                                                                                     : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                      0)}))))
                                                                                  : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                   0)}))))
                                                                               : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                                0)}))))
                                                                            : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                             0)}))))
                                                                         : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                          0)}))))
                                                                      : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                       0)}))))
                                                                   : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                    0)}))))
                                                                : M (option ((ast * {n : Z & ArithFact (n >=?
                                                                 0)}))))
                                                             : M (option ((ast * {n : Z & ArithFact (n >=?
                                                              0)}))))
                                                          : M (option ((ast * {n : Z & ArithFact (n >=?
                                                           0)}))))
                                                       : M (option ((ast * {n : Z & ArithFact (n >=?
                                                        0)}))))
                                                    : M (option ((ast * {n : Z & ArithFact (n >=? 0)}))))
                                                 : M (option ((ast * {n : Z & ArithFact (n >=? 0)}))))
                                              : M (option ((ast * {n : Z & ArithFact (n >=? 0)}))))
                                           : M (option ((ast * {n : Z & ArithFact (n >=? 0)}))))
                                        : M (option ((ast * {n : Z & ArithFact (n >=? 0)}))))
                                     : M (option ((ast * {n : Z & ArithFact (n >=? 0)}))))
                                  : M (option ((ast * {n : Z & ArithFact (n >=? 0)}))))
                               : M (option ((ast * {n : Z & ArithFact (n >=? 0)}))))
                            : M (option ((ast * {n : Z & ArithFact (n >=? 0)}))))
                         : M (option ((ast * {n : Z & ArithFact (n >=? 0)}))))
                      : M (option ((ast * {n : Z & ArithFact (n >=? 0)}))))
                   : M (option ((ast * {n : Z & ArithFact (n >=? 0)}))))
                : M (option ((ast * {n : Z & ArithFact (n >=? 0)}))))
             : M (option ((ast * {n : Z & ArithFact (n >=? 0)}))))
          : M (option ((ast * {n : Z & ArithFact (n >=? 0)}))))
       : M (option ((ast * {n : Z & ArithFact (n >=? 0)}))))
    : M (option ((ast * {n : Z & ArithFact (n >=? 0)}))).

Definition print_insn (insn : ast) : M (string) := (assembly_forwards insn)  : M (string).

Definition decode (bv : mword 32) : M (ast) := (encdec_backwards bv)  : M (ast).

Definition decodeCompressed (bv : mword 16) : M (ast) :=
   (encdec_compressed_backwards bv)  : M (ast).

Definition GPRstrs : vec string 32 :=
vec_of_list_len ["x31";"x30";"x29";"x28";"x27";"x26";"x25";"x24";"x23";"x22";"x21";"x20";"x19";"x18";
                 "x17";"x16";"x15";"x14";"x13";"x12";"x11";"x10";"x9";"x8";"x7";"x6";"x5";"x4";"x3";
                 "x2";"x1";"x0"].
Hint Unfold GPRstrs : sail.
Definition GPRstr (i : mword 5) : string := vec_access_dec GPRstrs (projT1 (uint i)).

Definition CIA_fp := RFull "CIA".
Hint Unfold CIA_fp : sail.
Definition NIA_fp := RFull "NIA".
Hint Unfold NIA_fp : sail.
Definition initial_analysis (instr : ast)
: M ((list regfp * list regfp * list regfp * list niafp * diafp * instruction_kind)) :=
   let iR := []  : regfps in
   let oR := []  : regfps in
   let aR := []  : regfps in
   let ik := (IK_simple tt)  : instruction_kind in
   let Nias := [NIAFP_successor tt]  : niafps in
   let Dia := (DIAFP_none tt)  : diafp in
   (match instr with
    | EBREAK tt => returnm (Nias, aR, iR, ik, oR)
    | UTYPE (imm, rd, op) =>
       let oR : list regfp :=
         if eq_vec rd ('b"00000"  : mword 5) then oR
         else (RFull (GPRstr rd)) :: oR in
       returnm (Nias, aR, iR, ik, oR)
    | RISCV_JAL (imm, rd) =>
       let oR : list regfp :=
         if eq_vec rd ('b"00000"  : mword 5) then oR
         else (RFull (GPRstr rd)) :: oR in
       let offset : bits 64 := EXTS 64 imm in
       ((read_reg PC_ref)  : M (mword 64)) >>= fun w__0 : mword 64 =>
       let Nias : list niafp := [NIAFP_concrete_address (add_vec w__0 offset)] in
       let ik : instruction_kind := IK_branch tt in
       returnm (Nias, aR, iR, ik, oR)
    | RISCV_JALR (imm, rs, rd) =>
       let iR : list regfp :=
         if eq_vec rs ('b"00000"  : mword 5) then iR
         else (RFull (GPRstr rs)) :: iR in
       let oR : list regfp :=
         if eq_vec rd ('b"00000"  : mword 5) then oR
         else (RFull (GPRstr rd)) :: oR in
       let offset : bits 64 := EXTS 64 imm in
       let Nias : list niafp := [NIAFP_indirect_address tt] in
       let ik : instruction_kind := IK_branch tt in
       returnm (Nias, aR, iR, ik, oR)
    | BTYPE (imm, rs2, rs1, op) =>
       let iR : list regfp :=
         if eq_vec rs2 ('b"00000"  : mword 5) then iR
         else (RFull (GPRstr rs2)) :: iR in
       let iR : list regfp :=
         if eq_vec rs1 ('b"00000"  : mword 5) then iR
         else (RFull (GPRstr rs1)) :: iR in
       let ik := (IK_branch tt)  : instruction_kind in
       let offset : bits 64 := EXTS 64 imm in
       ((read_reg PC_ref)  : M (mword 64)) >>= fun w__1 : mword 64 =>
       let Nias : list niafp := [NIAFP_concrete_address (add_vec w__1 offset); NIAFP_successor tt] in
       returnm (Nias, aR, iR, ik, oR)
    | ITYPE (imm, rs, rd, op) =>
       let iR : list regfp :=
         if eq_vec rs ('b"00000"  : mword 5) then iR
         else (RFull (GPRstr rs)) :: iR in
       let oR : list regfp :=
         if eq_vec rd ('b"00000"  : mword 5) then oR
         else (RFull (GPRstr rd)) :: oR in
       returnm (Nias, aR, iR, ik, oR)
    | SHIFTIOP (imm, rs, rd, op) =>
       let iR : list regfp :=
         if eq_vec rs ('b"00000"  : mword 5) then iR
         else (RFull (GPRstr rs)) :: iR in
       let oR : list regfp :=
         if eq_vec rd ('b"00000"  : mword 5) then oR
         else (RFull (GPRstr rd)) :: oR in
       returnm (Nias, aR, iR, ik, oR)
    | RTYPE (rs2, rs1, rd, op) =>
       let iR : list regfp :=
         if eq_vec rs2 ('b"00000"  : mword 5) then iR
         else (RFull (GPRstr rs2)) :: iR in
       let iR : list regfp :=
         if eq_vec rs1 ('b"00000"  : mword 5) then iR
         else (RFull (GPRstr rs1)) :: iR in
       let oR : list regfp :=
         if eq_vec rd ('b"00000"  : mword 5) then oR
         else (RFull (GPRstr rd)) :: oR in
       returnm (Nias, aR, iR, ik, oR)
    | CSR (csr, rs1, rd, is_imm, op) =>
       let isWrite : bool :=
         match op with
         | CSRRW => true
         | _ =>
            if sumbool_of_bool is_imm then projT1 (neq_int (projT1 (uint rs1)) 0)
            else projT1 (neq_int (projT1 (uint rs1)) 0)
         end in
       let iR : list regfp := (RFull (csr_name csr)) :: iR in
       let iR : list regfp :=
         if sumbool_of_bool (negb is_imm) then (RFull (GPRstr rs1)) :: iR
         else iR in
       let oR : list regfp := if sumbool_of_bool isWrite then (RFull (csr_name csr)) :: oR else oR in
       let oR : list regfp := (RFull (GPRstr rd)) :: oR in
       returnm (Nias, aR, iR, ik, oR)
    | LOAD (imm, rs, rd, unsign, width, aq, rl) =>
       let iR : list regfp :=
         if eq_vec rs ('b"00000"  : mword 5) then iR
         else (RFull (GPRstr rs)) :: iR in
       let oR : list regfp :=
         if eq_vec rd ('b"00000"  : mword 5) then oR
         else (RFull (GPRstr rd)) :: oR in
       let aR := iR  : list regfp in
       (match (aq, rl) with
        | (false, false) => returnm (IK_mem_read Read_plain)
        | (true, false) => returnm (IK_mem_read Read_RISCV_acquire)
        | (true, true) => returnm (IK_mem_read Read_RISCV_strong_acquire)
        | _ =>
           (internal_error "LOAD type not implemented in initial_analysis")  : M (instruction_kind)
        end) >>= fun w__3 : instruction_kind =>
       let ik : instruction_kind := w__3 in
       returnm (Nias, aR, iR, ik, oR)
    | STORE (imm, rs2, rs1, width, aq, rl) =>
       let iR : list regfp :=
         if eq_vec rs2 ('b"00000"  : mword 5) then iR
         else (RFull (GPRstr rs2)) :: iR in
       let iR : list regfp :=
         if eq_vec rs1 ('b"00000"  : mword 5) then iR
         else (RFull (GPRstr rs1)) :: iR in
       let aR : list regfp :=
         if eq_vec rs1 ('b"00000"  : mword 5) then aR
         else (RFull (GPRstr rs1)) :: aR in
       (match (aq, rl) with
        | (false, false) => returnm (IK_mem_write Write_plain)
        | (false, true) => returnm (IK_mem_write Write_RISCV_release)
        | (true, true) => returnm (IK_mem_write Write_RISCV_strong_release)
        | _ =>
           (internal_error "STORE type not implemented in initial_analysis")  : M (instruction_kind)
        end) >>= fun w__5 : instruction_kind =>
       let ik : instruction_kind := w__5 in
       returnm (Nias, aR, iR, ik, oR)
    | ADDIW (imm, rs, rd) =>
       let iR : list regfp :=
         if eq_vec rs ('b"00000"  : mword 5) then iR
         else (RFull (GPRstr rs)) :: iR in
       let oR : list regfp :=
         if eq_vec rd ('b"00000"  : mword 5) then oR
         else (RFull (GPRstr rd)) :: oR in
       returnm (Nias, aR, iR, ik, oR)
    | SHIFTW (imm, rs, rd, op) =>
       let iR : list regfp :=
         if eq_vec rs ('b"00000"  : mword 5) then iR
         else (RFull (GPRstr rs)) :: iR in
       let oR : list regfp :=
         if eq_vec rd ('b"00000"  : mword 5) then oR
         else (RFull (GPRstr rd)) :: oR in
       returnm (Nias, aR, iR, ik, oR)
    | RTYPEW (rs2, rs1, rd, op) =>
       let iR : list regfp :=
         if eq_vec rs2 ('b"00000"  : mword 5) then iR
         else (RFull (GPRstr rs2)) :: iR in
       let iR : list regfp :=
         if eq_vec rs1 ('b"00000"  : mword 5) then iR
         else (RFull (GPRstr rs1)) :: iR in
       let oR : list regfp :=
         if eq_vec rd ('b"00000"  : mword 5) then oR
         else (RFull (GPRstr rd)) :: oR in
       returnm (Nias, aR, iR, ik, oR)
    | FENCE (pred, succ) =>
       (match (pred, succ) with
        | (v__1502, v__1503) =>
           (if andb (eq_vec (subrange_vec_dec v__1502 1 0) ('b"11"  : mword (1 - 0 + 1)))
                 (eq_vec (subrange_vec_dec v__1503 1 0) ('b"11"  : mword (1 - 0 + 1))) then
              returnm (IK_barrier (Barrier_RISCV_rw_rw tt))
            else if andb (eq_vec (subrange_vec_dec v__1502 1 0) ('b"10"  : mword (1 - 0 + 1)))
                      (eq_vec (subrange_vec_dec v__1503 1 0) ('b"11"  : mword (1 - 0 + 1))) then
              returnm (IK_barrier (Barrier_RISCV_r_rw tt))
            else if andb (eq_vec (subrange_vec_dec v__1502 1 0) ('b"10"  : mword (1 - 0 + 1)))
                      (eq_vec (subrange_vec_dec v__1503 1 0) ('b"10"  : mword (1 - 0 + 1))) then
              returnm (IK_barrier (Barrier_RISCV_r_r tt))
            else if andb (eq_vec (subrange_vec_dec v__1502 1 0) ('b"11"  : mword (1 - 0 + 1)))
                      (eq_vec (subrange_vec_dec v__1503 1 0) ('b"01"  : mword (1 - 0 + 1))) then
              returnm (IK_barrier (Barrier_RISCV_rw_w tt))
            else if andb (eq_vec (subrange_vec_dec v__1502 1 0) ('b"01"  : mword (1 - 0 + 1)))
                      (eq_vec (subrange_vec_dec v__1503 1 0) ('b"01"  : mword (1 - 0 + 1))) then
              returnm (IK_barrier (Barrier_RISCV_w_w tt))
            else if andb (eq_vec (subrange_vec_dec v__1502 1 0) ('b"01"  : mword (1 - 0 + 1)))
                      (eq_vec (subrange_vec_dec v__1503 1 0) ('b"11"  : mword (1 - 0 + 1))) then
              returnm (IK_barrier (Barrier_RISCV_w_rw tt))
            else if andb (eq_vec (subrange_vec_dec v__1502 1 0) ('b"11"  : mword (1 - 0 + 1)))
                      (eq_vec (subrange_vec_dec v__1503 1 0) ('b"10"  : mword (1 - 0 + 1))) then
              returnm (IK_barrier (Barrier_RISCV_rw_r tt))
            else if andb (eq_vec (subrange_vec_dec v__1502 1 0) ('b"10"  : mword (1 - 0 + 1)))
                      (eq_vec (subrange_vec_dec v__1503 1 0) ('b"01"  : mword (1 - 0 + 1))) then
              returnm (IK_barrier (Barrier_RISCV_r_w tt))
            else if andb (eq_vec (subrange_vec_dec v__1502 1 0) ('b"01"  : mword (1 - 0 + 1)))
                      (eq_vec (subrange_vec_dec v__1503 1 0) ('b"10"  : mword (1 - 0 + 1))) then
              returnm (IK_barrier (Barrier_RISCV_w_r tt))
            else if andb (eq_vec (subrange_vec_dec v__1502 1 0) ('b"00"  : mword (1 - 0 + 1)))
                      (eq_vec (subrange_vec_dec v__1503 1 0) ('b"00"  : mword (1 - 0 + 1))) then
              returnm (IK_simple tt)
            else
              (internal_error "barrier type not implemented in initial_analysis")
               : M (instruction_kind))
            : M (instruction_kind)
        end) >>= fun w__17 : instruction_kind =>
       let ik : instruction_kind := w__17 in
       returnm (Nias, aR, iR, ik, oR)
    | FENCE_TSO (pred, succ) =>
       (match (pred, succ) with
        | (v__1542, v__1543) =>
           (if andb (eq_vec (subrange_vec_dec v__1542 1 0) ('b"11"  : mword (1 - 0 + 1)))
                 (eq_vec (subrange_vec_dec v__1543 1 0) ('b"11"  : mword (1 - 0 + 1))) then
              returnm (IK_barrier (Barrier_RISCV_tso tt))
            else
              (internal_error "barrier type not implemented in initial_analysis")
               : M (instruction_kind))
            : M (instruction_kind)
        end) >>= fun w__20 : instruction_kind =>
       let ik : instruction_kind := w__20 in
       returnm (Nias, aR, iR, ik, oR)
    | FENCEI tt =>
       let ik : instruction_kind := IK_simple tt in
       returnm (Nias, aR, iR, ik, oR)
    | LOADRES (aq, rl, rs1, width, rd) =>
       let iR : list regfp :=
         if eq_vec rs1 ('b"00000"  : mword 5) then iR
         else (RFull (GPRstr rs1)) :: iR in
       let oR : list regfp :=
         if eq_vec rd ('b"00000"  : mword 5) then oR
         else (RFull (GPRstr rd)) :: oR in
       let aR := iR  : list regfp in
       (match (aq, rl) with
        | (false, false) => returnm (IK_mem_read Read_RISCV_reserved)
        | (true, false) => returnm (IK_mem_read Read_RISCV_reserved_acquire)
        | (true, true) => returnm (IK_mem_read Read_RISCV_reserved_strong_acquire)
        | (false, true) =>
           (internal_error "LOADRES type not implemented in initial_analysis")
            : M (instruction_kind)
        end) >>= fun w__22 : instruction_kind =>
       let ik : instruction_kind := w__22 in
       returnm (Nias, aR, iR, ik, oR)
    | STORECON (aq, rl, rs2, rs1, width, rd) =>
       let iR : list regfp :=
         if eq_vec rs2 ('b"00000"  : mword 5) then iR
         else (RFull (GPRstr rs2)) :: iR in
       let iR : list regfp :=
         if eq_vec rs1 ('b"00000"  : mword 5) then iR
         else (RFull (GPRstr rs1)) :: iR in
       let aR : list regfp :=
         if eq_vec rs1 ('b"00000"  : mword 5) then aR
         else (RFull (GPRstr rs1)) :: aR in
       let oR : list regfp :=
         if eq_vec rd ('b"00000"  : mword 5) then oR
         else (RFull (GPRstr rd)) :: oR in
       (match (aq, rl) with
        | (false, false) => returnm (IK_mem_write Write_RISCV_conditional)
        | (false, true) => returnm (IK_mem_write Write_RISCV_conditional_release)
        | (true, true) => returnm (IK_mem_write Write_RISCV_conditional_strong_release)
        | (true, false) =>
           (internal_error "STORECON type not implemented in initial_analysis")
            : M (instruction_kind)
        end) >>= fun w__24 : instruction_kind =>
       let ik : instruction_kind := w__24 in
       returnm (Nias, aR, iR, ik, oR)
    | AMO (op, aq, rl, rs2, rs1, width, rd) =>
       let iR : list regfp :=
         if eq_vec rs2 ('b"00000"  : mword 5) then iR
         else (RFull (GPRstr rs2)) :: iR in
       let iR : list regfp :=
         if eq_vec rs1 ('b"00000"  : mword 5) then iR
         else (RFull (GPRstr rs1)) :: iR in
       let aR : list regfp :=
         if eq_vec rs1 ('b"00000"  : mword 5) then aR
         else (RFull (GPRstr rs1)) :: aR in
       let oR : list regfp :=
         if eq_vec rd ('b"00000"  : mword 5) then oR
         else (RFull (GPRstr rd)) :: oR in
       let ik : instruction_kind :=
         match (aq, rl) with
         | (false, false) => IK_mem_rmw (Read_RISCV_reserved, Write_RISCV_conditional)
         | (false, true) => IK_mem_rmw (Read_RISCV_reserved, Write_RISCV_conditional_release)
         | (true, false) => IK_mem_rmw (Read_RISCV_reserved_acquire, Write_RISCV_conditional)
         | (true, true) => IK_mem_rmw (Read_RISCV_reserved_acquire, Write_RISCV_conditional_release)
         end in
       returnm (Nias, aR, iR, ik, oR)
    | _ => returnm (Nias, aR, iR, ik, oR)
    end) >>= fun '((Nias, aR, iR, ik, oR)
   : (list niafp * list regfp * list regfp * instruction_kind * list regfp)) =>
   returnm (iR, oR, aR, Nias, Dia, ik).



